00001 
00002 
00003 
00004 
00005 
00006 
00007 #ifndef STRINGOPS_H
00008 #define STRINGOPS_H
00009 
00010 #include <map>
00011 #include <sstream>
00012 #include <string>
00013 
00014 #include "DataTypes.h"
00015 
00017 namespace StringOps
00018 {
00020   template <typename Number>
00021   std::string NumToString(const Number& aNumber)
00022   {
00023     std::ostringstream strStream;
00024     strStream << std::fixed << aNumber;
00025     return strStream.str();
00026   }
00027 
00029   std::string ToLower(const std::string& str);
00030 
00033   void split(const std::string& str, char sep, StringMap& words);
00034 
00036   void splitDoublet(const std::string& str,
00037                           std::string& value1,
00038                           std::string& value2);
00039 
00042   void parseTextFile(const std::string& fileName,
00043                      std::map<int, StringMap>& text);
00044 
00046   bool hasSubstr(const std::string& name, const std::string& substr);
00047 }
00048 
00049 #endif