Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/serialization/src/xml_grammar.cpp @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

File size: 2.0 KB
Line 
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#define BOOST_ARCHIVE_SOURCE
16#include <boost/archive/impl/basic_xml_grammar.hpp>
17
18using namespace boost::spirit;
19
20#include <boost/config.hpp>
21
22// fixup for borland
23// The following code will be put into Boost.Config in a later revision
24#if ! defined(__SGI_STL_PORT) \
25&& defined(BOOST_RWSTD_VER) && BOOST_RWSTD_VER<=0x020101
26#include <string>
27namespace std {
28    template<>
29    inline string & 
30    string::replace (
31        char * first1, 
32        char * last1,
33        const char * first2,
34        const char * last2
35    ){
36        replace(first1-begin(),last1-first1,first2,last2-first2,0,last2-first2);
37        return *this;
38    }
39} // namespace std
40#endif
41
42namespace boost {
43namespace archive {
44
45typedef basic_xml_grammar<char> xml_grammar;
46
47/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
48// specific definitions for char based XML
49
50template<>
51void xml_grammar::init_chset(){
52    Char = chset_t("\x9\xA\xD\x20-\xFF");
53    Letter = chset_t("\x41-\x5A\x61-\x7A\xC0-\xD6\xD8-\xF6\xF8-\xFF");
54    Digit = chset_t("0-9");
55    Extender = chset_t('\xB7');
56    Sch = chset_t("\x20\x9\xD\xA");
57    NameChar = Letter | Digit | chset_p("._:-") | Extender ;
58}
59
60} // namespace archive
61} // namespace boost
62
63#include "basic_xml_grammar.ipp"
64
65namespace boost {
66namespace archive {
67
68// explicit instantiation of xml for 8 bit characters
69template class basic_xml_grammar<char>;
70
71} // namespace archive
72} // namespace boost
73
Note: See TracBrowser for help on using the repository browser.