scsl 1.0.1
Shimmering Clarity Standard Library
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions
scsl Namespace Reference

scsl is the top-level namespace containing all the code in this library. More...

Namespaces

namespace  scstring
 String-related utility functions.
 
namespace  TLV
 Tag-length-value record tooling.
 

Classes

class  Arena
 Fixed, pre-allocated memory. More...
 
class  Buffer
 Basic line buffer. More...
 
class  Commander
 Subcommander manager for programs. More...
 
class  Dictionary
 Key-value store on top of Arena and TLV::Record. More...
 
struct  Flag
 Individual command-line flag. More...
 
class  Flags
 Basic facility for processing command line flags. More...
 
union  FlagValue
 FlagValue holds the value of a command line flag. More...
 
class  SimpleConfig
 SimpleConfig is a basic configuration for projects. More...
 
class  Subcommand
 Subcommands used by Commander. More...
 

Typedefs

using CommanderFunc = std::function< bool(std::vector< std::string >)>
 

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
}
 

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)
 
FlagNewFlag (std::string fName, FlagType fType, std::string fDescription)
 NewFlag is a helper function for constructing a new flag.
 

Detailed Description

scsl is the top-level namespace containing all the code in this library.

Typedef Documentation

◆ CommanderFunc

using scsl::CommanderFunc = typedef std::function<bool (std::vector<std::string>)>

CommanderFunc describes a function that can be run in Commander.

It expects an argument count and a list of arguments.

Enumeration Type Documentation

◆ ArenaType

enum class scsl::ArenaType : uint8_t
strong

ArenaType describes the type of

Enumerator
Uninit 

Uninit is an unintialized arena.

Static 

Static is an arena backed by a static block of memory.

Alloc 

Alloc is an arena backed by allocated memory.

MemoryMapped 

MemoryMapped is an arena backed by a memory-mapped file.

◆ FlagType

enum class scsl::FlagType : uint8_t
strong

FlagType indicates the value held in a FlagValue.

Todo:
When C++17 support is more common, switch to std::variant.
Enumerator
Unknown 

Unsupported value type.

Boolean 

bool

Integer 

int32_t

UnsignedInteger 

uint32_t

SizeT 

size_t

String 

std::string

Function Documentation

◆ NewFlag()

Flag * scsl::NewFlag ( std::string  fName,
FlagType  fType,
std::string  fDescription 
)

NewFlag is a helper function for constructing a new flag.

Parameters
fNameThe name of the flag.
fTypeThe type of the flag.
fDescriptionA description of the flag.
Returns
A pointer to a flag.

◆ operator!=()

bool scsl::operator!= ( const Buffer lhs,
const Buffer rhs 
)
inline

Two Buffers are not equal if their lengths differ or if their contents differ.

◆ operator<<() [1/2]

std::ostream & scsl::operator<< ( std::ostream &  os,
Arena arena 
)

Write an Arena out to the output stream.

The resulting output looks something like

Arena<allocated>@0x7fff91dfad70,store<128B>@0x0055d6c5881ec0.
^ ^ ^ ^
| +- base memory | +- store memory
+- arena type +- arena size
Fixed, pre-allocated memory.
Definition Arena.h:74
Parameters
os
arena
Returns

◆ operator<<() [2/2]

std::ostream & scsl::operator<< ( std::ostream &  os,
const Buffer buf 
)

The << operator is overloaded to write out the contents of the Buffer.