Skip to content

Latest commit

 

History

History
177 lines (132 loc) · 9.34 KB

README.md

File metadata and controls

177 lines (132 loc) · 9.34 KB
  • 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

(Created by gh-md-toc)

Installation & Usage

  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

from github in any of Linux distros

  1. Make sure you have installed cmake(3.18 or newer) make gcc(13 or newer) git, or the likes.

  2. git clone -b main --single-branch https://github.com/buck-yeh/bux.git .
    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_options(foo PRIVATE -std=c++2a)
    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 name 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.6.8#2          A supplemental C++ library with functionalities not directly supported fro...
    buck-yeh-bux-mariadb-client 1.0.3#1       Loose-coupled throw-on-error C++20 wrapper classes and utilities over mysq...
    buck-yeh-bux-sqlite      1.0.1            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. Available triplets are:

    buck-yeh-bux:x64-windows
    buck-yeh-bux:x64-windows-static
    buck-yeh-bux:x64-windows-static-md
    buck-yeh-bux:x86-windows
    buck-yeh-bux:x86-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_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.