-
buxis not Buck's. It could be box! -
Supplemental static library of whatever are seen required in sense of general purpose but not directly supported from Modern C++. Or whatever is deemed reusable from my side projects.
-
Doxygen-generated API reference is here.
Table of contents
In ArchLinux
-
Make sure you have installed
yayor any other pacman wrapper -
yay -S bux
-
To define target executable
foousingbuxinCMakeLists.txtadd_executable(foo foo.cpp) target_compile_options(foo PRIVATE -std=c++2a) target_link_libraries(foo bux)
-
Include the header files by prefixing header name with
bux/, for example:#include <bux/Logger.h>
p.s. Header files are in
/usr/include/buxand compiler is expected to search/usr/includeby default. -
If directly using
gccorclangis intended, the required compiler flags are-std=c++23 -lbux
Build from github in MacOS or any of Linux distros
-
Make sure you have installed the following tools or the likes:
cmake(3.18 or newer)makegcc(13 or newer) orclang(usually thru installing xcode on MacOS)git
-
git clone https://github.com/buck-yeh/bux.git cd bux cmake . make -j BUX_DIR="/full/path/to/current/dir"
p.s. You can install a tagged version by replacing
mainwith tag name. -
To define target executable
foousingbuxinCMakeLists.txtadd_executable(foo foo.cpp) target_compile_features(foo PRIVATE cxx_std_23) target_include_directories(foo PRIVATE "$env{BUX_DIR}/include") target_link_directories(foo PRIVATE "$env{BUX_DIR}/src") target_link_libraries(foo bux)
-
Include the header files by prefixing header names with
bux/, for example:#include <bux/Logger.h>
-
If directly using command
gccorclangis intended, the required compiler flags are-std=c++23 -I$BUX_DIR/include -L$BUX_DIR/src -lbux -
Subdirectory
test/is excluded by default. To build with it, reconfigurecmakewith:rm CMakeCache.txt cmake . -DBUILD_TEST=1 makeAnd test all of them:
cd test ctest .
-
PS F:\vcpkg> .\vcpkg.exe search bux buck-yeh-bux 1.11.0 A supplemental C++ library with functionalities not directly supported fro... buck-yeh-bux-sqlite 1.0.5 Modern C++ wrapper classes and utilities of the original sqlite3 API The result may be outdated. Run `git pull` to get the latest results. If your port is not listed, please open an issue at and/or consider making a pull request. - https://github.com/Microsoft/vcpkg/issues PS F:\vcpkg>
-
Install
buck-yeh-buxwith triplets you needed. For example:PS F:\vcpkg> .\vcpkg.exe install buck-yeh-bux:x64-windows-static
-
Include the header files by prefixing header name with
bux/, for example:#include <bux/Logger.h>
💡 The following headers and other headers using them should be avoided to use because they call std::format() directly or indirectly, which in turn calls the floating point version of std::to_chars(), which wasn't ready in AppleClang with the advent of C++17 for quite a few years.
- Intervals.h -
std::C_Intervals<T>defines its own arithmetics but is currently ever used byscannergen - PartialOrdering.h - Define partial ordering as container in order to generate a compatible linear ordering.
- XQue.h - An efficient generic queue.
- Xtack.h - Generic stack types.
- EZArgs.h - Inspired by Python argparse.ArgumentParser with interfaces making sense to Modern C++
- LogStream.h - Fundation functions for
std::ostream, used indirectly by logger macros such asLOG(), ... - MemIn.h - Drop-in replacement of C++98-deprecated
std::istrstream. - MemOut.h - Drop-in replacement of C++98-deprecated
std::ostrstream. (Not used recently) - Serialize.h - Simple functions to define serialization/deserialization in a symmetric way.
- StrUtil.h - String utilities.
- UnicodeCvt.h - Encode text stream to unicodes (
utf8/utf16/utf32)
- FileLog.h -
bux::C_PathFmtLogSnapcan be configured to automatically change the output path, IOW to output to different files, according to the current timestamp. The object is a plugin tobux::C_ReenterableOstreamSnapandbux::C_ParaLog - Logger.h - Log macros for various needs with singleton
bux::logger()in mind. - LogLevel.h - LL_FATAL, LL_ERROR, LL_WARNING, LL_INFO, LL_DEBUG, LL_VERBOSE
- ParaLog.h -
bux::C_ParaLogis a logger facade to reroute log lines to multiple child loggers - SyncLog.h - Basic classes to give variety of thread-safe loggers.
- FA.h - Supports to finite automaton, aka finite state machine, aka regular expression, emphasizing on minimizing NFA into DFA.
- GLR.h - Implementation of Generalized LR parser
- ImplGLR.h - Stuffs constantly needed by
parsergen-generated *.cpp files for syntaxes classified as GLR. - ImplLR1.h - Stuffs constantly needed by
parsergen-generated *.cpp files for syntaxes classified as LR1. - ImplScanner.h - Generic implementation of scanner, aka lexical analyzer, mainly used by
scannergen - LexBase.h - Basic supports to create lexical tokens and parsers.
- LR1.h - Implementation of LR1 parser
- ParserBase.h - Common supports to all parsers.
- Range2Type.h -
bux::fittestType()called byparsergen&scannergen. - ScannerBase.h - Generic supports to all scanners.
- FileAsMem.h - Memory-mapped file
- FsUtil.h - Utilities solely related to <filesystem>
- XConsole.h - Cross-platform console functions.
- XPlatform.h - Conditionally defined macros, types, functions for as many platforms as possible.
- AtomiX.h - Spin lock on
std::atomic_flag& a mapping cache type using it.
- EZScape.h - Replacement of
curl_easy_escape()&curl_easy_unescape()inlibcurl. - SafeArith.h - Supports to safe arithmetics. (Not used recently)
- XAutoPtr.h - Safe
std::auto_ptrdated back to pre-C++11 years. It ain't broke ... - XException.h - Macros to throw
std::runtime_error,std::logic_error, as well as other exceptions, with location & formatted message.