A collection of useful C++ routines.
Go to file
2019-04-26 12:11:25 +10:00
algo types/traits: use LessThanComparable more consistently 2019-02-03 17:28:53 +11:00
alloc build: satiate clang-tidy somewhat 2019-01-03 15:48:34 +11:00
array array/sarray: add move assignment operator 2019-03-27 15:51:57 +11:00
buffer buffer: move buffer code out of 'memory' namespace 2018-12-19 20:22:18 +11:00
coord coord/base: take const-ref for supplementary index query 2019-03-22 15:09:19 +11:00
cpuid cpuid/x86: avoid coercing cpuid params from int to unsigned 2019-04-15 10:35:12 +10:00
debug/gdb coord/store: prefer raw arrays to std::array 2019-03-06 17:09:26 +11:00
doc doc: add noise documentation stubs 2016-02-02 10:36:42 +11:00
encode encode/number: set the view's remainder at exit 2018-12-16 18:06:28 +11:00
fixup/experimental build: transition from experimental filesystem 2018-12-05 19:12:03 +11:00
geom geom/aabb: add expand observer. 2019-04-08 14:05:38 +10:00
hash hash/buzhash: add digest_type typedef 2019-04-23 08:54:58 +10:00
iterator iterator: move each iterator to their own unit 2019-03-18 16:18:27 +11:00
job job/queue: avoid noexcept termination in default_parallelism 2019-04-15 10:35:49 +10:00
map map/fixed: add custom comparator support 2019-04-15 13:34:26 +10:00
maths rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
memory buffer: move buffer code out of 'memory' namespace 2018-12-19 20:22:18 +11:00
parallel thread/primitive: add platform wrappers for pause/yield instructions 2019-02-02 14:55:13 +11:00
parse parse/time: add consuming and non-consuming parsers 2019-03-19 17:09:03 +11:00
posix posix/util: add stat wrappers 2019-04-26 12:11:25 +10:00
rand rand/pcg: add pcg_xsh_rr generator 2019-02-21 20:53:58 +11:00
roots rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
test bitwise: add ctz, aka count trailing zeroes 2019-04-24 13:25:44 +10:00
thread thread/primitive: add platform wrappers for pause/yield instructions 2019-02-02 14:55:13 +11:00
time rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
tools build: remove buzstats tool 2019-04-23 08:19:47 +10:00
tuple tuple/value: forward the arguments from map to the helper function 2019-03-18 14:09:29 +11:00
types iterator: move each iterator to their own unit 2019-03-18 16:18:27 +11:00
win32 win32/file: add move operators 2019-03-27 19:08:42 +11:00
.gitignore build; remove unnecessary gitignore entries 2018-08-06 14:36:23 +10:00
.gitlab-ci.yml gitlab-ci: Use the official Arch linux image 2019-02-10 12:50:18 +11:00
.gitmodules build: don't include cmake modules in this repository 2018-07-24 16:16:53 +10:00
abnf.rl uri: extract grammar into contained ragel file 2017-12-20 12:45:05 +11:00
adapter.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
adapter.hpp build: satiate clang-tidy somewhat 2019-01-03 15:48:34 +11:00
annotation.hpp build: add doxygen comments for various headers 2019-01-03 11:15:00 +11:00
ascii.hpp ascii: rename hex2u8 as hex2u08 2019-02-09 14:57:02 +11:00
backtrace_execinfo.cpp backtrace: remove dependency on addr2line 2018-09-12 14:01:21 +10:00
backtrace_null.cpp relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
backtrace_stackwalk.cpp build: many compilation fixes for win32 2019-01-04 17:13:21 +11:00
backtrace_win32.cpp win32/windows: add a defensive windows wrapper header 2018-08-27 14:16:27 +10:00
backtrace.hpp relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
bezier1.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
bezier2.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
bezier3.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
bezier.cpp iterator: move each iterator to their own unit 2019-03-18 16:18:27 +11:00
bezier.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
bitwise.cpp relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
bitwise.hpp bitwise: don't allow full rotation 2019-04-26 10:27:22 +10:00
cast.hpp build: many compilation fixes for win32 2019-01-04 17:13:21 +11:00
CMakeLists.txt posix/util: add stat wrappers 2019-04-26 12:11:25 +10:00
cmdopt.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
cmdopt.hpp introspection: use __FUNCTION__ parsing method for type_name queries 2019-04-16 10:17:53 +10:00
colour.cpp parse: move si and value parsing into common namespace 2019-03-19 12:38:22 +11:00
colour.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
coord.hpp relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
COPYING relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
cpp.cpp build: transition from experimental filesystem 2018-12-05 19:12:03 +11:00
cpp.hpp build: transition from experimental filesystem 2018-12-05 19:12:03 +11:00
cpuid.cpp cpuid: add initial trivial CPUID queries 2018-03-18 17:29:44 +11:00
cpuid.hpp cpuid: connect the 'none' provider 2019-02-02 17:01:03 +11:00
debug_posix.cpp debug;posix: log that we're waiting for a debugger 2018-09-12 14:02:27 +10:00
debug_win32.cpp build: many compilation fixes for win32 2019-01-04 17:13:21 +11:00
debug.cpp debug: add a breakpoint before unhandled aborts 2019-01-07 12:18:45 +11:00
debug.hpp debug: pretend to return the same type in unhandled 2019-02-05 18:16:36 +11:00
Doxyfile.in Doxyfile: Use CMake variables in preference to autotools variables 2019-01-03 11:15:00 +11:00
endian.cpp relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
endian.hpp endian: be less clever with value operators 2019-02-03 16:37:08 +11:00
except.cpp except: add custom base exception 2018-12-03 15:29:21 +11:00
except.hpp except: error::describe shouldn't be noexcept 2019-02-02 15:35:44 +11:00
exe_freebsd.cpp build: transition from experimental filesystem 2018-12-05 19:12:03 +11:00
exe_linux.cpp build: transition from experimental filesystem 2018-12-05 19:12:03 +11:00
exe_win32.cpp build: many compilation fixes for win32 2019-01-04 17:13:21 +11:00
exe.hpp build: transition from experimental filesystem 2018-12-05 19:12:03 +11:00
expected.hpp expected: add a trivial move constructor 2019-03-19 17:08:35 +11:00
extent.cpp build: satiate clang-tidy somewhat 2019-01-03 15:48:34 +11:00
extent.hpp extent: use matching types for random calls 2019-04-11 11:48:34 +10:00
fixed.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
fixed.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
float.cpp build: many compilation fixes for win32 2019-01-04 17:13:21 +11:00
float.hpp build: many compilation fixes for win32 2019-01-04 17:13:21 +11:00
format.cpp.rl rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
format.hpp format: support string_view as a string 2019-04-16 10:18:10 +10:00
fourcc.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
fourcc.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
functor.hpp functor: add construct and tuple_construct 2019-02-05 12:13:53 +11:00
gcc.hpp relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
hash.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
introspection.cpp relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
introspection.hpp introspection: use __FUNCTION__ parsing method for type_name queries 2019-04-16 10:17:53 +10:00
io_posix.cpp io: don't forget to initialise the mmap size for zero length mappings 2019-02-03 18:23:22 +11:00
io_posix.hpp io;posix: implement move constructor for mapped_file 2019-01-17 19:49:45 +11:00
io_win32.cpp io_win32: add move operators to mapped_file 2019-03-27 19:08:55 +11:00
io_win32.hpp io_win32: add move operators to mapped_file 2019-03-27 19:08:55 +11:00
io.cpp io: use the actual path when loggin failures 2019-02-27 15:33:07 +11:00
io.hpp io: ensure write/pwrite views use pointer iterators 2018-12-19 17:13:06 +11:00
kmeans.hpp iterator: move each iterator to their own unit 2019-03-18 16:18:27 +11:00
libcruft.pc.in rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
library_posix.cpp build: transition from experimental filesystem 2018-12-05 19:12:03 +11:00
library_posix.hpp build: transition from experimental filesystem 2018-12-05 19:12:03 +11:00
library_win32.cpp build: many compilation fixes for win32 2019-01-04 17:13:21 +11:00
library_win32.hpp build: many compilation fixes for win32 2019-01-04 17:13:21 +11:00
library.hpp relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
log.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
log.hpp preprocessor: build the header out of tree 2018-10-30 21:41:15 +11:00
maths.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
maths.hpp maths: add pow2 convenience function 2019-03-28 14:28:08 +11:00
matrix2.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
matrix3.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
matrix4.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
matrix.cpp iterator: move each iterator to their own unit 2019-03-18 16:18:27 +11:00
matrix.hpp iterator: move each iterator to their own unit 2019-03-18 16:18:27 +11:00
meson.build build: add initial meson experiments 2019-02-22 12:41:19 +11:00
nocopy.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
platform.hpp build: many compilation fixes for win32 2019-01-04 17:13:21 +11:00
point.cpp build: satiate clang-tidy somewhat 2019-01-03 15:48:34 +11:00
point.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
pointer.hpp build: many compilation fixes for win32 2019-01-04 17:13:21 +11:00
polynomial.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
polynomial.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
pool.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
pool.hpp pool: add attributes to allocate 2019-01-21 17:14:02 +11:00
preprocessor.py preprocessor: add convenience APPEND_COMMA macro 2018-11-13 15:19:53 +11:00
quaternion.cpp quaternion: add slerp and nlerp 2019-02-07 15:45:08 +11:00
quaternion.hpp quaternion: add slerp and nlerp 2019-02-07 15:45:08 +11:00
random.cpp relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
random.hpp random: clarify the intervals for 'uniform' calls 2019-04-11 11:49:16 +10:00
range.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
range.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
rational.cpp build: satiate clang-tidy somewhat 2019-01-03 15:48:34 +11:00
rational.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
README.adoc rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
region.cpp region: make area and diameter constexpr 2019-03-20 16:07:42 +11:00
region.hpp region: make area and diameter constexpr 2019-03-20 16:07:42 +11:00
registrar.cpp registrar: add skeleton of plugin registry 2019-04-16 11:02:26 +10:00
registrar.hpp registrar: add skeleton of plugin registry 2019-04-16 11:02:26 +10:00
rfc3986.rl rfc3986: don't enforce actions for rules 2017-12-26 17:34:08 +11:00
scoped.hpp scoped: don't force rvals for function object 2019-04-25 09:22:02 +10:00
signal.cpp signal: reduce templating complexity 2019-03-13 12:08:57 +11:00
signal.hpp signal: add default move and copy operators 2019-03-13 14:07:51 +11:00
singleton.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
stats.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
stats.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
std.hpp relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
stream.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
stream.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
string.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
string.hpp string: fixup tokeniser::contains 2019-02-20 15:51:54 +11:00
stringid.cpp stringid: use string_view for accessors 2018-09-18 16:36:03 +10:00
stringid.hpp stringid: add at method 2018-09-18 16:36:28 +10:00
strongdef.cpp strongdef: don't expose the raw data directly 2019-03-20 15:39:24 +11:00
strongdef.hpp strongdef: don't expose the raw data directly 2019-03-20 15:39:24 +11:00
tap.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
tap.hpp build: satiate clang-tidy somewhat 2019-01-03 15:48:34 +11:00
term.cpp build: transition from experimental filesystem 2018-12-05 19:12:03 +11:00
term.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
time_posix.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
time_win32.cpp build; fix compilation errors under win32 2018-08-13 14:52:40 +10:00
time.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
time.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
typeidx.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
typeidx.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
types.hpp types: add a 'has_native' trait 2019-02-27 11:14:45 +11:00
uri.cpp.rl Change remnant GPL licence to MPL 2019-03-19 16:00:44 +11:00
uri.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
utf8.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
utf8.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
variadic.cpp relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
variadic.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
vector.cpp build: satiate clang-tidy somewhat 2019-01-03 15:48:34 +11:00
vector.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
version.cpp.rl Change remnant GPL licence to MPL 2019-03-19 16:00:44 +11:00
version.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
view.cpp relicense under MPL-2.0 2018-08-04 15:14:06 +10:00
view.hpp view: add front and back observers 2019-02-08 11:59:24 +11:00
zlib.cpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00
zlib.hpp rename root namespace from util to cruft 2018-08-05 14:42:02 +10:00

== libcruft

A simple cross-platform C++ utility library.

Supported compilers: >=clang-5.x, >=gcc7.x; specifically, we require cxx17 features such as structured bindings which aren't present in older compilers. No attempt has been made to compile under MSVC.

=== Environment Variables

The following variables can be defined at runtime to change the library behaviour.

DEBUG:: whether to initialise basic debugging features at load time. the value is irrelevant; the test is for whether the variable is defined.
DEBUG_WAIT:: whether to wait for a debugger to attach before executing `main`.

LOG_LEVEL:: minimum log level that will render to the logging stream. note that a given level may have been compiled out and may not be present, eg. DEBUG tends to only be present for debug builds.
BREAK_LEVEL:: minimum log level that will trigger a breakpoint

JOB_THREADS:: default number of threads to spin up for job queues.
JOB_DEPTH:: the default size of the pending work item queue for a job queue.

Ideally one would not resort to using these variables, but they may make debugging a little easier in some circumstances.