Embeddable Scriting LAnguage

Stanford University, Rock Fracture Project research group

© 2003

StringVarRegistry Class Reference

Detailed Description

This class works like a string registry, and allows parsing of expressions containing string variables, by replacing those variables by there value. A variable is define by: set $varName "value" A variable is used like this: Example: set $TEST "test" set $OTHER "other " set $DOUBLE " "

Variable OTHER has the value "other test" Variable DOUBLE has the value "other test other test"

Definition at line 51 of file string_var_registry.h.

Static Public Methods

bool bind (const std::string &expression, bool verbose=false)
bool bind (const std::string &name, const std::string &value)
bool rebind (const std::string &name, const std::string &new_value)
std::string resolve (const std::string &name)
std::string parse (const std::string &expr)
void dump (std::iostream &os)
std::string extract_name (const std::string &name)

Member Function Documentation

bool StringVarRegistry::bind const std::string &    name,
const std::string &    value

Register a variable given its name and value pair

bool StringVarRegistry::bind const std::string &    expression,
bool    verbose = false

Register a variable given an expression

void StringVarRegistry::dump std::iostream &    os [static]

Print all variable's name and value pair

std::string StringVarRegistry::extract_name const std::string &    name [static]

std::string StringVarRegistry::parse const std::string &    expr [static]

Parse the expression expr, by replacing every variable by its value

bool StringVarRegistry::rebind const std::string &    name,
const std::string &    new_value

Change a variable value

std::string StringVarRegistry::resolve const std::string &    name [static]

Retrieve a variable value

Generated on Wed May 14 11:42:34 2003 for Esla-lib by doxygen1.3-rc1