consider using std::stringstream here and in the following methods -- it is slightly more efficient for this kind of pattern, I believe