ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Public Member Functions | Private Member Functions | Private Attributes | List of all members
etiss::string::form_string Class Reference

#include <FastString.h>

Collaboration diagram for etiss::string::form_string:
Collaboration graph
[legend]

Public Member Functions

template<typename... T>
 form_string (T... str)
 
template<typename T >
std::enable_if< std::is_integral< T >::value, void > write_dec (unsigned field, T value)
 
void write (unsigned field, const char *buf, size_t length)
 
void writet (unsigned field, const char *buf, size_t length, char terminator=' ', char fill=' ')
 
char * c_str ()
 
const char * c_str () const
 

Private Member Functions

size_t char_size (unsigned, size_t *, bool *)
 terminates template recursion More...
 
template<typename... O>
size_t char_size (unsigned pos, size_t *size, bool *isPlaceholder, const char *s, O... others)
 
template<typename... O>
size_t char_size (unsigned pos, size_t *size, bool *isPlaceholder, size_t len, O... others)
 
void char_copy (unsigned, char *, size_t *)
 terminates template recursion More...
 
template<typename... O>
void char_copy (unsigned pos, char *buf, size_t *size, const char *s, O... others)
 
template<typename... O>
void char_copy (unsigned pos, char *buf, size_t *size, size_t, O... others)
 

Private Attributes

char * buffer
 
size_t size
 
std::vector< std::pair< size_t, size_t > > fields
 list of field in the form_string. (offset,length) pairs More...
 

Detailed Description

Attention
this function relies on spaces being an acceptable fill character in case of field/input length missmatch

Definition at line 80 of file FastString.h.

Constructor & Destructor Documentation

◆ form_string()

template<typename... T>
etiss::string::form_string::form_string ( T...  str)
inline

Definition at line 123 of file FastString.h.

References buffer, char_copy(), char_size(), fields, size, and get_metrics::str.

Here is the call graph for this function:

Member Function Documentation

◆ c_str() [1/2]

char* etiss::string::form_string::c_str ( )
inline

Definition at line 215 of file FastString.h.

References buffer.

Referenced by etiss::string::operator<<().

Here is the caller graph for this function:

◆ c_str() [2/2]

const char* etiss::string::form_string::c_str ( ) const
inline

Definition at line 216 of file FastString.h.

References buffer.

◆ char_copy() [1/3]

template<typename... O>
void etiss::string::form_string::char_copy ( unsigned  pos,
char *  buf,
size_t size,
const char *  s,
O...  others 
)
inlineprivate

Definition at line 109 of file FastString.h.

References char_copy(), memcpy(), s, and size.

Here is the call graph for this function:

◆ char_copy() [2/3]

template<typename... O>
void etiss::string::form_string::char_copy ( unsigned  pos,
char *  buf,
size_t size,
size_t  ,
O...  others 
)
inlineprivate

Definition at line 115 of file FastString.h.

References char_copy(), memset(), and size.

Here is the call graph for this function:

◆ char_copy() [3/3]

void etiss::string::form_string::char_copy ( unsigned  ,
char *  ,
size_t  
)
inlineprivate

terminates template recursion

Definition at line 107 of file FastString.h.

Referenced by char_copy(), and form_string().

Here is the caller graph for this function:

◆ char_size() [1/3]

template<typename... O>
size_t etiss::string::form_string::char_size ( unsigned  pos,
size_t size,
bool isPlaceholder,
const char *  s,
O...  others 
)
inlineprivate

Definition at line 91 of file FastString.h.

References char_size(), s, and size.

Here is the call graph for this function:

◆ char_size() [2/3]

template<typename... O>
size_t etiss::string::form_string::char_size ( unsigned  pos,
size_t size,
bool isPlaceholder,
size_t  len,
O...  others 
)
inlineprivate

Definition at line 98 of file FastString.h.

References char_size(), and size.

Here is the call graph for this function:

◆ char_size() [3/3]

size_t etiss::string::form_string::char_size ( unsigned  ,
size_t ,
bool  
)
inlineprivate

terminates template recursion

Definition at line 89 of file FastString.h.

Referenced by char_size(), and form_string().

Here is the caller graph for this function:

◆ write()

void etiss::string::form_string::write ( unsigned  field,
const char *  buf,
size_t  length 
)
inline

Definition at line 179 of file FastString.h.

References buffer, ETISS_SRCLOC, etiss::FATALERROR, fields, length(), etiss::log(), memcpy(), and memset().

Here is the call graph for this function:

◆ write_dec()

template<typename T >
std::enable_if<std::is_integral<T>::value, void> etiss::string::form_string::write_dec ( unsigned  field,
value 
)
inline

Definition at line 149 of file FastString.h.

References buffer, c, ETISS_SRCLOC, etiss::FATALERROR, fields, and etiss::log().

Here is the call graph for this function:

◆ writet()

void etiss::string::form_string::writet ( unsigned  field,
const char *  buf,
size_t  length,
char  terminator = ' ',
char  fill = ' ' 
)
inline

Definition at line 196 of file FastString.h.

References buffer, ETISS_SRCLOC, etiss::FATALERROR, fields, length(), etiss::log(), memcpy(), and memset().

Here is the call graph for this function:

Member Data Documentation

◆ buffer

char* etiss::string::form_string::buffer
private

Definition at line 83 of file FastString.h.

Referenced by c_str(), form_string(), write(), write_dec(), and writet().

◆ fields

std::vector<std::pair<size_t, size_t> > etiss::string::form_string::fields
private

list of field in the form_string. (offset,length) pairs

Definition at line 85 of file FastString.h.

Referenced by form_string(), write(), write_dec(), and writet().

◆ size

size_t etiss::string::form_string::size
private

Definition at line 84 of file FastString.h.

Referenced by char_copy(), char_size(), and form_string().


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