diff options
Diffstat (limited to 'Source/cmStandardIncludes.h')
-rw-r--r-- | Source/cmStandardIncludes.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index b4ae657..3731502 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -241,7 +241,7 @@ inline bool operator==(std::string const& a, const char* b) // std::string is really basic_string<....lots of stuff....> // when combined with a map or set, the symbols can be > 2000 chars! #include <cmsys/String.hxx> -typedef cmsys::String cmStdString; +//typedef cmsys::String std::string; // Define cmOStringStream and cmIStringStream wrappers to hide // differences between std::stringstream and the old strstream. @@ -324,12 +324,12 @@ struct cmDocumentationEntry { std::string Name; std::string Brief; - cmDocumentationEntry(){}; + cmDocumentationEntry(){} cmDocumentationEntry(const char *doc[2]) { if (doc[0]) this->Name = doc[0]; - if (doc[1]) this->Brief = doc[1];}; + if (doc[1]) this->Brief = doc[1];} cmDocumentationEntry(const char *n, const char *b) - { if (n) this->Name = n; if (b) this->Brief = b; }; + { if (n) this->Name = n; if (b) this->Brief = b; } }; /** Data structure to represent a single command line. */ @@ -378,7 +378,8 @@ static thisClass* SafeDownCast(cmObject *c) \ return static_cast<thisClass *>(c); \ } \ return 0;\ -} +} \ +class cmTypeMacro_UseTrailingSemicolon inline bool cmHasLiteralPrefixImpl(const std::string &str1, const char *str2, @@ -449,11 +450,16 @@ bool cmHasLiteralSuffix(T str1, const char (&str2)[N]) struct cmStrCmp { cmStrCmp(const char *test) : m_test(test) {} - cmStrCmp(std::string &test) : m_test(test.c_str()) {} + cmStrCmp(const std::string &test) : m_test(test) {} + + bool operator()(const std::string& input) const + { + return m_test == input; + } bool operator()(const char * input) const { - return strcmp(input, m_test) == 0; + return strcmp(input, m_test.c_str()) == 0; } // For use with binary_search @@ -463,7 +469,7 @@ struct cmStrCmp { } private: - const char * const m_test; + const std::string m_test; }; #endif |