BLT/README.md

50 lines
2.1 KiB
Markdown
Raw Normal View History

# **BLT v0.6.1a**
A common utilities library I find useful
2023-01-24 15:57:52 -05:00
![Icon](icon_large.png)
---
2023-01-24 15:57:52 -05:00
# Specialties
## blt::logging.v2
Found in the header file `include/std/logging.h`, blt::logging is a fast and simple
single header logging library which can be used independently of BLT. Just include
the header file anywhere in your project and in ONE cpp file define `#define BLT_LOGGING_IMPLEMENTATION`.
If you are using BLT as a CMake library (as you should!) this is done for you.
- ### Compile Time Config
- Using CMake
2023-07-22 12:30:07 -04:00
- Several options are provided which disable various logging contexts, as such global logging can be disabled by passing `-DBLT_DISABLE_LOGGING:BOOL=ON`
- Options follow the pattern of `BLT_DISABLE_LEVEL` where level is one of `TRACE`,`DEBUG`,`INFO`,`WARN`,`ERROR`, or `FATAL`.
- This allows for individual logging levels to be disabled while leaving the others functional. These options can be combined.
- See CMakeLists.txt for a complete list of options.
- Standalone
- The CMake options define global variables in a config file. If you are using logging standalone you will need to remove the config include.
- Macros can be used in the same pattern of `BLT_DISABLE_LEVEL` to disable the various logging levels
---
# **Features / Examples**
2023-01-24 15:57:52 -05:00
- ## Data Structures
- Queue / Stack
- faster than std::queue / std::stack
- backed by a contiguous array
2023-01-24 15:57:52 -05:00
- ## Utility
- Simple Random Wrapper Interface
- Simple random functions based on the PCG Hash
2023-01-24 15:57:52 -05:00
- ### String Functions
- starts_with
- ends_with
- contains
- toLowerCase
- toUpperCase
- split
- trim
- Logging
- See blt::logging section above
2023-01-24 15:57:52 -05:00
- Time
- Current time in nanoseconds (without all the c++ gobbledygook)
- Java's currentTimeMilliseconds
- nanoTime as well
- `std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count()` becomes `blt::system::nanoTime()`
2023-01-24 15:57:52 -05:00
- Formatted time string with year/month/date + current time
- ## Profiling
- Basic profiler with history and formatted output