00001 /* 00002 00003 AmnesiaEngine 00004 Copyright (c) 2006 John DiSanti. 00005 00006 Permission is hereby granted, free of charge, 00007 to any person obtaining a copy of this software and associated 00008 documentation files (the "Software"), to deal in the Software 00009 without restriction, including without limitation the rights to 00010 use, copy, modify, merge, publish, distribute, sublicense, 00011 and/or sell copies of the Software, and to permit persons to 00012 whom the Software is furnished to do so, subject to the following 00013 conditions: 00014 00015 The above copyright notice and this permission notice shall be included 00016 in all copies or substantial portions of the Software. 00017 00018 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 00019 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 00020 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 00021 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 00022 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 00023 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00024 00025 */ 00026 00027 #ifndef AMN_IREADFILEXML_H 00028 #define AMN_IREADFILEXML_H 00029 00030 #include "IReference.h" 00031 #include <string> 00032 00033 namespace amn 00034 { 00035 class IFileManager; 00036 00037 enum E_XML_CHUNK 00038 { 00040 EXC_COMMENT, 00042 EXC_BEGINTAG, 00044 EXC_TEXT, 00046 EXC_ENDTAG, 00048 EXC_UNKNOWN 00049 }; 00050 00052 class IReadFileXML : public IReference 00053 { 00054 public: 00055 IReadFileXML(const char* filename, IFileManager* manager) {} 00056 virtual ~IReadFileXML() {} 00057 00059 virtual bool isOpen() = 0; 00060 00062 virtual void close() = 0; 00063 00067 virtual bool read() = 0; 00068 00070 virtual E_XML_CHUNK getChunkType() = 0; 00071 00073 virtual std::string& getTagName() = 0; 00074 00080 virtual std::string& getText() = 0; 00081 00083 virtual int getAttributeCount() = 0; 00084 00086 virtual std::string& getAttributeValue(int attributeNumber) = 0; 00087 00089 virtual std::string& getAttributeValue(const char* attributeName) = 0; 00090 00092 virtual int getAttributeValueAsInt(int attributeNumber) = 0; 00093 00095 virtual int getAttributeValueAsInt(const char* attributeName) = 0; 00096 00098 virtual float getAttributeValueAsFloat(int attributeNumber) = 0; 00099 00101 virtual float getAttributeValueAsFloat(const char* attributeName) = 0; 00102 00103 protected: 00104 IFileManager* fileManager; 00105 }; 00106 }; 00107 00108 #endif//AMN_IREADFILEXML_H 00109 00110 /* End of File */