Evo C++ Library v0.5.1
Public Member Functions | Public Attributes | List of all members
FmtSetNull Struct Reference

#include <evo/impl/str.h>

Detailed Description

Holds string to use when formatting null values.

Example
#include <evo/io.h>
#include <evo/string.h>
using namespace evo;
static Console& c = con();
int main() {
String null_str;
Int null_int;
// Format to stream
Stream::Format(c.out) << FmtSetNull("(null)") << null_str << ',' << null_int << NL;
// Format same output to a string
String::Format(str) << FmtSetNull("(null)") << null_str << ',' << null_int << NL;
return 0;
}

Output:

(null),(null)

Public Member Functions

 FmtSetNull ()
 Constructor. More...
 
 FmtSetNull (const char *null)
 Constructor. More...
 
 FmtSetNull (const char *null, StrSizeT size)
 Constructor. More...
 
 FmtSetNull (const ListBase< char, StrSizeT > &null)
 Constructor. More...
 
FmtSetNullreset ()
 Reset to defaults. More...
 

Public Attributes

StrSizeT size
 String (str) size for formatting null values, 0 for none/empty More...
 
const char * str
 Pointer to string for formatting null values, ignored if size is 0. More...
 

Constructor & Destructor Documentation

◆ FmtSetNull() [1/4]

FmtSetNull ( )
inline

Constructor.

◆ FmtSetNull() [2/4]

FmtSetNull ( const char *  null)
inline

Constructor.

Parameters
nullNull string to set, must be terminated

◆ FmtSetNull() [3/4]

FmtSetNull ( const char *  null,
StrSizeT  size 
)
inline

Constructor.

Parameters
nullNull string to set
sizeNull string size in bytes

◆ FmtSetNull() [4/4]

FmtSetNull ( const ListBase< char, StrSizeT > &  null)
inline

Constructor.

Parameters
nullNull string to set

Member Function Documentation

◆ reset()

FmtSetNull& reset ( )
inline

Reset to defaults.

Returns
This

Member Data Documentation

◆ size

StrSizeT size

String (str) size for formatting null values, 0 for none/empty

◆ str

const char* str

Pointer to string for formatting null values, ignored if size is 0.


The documentation for this struct was generated from the following file: