This repository represents the Lynar Studios - Standard Library (ls-std).

patrick-christopher.mattulat dc7637e8d4 Merge branch 'rc-2023.2.0' of public/ls-standard-library into master 1 year ago
config d1294730b0 Add cpp check configuration to analysis configuration 1 year ago
doc ab0accd845 Adjust documentation for Section-Pair standard 1 year ago
include e4127ed540 Add timestamp configuration to Logger class 1 year ago
source fb571b08c9 Improve directory creation exception 1 year ago
test fb571b08c9 Improve directory creation exception 1 year ago
.clang-format ad5fd017ed Update clang format file to force compact namespaces 1 year ago
.clang-tidy b3e4fb112b Add .clang-tidy configuration 1 year ago
.gitignore 82faffd63e Add AppleClang compiler support 2 years ago
CMakeLists.txt 41a19653c8 Reduce complexity of system time JNI implementation 1 year ago
LICENSE.MIT bbf7536450 Rename LICENSE.txt file 4 years ago
README.md 472200bba0 Add Changelog for file exception improvements 1 year ago

README.md

Lynar Studios - Standard Library 2023.2.0

This is a cross-platform standard library written in C++ offering functionalities you would usually miss in C++'s standard template library (STL), especially if you would search for cross-platform implementations.
This library has been tested on Windows, Linux and MacOS systems. Following a modularized approach the following independent submodules are defined in scope of this library:

Boxing

This library module provides boxing classes for primitive data types (e.g. string, int, long, float...), adding additional functionalities.

Core

The core module is a base module providing common functionalities being shared among other library submodules. Functionalities provided by this module include interfaces, exceptions and base classes, which provide basic reflection functionalities.

Encoding

To encode a byte field (e.g. a binary file) for network transfer the Base64 encoding / decoding functionality is being provided by this submodule as a first feature.

Event

This submodule comes with events in a primitive form, as well as with handlers and managers to provide an intuitive event handling for your application.

IO

To handle file operations - or to receive information of a file - this library submodule provides an own File class implementation, which can also be passed to library implemented input or output stream classes.
Additionally XML and KV parsing functionalities are provided.

Time

A Date class comes with this submodule, which you can use to represent a date and do operations on it.


Changelog

Features

  • added NotImplementedException class, which can be thrown in case a method is provided, but not implemented
  • a JNI class is now available, wrapping C-like JNI functionalities, which can be found in ls-std-core module - in order to use this feature the CMake option LS_STD_BUILD_WITH_JNI has to be enabled - please note, that this feature is experimental and incomplete
  • a SystemTime class has been added to the library's time module for setting the local system time
  • Logger class is now configurable to silent log level or timestamp output

Improvements

  • made test constructors public and reduced test setup overhead
  • added missing nodiscard attributes to test package
  • made Exception base class abstract, which prevents it from being instantiated
  • NullPointerEvaluator & NullPointerArgumentEvaluator now except raw pointers
  • Section-Pair identifiers can now have a length of 64 characters
  • Section-Pair values can now have a length of 512 characters
  • exceptions for creation of files or directories have been improved and now show the absolute file path

Fixes

  • no comment

Documentation

You can find a detailed documentation on Lynar Studios Website: lynarstudios.com


License

This software is licensed and uses MIT-license. You can find a LICENSE.MIT file inside the project's root directory.


Building

Building this library would result into providing binaries for each library module and CLI tool:

binary type dependency
cli-base64 CLI executable ls-std-encoding, ls-std-core
ls-std-boxing library (static / dynamic) ls-std-core
ls-std-core library (static / dynamic) ---
ls-std-encoding library (static / dynamic) ls-std-core
ls-std-event library (static / dynamic) ls-std-core
ls-std-io library (static / dynamic) ls-std-core
ls-std-time library (static / dynamic) ls-std-core

Prerequisites

To build this library you'd need a supported toolchain in place, consisting of a build tool and compiler. The following table is a listing of supported compilers and build tools associated with operating systems, where this library has been tested:

Supported Compiler
(mandatory)
OS Supported Compiler Version
(mandatory)
Build Tool
(mandatory)
Build Tool Version (mandatory)
GCC Linux Mint 20.3 12.2.0 CMake >= 3.24.0
Clang Linux Mint 20.3 12.0.0-3ubuntu1~20.04.5 CMake >= 3.24.0
MinGW-w64 / GCC Windows 10 11.2.0 CMake >= 3.24.0
MSVC Windows 10 19.32.31332.0 CMake >= 3.24.0
AppleClang MacOS Monterey 14.0.0 CMake >= 3.24.0

Please note, that where the underlying operating system is optional in this listing, the toolchain itself is not! This means, that by default you should use one of the supported listed toolchains.
In case you'd like to use an unsupported toolchain, you can enforce this during CMake project generation. For that have a look at the CMake flag usage section below.

Generate CMake Project (Unix)

To prepare a CMake project, create a build folder within the project's root folder (where the CMakeLists.txt file is located) via CLI and navigate to it:

mkdir cmake-build-release
cd cmake-build-release

Inside this folder generate the CMake project:

cmake ../

Alternatively, the CMake project generation can be controlled by providing library specific CMake flags. The following table is a listing of available flags:

CMake Flag Default Value Description
LS_STD_BUILD_WITH_TESTS OFF This flag can be enabled to build automated tests, like unit or integration tests.
LS_STD_BUILD_WITH_SUPPORTED_COMPILER ON This flag enforces the usage of supported compilers, only.
For usage of an unsupported toolchain, set this flag to OFF.
LS_STD_BUILD_STATIC ON This flag indicates, that all library modules should be built as static goals.
Please note, that LS_STD_BUILD_SHARED has to be turned off.
LS_STD_BUILD_SHARED OFF This flag indicates, that all library modules should be built as shared goals.
Please note, that LS_STD_BUILD_STATIC has to be turned off.
LS_STD_BUILD_WITH_JNI OFF This flag enables the build of JNI dependencies.
Please note, that LS_STD_BUILD_SHARED has to be turned on.

To use one or more of these flags, you'd have to adjust previous command, like:

cmake -DLS_STD_BUILD_WITH_TESTS=ON ../

Compile Project

Now, that the CMake project is generated, you should find CMake generated files inside previously created build folder. In order to compile the project run:

cmake --build . --config Release

Once compilation is done, you should find generated binaries within cmake-build-release folder.


Link ls-std Libraries (CMake)

If you would like to add this library's modules to your own CMake project, make sure that you would add the libraries' include directory:

include_directories(${CMAKE_CURRENT_LIST_DIR}/path/to/this/library/include)

Then link the libraries' binary files, like:

target_link_libraries(... ls-std-core ls-std-boxing ...)

Run Automated Tests

When enabling test build CMake flag during CMake project generation, executable test suite binaries will be generated during project compilation.
You would then find individual module test suites, as well as a whole project test suite, which can be run via CLI.