Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

xml_token.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2005 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Magnus Norddahl
00027 */
00028 
00031 
00032 #ifndef header_xml_token
00033 #define header_xml_token
00034 
00035 #if _MSC_VER > 1000
00036 #pragma once
00037 #endif
00038 
00039 #include <string>
00040 
00041 //: XML token in a XML file.
00042 //- !group=Core/XML!
00043 //- !header=core.h!
00044 class CL_XMLToken
00045 {
00047 public:
00048         virtual ~CL_XMLToken() { return; }
00049         
00051 public:
00052         enum TokenType
00053         {
00054                 NULL_TOKEN                     = 0,
00055                 ELEMENT_TOKEN                  = 1,
00056                 TEXT_TOKEN                     = 3,
00057                 CDATA_SECTION_TOKEN            = 4,
00058                 ENTITY_REFERENCE_TOKEN         = 5,
00059                 ENTITY_TOKEN                   = 6,
00060                 PROCESSING_INSTRUCTION_TOKEN   = 7,
00061                 COMMENT_TOKEN                  = 8,
00062                 DOCUMENT_TYPE_TOKEN            = 10,
00063                 NOTATION_TOKEN                 = 12
00064         };
00065         
00066         enum TokenVariant
00067         {
00068                 BEGIN  = 1,
00069                 END    = 2,
00070                 SINGLE = 3
00071         };
00072 
00073         //: Returns the token type.
00074         virtual TokenType get_type() const = 0;
00075         
00076         //: Returns the token variant.
00077         virtual TokenVariant get_variant() const = 0;
00078         
00079         //: Returns the name of the token.
00080         virtual std::string get_name() const = 0;
00081         
00082         //: Returns the value of the token.
00083         virtual std::string get_value() const = 0;
00084         
00085         virtual int get_attributes_number() const = 0;
00086 
00087         //: Returns the attribute name and value for attribute with specified index.
00088         virtual std::pair<std::string, std::string> get_attribute(int attribute_num) const = 0;
00089 
00091 public:
00092 
00094 private:
00095 };
00096 
00097 #endif

Generated on Sat Feb 19 22:51:16 2005 for npcore by  doxygen 1.4.1