XmlFile.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef XML_FILE_H
  2. #define XML_FILE_H
  3. #include <OgreColourValue.h>
  4. #include <OgreMatrix4.h>
  5. #include <OgreString.h>
  6. #include <Ogre.h>
  7. #include <Overlay/OgreUTFString.h>
  8. #include <tinyxml.h>
  9. class XmlFile
  10. {
  11. public:
  12. XmlFile( const Ogre::String& file );
  13. virtual ~XmlFile();
  14. bool GetBool( TiXmlNode* node, const Ogre::String& tag, bool def = false ) const;
  15. int GetInt( TiXmlNode* node, const Ogre::String& tag, int def = 0 ) const;
  16. float GetFloat( TiXmlNode* node, const Ogre::String& tag, float def = 0.0f ) const;
  17. const Ogre::String GetString( TiXmlNode* node, const Ogre::String& tag, const Ogre::String& def = "" ) const;
  18. const Ogre::UTFString GetUTFString( TiXmlNode* node, const Ogre::String& tag, const Ogre::UTFString& def = "" ) const;
  19. const Ogre::Vector2 GetVector2( TiXmlNode* node, const Ogre::String& tag, const Ogre::Vector2& def = Ogre::Vector2::ZERO ) const;
  20. const Ogre::Vector3 GetVector3( TiXmlNode* node, const Ogre::String& tag, const Ogre::Vector3& def = Ogre::Vector3::ZERO ) const;
  21. const Ogre::Vector4 GetVector4( TiXmlNode* node, const Ogre::String& tag, const Ogre::Vector4& def = Ogre::Vector4::ZERO ) const;
  22. const Ogre::Matrix4 GetMatrix4( TiXmlNode* node, const Ogre::String& tag, const Ogre::Matrix4& def = Ogre::Matrix4::IDENTITY ) const;
  23. const Ogre::Quaternion GetQuaternion( TiXmlNode* node, const Ogre::String& tag, const Ogre::Quaternion& def = Ogre::Quaternion::IDENTITY ) const;
  24. const Ogre::ColourValue GetColourValue( TiXmlNode* node, const Ogre::String& tag, const Ogre::ColourValue& def = Ogre::ColourValue::ZERO ) const;
  25. protected:
  26. bool m_NormalFile;
  27. TiXmlDocument m_File;
  28. };
  29. #endif // XML_FILE_H