Branch data Line data Source code
1 : : // Copyright (c) 2005-2014 Code Synthesis Tools CC
2 : : //
3 : : // This program was generated by CodeSynthesis XSD, an XML Schema to
4 : : // C++ data binding compiler.
5 : : //
6 : : // This program is free software; you can redistribute it and/or modify
7 : : // it under the terms of the GNU General Public License version 2 as
8 : : // published by the Free Software Foundation.
9 : : //
10 : : // This program is distributed in the hope that it will be useful,
11 : : // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 : : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 : : // GNU General Public License for more details.
14 : : //
15 : : // You should have received a copy of the GNU General Public License
16 : : // along with this program; if not, write to the Free Software
17 : : // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 : : //
19 : : // In addition, as a special exception, Code Synthesis Tools CC gives
20 : : // permission to link this program with the Xerces-C++ library (or with
21 : : // modified versions of Xerces-C++ that use the same license as Xerces-C++),
22 : : // and distribute linked combinations including the two. You must obey
23 : : // the GNU General Public License version 2 in all respects for all of
24 : : // the code used other than Xerces-C++. If you modify this copy of the
25 : : // program, you may extend this exception to your version of the program,
26 : : // but you are not obligated to do so. If you do not wish to do so, delete
27 : : // this exception statement from your version.
28 : : //
29 : : // Furthermore, Code Synthesis Tools CC makes a special exception for
30 : : // the Free/Libre and Open Source Software (FLOSS) which is described
31 : : // in the accompanying FLOSSE file.
32 : : //
33 : :
34 : : // Begin prologue.
35 : : //
36 : : //
37 : : // End prologue.
38 : :
39 : : #include <xsd/cxx/pre.hxx>
40 : :
41 : : #include "file.hxx"
42 : :
43 : : #include "axes.hxx"
44 : :
45 : : #include "binary.hxx"
46 : :
47 : : #include "version.hxx"
48 : :
49 : : // File
50 : : //
51 : :
52 : 0 : const File::AxesType& File::
53 : : getAxes () const
54 : : {
55 : 0 : return this->axes_.get ();
56 : : }
57 : :
58 : 0 : File::AxesType& File::
59 : : getAxes ()
60 : : {
61 : 0 : return this->axes_.get ();
62 : : }
63 : :
64 : 0 : void File::
65 : : setAxes (const AxesType& x)
66 : : {
67 : 0 : this->axes_.set (x);
68 : 0 : }
69 : :
70 : 0 : void File::
71 : : setAxes (::std::unique_ptr< AxesType > x)
72 : : {
73 [ # # ]: 0 : this->axes_.set (std::move (x));
74 : 0 : }
75 : :
76 : 0 : const File::BinaryType& File::
77 : : getBinary () const
78 : : {
79 : 0 : return this->binary_.get ();
80 : : }
81 : :
82 : 0 : File::BinaryType& File::
83 : : getBinary ()
84 : : {
85 : 0 : return this->binary_.get ();
86 : : }
87 : :
88 : 0 : void File::
89 : : setBinary (const BinaryType& x)
90 : : {
91 : 0 : this->binary_.set (x);
92 : 0 : }
93 : :
94 : 0 : void File::
95 : : setBinary (::std::unique_ptr< BinaryType > x)
96 : : {
97 [ # # ]: 0 : this->binary_.set (std::move (x));
98 : 0 : }
99 : :
100 : 0 : const File::VersionOptional& File::
101 : : getVersion () const
102 : : {
103 : 0 : return this->version_;
104 : : }
105 : :
106 : 1 : File::VersionOptional& File::
107 : : getVersion ()
108 : : {
109 : 1 : return this->version_;
110 : : }
111 : :
112 : 0 : void File::
113 : : setVersion (const VersionType& x)
114 : : {
115 : 0 : this->version_.set (x);
116 : 0 : }
117 : :
118 : 0 : void File::
119 : : setVersion (const VersionOptional& x)
120 : : {
121 : 0 : this->version_ = x;
122 : 0 : }
123 : :
124 : 0 : void File::
125 : : setVersion (::std::unique_ptr< VersionType > x)
126 : : {
127 [ # # ]: 0 : this->version_.set (std::move (x));
128 : 0 : }
129 : :
130 : :
131 : : #include <xsd/cxx/xml/dom/parsing-source.hxx>
132 : :
133 : : // File
134 : : //
135 : :
136 : 0 : File::
137 : : File ()
138 : : : ::xml_schema::Type (),
139 : : axes_ (this),
140 : : binary_ (this),
141 : 0 : version_ (this)
142 : : {
143 : 0 : }
144 : :
145 : 0 : File::
146 : : File (const AxesType& axes,
147 : : const BinaryType& binary)
148 : : : ::xml_schema::Type (),
149 : : axes_ (axes, this),
150 : : binary_ (binary, this),
151 : 0 : version_ (this)
152 : : {
153 : 0 : }
154 : :
155 : 0 : File::
156 : : File (::std::unique_ptr< AxesType > axes,
157 : : ::std::unique_ptr< BinaryType > binary)
158 : : : ::xml_schema::Type (),
159 : : axes_ (std::move (axes), this),
160 : : binary_ (std::move (binary), this),
161 [ # # ][ # # ]: 0 : version_ (this)
162 : : {
163 : 0 : }
164 : :
165 : 0 : File::
166 : : File (const File& x,
167 : : ::xml_schema::Flags f,
168 : : ::xml_schema::Container* c)
169 : : : ::xml_schema::Type (x, f, c),
170 : : axes_ (x.axes_, f, this),
171 : : binary_ (x.binary_, f, this),
172 [ # # ][ # # ]: 0 : version_ (x.version_, f, this)
[ # # ]
173 : : {
174 : 0 : }
175 : :
176 : 1 : File::
177 : : File (const ::xercesc::DOMElement& e,
178 : : ::xml_schema::Flags f,
179 : : ::xml_schema::Container* c)
180 : : : ::xml_schema::Type (e, f | ::xml_schema::Flags::base, c),
181 : : axes_ (this),
182 : : binary_ (this),
183 : 1 : version_ (this)
184 : : {
185 [ + - ]: 1 : if ((f & ::xml_schema::Flags::base) == 0)
186 : : {
187 [ + - ]: 1 : ::xsd::cxx::xml::dom::parser< char > p (e, true, false, true);
188 [ + - ]: 1 : this->parse (p, f);
189 : : }
190 : 1 : }
191 : :
192 : 2 : void File::
193 : : parse (::xsd::cxx::xml::dom::parser< char >& p,
194 : : ::xml_schema::Flags f)
195 : : {
196 [ + + ]: 3 : for (; p.more_content (); p.next_content (false))
197 : : {
198 : : const ::xercesc::DOMElement& i (p.cur_element ());
199 : : const ::xsd::cxx::xml::qualified_name< char > n (
200 : 2 : ::xsd::cxx::xml::dom::name< char > (i));
201 : :
202 : : // axes
203 : : //
204 [ + + ][ - + ]: 2 : if (n.name () == "axes" && n.namespace_ ().empty ())
[ + + ]
205 : : {
206 : : ::std::unique_ptr< AxesType > r (
207 [ + - ]: 1 : AxesTraits::create (i, f, this));
208 : :
209 [ + - ]: 1 : if (!axes_.present ())
210 : : {
211 [ + - ]: 1 : this->axes_.set (::std::move (r));
212 : : continue;
213 : : }
214 : : }
215 : :
216 : : // binary
217 : : //
218 [ + - ][ - + ]: 1 : if (n.name () == "binary" && n.namespace_ ().empty ())
[ + - ]
219 : : {
220 : : ::std::unique_ptr< BinaryType > r (
221 [ + - ]: 1 : BinaryTraits::create (i, f, this));
222 : :
223 [ + - ]: 1 : if (!binary_.present ())
224 : : {
225 [ + - ]: 1 : this->binary_.set (::std::move (r));
226 : : continue;
227 : : }
228 : : }
229 : :
230 : 0 : break;
231 : : }
232 : :
233 [ - + ]: 1 : if (!axes_.present ())
234 : : {
235 : : throw ::xsd::cxx::tree::expected_element< char > (
236 : : "axes",
237 [ # # ][ # # ]: 0 : "");
[ # # ]
238 : : }
239 : :
240 [ + - ]: 1 : if (!binary_.present ())
241 : : {
242 : : throw ::xsd::cxx::tree::expected_element< char > (
243 : : "binary",
244 [ # # ][ # # ]: 1 : "");
[ # # ]
245 : : }
246 : :
247 [ + + ]: 2 : while (p.more_attributes ())
248 : : {
249 : : const ::xercesc::DOMAttr& i (p.next_attribute ());
250 : : const ::xsd::cxx::xml::qualified_name< char > n (
251 : 1 : ::xsd::cxx::xml::dom::name< char > (i));
252 : :
253 [ + - ][ - + ]: 1 : if (n.name () == "version" && n.namespace_ ().empty ())
[ + - ]
254 : : {
255 [ + - ][ + - ]: 1 : this->version_.set (VersionTraits::create (i, f, this));
256 : 1 : continue;
257 : : }
258 : : }
259 : 1 : }
260 : :
261 : 0 : File* File::
262 : : _clone (::xml_schema::Flags f,
263 : : ::xml_schema::Container* c) const
264 : : {
265 [ # # ]: 0 : return new class File (*this, f, c);
266 : : }
267 : :
268 : 0 : File& File::
269 : : operator= (const File& x)
270 : : {
271 [ # # ]: 0 : if (this != &x)
272 : : {
273 : 0 : static_cast< ::xml_schema::Type& > (*this) = x;
274 : 0 : this->axes_ = x.axes_;
275 : 0 : this->binary_ = x.binary_;
276 : 0 : this->version_ = x.version_;
277 : : }
278 : :
279 : 0 : return *this;
280 : : }
281 : :
282 : 2 : File::
283 : 1 : ~File ()
284 : : {
285 : 1 : }
286 : :
287 : : bool
288 : 0 : operator== (const File& x, const File& y)
289 : : {
290 [ # # ]: 0 : if (!(x.getAxes () == y.getAxes ()))
291 : : return false;
292 : :
293 [ # # ]: 0 : if (!(x.getBinary () == y.getBinary ()))
294 : : return false;
295 : :
296 [ # # ]: 0 : if (!(x.getVersion () == y.getVersion ()))
297 : : return false;
298 : :
299 : 0 : return true;
300 : : }
301 : :
302 : : bool
303 : 0 : operator!= (const File& x, const File& y)
304 : : {
305 : 0 : return !(x == y);
306 : : }
307 : :
308 : : #include <istream>
309 : : #include <xsd/cxx/xml/sax/std-input-source.hxx>
310 : : #include <xsd/cxx/tree/error-handler.hxx>
311 : :
312 : : #include <xsd/cxx/post.hxx>
313 : :
314 : : // Begin epilogue.
315 : : //
316 : : //
317 : : // End epilogue.
318 : :
|