Skip to content
/ bux Public

Static library of whatever are seen required in general purpose but not directly supported from Modern C++. Or whatever reusable originated from my side projects.

License

Notifications You must be signed in to change notification settings

buck-yeh/bux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  • bux is 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. 💡 Doxygen has been known for being insensitive to Modern C++ for so many years. Keywords like any of attributes, ... etc can be misinterpreted or simply dropped. Viewer's discretion is advised.


Table of contents

  1. Make sure you have installed yay or any other pacman wrapper

  2. yay -Ss bux
  3. To define target executable foo using bux in CMakeLists.txt

    add_executable(foo foo.cpp)
    target_compile_options(foo PRIVATE -std=c++2a)
    target_link_libraries(foo bux)
  4. Include the header files by prefixing header name with bux/, for example:

    #include <bux/Logger.h>

    p.s. Header files are in /usr/include/bux and compiler is expected to search /usr/include by default.

  5. If directly using gcc or clang is intended, the required compiler flags are -std=c++23 -lbux

Build from github in MacOS or any of Linux distros

  1. Make sure you have installed the following tools or the likes:

    • cmake(3.18 or newer)
    • make
    • gcc(13 or newer) or clang(usually thru installing xcode on MacOS)
    • git
  2. 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 main with tag name.

  3. To define target executable foo using bux in CMakeLists.txt

    add_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)
  4. Include the header files by prefixing header names with bux/, for example:

    #include <bux/Logger.h>
  5. If directly using command gcc or clang is intended, the required compiler flags are -std=c++23 -I$BUX_DIR/include -L$BUX_DIR/src -lbux

  6. Subdirectory test/ is excluded by default. To build with it, reconfigure cmake with:

    rm CMakeCache.txt
    cmake . -DBUILD_TEST=1
    make

    And test all of them:

    cd test
    ctest .

From vcpkg in Windows

  1. 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>
  2. Install buck-yeh-bux with triplets you needed. For example:

    PS F:\vcpkg> .\vcpkg.exe install buck-yeh-bux:x64-windows-static
  3. Include the header files by prefixing header name with bux/, for example:

    #include <bux/Logger.h>

Header Intros

Containers

Input/Output

Logger

  • FileLog.h - bux::C_PathFmtLogSnap can be configured to automatically change the output path, IOW to output to different files, according to the current timestamp. The object is a plugin to bux::C_ReenterableOstreamSnap and bux::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_ParaLog is a logger facade to reroute log lines to multiple child loggers
  • SyncLog.h - Basic classes to give variety of thread-safe loggers.

Parser/scanner related

System

Thread Safety

Misc.