1------------------------------------------------------------------------------
2--                                                                          --
3--                            Matreshka Project                             --
4--                                                                          --
5--                               XML Processor                              --
6--                                                                          --
7--                        Runtime Library Component                         --
8--                                                                          --
9------------------------------------------------------------------------------
10--                                                                          --
11-- Copyright © 2014, Vadim Godunko <vgodunko@gmail.com>                     --
12-- All rights reserved.                                                     --
13--                                                                          --
14-- Redistribution and use in source and binary forms, with or without       --
15-- modification, are permitted provided that the following conditions       --
16-- are met:                                                                 --
17--                                                                          --
18--  * Redistributions of source code must retain the above copyright        --
19--    notice, this list of conditions and the following disclaimer.         --
20--                                                                          --
21--  * Redistributions in binary form must reproduce the above copyright     --
22--    notice, this list of conditions and the following disclaimer in the   --
23--    documentation and/or other materials provided with the distribution.  --
24--                                                                          --
25--  * Neither the name of the Vadim Godunko, IE nor the names of its        --
26--    contributors may be used to endorse or promote products derived from  --
27--    this software without specific prior written permission.              --
28--                                                                          --
29-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      --
30-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT        --
31-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR    --
32-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT     --
33-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,   --
34-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
35-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR   --
36-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF   --
37-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING     --
38-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS       --
39-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.             --
40--                                                                          --
41------------------------------------------------------------------------------
42--  $Revision: 4963 $ $Date: 2014-10-25 16:56:26 +0400 (Sat, 25 Oct 2014) $
43------------------------------------------------------------------------------
44private with League.Strings;
45private with XML.SAX.Attributes;
46with XML.SAX.Writers;
47with XML.Templates.Streams;
48
49package XML.SAX.Event_Writers is
50
51   type Event_Writer is limited new XML.SAX.Writers.SAX_Writer with private;
52
53   function Get_Stream
54    (Self : Event_Writer'Class)
55       return XML.Templates.Streams.XML_Stream_Element_Vectors.Vector;
56   --  Returns accumulated stream.
57
58private
59
60   type Event_Writer is limited new XML.SAX.Writers.SAX_Writer with record
61      Stream : XML.Templates.Streams.XML_Stream_Element_Vectors.Vector;
62   end record;
63
64   overriding procedure Characters
65    (Self    : in out Event_Writer;
66     Text    : League.Strings.Universal_String;
67     Success : in out Boolean);
68
69   overriding procedure Comment
70    (Self    : in out Event_Writer;
71     Text    : League.Strings.Universal_String;
72     Success : in out Boolean);
73
74   overriding procedure End_CDATA
75    (Self    : in out Event_Writer;
76     Success : in out Boolean);
77
78   overriding procedure End_DTD
79    (Self    : in out Event_Writer;
80     Success : in out Boolean);
81
82   overriding procedure End_Element
83    (Self           : in out Event_Writer;
84     Namespace_URI  : League.Strings.Universal_String;
85     Local_Name     : League.Strings.Universal_String;
86     Qualified_Name : League.Strings.Universal_String;
87     Success        : in out Boolean);
88
89   overriding procedure End_Prefix_Mapping
90    (Self    : in out Event_Writer;
91     Prefix  : League.Strings.Universal_String;
92     Success : in out Boolean);
93
94   overriding function Error_String
95    (Self : Event_Writer) return League.Strings.Universal_String;
96
97   overriding procedure Ignorable_Whitespace
98    (Self    : in out Event_Writer;
99     Text    : League.Strings.Universal_String;
100     Success : in out Boolean);
101
102   overriding procedure Processing_Instruction
103    (Self    : in out Event_Writer;
104     Target  : League.Strings.Universal_String;
105     Data    : League.Strings.Universal_String;
106     Success : in out Boolean);
107
108   overriding procedure Start_CDATA
109    (Self    : in out Event_Writer;
110     Success : in out Boolean);
111
112   overriding procedure Start_DTD
113    (Self      : in out Event_Writer;
114     Name      : League.Strings.Universal_String;
115     Public_Id : League.Strings.Universal_String;
116     System_Id : League.Strings.Universal_String;
117     Success   : in out Boolean);
118
119   overriding procedure Start_Element
120    (Self           : in out Event_Writer;
121     Namespace_URI  : League.Strings.Universal_String;
122     Local_Name     : League.Strings.Universal_String;
123     Qualified_Name : League.Strings.Universal_String;
124     Attributes     : XML.SAX.Attributes.SAX_Attributes;
125     Success        : in out Boolean);
126
127   overriding procedure Start_Prefix_Mapping
128    (Self          : in out Event_Writer;
129     Prefix        : League.Strings.Universal_String;
130     Namespace_URI : League.Strings.Universal_String;
131     Success       : in out Boolean);
132
133end XML.SAX.Event_Writers;
134