18 #ifndef _FDFCommonImageIO_H_
19 #define _FDFCommonImageIO_H_
33 void Tokenize(
const std::string& str, std::vector<std::string>& tokens,
const std::string& delimiters =
" ");
40 std::stringstream str;
48 std::vector<std::string> tokens;
51 std::string::size_type startBracketPosition = value.find_first_of(
"{", 0);
52 std::string::size_type endBracketPosition = value.find_first_of(
"}", startBracketPosition);
54 if ( startBracketPosition != std::string::npos && endBracketPosition != std::string::npos) {
55 std::string elements = value.substr(startBracketPosition + 1, endBracketPosition - startBracketPosition - 1);
63 for(
unsigned int i=0; i<tokens.size(); i++) {
65 values.push_back(element);
70 void PrintVector (std::ostream& os, std::string name,
const std::vector<T>& vect)
72 int size = vect.size();
76 for(
int i=0; i < size; i++) {
83 os <<
"}" << std::endl;
void Tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
void ConvertFromString(std::string s, T &value)
std::string ParseLine(std::string line)
std::string RemoveCharacters(std::string, char)
void PrintVector(std::ostream &os, std::string name, const std::vector< T > &vect)
void StringToVector(std::string value, std::vector< T > &values)