Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emomaxd/ff
header-only fast-formatting library
https://github.com/emomaxd/ff
c-plus-plus format formatting header-only library open-source standard-library stdlib string stringformat
Last synced: about 1 month ago
JSON representation
header-only fast-formatting library
- Host: GitHub
- URL: https://github.com/emomaxd/ff
- Owner: emomaxd
- License: mit
- Created: 2024-11-12T20:15:39.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2024-11-22T11:29:51.000Z (about 1 month ago)
- Last Synced: 2024-11-22T12:27:32.736Z (about 1 month ago)
- Topics: c-plus-plus, format, formatting, header-only, library, open-source, standard-library, stdlib, string, stringformat
- Language: C++
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ff - fast-format
**ff** is a lightweight header-only C++ library designed to formatting strings. Customize outputs easily with placeholders and specifiers for decimal, hex, octal, binary, scientific, and more.
### Usage
No need to build, just put ff.h into your project's include directory and you are ready to go!### Building
In case if you want to build the library
```bash
mkdir build && cd build
cmake .. && make
```
And you can link with the static library in build/src/ named as ff### Example
```cpp
std::string result = ff::format("Decimal: {}, Hex: {0:x}, Binary: {b}", 255, 15);
std::cout << result; // Output: Decimal: 255, Hex: 0xFF, Binary: 0b1111
std::string result1 = ff::format("Pi: {.2}, Scientific: {s}", 3.14159f, 1000.0f);
std::cout << result1; // Output: Pi: 3.14, Scientific, 1.000000e+03
```