• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2 // xml_grammar.cpp:
3 
4 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
5 // Use, modification and distribution is subject to the Boost Software
6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 
9 //  See http://www.boost.org for updates, documentation, and revision history.
10 
11 #if (defined _MSC_VER) && (_MSC_VER == 1200)
12 #  pragma warning (disable : 4786) // too long name, harmless warning
13 #endif
14 
15 #include <boost/config.hpp>
16 
17 #define BOOST_ARCHIVE_SOURCE
18 #include <boost/serialization/config.hpp>
19 #include <boost/archive/impl/basic_xml_grammar.hpp>
20 
21 using namespace boost::spirit::classic;
22 
23 // fixup for borland
24 // The following code will be put into Boost.Config in a later revision
25 #if ! defined(__SGI_STL_PORT) \
26 && defined(BOOST_RWSTD_VER) && BOOST_RWSTD_VER<=0x020101
27 #include <string>
28 namespace std {
29     template<>
30     inline string &
replace(char * first1,char * last1,const char * first2,const char * last2)31     string::replace (
32         char * first1,
33         char * last1,
34         const char * first2,
35         const char * last2
36     ){
37         replace(first1-begin(),last1-first1,first2,last2-first2,0,last2-first2);
38         return *this;
39     }
40 } // namespace std
41 #endif
42 
43 namespace boost {
44 namespace archive {
45 
46 typedef basic_xml_grammar<char> xml_grammar;
47 
48 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
49 // specific definitions for char based XML
50 
51 template<>
init_chset()52 void xml_grammar::init_chset(){
53     Char = chset_t("\x9\xA\xD\x20-\x7f\x80\x81-\xFF");
54     Letter = chset_t("\x41-\x5A\x61-\x7A\xC0-\xD6\xD8-\xF6\xF8-\xFF");
55     Digit = chset_t("0-9");
56     Extender = chset_t('\xB7');
57     Sch = chset_t("\x20\x9\xD\xA");
58     NameChar = Letter | Digit | chset_p("._:-") | Extender ;
59 }
60 
61 } // namespace archive
62 } // namespace boost
63 
64 #include "basic_xml_grammar.ipp"
65 
66 namespace boost {
67 namespace archive {
68 
69 // explicit instantiation of xml for 8 bit characters
70 template class basic_xml_grammar<char>;
71 
72 } // namespace archive
73 } // namespace boost
74 
75