diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2001-08-22 15:58:17 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2001-08-22 15:58:17 (GMT) |
commit | ddd5a7d7290390771dbe8d41ea9ef737ce4d0c62 (patch) | |
tree | 9ccc824cb9248e886ea77dc98ff254addbe8c9bf /Source | |
parent | 032106c3379d26f28b3b7953165d8fc018f772af (diff) | |
download | CMake-ddd5a7d7290390771dbe8d41ea9ef737ce4d0c62.zip CMake-ddd5a7d7290390771dbe8d41ea9ef737ce4d0c62.tar.gz CMake-ddd5a7d7290390771dbe8d41ea9ef737ce4d0c62.tar.bz2 |
ENH: change all maps of string to be maps of cmStdString, to reduce symbol length in object files.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCableClassSet.h | 2 | ||||
-rw-r--r-- | Source/cmCableWrapTclCommand.cxx | 4 | ||||
-rw-r--r-- | Source/cmCacheManager.cxx | 8 | ||||
-rw-r--r-- | Source/cmCacheManager.h | 2 | ||||
-rw-r--r-- | Source/cmMakeDepend.h | 2 | ||||
-rw-r--r-- | Source/cmMakefile.h | 15 | ||||
-rw-r--r-- | Source/cmSourceGroup.h | 4 | ||||
-rw-r--r-- | Source/cmStandardIncludes.h | 12 | ||||
-rw-r--r-- | Source/cmTarget.h | 2 | ||||
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 14 |
10 files changed, 39 insertions, 26 deletions
diff --git a/Source/cmCableClassSet.h b/Source/cmCableClassSet.h index a21fa83..3ecb4ca 100644 --- a/Source/cmCableClassSet.h +++ b/Source/cmCableClassSet.h @@ -90,7 +90,7 @@ public: * The set is stored internally as a map from class name to cmCableClass * instance. */ - typedef std::map<std::string, cmCableClass*> CableClassMap; + typedef std::map<cmStdString, cmCableClass*> CableClassMap; void AddClass(const char*, cmCableClass*); void AddSource(const char* name); diff --git a/Source/cmCableWrapTclCommand.cxx b/Source/cmCableWrapTclCommand.cxx index b77825f..720fa07 100644 --- a/Source/cmCableWrapTclCommand.cxx +++ b/Source/cmCableWrapTclCommand.cxx @@ -119,7 +119,7 @@ void cmCableWrapTclCommand::GenerateCableFiles() const // use the tags to make easy-to-read, unique file names for each // class's wrapper. Count the number of times each tag is used. // Warn if a tag is used more than once. - std::map<std::string, unsigned int> tagCounts; + std::map<cmStdString, unsigned int> tagCounts; for(cmCableClassSet::CableClassMap::const_iterator c = m_CableClassSet->Begin(); c != m_CableClassSet->End(); ++c) { @@ -146,7 +146,7 @@ void cmCableWrapTclCommand::GenerateCableFiles() const // Write out the cable configuration files with one class per group. // Try to name the groups based on their class's tag, but use an // index to disambiguate tag repeats (mostly used for empty tags). - std::map<std::string, unsigned int> tagIndexes; + std::map<cmStdString, unsigned int> tagIndexes; for(cmCableClassSet::CableClassMap::const_iterator c = m_CableClassSet->Begin(); c != m_CableClassSet->End(); ++c) { diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 46e0ea2..3adb3c8 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -239,7 +239,7 @@ void cmCacheManager::DefineCache(cmMakefile *mf) } // add definition to the makefile - for( std::map<std::string, CacheEntry>::const_iterator i = m_Cache.begin(); + for( std::map<cmStdString, CacheEntry>::const_iterator i = m_Cache.begin(); i != m_Cache.end(); ++i) { const CacheEntry& ce = (*i).second; @@ -293,7 +293,7 @@ bool cmCacheManager::SaveCache(const char* path) fout << "########################\n"; fout << "\n"; - for( std::map<std::string, CacheEntry>::const_iterator i = m_Cache.begin(); + for( std::map<cmStdString, CacheEntry>::const_iterator i = m_Cache.begin(); i != m_Cache.end(); ++i) { const CacheEntry& ce = (*i).second; @@ -326,7 +326,7 @@ bool cmCacheManager::SaveCache(const char* path) fout << "########################\n"; fout << "\n"; - for( std::map<std::string, CacheEntry>::const_iterator i = m_Cache.begin(); + for( std::map<cmStdString, CacheEntry>::const_iterator i = m_Cache.begin(); i != m_Cache.end(); ++i) { const CacheEntry& ce = (*i).second; @@ -423,7 +423,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const { out << "=================================================" << std::endl; out << "CMakeCache Contents:" << std::endl; - for(std::map<std::string, CacheEntry>::const_iterator i = m_Cache.begin(); + for(std::map<cmStdString, CacheEntry>::const_iterator i = m_Cache.begin(); i != m_Cache.end(); ++i) { if((*i).second.m_Type != INTERNAL) diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index d1b6c21..59e776c 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -61,7 +61,7 @@ public: CacheEntryType m_Type; }; public: - typedef std::map<std::string, CacheEntry> CacheEntryMap; + typedef std::map<cmStdString, CacheEntry> CacheEntryMap; /** * Types for the cache entries. These are useful as * hints for a cache editor program. Path should bring diff --git a/Source/cmMakeDepend.h b/Source/cmMakeDepend.h index fabb47f..27853b2 100644 --- a/Source/cmMakeDepend.h +++ b/Source/cmMakeDepend.h @@ -177,7 +177,7 @@ protected: cmRegularExpression m_IncludeFileRegularExpression; cmRegularExpression m_ComplainFileRegularExpression; std::vector<std::string> m_IncludeDirectories; - typedef std::map<std::string, cmDependInformation*> DependInformationMap; + typedef std::map<cmStdString, cmDependInformation*> DependInformationMap; DependInformationMap m_DependInformationMap; }; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index d55e8c2..c5363d6 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -397,7 +397,7 @@ public: /** * Get the subdirectory dependencies for the given subdirectory. */ - const std::set<std::string>& GetSubdirDepends(const char* subdir) + const std::set<cmStdString>& GetSubdirDepends(const char* subdir) { return m_SubdirDepends[subdir]; } @@ -425,7 +425,7 @@ public: /** * Return a list of source files in this makefile. */ - typedef std::map<std::string,std::vector<cmSourceFile> > SourceMap; + typedef std::map<cmStdString,std::vector<cmSourceFile> > SourceMap; const SourceMap &GetSources() const {return m_Sources;} SourceMap &GetSources() {return m_Sources;} cmSourceFile *GetSource(const char *srclist, const char *sourceName); @@ -552,10 +552,11 @@ protected: SourceMap m_Sources; std::vector<std::string> m_SubDirectories; // list of sub directories - struct StringSet : public std::set<std::string> + struct StringSet : public std::set<cmStdString> { }; - std::map<std::string, StringSet > m_SubdirDepends; + + std::map<cmStdString, StringSet > m_SubdirDepends; // The include and link-library paths. These may have order // dependency, so they must be vectors (not set). @@ -573,8 +574,8 @@ protected: std::vector<std::string> m_HeaderFileExtensions; std::string m_DefineFlags; std::vector<cmSourceGroup> m_SourceGroups; - typedef std::map<std::string, cmCommand*> RegisteredCommandsMap; - typedef std::map<std::string, std::string> DefinitionMap; + typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap; + typedef std::map<cmStdString, cmStdString> DefinitionMap; DefinitionMap m_Definitions; RegisteredCommandsMap m_Commands; std::vector<cmCommand*> m_UsedCommands; @@ -596,7 +597,7 @@ private: void AddDefaultDefinitions(); std::set<cmFunctionBlocker *> m_FunctionBlockers; - typedef std::map<std::string, cmData*> DataMap; + typedef std::map<cmStdString, cmData*> DataMap; DataMap m_DataMap; bool m_Inheriting; }; diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h index 86a7b19..d5627ee 100644 --- a/Source/cmSourceGroup.h +++ b/Source/cmSourceGroup.h @@ -74,12 +74,12 @@ public: /** * Map from command to its output/depends sets. */ - typedef std::map<std::string, CommandFiles> Commands; + typedef std::map<cmStdString, CommandFiles> Commands; /** * Map from source to command map. */ - typedef std::map<std::string, Commands> BuildRules; + typedef std::map<cmStdString, Commands> BuildRules; bool Matches(const char* name); void SetGroupRegex(const char* regex) diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 70c280a..ffae33a 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -131,4 +131,16 @@ inline bool operator==(std::string const& a, const char* b) { return (a==std::string(b)); } # endif // end CM_SGI_CC_720 + +struct cmStdString : public std::string +{ + typedef std::string Parent; + cmStdString(const char* s) : Parent(s) + { + } + cmStdString(std::string const&s) : Parent(s) + { + } +}; + #endif diff --git a/Source/cmTarget.h b/Source/cmTarget.h index e7946a6..d556fbc 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -139,6 +139,6 @@ private: std::set<std::string> m_Utilities; }; -typedef std::map<std::string,cmTarget> cmTargets; +typedef std::map<cmStdString,cmTarget> cmTargets; #endif diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index ad6b774..9df4254 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -730,8 +730,8 @@ OutputSubDirectoryVars(std::ostream& fout, { std::string subdir = FixDirectoryName(SubDirectories[i].c_str()); fout << target << "_" << subdir.c_str() << ":"; - const std::set<std::string>& subdirDepends = m_Makefile->GetSubdirDepends(SubDirectories[i].c_str()); - for(std::set<std::string>::const_iterator d = subdirDepends.begin(); + const std::set<cmStdString>& subdirDepends = m_Makefile->GetSubdirDepends(SubDirectories[i].c_str()); + for(std::set<cmStdString>::const_iterator d = subdirDepends.begin(); d != subdirDepends.end(); ++d) { std::string fixed_d = FixDirectoryName(d->c_str()); @@ -792,8 +792,8 @@ void cmUnixMakefileGenerator::OutputSubDirectoryRules(std::ostream& fout) void cmUnixMakefileGenerator::OutputObjectDepends(std::ostream& fout) { // Iterate over every target. - std::map<std::string, cmTarget>& targets = m_Makefile->GetTargets(); - for(std::map<std::string, cmTarget>::const_iterator target = targets.begin(); + std::map<cmStdString, cmTarget>& targets = m_Makefile->GetTargets(); + for(std::map<cmStdString, cmTarget>::const_iterator target = targets.begin(); target != targets.end(); ++target) { // Iterate over every source for this target. @@ -1196,7 +1196,7 @@ void cmUnixMakefileGenerator::OutputMakeRules(std::ostream& fout) // see if there is already a target for a cmake executable in this // makefile bool buildingCMake = false; - std::map<std::string, cmTarget>& targets = m_Makefile->GetTargets(); + std::map<cmStdString, cmTarget>& targets = m_Makefile->GetTargets(); for(cmTargets::const_iterator l = targets.begin(); l != targets.end(); l++) { @@ -1229,8 +1229,8 @@ void cmUnixMakefileGenerator::OutputSourceObjectBuildRules(std::ostream& fout) std::set<std::string> rules; // Iterate over every target. - std::map<std::string, cmTarget>& targets = m_Makefile->GetTargets(); - for(std::map<std::string, cmTarget>::const_iterator target = targets.begin(); + std::map<cmStdString, cmTarget>& targets = m_Makefile->GetTargets(); + for(std::map<cmStdString, cmTarget>::const_iterator target = targets.begin(); target != targets.end(); ++target) { bool shared = (target->second.GetType() == cmTarget::SHARED_LIBRARY); |