basic utilities: strings, smart pointers, containers, debugging, tracing, profiling, i/o
More...basic utilities: strings, smart pointers, containers, debugging, tracing, profiling, i/o
src/rutz offers a range of low-level basic utilities, many of which can be seen as extensions of, or alternatives to, components from the c++ standard library. For example, rutz::fstring is similar to std::string in encapsulating memory-management of c-style strings, but whereas std::string is a template with everything inline (causing slow compile times), rutz::fstring is a non-template, with only efficiency-critical functions inlined. This makes rutz::fstring much less of a compile-time drain than std::string, although naturally it has fewer features than std::string. Nevertheless, in a vast majority of use cases, only basic string features are needed, and in these cases rutz::fstring suffices; in the few cases where more sophisticated processing is required, then std::string can be used and optionally translated back to a rutz::fstring.
Similarly, there are a number of stl-style containers that provide extremely lightweight alternatives to std::vector, yet still offer exception-safe automatic memory management: rutz::static_stack, rutz::static_block, rutz::fixed_block, rutz::shared_array, rutz::dynamic_block.
There are a number of facilities for debugging, tracing, and profiling; these are to be found in rutz/abort.h, rutz/backtrace.h, rutz/debug.h, rutz/prof.h, and rutz/trace.h.
There a few extensions to c++ std library i/o, including rutz::gzstreambuf which encapsulated gzip-encoded streams and rutz::imemstream and rutz::icstrstream which read from in-memory strings, like std::stringstream but much more lightweight both in run time and in compile time.