ShlubluLib is a lightweight, modular, general purpose, open-source C++ library for Linux and Windows.
The current version is v0.6.
This library is designed to be simple to use. It is intended to cover frequent use cases in a simple way without preventing or hindering the development of more advanced features when needed. It actually consists of code that I wrote for my own use and that could be useful to others.
ShlubluLib is licensed under the EUPL-1.2-or-later (European Union Public Licence), which is compatible with the most frequent open source licenses. Please see the file "LICENSE.txt", or read the EUPL text online in any EU language.
- Modules and documentation
- C++ version and linkage
- Installation from binaries
- Installation from sources
- Unit tests
- About the author
- Acknowledgements
This library currently consists in the following modules:
async
: threading and asynchronous operationsMutexLock
: Recursive mutex helper based onstd::recursive_mutex
.
binding
: interactions with other languagesPython
: based on the CPython standard API, this module is intended to make Python integration easier.
hash
: hash algorithmsCRC
: cyclic redundancy check.
math
: math issuesCombinatorics
: combinatorics-oriented classes.Math
: helper functions not included in the standard<cmath>
header.
random
: random numbers generationtext
: text content handlingString
: helper functions not included instd::string
.
util
: miscellaneousDebug
: Macros useful for developing and debugging: compilation messages, optimization control, and so on.NotImplementedError
: Exception thrown in case of missing implementation..
The Doxygen documentation of these modules is available at shlublulib.shlublu.org/v0.6/.
Some of these modules require external libraries such as Boost or Python. Such requirements are specified in their documentation.
Changes since former versions are tracked in the file CHANGELOG.md
.
This is a C++17 static linkage library.
The deprecated class template std::codecvt is still used though as it has no standardized replacement so far.
Should you just wish to use Shlublulib as a development tool, the binary distribution can be downloaded from our website.
- Linux x86 version (PGP sig - SHA-256:
9086e65cd4bb62190c54fefc45bd4e92427d2775928846380c92cdd4d18d29ed
) - Win64 x86 version (PGP sig - SHA-256:
59b57bb412d548002eca552319723b8e2f679996670b7311b4aa0402bd8778bd
)
These archives are signed with this PGP key so that you can check their integrity. They contain:
- the library file to link to your client programs
- the
include
directory to add to your include path - the
CHANGELOG.md
file - the license file
LICENSE.txt
applicable to this library
Should you wish to contribute, to play with the code, or should you prefer not to download binaries, this method is for you.
The following libraries are required for ShlubluLib to compile:
- Python 3.5 or higher
- Boost 1.53 or higher
Those version numbers correspond to my testing. Lower version numbers may work but this has not been tested yet.
This library is developed under Microsoft Visual Studio 2019 using the following features and extensions:
- Microsoft Python - C++ projects debugging support extension
- Integrated Microsoft CppUnitTest framework
- Integrated Microsoft Linux Development remote build features
- Doxygen documentation generator
Visual Studio is not an absolute prerequisite. The modules codebase compiles with GCC 5.4 or above. Only makefiles and unit tests are
specific to Visual Studio. They can be quite easily rewritten for other tools if needed. Should you plan to do that please let me know and I'll provide you with
the g++
and ar
command lines I use for Linux.
The same way, depending on what you would like to do, you do not need all of the above:
- Microsoft Python - C++ projects debugging support is optional. You can build and use Shlublulib as long as you already have a compatible Python library installed (see External Libraries above).
- Microsoft CppUnitTest is only needed if you would like to build and run the unit tests suite.
- Microsoft Linux Development for Visual Studio is only needed if you would like to remotely build the Linux version of the library from the Visual Studio GUI.
- Doxygen is only needed it if you would like to generate a local version of the documentation.
ShlubluLib is hosted on GitHub. The repository can be found here.
You can either:
- Git clone our repository: https://github.com/shlublu/ShlubluLib.git. This is the recommended option as it allows pulling updates.
- or just download a snapshot of the current version.
The repository is organized as follows on the files system:
|
|____doc/
| |____notice.txt
|
|____include/
| |____shlublu/
| |____(module A)/
| | |____(feature X.h)
| | |____(feature Y.h)
| |
| |____(module B)/
| |____(...)
|
|____src/
| |____(module A)/
| | |____(feature X.cpp)
| | |____(feature Y.cpp)
| |
| |____(module B)/
| |____(...)
|
|____tests/
| |____(module A)/
| | |____(tests feature X.cpp)
| |
| |____(module B)/
| |____(...)
|
|____ShlubluLib.sln
|
|____(VS unit tests subproject files)
|____(VS Linux subproject files)
|____(VS Windows subproject files)
|
|____CHANGELOG.md
|____doxygen.conf
|____doxygen-structure.txt
|____LICENSE.txt
|____README.md
The main project file to open with Visual Studio is ShlubluLib.sln
.
The Visual Studio projects structure looks like this:
ShlubluLib
|
|____CHANGELOG.md
|____doxygen.conf
|____doxygen-structure.txt
|____LICENSE.txt
|____README.md
|
|____00tests-shlublu
| |____tests/
| |____(module A)
| | |____(tests X.cpp)
| | |____(tests Y.cpp)
| |
| |____(module B)
| |____(...)
|
|____shlublu
| |____include/
| | |____(module A)
| | | |____(feature X.h)
| | | |____(feature Y.h)
| | |
| | |____(module B)
| | |____(...)
| |
| |____src/
| |____(module A)
| | |____(feature X.cpp)
| | |____(feature Y.cpp)
| |
| |____(module B)
| |____(...)
|
|____shlublu-linux
|____include/
| |____(module A)
| | |____(feature X.h)
| | |____(feature Y.h)
| |
| |____(module B)
| |____(...)
|
|____src/
|____(module A)
| |____(feature X.cpp)
| |____(feature Y.cpp)
|
|____(module B)
|____(...)
The projects shlublu
(Windows) and shlublu-linux
(Linux) can be built independantly of each other. You can
decide to only build those you are interested in.
The unit tests project 00tests-shlublu
, on its end, depends on shlublu
. Building it is optional.
Projects you plan to use need their settings to be modified according to your local environment:
00tests-shlublu
:- VC++ directories:
- Includes: paths to the Boost and C-Python include files of your local Windows environment
- Libraries: path to the Boost library files of your Windows environment
- Build events:
- Pre-build: Doxygen generation command-line takes place here and can be removed if you prefer
- VC++ directories:
shlublu
:- VC++ directories:
- Includes: paths to the Boost and C-Python include files of your local Windows environment
- VC++ directories:
shlublu-linux
:- VC++ directories:
- Includes: paths to the Boost and C-Python include files of your remote Linux environment
- VC++ directories:
I am working on making this cleaner and easier to use. I hope it's ok for now.
00tests-shlublu
creates a test suite that can be used from the Test Explorer tab of Visual Studioshlublu
outputs to:- your local Windows environment:
<\path\to\ShlubluLib>\x64\<Debug|Release>\shlublu.lib
- your local Windows environment:
shlublu-linux
outputs to:- your local Windows environment:
<\path\to\ShlubluLib>\bin\x64\<Debug|Release>\libshlublu-linux.a
- your remote Linux environment:
~/projects/shlublu-linux/bin/x64/<Debug|Release>\libshlublu-linux.a
- your local Windows environment:
Your client projects should also add the following directory to their include path:
- Windows:
<\path\to>\ShlubluLib\include
- Linux:
~/projects/shlublu-linux/include
Unit tests are only available for Windows currently.
My name is Vincent Poulain.
You can find me there (user ID: @shlublu):
PGP public key: 0x1412f1e42222f90d
Many thanks to:
- so many Stack Overflow contributors,
- the Stack Overflow team,
- all the Boost community,
- and Dimitri van Heesch for Doxygen