ICG 2
Electric Boogaloo
Classes | Typedefs | Functions
ICGTemplateEngine Namespace Reference

Classes

class  recursable
 An interface for an object that has some attributes that should be used in a list_ token, with the option to nest. More...
 

Typedefs

typedef std::map< std::string, std::string > Dictionary
 Map of token name to string it should be replaced with. More...
 
typedef std::map< std::string, std::vector< const recursable * > > ListTokenItems
 Lists that we can recurse into. More...
 

Functions

std::string process (const std::string &template_to_fill, const Dictionary &token_dictionary, const ListTokenItems &recursable_map)
 
std::string process (const Dictionary &token_dictionary, const ListTokenItems &recursable_list)
 process(const std::string& template_to_fill, const Dictionary& token_dictionary, const std::vector<const recursable *>& recursable_list); Uses token named "top" in token_dictionary to begin processing. More...
 
int get_next_token (const std::string &format, std::string &token)
 
std::string ReplaceAll (std::string str, const std::string &from, const std::string &to)
 
std::string replace_token (const std::string &full, const std::string &token_name, const std::string &replace_val)
 

Typedef Documentation

◆ Dictionary

typedef std::map<std::string, std::string> ICGTemplateEngine::Dictionary

Map of token name to string it should be replaced with.

◆ ListTokenItems

typedef std::map<std::string, std::vector<const recursable *> > ICGTemplateEngine::ListTokenItems

Lists that we can recurse into.

Function Documentation

◆ get_next_token()

int ICGTemplateEngine::get_next_token ( const std::string &  format,
std::string &  token 
)

◆ process() [1/2]

std::string ICGTemplateEngine::process ( const Dictionary token_dictionary,
const ListTokenItems recursable_list 
)

process(const std::string& template_to_fill, const Dictionary& token_dictionary, const std::vector<const recursable *>& recursable_list); Uses token named "top" in token_dictionary to begin processing.

Parameters
token_dictionarymap of token names to string values they expand to. Values may contain more tokens.
recursable_listList of special objects that implement recursable that should be used to fill in list_ tokens
Returns
std::string

◆ process() [2/2]

std::string ICGTemplateEngine::process ( const std::string &  template_to_fill,
const Dictionary token_dictionary,
const ListTokenItems recursable_map 
)
Parameters
template_to_filltop level template to fill in
token_dictionarymap of token names to string values they expand to. Values may contain more tokens.
recursable_listList of special objects that implement recursable that should be used to fill in list_ tokens
Returns
std::string

◆ replace_token()

std::string ICGTemplateEngine::replace_token ( const std::string &  full,
const std::string &  token_name,
const std::string &  replace_val 
)

◆ ReplaceAll()

std::string ICGTemplateEngine::ReplaceAll ( std::string  str,
const std::string &  from,
const std::string &  to 
)