diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2015-07-15 15:37:57 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2015-07-15 17:09:51 -0700 |
commit | a9be2d378b7ad84e679a48efa81f42fb54f85d9a (patch) | |
tree | 587d34728dac3517a213d6d2a9a6ebdecd4e7531 /xmlserializer/XmlDocSource.h | |
parent | c99720d29f2ee618cc74c9336d2cd2a26544c020 (diff) | |
download | external_parameter-framework-a9be2d378b7ad84e679a48efa81f42fb54f85d9a.zip external_parameter-framework-a9be2d378b7ad84e679a48efa81f42fb54f85d9a.tar.gz external_parameter-framework-a9be2d378b7ad84e679a48efa81f42fb54f85d9a.tar.bz2 |
Drop release v2.6.0+no-stlport
Bug 246391
Change-Id: I662b7b0f90c97cb169978e1b64ad1fe32c440cf5
Signed-off-by: Jean-Michel Trivi <jmtrivi@google.com>
Diffstat (limited to 'xmlserializer/XmlDocSource.h')
-rw-r--r-- | xmlserializer/XmlDocSource.h | 65 |
1 files changed, 26 insertions, 39 deletions
diff --git a/xmlserializer/XmlDocSource.h b/xmlserializer/XmlDocSource.h index e7be8f3..e41923e 100644 --- a/xmlserializer/XmlDocSource.h +++ b/xmlserializer/XmlDocSource.h @@ -54,22 +54,7 @@ public: * @param[in] pRootNode a pointer to the root element of the document. * @param[in] bValidateWithSchema a boolean that toggles schema validation */ - CXmlDocSource(_xmlDoc* pDoc, _xmlNode* pRootNode = NULL, bool bValidateWithSchema = false); - - /** - * Constructor - * - * @param[out] pDoc a pointer to the xml document that will be filled by the class - * @param[in] strXmlSchemaFile a std::string containing the path to the schema file - * @param[in] strRootElementType a std::string containing the root element type - * @param[in] strRootElementName a std::string containing the root element name - * @param[in] strNameAttributeName a std::string containing the name of the root name attribute - */ - CXmlDocSource(_xmlDoc* pDoc, - const std::string& strXmlSchemaFile, - const std::string& strRootElementType, - const std::string& strRootElementName, - const std::string& strNameAttrituteName); + CXmlDocSource(_xmlDoc* pDoc, bool bValidateWithSchema = false, _xmlNode* pRootNode = NULL); /** * Constructor @@ -81,22 +66,11 @@ public: * @param[in] strNameAttributeName a string containing the name of the root name attribute * @param[in] bValidateWithSchema a boolean that toggles schema validation */ - CXmlDocSource(_xmlDoc* pDoc, - const std::string& strXmlSchemaFile, - const std::string& strRootElementType, - const std::string& strRootElementName, - const std::string& strNameAttrituteName, - bool bValidateWithSchema); - - /** - * Constructor - * - * @param[out] pDoc a pointer to the xml document that will be filled by the class - * @param[in] strXmlSchemaFile a string containing the path to the schema file - * @param[in] strRootElementType a string containing the root element type - */ - CXmlDocSource(_xmlDoc* pDoc, const std::string& strXmlSchemaFile, const std::string& strRootElementType, - bool bValidateWithSchema); + CXmlDocSource(_xmlDoc* pDoc, bool bValidateWithSchema, + const std::string& strXmlSchemaFile = "", + const std::string& strRootElementType = "", + const std::string& strRootElementName = "", + const std::string& strNameAttributeName = ""); /** * Destructor @@ -110,7 +84,7 @@ public: * * @return false if there are any error */ - virtual bool populate(CXmlSerializingContext& serializingContext) = 0; + virtual bool populate(CXmlSerializingContext& serializingContext); /** * Method that returns the root element of the Xml tree. @@ -154,6 +128,24 @@ public: */ virtual bool validate(CXmlSerializingContext& serializingContext); + /** + * Method that checks that the xml document has been correctly parsed. + * + * @return false if any error occurs during the parsing + */ + virtual bool isParsable() const; + + /** + * Helper method for creating an xml document from either a file or a + * string. + * + * @param[in] source either a filename or a string representing an xml document + * @param[in] fromFile true if source is a filename, false if source is an xml + * represents an xml document + * @param[in] xincludes if true, process xincludes tags + * @param[out] errorMsg used as error output + */ + static _xmlDoc* mkXmlDoc(const std::string& source, bool fromFile, bool xincludes, std::string& errorMsg); protected: @@ -210,12 +202,7 @@ private: /** * Element name attribute info */ - std::string _strNameAttrituteName; - - /** - * Boolean that enables the root element name attribute check - */ - bool _bNameCheck; + std::string _strNameAttributeName; /** * Boolean that enables the validation via xsd files |