scsl 0.1.1
Shimmering Clarity Standard Library
|
scsl is the top-level namespace containing all the code in this library. More...
Namespaces | |
namespace | U |
namespace U contains utilities. | |
Classes | |
class | Arena |
class | AssertionFailed |
AssertionFailed indicates that some invariant didn't hold. More... | |
class | Buffer |
class | Commander |
class | Dictionary |
struct | Flag |
class | Flags |
union | FlagValue |
class | NotImplemented |
class | Subcommand |
Typedefs | |
typedef std::function< bool(int, char **)> | CommanderFunc |
Enumerations | |
enum class | ArenaType : uint8_t { Uninit , Static , Alloc , MemoryMapped } |
enum class | FlagType : uint8_t { Unknown = 0 , Boolean = 1 , Integer = 2 , UnsignedInteger = 3 , SizeT = 4 , String = 5 } |
FlagType indicates the value held in a FlagValue. More... | |
enum class | ParseStatus : uint8_t { Unknown = 0 , OK = 1 , EndOfFlags = 2 , NotRegistered = 3 , NotEnoughArgs = 4 } |
Functions | |
std::ostream & | operator<< (std::ostream &os, Arena &arena) |
std::ostream & | operator<< (std::ostream &os, const Buffer &buf) |
The << operator is overloaded to write out the contents of the Buffer. | |
bool | operator!= (const Buffer &lhs, const Buffer &rhs) |
std::string | ParseStatusToString (ParseStatus status) |
Flag * | NewFlag (FlagType fType, std::string fName, std::string fDescription) |
void | TestAssert (bool condition) |
void | TestAssert (bool condition, std::string message) |
bool | operator== (const Buffer &lhs, const Buffer &rhs) |
std::ostream & | operator<< (std::ostream &os, const Dictionary &dictionary) |
Variables | |
constexpr size_t | defaultCapacity = 32 |
constexpr size_t | maxReasonableLine = 8192 |
scsl is the top-level namespace containing all the code in this library.
typedef std::function<bool(int, char **)> scsl::CommanderFunc |
CommanderFunc describes a function that can be run in Commander.
It expects an argument count and a list of arguments.
|
strong |
|
strong |
FlagType indicates the value held in a FlagValue.
Enumerator | |
---|---|
Integer | int32_t |
UnsignedInteger | uint32_t |
SizeT | size_t |
Two Buffers are not equal if their lengths differ or if their contents differ.
std::ostream & scsl::operator<< | ( | std::ostream & | os, |
Arena & | arena | ||
) |
Write an Arena out to the output stream.
The resulting output looks something like
os | |
arena |
std::ostream & scsl::operator<< | ( | std::ostream & | os, |
const Dictionary & | dictionary | ||
) |
operator<< writes the key pairs phonto the output stream.
os | The output stream to write to. |
dictionary | The dictionary to write out. |
Two buffers are equal if their lengths are the same and their contents are the same. Equality is irrespective of their capacities.
void scsl::TestAssert | ( | bool | condition | ) |
TestAssert is a variant on the assert macro. This variant is intended to be a drop-in replacement for the cassert macro: even in release mode, the tests should still run.
If NDEBUG is set, TestAssert will throw an exception if condition is false. Otherwise, it calls assert after printing the message.
condition | If true, TestAssert throws an exception. |
void scsl::TestAssert | ( | bool | condition, |
std::string | message | ||
) |
TestAssert is a variant on the assert macro.
If NDEBUG is set, TestAssert will throw an exception if condition is false. Otherwise, it calls assert after printing the message.
In addition to NDEBUG, SCSL_NOEXCEPT will suppress assertions.
AssertionFailed |
condition | The condition to assert. |
message | The message that should be displayed if condition is false. |
|
constexpr |
The defaultCapacity for a new Buffer is a reasonably arbitrary starting point.
|
constexpr |
maxReasonableLine is the longest a reasonable line could be. It assumes something like a long, unprettified JSON strong or the like.