此库是c++基础库。
受muduo影响,出于学习目的,尝试移植一部分基础库到windows上,后来又参考了limonp库的部分功能,作为平时开发基础库。
google风格。修改了三处,如下,详见:.clang-format
BasedOnStyle: Google
DerivePointerAlignment: false
PointerAlignment: Right
ColumnLimit: 120
提交代码前请使用格式化脚本格式化代码。
python .\build_support\run_clang_format.py .\test
python .\build_support\run_clang_format.py .\src
格式化脚本可以设置跳过文件夹和文件。
...
skippath = ['zib.h', 'zipconf.h']
for val in skippath:
if filename.endswith(val):
return True
...
...
skipdir = ['baselib','lib','.git','.vscode']
for val in skipdir:
if dir.endswith(val):
return True
...
-
linux
依赖安装
sudo apt install libgtest-dev cd /usr/src/gtest sudo mkdir build cd build sudo cmake .. sudo make sudo make install sudo apt install gtest zlib1g-dev libboost-dev
编译
git clone --recursive https://github.com/lilucpp/base.git cd base mkdir build cd build cmake .. -DFMT_INSTALL=1 make make install .
-
windows
依赖安装,使用包管理工具vcpkg。
./vcpkg.exe install boost-utility boost-circular-buffer boost-stacktrace zlib gtest
编译
git clone --recursive https://github.com/lilucpp/base.git mkdir build cd build cmake .. -G "Visual Studio 14 2015" -DCMAKE_TOOLCHAIN_FILE=P:/vcpkg/scripts/buildsystems/vcpkg.cmake -DFMT_INSTALL=1 cmake --build . --config Release --verbose cmake --install .
- Atomic
- BlockingQueue
- BoundedBlockingQueue
- Colors
- Condition
- Config
- Copyable
- CountDownLatch
- CurrentThread
- Date
- Exception
- GzipFile
- Mutex
- Noncopyabe
- Singleton
- StdExtension
- StringPiece
- StringUtil
- Thread
- ThreadPool
- Timestamp
- Types
减少boost依赖放弃了减少boost依赖。跨平台- 增加其他常用功能
增加mkdir,递归创建增加getfilecontent