38 #ifndef H_OGF_BASIC_OS_TEXT_UTILS_H
39 #define H_OGF_BASIC_OS_TEXT_UTILS_H
77 std::string
value(
const std::string& name)
const ;
88 const std::vector<std::string>&
values(
const std::string& name)
const ;
99 void set_value(
const std::string& name,
const std::string& value) ;
110 void set_values(
const std::string& name,
const std::vector<std::string>& values) ;
130 void append_values(
const std::string& name,
const std::vector<std::string>& values) ;
150 void print(std::ostream& out)
const ;
153 typedef std::map< std::string, std::vector<std::string> > EnvMap ;
176 const std::string& file_name,
191 std::istream& in, std::ostream& out,
202 std::istream& in, std::ostream& out
215 const std::string& file_name,
const std::string& x
Manages a set of name-value or name-values pairs, used to manipulate text files.
void append_value(const std::string &name, const std::string &value)
Appends a value to the set of values associated with a variable.
std::string value(const std::string &name) const
Gets the value of a variable.
void clear_value(const std::string &name)
Clears the values of a variable.
void print(std::ostream &out) const
Outputs the contents of this Enviroment to a stream.
void set_values(const std::string &name, const std::vector< std::string > &values)
Sets the values of a variable.
void append_values(const std::string &name, const std::vector< std::string > &values)
Appends a set of values to the set of values associated with a variable.
void set_value(const std::string &name, const std::string &value)
Sets the value of a variable.
const std::vector< std::string > & values(const std::string &name) const
Gets the vector of values associated with a variable.
bool has_variable(const std::string &name) const
Tests whether a variable exists in this Environment.
void clear()
Removes all the variables and their values.
Global Graphite namespace.
std::ostream & operator<<(std::ostream &out, const ArgList &args)
Prints an ArgList into a stream.
Definitions common to all include files in the basic library.
void concatenate(std::istream &in, std::ostream &out)
Copies the content of an input stream to an output stream.
bool file_contains_string(const std::string &file_name, const std::string &x)
Tests whether a file contains an occurence of a string.
void find_and_replace(std::istream &in, std::ostream &out, const Environment &env)
Performs variables substitution in a stream.
void read_environment_file(const std::string &file_name, Environment &environment)
Reads an Environment from a file.