source: trunk/src/xmldecl.h @ 125

Last change on this file since 125 was 100, checked in by lindanl, 11 years ago

Parsers for internal and external entities.

File size: 954 bytes
Line 
1/*  xmldecl.h - Parsing XML and text declarations.
2    Copyright (c) 2008,  Robert D. Cameron.
3    Licensed to the public under the Open Software License 3.0.
4    Licensed to International Characters, Inc., under the Academic
5    Free License 3.0.
6
7*/
8#ifndef XML_DECL_H
9#define XML_DECL_H
10
11#include "byteplex.h"
12#include "xmlmodel.h"
13
14template <CodeUnit_Base C>
15class XML_Decl_Parser {
16public:
17        XML_Decl_Parser (Byteplex * b);
18        ~XML_Decl_Parser ();
19       
20        int ReadXMLInfo(Entity_Info * e);
21        int ReadTextDeclaration(Entity_Info * e);
22       
23
24protected:
25
26        Byteplex * byteplex;
27        unsigned char * x8data;
28        int buffer_base_pos;
29        int buffer_rel_pos;
30        int buffer_limit_pos;
31       
32        void Advance(int n);
33        int AbsPos() const;
34        unsigned char * cur() const;
35       
36        int EncodingAction(Entity_Info * e, int start_pos, int end_pos);
37private:
38        /* Bytespace parsing routines for internal use in ReadXMLInfo and
39           ReadTextDeclaration. */
40        void Scan_WS();
41        void ScanToQuote();
42
43};
44#endif
Note: See TracBrowser for help on using the repository browser.