ConfigCmd.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef CONFIG_CMD_H
  2. #define CONFIG_CMD_H
  3. #include <OgreString.h>
  4. #include <OgreStringVector.h>
  5. class ConfigCmdManager;
  6. typedef void ( *ConfigCmdHandler )( const Ogre::StringVector& params );
  7. typedef void ( *ConfigCmdCompletion )( Ogre::StringVector& complete_params );
  8. class ConfigCmd
  9. {
  10. friend class ConfigCmdManager;
  11. public:
  12. const Ogre::String& GetName() const;
  13. const Ogre::String& GetDescription() const;
  14. const Ogre::String& GetParamsDescription() const;
  15. ConfigCmdHandler GetHandler() const;
  16. ConfigCmdCompletion GetCompletion() const;
  17. // ConfigCmd could be created only by ConfigCmdManager
  18. ConfigCmd(const Ogre::String& name, const Ogre::String& description, const Ogre::String& params_description, ConfigCmdHandler handler, ConfigCmdCompletion completion);
  19. private:
  20. // forbid copy
  21. ConfigCmd(const ConfigCmd& rhs) = delete;
  22. ConfigCmd& operator =(const ConfigCmd& rhs) = delete;
  23. Ogre::String m_Name;
  24. Ogre::String m_Description;
  25. Ogre::String m_ParamsDescription;
  26. ConfigCmdHandler m_Handler;
  27. ConfigCmdCompletion m_Completion;
  28. };
  29. #endif // CONFIG_CMD_H