AWL - A Working Library
AWL is a small cross-platform C++ library that includes:
- A simple binary serialization framework and simple JSON serialization framework.
- Memory stream, buffered stream, hashing stream.
- A set that finds an element by both key and index with O(logN) time.
- A doubly linked list with static
insertanderasemethods and movable elements. - A movable observable with movable observers.
- Bitset based on enum.
- A circular buffer with an interface similar to std::queue.
- Other simple classes like CompositeCompare, ReverseCompare, scope_guard, etc...
- A simple testing framework.
Theoretically, the master branch should compile with C++20 and work, at least it is periodically built with MSVC 19.44.35219, GCC 13.3.0, Android CLang 20.0 (from NDK 29.0.13113456) and Apple Clang 1700.0.13.5 (on MacOS Sonoma with Xcode 16.4).
There is also cpp17 branch that partially compiles with C++17.
Version compatibility is not guaranteed and there is no warranty of any kind.
Feel free to use it or fork it, report a bug by opening an issue.
To leave the author a message fill the form on his website.
cmake ..\..\Awl -G "Visual Studio 17 2022" -A x64
cmake --build . --target AwlTest --config Releaseor
msbuild AwlTest.sln /p:Configuration=Release /p:Platform=x64It also builds for x86 using the following command:
cmake ..\..\Awl -G "Visual Studio 17 2022" -A win32but with couple warnings related to std::streamsize that are not fixed yet.
cmake ../../repos/Awl/ -G Ninja
cmake --build . --parallel --target AwlTest --config RelWithDebInfoCompiling a single source file (by example of VtsTest.cpp):
cmake --build . --parallel --target CMakeFiles/AwlTest.dir/Tests/VtsTest.cpp.ocmake ../../Awl/ -DCMAKE_BUILD_TYPE=Release
cmake --build . --parallelor
cmake ../../Awl/ -DCMAKE_BUILD_TYPE=Debug
cmake --build . --parallelUse -DAWL_STATIC_RUNTIME:BOOL=ON CMake option if QT and BOOST are compiled with static runtime:
set MY_DRIVE=C:
%MY_DRIVE%
cd \dev\build\awl
set MY_CMAKE_EXE=%MY_DRIVE%\dev\tools\cmake-4.1.2-windows-x86_64\bin\cmake.exe
set MY_QT_DIR=%MY_DRIVE%\dev\libs\Qt6\windows
set MY_BOOST_DIR=%MY_DRIVE%\dev\libs\boost_1_89_0
set MY_VS_GENERATOR="Visual Studio 17 2022"
set OPENSSL_ROOT_DIR=%MY_DRIVE%/dev/libs/OpenSSL
set OPENSSL_USE_STATIC_LIBS=ON
%MY_CMAKE_EXE% ..\..\repos\Awl -G %MY_VS_GENERATOR% -A x64 -DCMAKE_PREFIX_PATH="%MY_QT_DIR%;%MY_BOOST_DIR%" -DAWL_FIND_OPENSSL:BOOL=ON -DAWL_FIND_BOOST:BOOL=ON -DAWL_FIND_QT:BOOL=ON -DAWL_STATIC_RUNTIME:BOOL=ON -DAWL_ANSI_CMD_CHAR:BOOL=ON
%MY_CMAKE_EXE% --build . --parallel --target AwlTest --config Debug
%MY_CMAKE_EXE% --build . --parallel --target AwlTest --config RelWithDebInfoexport OPENSSL_ROOT_DIR=/home/dmitriano/dev/libs/OpenSSL
export OPENSSL_USE_STATIC_LIBS=ON
cmake ../../repos/Awl/ -G Ninja -DCMAKE_PREFIX_PATH="/home/dmitriano/dev/libs/boost" -DAWL_FIND_OPENSSL:BOOL=ON -DAWL_FIND_BOOST:BOOL=ON -DAWL_STATIC_RUNTIME:BOOL=ON
cmake --build . --parallelAdd -DAWL_SANITIZE_ADDRESS=1 or -DAWL_SANITIZE_UNDEFINED=1 or -DAWL_SANITIZE_THREAD=1 to CMake command, for example:
cmake ../../repos/Awl/ -G Ninja -DAWL_SANITIZE_ADDRESS=1
cmake --build . --parallel --target AwlTest --config RelWithDebInfoRemove ./ prefix on Windows and do not forget quotes on Linux:
./AwlTestof
./AwlTest --filter ".*_Test"Running the benchmarks:
./AwlTest --filter ".*_Benchmark" --output allRunning the examples:
./AwlTest --filter ".*_Example" --output allRunning unstable tests and examples:
./AwlTest --filter ".*_Unstable"or
./AwlTest --filter ".*"Built AWL for Android with -DAWL_STATIC_RUNTIME:BOOL=ON CMake option and if you use QT Creator do not forget to set -DAWL_FIND_QT:BOOL=OFF, upload the executable file to the device:
adb push AwlTest /data/local/tmpand run it with the same options as on Linux:
adb shell
cd /data/local/tmp
chmod a+x AwlTest
./AwlTestor with a single command:
adb shell "cd /data/local/tmp && chmod a+x AwlTest && ./AwlTest"or
adb shell "cd /data/local/tmp && chmod a+x AwlTest && ./AwlTest --filter .*CompositeCompare.*"