Expansion of utility functions
In order to keep things simple and easy to read, it's always a good idea to create utility-type functions out of any code that is going to be used frequently. When dealing with interface de-serialization, many elements have to read in parameters that have spaces in them. Our solution to this problem is to put the string in double quotes and define an inline function to read the data. The perfect spot for that is in the Utilities.h
file:
inline void ReadQuotedString(std::stringstream& l_stream, std::string& l_string) { l_stream >> l_string; if (l_string.at(0) == '"'){ while (l_string.at(l_string.length() - 1) != '"' || !l_stream.eof()) { std::string str; l_stream >> str; l_string.append(" " + str); } } l_string.erase(std::remove(l_string.begin(), l_string.end(), '"'), l_string.end()); }
A word is loaded from the string stream object into the string provided as an argument. Its first character...