[657] | 1 | /************************************************************************* |
---|
| 2 | Crazy Eddie's GUI System (http://www.cegui.org.uk) |
---|
| 3 | Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk) |
---|
| 4 | |
---|
| 5 | This library is free software; you can redistribute it and/or |
---|
| 6 | modify it under the terms of the GNU Lesser General Public |
---|
| 7 | License as published by the Free Software Foundation; either |
---|
| 8 | version 2.1 of the License, or (at your option) any later version. |
---|
| 9 | |
---|
| 10 | This library is distributed in the hope that it will be useful, |
---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 13 | Lesser General Public License for more details. |
---|
| 14 | |
---|
| 15 | You should have received a copy of the GNU Lesser General Public |
---|
| 16 | License along with this library; if not, write to the Free Software |
---|
| 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
| 18 | *************************************************************************/ |
---|
| 19 | #ifndef _CEGUIXmlHandlerHelper_h_ |
---|
| 20 | #define _CEGUIXmlHandlerHelper_h_ |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | namespace CEGUI |
---|
| 24 | { |
---|
| 25 | /*! |
---|
| 26 | \brief |
---|
| 27 | Internal helper class to extract attribute values from xerces-c attribute blocks. |
---|
| 28 | */ |
---|
| 29 | class XmlHandlerHelper |
---|
| 30 | { |
---|
| 31 | public: |
---|
| 32 | /*! |
---|
| 33 | \brief |
---|
| 34 | Return a pointer to a character array that contains the value of the requested attribute from the given attributes collection. |
---|
| 35 | |
---|
| 36 | \param attrs |
---|
| 37 | Xerces-c Attributes collection. |
---|
| 38 | |
---|
| 39 | \param attributeName |
---|
| 40 | character array holding the name of the attribute to be accessed. |
---|
| 41 | |
---|
| 42 | \return |
---|
| 43 | pointer to a character array holding the string value of \a attributeName. Note that the returned pointer is |
---|
| 44 | owned by xerces-c and should be released by using XMLString::release when it is no longer needed. |
---|
| 45 | */ |
---|
| 46 | static char* getAttributeValueAsChar(const XERCES_CPP_NAMESPACE::Attributes& attrs, const char* const attributeName); |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | /*! |
---|
| 50 | \brief |
---|
| 51 | Return a pointer to a XMLCh array that contains the value of the requested attribute from the given attributes collection. |
---|
| 52 | |
---|
| 53 | \param attrs |
---|
| 54 | Xerces-c Attributes collection. |
---|
| 55 | |
---|
| 56 | \param attributeName |
---|
| 57 | character array holding the name of the attribute to be accessed. |
---|
| 58 | |
---|
| 59 | \return |
---|
| 60 | pointer to a XMLCh array holding the string value of \a attributeName. Note that the returned pointer is |
---|
| 61 | owned by xerces-c and should be released by using XMLString::release when it is no longer needed. |
---|
| 62 | */ |
---|
| 63 | static const XMLCh* getAttributeValueAsXmlChar(const XERCES_CPP_NAMESPACE::Attributes& attrs, const char* const attributeName); |
---|
| 64 | |
---|
| 65 | |
---|
| 66 | /*! |
---|
| 67 | \brief |
---|
| 68 | Return an integer equal to the value of the requested attribute from the given attributes collection. |
---|
| 69 | |
---|
| 70 | \param attrs |
---|
| 71 | Xerces-c Attributes collection. |
---|
| 72 | |
---|
| 73 | \param attributeName |
---|
| 74 | character array holding the name of the attribute to be accessed. |
---|
| 75 | |
---|
| 76 | \return |
---|
| 77 | integer value of the requested attribute. |
---|
| 78 | */ |
---|
| 79 | static int getAttributeValueAsInteger(const XERCES_CPP_NAMESPACE::Attributes& attrs, const char* const attributeName); |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | /*! |
---|
| 83 | \brief |
---|
| 84 | Return a String object that contains the value of the requested attribute from the given attributes collection. |
---|
| 85 | |
---|
| 86 | \param attrs |
---|
| 87 | Xerces-c Attributes collection. |
---|
| 88 | |
---|
| 89 | \param attributeName |
---|
| 90 | character array holding the name of the attribute to be accessed. |
---|
| 91 | |
---|
| 92 | \return |
---|
| 93 | String object containing the text of the attribute value requested. |
---|
| 94 | */ |
---|
| 95 | static String getAttributeValueAsString(const XERCES_CPP_NAMESPACE::Attributes& attrs, const char* const attributeName); |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | /*! |
---|
| 99 | \brief |
---|
| 100 | Return a string object containing data transcoded from the given XMLCh array |
---|
| 101 | |
---|
| 102 | \param xmlch_str |
---|
| 103 | Pointer to an XMLCh array holding the source string to be transcoded. |
---|
| 104 | |
---|
| 105 | \return |
---|
| 106 | String object containing the transcoded text string. |
---|
| 107 | */ |
---|
| 108 | static String transcodeXmlCharToString(const XMLCh* const xmlch_str); |
---|
| 109 | }; |
---|
| 110 | |
---|
| 111 | } |
---|
| 112 | |
---|
| 113 | #endif |
---|