Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
/ ShlubluLib Public archive

ShlubluLib is a lightweight, modular, general purpose, open-source C++ library for Linux and Windows.

License

Notifications You must be signed in to change notification settings

shlublu/ShlubluLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository has been archived on the 3rd of September 2024

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.

Table of content

Modules and documentation

This library currently consists in the following modules:

  • async: threading and asynchronous operations
  • binding: interactions with other languages
  • hash: hash algorithms
    • CRC: cyclic redundancy check.
  • math: math issues
  • random: random numbers generation
  • text: text content handling
  • util: miscellaneous
    • Debug: 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.

C++ version and linkage

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.

Installation from binaries

Should you just wish to use Shlublulib as a development tool, the binary distribution can be downloaded from our website.

Download

Content

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

Installation from sources

Should you wish to contribute, to play with the code, or should you prefer not to download binaries, this method is for you.

Prerequisites

External libraries

The following libraries are required for ShlubluLib to compile:

Those version numbers correspond to my testing. Lower version numbers may work but this has not been tested yet.

Development environment

This library is developed under Microsoft Visual Studio 2019 using the following features and extensions:

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.

Git repository

ShlubluLib is hosted on GitHub. The repository can be found here.

You can either:

Files system

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.

Visual Studio projects structure

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.

Build configuration

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
  • shlublu:
    • VC++ directories:
      • Includes: paths to the Boost and C-Python include files of your local Windows environment
  • shlublu-linux:
    • VC++ directories:
      • Includes: paths to the Boost and C-Python include files of your remote Linux environment

I am working on making this cleaner and easier to use. I hope it's ok for now.

Build outputs

  • 00tests-shlublu creates a test suite that can be used from the Test Explorer tab of Visual Studio
  • shlublu outputs to:
    • your local Windows environment: <\path\to\ShlubluLib>\x64\<Debug|Release>\shlublu.lib
  • 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 client projects should also add the following directory to their include path:

  • Windows: <\path\to>\ShlubluLib\include
  • Linux: ~/projects/shlublu-linux/include

Unit tests

Unit tests are only available for Windows currently.

About the author

My name is Vincent Poulain.

You can find me there (user ID: @shlublu):

PGP public key: 0x1412f1e42222f90d

Acknowledgements

Many thanks to: