123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- #ifndef BOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP
- #define BOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP
- #if defined(_MSC_VER)
- # pragma once
- #endif
- #include <string>
- #include <boost/config.hpp>
- #include <boost/detail/workaround.hpp>
- #include <boost/spirit/include/classic_rule.hpp>
- #include <boost/spirit/include/classic_chset.hpp>
- #include <boost/archive/basic_archive.hpp>
- #include <boost/serialization/tracking.hpp>
- #include <boost/serialization/version.hpp>
- namespace boost {
- namespace archive {
- template<class CharType>
- class BOOST_SYMBOL_VISIBLE basic_xml_grammar {
- public:
-
-
- struct return_values;
- friend struct return_values;
- private:
- typedef typename std::basic_istream<CharType> IStream;
- typedef typename std::basic_string<CharType> StringType;
- typedef typename boost::spirit::classic::chset<CharType> chset_t;
- typedef typename boost::spirit::classic::chlit<CharType> chlit_t;
- typedef typename boost::spirit::classic::scanner<
- typename std::basic_string<CharType>::iterator
- > scanner_t;
- typedef typename boost::spirit::classic::rule<scanner_t> rule_t;
-
- rule_t
- Reference,
- Eq,
- STag,
- ETag,
- LetterOrUnderscoreOrColon,
- AttValue,
- CharRef1,
- CharRef2,
- CharRef,
- AmpRef,
- LTRef,
- GTRef,
- AposRef,
- QuoteRef,
- CharData,
- CharDataChars,
- content,
- AmpName,
- LTName,
- GTName,
- ClassNameChar,
- ClassName,
- Name,
- XMLDecl,
- XMLDeclChars,
- DocTypeDecl,
- DocTypeDeclChars,
- ClassIDAttribute,
- ObjectIDAttribute,
- ClassNameAttribute,
- TrackingAttribute,
- VersionAttribute,
- UnusedAttribute,
- Attribute,
- SignatureAttribute,
- SerializationWrapper,
- NameHead,
- NameTail,
- AttributeList,
- S;
-
- chset_t
- BaseChar,
- Ideographic,
- Char,
- Letter,
- Digit,
- CombiningChar,
- Extender,
- Sch,
- NameChar;
- void init_chset();
- bool my_parse(
- IStream & is,
- const rule_t &rule_,
- const CharType delimiter = L'>'
- ) const ;
- public:
- struct return_values {
- StringType object_name;
- StringType contents;
-
- int_least16_t class_id;
-
- uint_least32_t object_id;
-
- unsigned int version;
- tracking_type tracking_level;
- StringType class_name;
- return_values() :
- version(0),
- tracking_level(false)
- {}
- } rv;
- bool parse_start_tag(IStream & is) ;
- bool parse_end_tag(IStream & is) const;
- bool parse_string(IStream & is, StringType & s) ;
- void init(IStream & is);
- bool windup(IStream & is);
- basic_xml_grammar();
- };
- }
- }
- #endif
|