2 * Copyright (C) 2013 HERE Global B.V. All rights reserved.
3 * This software, including documentation, is protected by copyright controlled by
4 * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
5 * storing, adapting or translating, any or all of this material requires the prior
6 * written consent of HERE Global B.V. You may use this
7 * Software in accordance with the terms and conditions defined in the
8 * HERE Location Platform Services Terms and Conditions, available at
9 * http://developer.here.com/terms-conditions-base
11 * As an additional permission to the above, you may distribute Software,
12 * in object code format as part of an Application, according to, and subject to, terms and
13 * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
14 * You may distribute such object code format Application under terms of your choice,
15 * provided that the header and source files of the Software have not been modified.
21 #include "HereMaps_global.h"
23 #include "common/ErrorBase.h"
25 HERE_MAPS_BEGIN_NAMESPACE
28 * This class encapsulates an XML parser error. It allows you to set and
29 * retrieve the error message, error type and other details concerning an error
32 class EXPORT_API ParserError : public ErrorBase
36 * This enumeration defines identifiers for the recognized error types.
40 PE_InvalidXmlDocument, ///< Indicates that the XML document is invalid.
41 PE_Utf8ConversionFailed, ///< Indicates that UTF8 conversion failed.
42 PE_ExtractXMLTextNodeFail, ///< Indicates that it an attempt to extract an XML node failed.
43 PE_MissingAttribute, ///< Indicates that an attribute is missing.
44 PE_InternalParserError ///< Indicates that an internal parser error occurred.
48 * This method is a constructor.
50 * @param aType A value indicating the error type.
52 ParserError(Type aType);
55 * This method is a constructor.
57 * @param aType A value indicating the error type.
59 * @param sParentNodename A constant reference to the parent node (XML).
61 ParserError(Type aType, const String& sParentNodename);
64 * This method is a constructor.
66 * @param aType A value indicating the error type.
68 * @param sParentNodename A constant reference to a string containing the
69 * name of the parent node (XML).
71 * @param sDescription A constant reference to a string containing the error description.
73 ParserError(Type aType, const String& sParentNodename, const String& sDescription);
76 * This method is the destructor.
78 virtual ~ParserError();
81 * This method converts the given instance to a string. The default
82 * implementation outputs a string containing the error type, description,
83 * parser input and the name of the parent element.
85 * @return A string representation of the given instance of the class.
87 virtual String ToString() const;
90 * This method retrieves a value indicating the error type.
92 * @return A value indicating the error type.
94 Type getParserErrorType() const;
97 * This method sets the parser input.
99 * @param sInput A constant reference to a string containing parser input.
101 void setParserInput(const String& sInput);
104 * This method retrieves the parser input.
106 * @return A constant reference to a string containing parser input.
108 const String& getParserInput() const;
111 * This method sets the name of the parent node.
113 * @param sNodename A constant reference to a string containing name of the
116 void setParentElement(const String& sNodename);
119 * This method retrieves the name of the parent node.
121 * @return A constant reference to a string containing name of the
124 const String& getParentElement() const;
127 * This method sets the error description.
129 * @param sDsc A constant reference to a string containing the
130 * description of the error.
132 void setDescription(const String& sDsc);
135 * This method retrieves the error description.
137 * @return A constant reference to a string containing the
138 * description of the error.
140 const String& getDescription() const;
143 class ParserErrorImpl;
144 ParserErrorImpl* m_pImpl;
147 HERE_MAPS_END_NAMESPACE