summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/LibXMLParser.h')
-rw-r--r--Swiften/Parser/LibXMLParser.h46
1 files changed, 25 insertions, 21 deletions
diff --git a/Swiften/Parser/LibXMLParser.h b/Swiften/Parser/LibXMLParser.h
index b8e1d7c..e21770d 100644
--- a/Swiften/Parser/LibXMLParser.h
+++ b/Swiften/Parser/LibXMLParser.h
@@ -1,32 +1,36 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2019 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+
#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Parser/XMLParser.h>
namespace Swift {
- /**
- * Warning: This constructor is not thread-safe, because it depends on global state to
- * check whether it is initialized.
- */
- class LibXMLParser : public XMLParser, public boost::noncopyable {
- public:
- LibXMLParser(XMLParserClient* client);
- ~LibXMLParser();
-
- bool parse(const std::string& data);
-
- private:
- static bool initialized;
-
- struct Private;
- boost::shared_ptr<Private> p;
- };
+ /**
+ * Warning: This constructor is not thread-safe, because it depends on global state to
+ * check whether it is initialized.
+ */
+ class LibXMLParser : public XMLParser, public boost::noncopyable {
+ public:
+ LibXMLParser(XMLParserClient* client, bool allowComments = false);
+ virtual ~LibXMLParser();
+
+ bool parse(const std::string& data, bool finalData = false);
+
+ void stopParser();
+
+ private:
+ static bool initialized;
+ bool stopped_ = false;
+
+ struct Private;
+ const std::unique_ptr<Private> p;
+ };
}