A collection of basic/generally desirable code I use across multiple C++ projects.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
3.0 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. This is a library of C++ code which I use as a standard library wrapper, supplement, and in some cases, replacement.
  2. If you want to use it, you can add all of the source files to your source tree, configure the `#define`'s in `config.h` to suit your needs, and it should just work.
  3. ---
  4. Features:
  5. - Stack, Scratch, and Block-based allocators as well as memory-leak checking mechanism and OS allocator wrappers in `alloc.h/.cpp`
  6. - Heap-friendly String type, including format strings and StringBuffers/Builders, as well as `<string.h>` function replacements as static methods in single-header `string.h`
  7. - Instrusive serialization mechanism in `serialize.h/.cpp` for complex types and primitives (no reflection though)
  8. - A few hash functions, HashTable and CacheTable (hash table that can forget its keys) implementations in `table.hpp`
  9. - A dynamic/growing array implementation in `array.hpp`
  10. - Common file operations, `<stdio>` wrapper in `file.h/.cpp`
  11. - Process signal handlers in `signal-handler.h` (define what happens when your process gets sent a SIGINT signal, etc)
  12. - `stdout` / printf wrapper in `print.h/.cpp` for programmer ergonomics + making it so if you `#include <stdio.h>` in your program, it will be just in these files.
  13. And some more stuff that is TODO:
  14. - `cpuid` x86 instruction wrapper
  15. - `glm` replacement - vector, matrix, and quaternion types and some common operations involving them
  16. # Licenses & Other Code
  17. ## fast_float
  18. Our serialization code uses `fast_float` library by Daniel Lemire et al, provided simultaneously under the [Apache License, Version 2.0](https://github.com/fastfloat/fast_float/blob/main/LICENSE-APACHE), the [MIT license](https://github.com/fastfloat/fast_float/blob/main/LICENSE-MIT) and/or the [BOOST license](https://github.com/fastfloat/fast_float/blob/main/LICENSE-BOOST). The `fast_float` library itself uses code originally published the Apache 2.0 license.
  19. ## sse_mathfun.h
  20. The `sin`, `cos`, `exp`, and `log` replacements used by this library are provided by a single-header library written by Julien Pommier under the zlib license:
  21. ```
  22. Copyright (C) 2007 Julien Pommier
  23. This software is provided 'as-is', without any express or implied
  24. warranty. In no event will the authors be held liable for any damages
  25. arising from the use of this software.
  26. Permission is granted to anyone to use this software for any purpose,
  27. including commercial applications, and to alter it and redistribute it
  28. freely, subject to the following restrictions:
  29. 1. The origin of this software must not be misrepresented; you must not
  30. claim that you wrote the original software. If you use this software
  31. in a product, an acknowledgment in the product documentation would be
  32. appreciated but is not required.
  33. 2. Altered source versions must be plainly marked as such, and must not be
  34. misrepresented as being the original software.
  35. 3. This notice may not be removed or altered from any source distribution.
  36. (this is the zlib license)
  37. ```