1
2
3
4
5
6 #ifndef SNGXML_DOM_PARSER_INCLUDED
7 #define SNGXML_DOM_PARSER_INCLUDED
8 #include <sngxml/dom/Document.hpp>
9 #include <soulng/util/SocketFwd.hpp>
10
11 namespace sngxml { namespace dom {
12
13 enum class Flags : int
14 {
15 none= 0, debug= 1 << 0
16 };
17
18 inline Flags operator&(Flags flags, Flags flag)
19 {
20 return static_cast<Flags>(static_cast<int>(flags) & static_cast<int>(flag));
21 }
22
23 inline Flags operator|(Flags flags, Flags flag)
24 {
25 return static_cast<Flags>(static_cast<int>(flags) | static_cast<int>(flag));
26 }
27
28 inline Flags operator~(Flags flags)
29 {
30 return static_cast<Flags>(~static_cast<int>(flags));
31 }
32
33 std::unique_ptr<Document> ParseDocument(const std::u32string& content, const std::string& systemId);
34 std::unique_ptr<Document> ParseDocument(const std::u32string& content, const std::string& systemId, Flags flags);
35 std::unique_ptr<Document> ReadDocument(const std::string& fileName);
36 std::unique_ptr<Document> ReadDocument(const std::string& fileName, Flags flags);
37 void SendDocument(soulng::util::TcpSocket& socket, Document& document);
38 std::unique_ptr<Document> ReceiveDocument(soulng::util::TcpSocket& socket);
39
40 } }
41
42 #endif // SNGXML_DOM_PARSER_INCLUDED