source: NonGTP/Boost/boost/archive/basic_xml_archive.hpp @ 857

Revision 857, 2.5 KB checked in by igarcia, 18 years ago (diff)
Line 
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
24namespace boost {
25namespace archive {
26
27//////////////////////////////////////////////////////////////////////
28// exceptions thrown by xml archives
29//
30class xml_archive_exception :
31    public virtual archive_exception
32{
33public:
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
64extern
65BOOST_ARCHIVE_DECL(const char *)
66OBJECT_ID();
67
68extern
69BOOST_ARCHIVE_DECL(const char *)
70OBJECT_REFERENCE();
71
72extern
73BOOST_ARCHIVE_DECL(const char *)
74CLASS_ID();
75
76extern
77BOOST_ARCHIVE_DECL(const char *)
78CLASS_ID_REFERENCE();
79
80extern
81BOOST_ARCHIVE_DECL(const char *)
82CLASS_NAME();
83
84extern
85BOOST_ARCHIVE_DECL(const char *)
86TRACKING();
87
88extern
89BOOST_ARCHIVE_DECL(const char *)
90VERSION();
91
92extern
93BOOST_ARCHIVE_DECL(const char *)
94SIGNATURE();
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
Note: See TracBrowser for help on using the repository browser.