1 | #ifndef BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP |
---|
2 | #define BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP |
---|
3 | |
---|
4 | // MS compatible compilers support #pragma once |
---|
5 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) |
---|
6 | # pragma once |
---|
7 | #endif |
---|
8 | |
---|
9 | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 |
---|
10 | // basic_xml_archive.hpp: |
---|
11 | |
---|
12 | // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . |
---|
13 | // Use, modification and distribution is subject to the Boost Software |
---|
14 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
---|
15 | // http://www.boost.org/LICENSE_1_0.txt) |
---|
16 | |
---|
17 | // See http://www.boost.org for updates, documentation, and revision history. |
---|
18 | |
---|
19 | #include <boost/archive/detail/auto_link_archive.hpp> |
---|
20 | #include <boost/archive/archive_exception.hpp> |
---|
21 | |
---|
22 | #include <boost/archive/detail/abi_prefix.hpp> // must be the last header |
---|
23 | |
---|
24 | namespace boost { |
---|
25 | namespace archive { |
---|
26 | |
---|
27 | ////////////////////////////////////////////////////////////////////// |
---|
28 | // exceptions thrown by xml archives |
---|
29 | // |
---|
30 | class xml_archive_exception : |
---|
31 | public virtual archive_exception |
---|
32 | { |
---|
33 | public: |
---|
34 | typedef enum { |
---|
35 | xml_archive_parsing_error, // see save_register |
---|
36 | xml_archive_tag_mismatch, |
---|
37 | xml_archive_tag_name_error |
---|
38 | } exception_code; |
---|
39 | xml_archive_exception(exception_code /* c */) |
---|
40 | {} |
---|
41 | virtual const char *what( ) const throw( ) |
---|
42 | { |
---|
43 | const char *msg; |
---|
44 | switch(code){ |
---|
45 | case xml_archive_parsing_error: |
---|
46 | msg = "unrecognized XML syntax"; |
---|
47 | break; |
---|
48 | case xml_archive_tag_mismatch: |
---|
49 | msg = "XML start/end tag mismatch"; |
---|
50 | break; |
---|
51 | case xml_archive_tag_name_error: |
---|
52 | msg = "Invalid XML tag name"; |
---|
53 | break; |
---|
54 | default: |
---|
55 | msg = archive_exception::what(); |
---|
56 | break; |
---|
57 | } |
---|
58 | return msg; |
---|
59 | } |
---|
60 | }; |
---|
61 | |
---|
62 | // constant strings used in xml i/o |
---|
63 | |
---|
64 | extern |
---|
65 | BOOST_ARCHIVE_DECL(const char *) |
---|
66 | OBJECT_ID(); |
---|
67 | |
---|
68 | extern |
---|
69 | BOOST_ARCHIVE_DECL(const char *) |
---|
70 | OBJECT_REFERENCE(); |
---|
71 | |
---|
72 | extern |
---|
73 | BOOST_ARCHIVE_DECL(const char *) |
---|
74 | CLASS_ID(); |
---|
75 | |
---|
76 | extern |
---|
77 | BOOST_ARCHIVE_DECL(const char *) |
---|
78 | CLASS_ID_REFERENCE(); |
---|
79 | |
---|
80 | extern |
---|
81 | BOOST_ARCHIVE_DECL(const char *) |
---|
82 | CLASS_NAME(); |
---|
83 | |
---|
84 | extern |
---|
85 | BOOST_ARCHIVE_DECL(const char *) |
---|
86 | TRACKING(); |
---|
87 | |
---|
88 | extern |
---|
89 | BOOST_ARCHIVE_DECL(const char *) |
---|
90 | VERSION(); |
---|
91 | |
---|
92 | extern |
---|
93 | BOOST_ARCHIVE_DECL(const char *) |
---|
94 | SIGNATURE(); |
---|
95 | |
---|
96 | }// namespace archive |
---|
97 | }// namespace boost |
---|
98 | |
---|
99 | #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas |
---|
100 | |
---|
101 | #endif // BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP |
---|
102 | |
---|