https://github.com/trflynn89/libfly
C++ utility library
https://github.com/trflynn89/libfly
c-plus-plus c-plus-plus-20 c-plus-plus-library cpp cpp-library cpp20 cross-platform utility-library
Last synced: 12 months ago
JSON representation
C++ utility library
- Host: GitHub
- URL: https://github.com/trflynn89/libfly
- Owner: trflynn89
- License: mit
- Created: 2016-07-29T22:08:52.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2022-08-16T19:51:01.000Z (over 3 years ago)
- Last Synced: 2025-03-25T01:36:34.494Z (about 1 year ago)
- Topics: c-plus-plus, c-plus-plus-20, c-plus-plus-library, cpp, cpp-library, cpp20, cross-platform, utility-library
- Language: C++
- Homepage: https://trflynn89.github.io/libfly/
- Size: 30.6 MB
- Stars: 16
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# libfly
[](https://dev.azure.com/trflynn89/libfly/_build?definitionId=5)
[](https://codecov.io/gh/trflynn89/libfly)
[](https://app.codacy.com/gh/trflynn89/libfly/dashboard)
libfly is a C++20 utility library for Linux, macOS, and Windows. It primarily serves as a playground
for learning new C++ standards and exploring interests.
## Features
* A [string library](fly/types/string/string.hpp) for all `std::basic_string` specializations,
including:
* A compile-time-validated string formatter based on `std::format`
* A type-safe lexical type converter
* UTF-8, UTF-16, and UTF-32 support
* A [JSON type](fly/types/json/json.hpp) as a first-class container
* Designed to feel like a Python dictionary
* [Instrumentation and logging](fly/logger/logger.hpp)
* Provides synchronous and asynchronous loggers
* Supports logging to the console ([with color](fly/logger/styler.hpp)), a file, or any
user-defined sink
* Networking
* [TCP](fly/net/socket/tcp_socket.hpp) and [UDP](fly/net/socket/udp_socket.hpp) sockets with
[IPv4](fly/net/ipv4_address.hpp) and [IPv6](fly/net/ipv6_address.hpp) support
* An [asynchronous socket](fly/net/socket/socket_service.hpp) IO service
* Coders
* Base64 [encoder and decoder](fly/coders/base64/base64_coder.hpp)
* Huffman [encoder](fly/coders/huffman/huffman_encoder.hpp) and [decoder](fly/coders/huffman/huffman_decoder.hpp)
* Includes a [bitwise IO stream](fly/types/bit_stream/detail/bit_stream.hpp) for reading
and writing content bit-by-bit
* [Path change monitoring](fly/path/path_monitor.hpp)
* Monitors any number of files or directories for creation, deletion, or change
* [Configuration management](fly/config/config_manager.hpp)
* Built around the path monitor to detect changes to a configuration file and automatically
update configuration objects
* [Task system](fly/task/task_runner.hpp) for policy-based asynchronous execution of tasks
* [INI](fly/parser/ini_parser.hpp) and [JSON](fly/parser/json_parser.hpp) file parsers
* [System resource monitor](fly/system/system_monitor.hpp)
* Thread-safe [queue](fly/types/concurrency/concurrent_queue.hpp) and [stack](fly/types/concurrency/concurrent_stack.hpp)
* [Concepts](fly/concepts/concepts.hpp) to extend the STL's ``
* Type-safe, fixed-width [integer literal suffixes](fly/types/numeric/literals.hpp)
## Building
After cloning libfly, [external dependencies](extern) should be fetched as well.
```bash
git submodule update --init
```
Of those dependencies, only [flymake](https://github.com/trflynn89/flymake) is required (on Linux
and macOS) to compile the libfly library. [Catch2](https://github.com/catchorg/Catch2) is required
only for building unit tests. All other dependencies are for benchmarking purposes, and not used by
libfly itself.
### Linux and macOS
On Linux and macOS, libfly is compiled using the [flymake](https://github.com/trflynn89/flymake)
build system, which is a GNU Makefile system. To build all libfly targets with the default
configuration, just run `make`.
The following individual Make targets are defined:
* `libfly` - Compiles the libfly library to static and shared library files.
* `libfly_unit_tests` - Compiles libfly unit tests.
* `libfly_benchmarks` - Compiles libfly performance benchmarks.
See the flymake README for [other make goals](https://github.com/trflynn89/flymake/blob/main/README.md#make-goals)
and [build configurations](https://github.com/trflynn89/flymake/blob/main/README.md#build-configuration).
### Windows
On Windows, libfly is compiled with Visual Studio. A [solution file](libfly.sln) is provided with
the following projects:
* [libfly](build/win/libfly/libfly.vcxproj) - Compiles libfly library to static library files.
* [libfly_unit_tests](build/win/libfly_unit_tests/libfly_unit_tests.vcxproj) - Compiles libfly unit
tests.
* [libfly_benchmarks](build/win/libfly_benchmarks/libfly_benchmarks.vcxproj) - Compiles libfly
performance benchmarks.
## Directory structure
* [fly](fly) - Contains the primary source and header files for libfly.
* [build](build) - Contains build output, platform-specific build files, and the CI configuration.
* [test](test) - Contains the libfly unit tests.
* [docs](docs) - Contains generated source code documentation.
* [bench](bench) - Contains performance benchmarks of various libfly components.
* [extern](extern) - Contains all third-party projects used by libfly.