OSStringUtil.cpp
Go to the documentation of this file.
1 /* $Id: OSStringUtil.cpp 3729 2010-10-18 12:25:22Z Gassmann $ */
17 #include "OSStringUtil.h"
18 #include "OSParameters.h"
19 #include "OSBase64.h"
20 #include "OSMathUtil.h"
21 
22 #include <sstream>
23 
24 using std::ostringstream;
25 
26 
38 std::string writeStringData(std::string str)
39 {
40  ostringstream outStr;
41  char quote;
42 
43  size_t iIndex = str.rfind("\"");
44  if (iIndex == std::string::npos)
45  quote = '\"';
46  else
47  quote = '\'';
48 
49  outStr << quote << str << quote;
50  return outStr.str();
51 }
52 
53 
54 
55 std::string makeStringFromInt(std::string theString, int theInt)
56 {
57  ostringstream outStr;
58  outStr << theString;
59  outStr << theInt;
60  return outStr.str();
61 }//end makeStringFromInt
std::string makeStringFromInt(std::string theString, int theInt)
std::string writeStringData(std::string str)
writeStringData