/phosg

C++ helpers for some common tasks

Primary LanguageC++

Phosg is a basic C++ wrapper library around some common C routines.

A short summary of its contents:
- Byteswapping and encoding functions (base64, rot13)
- Directory listing, smart-pointer fopen and stat, file and path manipulation
- Hash functions (fnv1a64, sha1, sha256, md5)
- Basic image manipulation/drawing
- JSON (de)serialization
- Network helpers (IP address parsing/formatting, listen/connect sockets)
- OS random data sources
- Process utilities (list processes, name <> PID mapping, subprocess execution)
- Time conversions
- std::string helpers like printf, split, time/size formatting, etc.
- 2D, 3D, 4D vectors and basic vector math
- KD-tree and LRU set data structures

Phosg also includes an executable (jsonformat) that reformats JSON.

Building & installing on macOS, Linux, or Windows (in a Cygwin bash shell):
- Install CMake, zlib (zlib-devel on Cygwin), and Python 3.
- `cmake .`
- `make`
- `make test`
- `sudo make install`

The Windows build does not have continuous integration, so I may accidentally
break it and not know for a while. Feel free to file a GitHub issue if it
doesn't work.