diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2019-07-04 16:14:22 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2019-07-14 13:37:30 (GMT) |
commit | 1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb (patch) | |
tree | 4db8440a950a88b7c15ea43218f98f61775bf889 /Source/cmState.h | |
parent | d9b2c7dae242868f13fc366773fb09448da26e8d (diff) | |
download | CMake-1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb.zip CMake-1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb.tar.gz CMake-1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb.tar.bz2 |
modernize: manage cmCommand instances using unique_ptr.
Diffstat (limited to 'Source/cmState.h')
-rw-r--r-- | Source/cmState.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/cmState.h b/Source/cmState.h index 0649ace..7e88030 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -146,11 +146,14 @@ public: // Returns a command from its name, or nullptr cmCommand* GetCommandByExactName(std::string const& name) const; - void AddBuiltinCommand(std::string const& name, cmCommand* command); - void AddDisallowedCommand(std::string const& name, cmCommand* command, + void AddBuiltinCommand(std::string const& name, + std::unique_ptr<cmCommand> command); + void AddDisallowedCommand(std::string const& name, + std::unique_ptr<cmCommand> command, cmPolicies::PolicyID policy, const char* message); void AddUnexpectedCommand(std::string const& name, const char* error); - void AddScriptedCommand(std::string const& name, cmCommand* command); + void AddScriptedCommand(std::string const& name, + std::unique_ptr<cmCommand> command); void RemoveBuiltinCommand(std::string const& name); void RemoveUserDefinedCommands(); std::vector<std::string> GetCommandNames() const; @@ -209,8 +212,8 @@ private: std::map<cmProperty::ScopeType, cmPropertyDefinitionMap> PropertyDefinitions; std::vector<std::string> EnabledLanguages; - std::map<std::string, cmCommand*> BuiltinCommands; - std::map<std::string, cmCommand*> ScriptedCommands; + std::map<std::string, std::unique_ptr<cmCommand>> BuiltinCommands; + std::map<std::string, std::unique_ptr<cmCommand>> ScriptedCommands; cmPropertyMap GlobalProperties; std::unique_ptr<cmCacheManager> CacheManager; std::unique_ptr<cmGlobVerificationManager> GlobVerificationManager; |