item_factory.h
Go to the documentation of this file.
1 /*
2  * Copyright 2006-2008 The FLWOR Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ZORBA_ITEM_FACTORY_API_H
18 #define ZORBA_ITEM_FACTORY_API_H
19 
20 #include <iostream>
21 #include <vector>
22 
23 #include <zorba/config.h>
24 #include <zorba/api_shared_types.h>
25 #include <zorba/item.h>
26 #include <zorba/streams.h>
27 
28 namespace zorba {
29 
30  /** \brief ItemFactory to create Items.
31  *
32  * An instance of this class can be obtained by calling getItemFactory on the Zorba object.
33  *
34  * Each createXXX function of this class creates an Item of an XML Schema item.
35  * If an isNull() call on an Item created by one of these functions returns true the
36  * Item could not be created.
37  */
38  class ZORBA_DLL_PUBLIC ItemFactory
39  {
40  public:
41  /** \brief Destructor
42  */
43  virtual ~ItemFactory() {}
44 
45  /** \brief Creates a String Item
46  * see [http://www.w3.org/TR/xmlschema-2/#string]
47  *
48  * @param aString String representation of the String Item.
49  * @return The String Item
50  */
51  virtual Item
52  createString(const String& aString) = 0;
53 
54  /** \brief Creates a streamable String Item
55  * see [http://www.w3.org/TR/xmlschema-2/#string]
56  *
57  * @param stream An istream from where to read the string's content.
58  * @param streamReleaser A function pointer which is invoked once
59  * the StreamableStringItem is destroyed. Normally this function
60  * will delete the std::istream object passed to it.
61  * @param seekable
62  * @return The streamable String Item
63  */
64  virtual Item
65  createStreamableString( std::istream &stream,
66  StreamReleaser streamReleaser,
67  bool seekable = false ) = 0;
68 
69  /** \brief Creates an AnyURI Item
70  * see [http://www.w3.org/TR/xmlschema-2/#anyURI]
71  *
72  * @param aURI String representation of the AnyURI.
73  * @return The AnyURI Item.
74  */
75  virtual Item
76  createAnyURI(const String& aURI) = 0;
77 
78  /** \brief Creates a QName Item
79  * see [http://www.w3.org/TR/xmlschema-2/#QName]
80  *
81  * @param aNamespace String representation of the namespace.
82  * @param aPrefix String representation of the prefix.
83  * @param aLocalname String representation of the localname.
84  *
85  * @return The QName Item.
86  */
87  virtual Item
88  createQName(const String& aNamespace, const String& aPrefix,
89  const String& aLocalname) = 0;
90 
91  /** \brief Creates a QName Item
92  * see [http://www.w3.org/TR/xmlschema-2/#QName]
93  *
94  * @param aNamespace String representation of the namespace.
95  * @param aLocalname String representation of the localname. *
96  * @return The QName Item.
97  */
98  virtual Item
99  createQName(const String& aNamespace, const String& aLocalname) = 0;
100 
101  /** \brief Creates a QName Item
102  * see [http://www.w3.org/TR/xmlschema-2/#QName]
103  *
104  * The QName is constructed by parsing the string using the notation
105  * invented by James Clark (i.e. {namespace}localname).
106  *
107  * @param aQNameString String in the QName notation by James Clark.
108  * @return The QName Item.
109  */
110  virtual Item
111  createQName(const String& aQNameString) = 0;
112 
113  /** \brief Creates a NCName Item
114  * see [http://www.w3.org/TR/xmlschema-2/#NCName]
115  *
116  * @param aValue String representation of the NCName.
117  * @return The NCName Item.
118  */
119  virtual Item
120  createNCName(const String& aValue) = 0;
121 
122 
123  /** \brief Creates a Base64Binary Item
124  * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
125  *
126  * @param aBinData a pointer to the base64 binary data.
127  * @param aLength the length of the base64 binary data.
128  * @return The Base64Binary Item.
129  */
130  virtual Item
131  createBase64Binary(const char* aBinData, size_t aLength) = 0;
132 
133  /** \brief Creates a Base64Binary Item
134  * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
135  *
136  * @param aStream A stream containing the Base64 encoded data.
137  * @return the Base64Binary Item.
138  */
139  virtual Item
140  createBase64Binary(std::istream& aStream) = 0;
141 
142  /** \brief Creates a Base64Binary Item
143  * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
144  *
145  * @param aBinData the data in binary form. The data is copied from aBinData.
146  * @param aLength the length of the data
147  * @return the Base64Binary Item.
148  */
149  virtual Item
150  createBase64Binary(const unsigned char* aBinData, size_t aLength) = 0;
151 
152  /** \brief Creates a streamable Base64Binary Item
153  * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
154  *
155  * @param stream An istream from where to read the binary's content.
156  * @param streamReleaser A function pointer which is invoked once
157  * the StreamableBase64Binary is destroyed. Normally this function
158  * will delete the std::istream object passed to it.
159  * @param seekable is the given stream seekable
160  * @param encoded is the contents of the given stream already base64
161  * encoded
162  * @return The streamable String Item
163  */
164  virtual Item
165  createStreamableBase64Binary(
166  std::istream &stream,
167  StreamReleaser streamReleaser,
168  bool seekable = false,
169  bool encoded = false) = 0;
170 
171  /** \brief Creates a Boolean Item
172  * see [http://www.w3.org/TR/xmlschema-2/#bool]
173  *
174  * @param aValue bool representation of the Boolean.
175  * @return The Boolean Item.
176  */
177  virtual Item
178  createBoolean(bool aValue) = 0;
179 
180  /** \brief Creates a Decimal Item
181  * see [http://www.w3.org/TR/xmlschema-2/#decimal]
182  *
183  * @param aValue unsigned long representation of the Decimal.
184  * @return The Decimal Item.
185  */
186  virtual Item
187  createDecimalFromLong (unsigned long aValue) = 0;
188 
189  /** \brief Creates a Decimal Item
190  * see [http://www.w3.org/TR/xmlschema-2/#decimal]
191  *
192  * @param aValue double representation of the Decimal.
193  * @return The Decimal Item.
194  */
195  virtual Item
196  createDecimalFromDouble (double aValue) = 0;
197 
198  /** \brief Creates a Decimal Item
199  * see [http://www.w3.org/TR/xmlschema-2/#decimal]
200  *
201  * @param aValue String representation of the Decimal (e.g. 12678967.543233).
202  * @return The Decimal Item.
203  */
204  virtual Item
205  createDecimal (const String& aValue) = 0;
206 
207  /** \brief Creates an Integer Item
208  * see [http://www.w3.org/TR/xmlschema-2/#integer]
209  *
210  * @param aInteger unsigned long representation of the Integer.
211  * @return The Integer Item.
212  */
213  virtual Item
214  createInteger(long long aInteger) = 0;
215 
216  /** \brief Creates an Integer Item
217  * see [http://www.w3.org/TR/xmlschema-2/#integer]
218  *
219  * @param aInteger String representation of the Integer.
220  * @return The Integer Item.
221  */
222  virtual Item
223  createInteger(const String& aInteger) = 0;
224 
225  /** \brief Creates a Long Item
226  * see [http://www.w3.org/TR/xmlschema-2/#long]
227  *
228  * @param aLong long long representation of the Long.
229  * @return The Long Item.
230  */
231  virtual Item
232  createLong ( long long aLong ) = 0;
233 
234  /** \brief Creates a Int Item
235  * see [http://www.w3.org/TR/xmlschema-2/#int]
236  *
237  * @param aInt int representation of the Int.
238  * @return The NCName Item.
239  */
240  virtual Item
241  createInt ( int aInt ) = 0;
242 
243  /** \brief Creates a Short Item
244  * see [http://www.w3.org/TR/xmlschema-2/#short]
245  *
246  * @param aShort short representation of the Short.
247  * @return The Short Item.
248  */
249  virtual Item
250  createShort ( short aShort ) = 0;
251 
252  /** \brief Creates a Byte Item
253  * see [http://www.w3.org/TR/xmlschema-2/#byte]
254  *
255  * @param aByte char representation of the Byte.
256  * @return The Byte Item.
257  */
258  virtual Item
259  createByte ( char aByte ) = 0;
260 
261  /** \brief Creates a Date Item
262  * see [http://www.w3.org/TR/xmlschema-2/#date]
263  *
264  * @param aDate String representation of the Date (e.g. 2002-10-10).
265  * @return The Date Item.
266  */
267  virtual Item
268  createDate ( const String& aDate ) = 0;
269 
270  /** \brief Creates a Date Item
271  * see [http://www.w3.org/TR/xmlschema-2/#date]
272  *
273  * @param aYear short-valued representation of the year.
274  * @param aMonth short-valued representation of the month.
275  * @param aDay short-valued representation of the day.
276  * @return The Date Item.
277  */
278  virtual Item
279  createDate ( short aYear, short aMonth, short aDay ) = 0;
280 
281  /** \brief Creates a DateTime Item
282  * see [http://www.w3.org/TR/xmlschema-2/#dateTime]
283  *
284  * @param aYear short-valued representation of the year.
285  * @param aMonth short-valued representation of the month.
286  * @param aDay short-valued representation of the day.
287  * @param aHour short-valued representation of the hour.
288  * @param aMinute short-valued representation of the minute.
289  * @param aSecond double-valued representation of the seconds and fractional seconds.
290  * @param aTimeZone_hours short-valued representation of the difference in hours to UTC.
291  * @return The DateTime Item.
292  */
293  virtual Item
294  createDateTime(short aYear, short aMonth, short aDay,
295  short aHour, short aMinute, double aSecond,
296  short aTimeZone_hours) = 0;
297 
298  /** \brief Creates a DateTime Item
299  * see [http://www.w3.org/TR/xmlschema-2/#dateTime]
300  *
301  * @param aDateTimeValue String representation of the datetime value
302  * (for example, 2002-10-10T12:00:00-05:00).
303  * @return The DateTime Item.
304  */
305  virtual Item
306  createDateTime( const String& aDateTimeValue ) = 0;
307 
308  /** \brief Creates a Double Item
309  * see [http://www.w3.org/TR/xmlschema-2/#double]
310  *
311  * @param aValue double representation of the Double.
312  * @return The Double Item.
313  */
314  virtual Item
315  createDouble ( double aValue ) = 0;
316 
317  /** \brief Creates a Double Item
318  * see [http://www.w3.org/TR/xmlschema-2/#double]
319  *
320  * @param aValue String representation of the Double.
321  * @return The Double Item.
322  */
323  virtual Item
324  createDouble ( const String& aValue ) = 0;
325 
326  /** \brief Creates a Duration Item
327  * see [http://www.w3.org/TR/xmlschema-2/#duration]
328  *
329  * @param aValue String representation of the NCName.
330  * @return The Duration Item.
331  */
332  virtual Item
333  createDuration( const String& aValue ) = 0;
334 
335  /** \brief Creates a Duration Item
336  * see [http://www.w3.org/TR/xmlschema-2/#duration]
337  *
338  * @param aYear short-valued representation of the years.
339  * @param aMonths short-valued representation of the months.
340  * @param aDays short-valued representation of the days.
341  * @param aHours short-valued representation of the hours.
342  * @param aMinutes short-valued representation of the minutes.
343  * @param aSeconds double-valued representation of the seconds and fractional seconds.
344  * @return The Duration Item.
345  */
346  virtual Item
347  createDuration ( short aYear, short aMonths, short aDays,
348  short aHours, short aMinutes, double aSeconds ) = 0;
349 
350  /** \brief Creates a dayTimeDuration Item
351  * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes]
352  *
353  * @param aValue String lexical representation of the duration.
354  * @return the dayTimeDuration Item.
355  */
356  virtual Item
357  createDayTimeDuration( const String& aValue ) = 0;
358 
359  /** \brief Creates a yearMonthDuration Item
360  * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes]
361  *
362  * @param aValue String lexical representation of the duration.
363  * @return the yearMonthDuration Item.
364  */
365  virtual Item
366  createYearMonthDuration( const String& aValue ) = 0;
367 
368  /** \brief Creates a documentNode Item
369  * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes]
370  *
371  * @param aBaseUri String representation of the Base URI.
372  * @param aDocUri String representation of the Document URI.
373  * @return the documentNode Item.
374  */
375  virtual Item
376  createDocumentNode( const String& aBaseUri, const String& aDocUri ) = 0;
377 
378  /** \brief creates a float item
379  * see [http://www.w3.org/tr/xmlschema-2/#float]
380  *
381  * @param aValue string representation of the float.
382  * @return the float item.
383  */
384  virtual Item
385  createFloat ( const String& aValue ) = 0;
386 
387  /** \brief creates a float item
388  * see [http://www.w3.org/tr/xmlschema-2/#float]
389  *
390  * @param aValue float representation of the float.
391  * @return the float item.
392  */
393  virtual Item
394  createFloat ( float aValue ) = 0;
395 
396  /** \brief Creates a gDay Item
397  * see [http://www.w3.org/TR/xmlschema-2/#gDay]
398  *
399  * @param aValue String representation of the gDay.
400  * @return The gDay Item.
401  */
402  virtual Item
403  createGDay ( const String& aValue ) = 0;
404 
405  /** \brief Creates a gDay Item
406  * see [http://www.w3.org/TR/xmlschema-2/#gDay]
407  *
408  * @param aDay short representation of the gDay.
409  * @return The gDay Item.
410  */
411  virtual Item
412  createGDay ( short aDay ) = 0;
413 
414  /** \brief Creates a gMonth Item
415  * see [http://www.w3.org/TR/xmlschema-2/#gMonth]
416  *
417  * @param aValue String representation of the gMonth.
418  * @return The gMonth Item.
419  */
420  virtual Item
421  createGMonth ( const String& aValue ) = 0;
422 
423  /** \brief Creates a gMonth Item
424  * see [http://www.w3.org/TR/xmlschema-2/#gMonth]
425  *
426  * @param aMonth short representation of the gMonth.
427  * @return The gMonth Item.
428  */
429  virtual Item
430  createGMonth ( short aMonth ) = 0;
431 
432  /** \brief Creates a gMonthDay Item
433  * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay]
434  *
435  * @param aValue String representation of the gMonthDay.
436  * @return The gMonthDay Item.
437  */
438  virtual Item
439  createGMonthDay ( const String& aValue ) = 0;
440 
441  /** \brief Creates a gMonthDay Item
442  * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay]
443  *
444  * @param aMonth short representation of the month.
445  * @param aDay short representation of the day.
446  * @return The gMonthDay Item.
447  */
448  virtual Item
449  createGMonthDay ( short aMonth, short aDay ) = 0;
450 
451  /** \brief Creates a gYear Item
452  * see [http://www.w3.org/TR/xmlschema-2/#gYear]
453  *
454  * @param aValue String representation of the gYear.
455  * @return The gYear Item.
456  */
457  virtual Item
458  createGYear ( const String& aValue ) = 0;
459 
460  /** \brief Creates a gYear Item
461  * see [http://www.w3.org/TR/xmlschema-2/#gYear]
462  *
463  * @param aYear short representation of the gYear.
464  * @return The gYear Item.
465  */
466  virtual Item
467  createGYear ( short aYear ) = 0;
468 
469  /** \brief Creates a gYearMonth Item
470  * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth]
471  *
472  * @param aValue String representation of the gYearMonth.
473  * @return The gYearMonth Item.
474  */
475  virtual Item
476  createGYearMonth ( const String& aValue ) = 0;
477 
478  /** \brief Creates a gYearMonth Item
479  * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth]
480  *
481  * @param aYear short representation of the year.
482  * @param aMonth short representation of the month.
483  * @return The gYearMonth Item.
484  */
485  virtual Item
486  createGYearMonth ( short aYear, short aMonth ) = 0;
487 
488  /** \brief Creates a HexBinary Item
489  * see [http://www.w3.org/TR/xmlschema-2/#hexBinary]
490  *
491  * @param aHexData pointer to the hexdata.
492  * @param aSize size of the hexdata.
493  * @return The HexBinary Item.
494  */
495  virtual Item
496  createHexBinary ( const char* aHexData, size_t aSize ) = 0;
497 
498  /** \brief Creates a negativeInteger Item
499  * see [http://www.w3.org/TR/xmlschema-2/#negativeInteger]
500  *
501  * @param aValue long long representation of the negativeInteger.
502  * @return The negativeInteger Item.
503  */
504  virtual Item
505  createNegativeInteger ( long long aValue ) = 0;
506 
507  /** \brief Creates a nonNegativeInteger Item
508  * see [http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger]
509  *
510  * @param aValue unsigned long representation of the nonNegativeInteger.
511  * @return The nonNegativeInteger Item.
512  */
513  virtual Item
514  createNonNegativeInteger ( unsigned long long aValue ) = 0;
515 
516  /** \brief Creates a nonPositiveInteger Item
517  * see [http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger]
518  *
519  * @param aValue long long representation of the NCName.
520  * @return The nonPositiveInteger Item.
521  */
522  virtual Item
523  createNonPositiveInteger ( long long aValue ) = 0;
524 
525  /** \brief Creates a positiveInteger\ Item
526  * see [http://www.w3.org/TR/xmlschema-2/#positiveInteger]
527  *
528  * @param aValue unsigned long representation of the positiveInteger.
529  * @return The positiveInteger Item.
530  */
531  virtual Item
532  createPositiveInteger ( unsigned long long aValue ) = 0;
533 
534  /** \brief Creates a Time Item
535  * see [http://www.w3.org/TR/xmlschema-2/#time]
536  *
537  * @param aValue String representation of the Time.
538  * @return The Time Item
539  */
540  virtual Item
541  createTime ( const String& aValue ) = 0;
542 
543  /** \brief Creates a Time Item
544  * see [http://www.w3.org/TR/xmlschema-2/#time]
545  *
546  * @param aHour short representation of the hour.
547  * @param aMinute short representation of the minute.
548  * @param aSecond double representation of the seconds and fractional seconds.
549  * @return The Time Item.
550  */
551  virtual Item
552  createTime ( short aHour, short aMinute, double aSecond ) = 0;
553 
554  /** \brief Creates a Time Item
555  * see [http://www.w3.org/TR/xmlschema-2/#time]
556  *
557  * @param aHour short representation of the hour.
558  * @param aMinute short representation of the minute.
559  * @param aSecond double representation of the seconds and fractional seconds.
560  * @param aTimeZone_hours short representation of the timezone difference in hours to UTC.
561  * @return The Time Item.
562  */
563  virtual Item
564  createTime ( short aHour, short aMinute, double aSecond, short aTimeZone_hours ) = 0;
565 
566  /** \brief Creates an Unsigned Byte Item
567  * see [http://www.w3.org/TR/xmlschema-2/#unsignedByte]
568  *
569  * @param aValue unsignedByte unsigned char representation of the unsigned byte.
570  * @return The Unsigned Byte Item.
571  */
572  virtual Item
573  createUnsignedByte(const unsigned char aValue) = 0;
574 
575  /** \brief Creates an unsigned int Item
576  * see [http://www.w3.org/TR/xmlschema-2/#unsignedInt]
577  *
578  * @param aValue unsigned int representation of the unsignedInt.
579  * @return The unsignedInt Item.
580  */
581  virtual Item
582  createUnsignedInt(unsigned int aValue) = 0;
583 
584  /** \brief Creates an unsignedLong Item
585  * see [http://www.w3.org/TR/xmlschema-2/#unsignedLong]
586  *
587  * @param aValue unsignedLong long long representation of the unsignedLong.
588  * @return The unsignedLong Item.
589  */
590  virtual Item
591  createUnsignedLong(unsigned long long aValue) = 0;
592 
593  /** \brief Creates a unsignedShort Item
594  * see [http://www.w3.org/TR/xmlschema-2/#unsignedShort]
595  *
596  * @param aValue unsigned short representation of the unsignedShort.
597  * @return The unsignedShort Item.
598  */
599  virtual Item
600  createUnsignedShort(unsigned short aValue) = 0;
601 
602  /**
603  * @brief Creates a new element node.
604  *
605  * Create a new element node N and place it at the end among the
606  * children of a given parent node. If no parent is given, N becomes the
607  * root (and single node) of a new XML tree.
608  *
609  * @param aParent The parent P of the new node; may be NULL.
610  * @param aNodeName The fully qualified name of the new node.
611  * @param aTypeName The fully qualified name of the new node's type.
612  * Not allowed to be NULL, use xsd:untyped instead.
613  * @param aHasTypedValue Whether the node has a typed value or not (element
614  * nodes with complex type and element-only content do
615  * not have typed value).
616  * @param aHasEmptyValue True if the typed value of the node is the empty
617  * sequence. This is the case if the element has a
618  * complex type with empty content.
619  * @param aNsBindings A set of namespace bindings. The namespaces property
620  * of N will be the union of this set and the namespaces
621  * property of P.
622  * @return The new node N created by this method
623  */
624  virtual Item
625  createElementNode(Item& aParent,
626  Item aNodeName,
627  Item aTypeName,
628  bool aHasTypedValue,
629  bool aHasEmptyValue,
630  NsBindings aNsBindings) = 0;
631  /**
632  * Create a new attribute node N and place it among the
633  * attributes of a given parent node. If no parent is given, N becomes the
634  * root (and single node) of a new XML tree.
635  *
636  * @param aParent The parent P of the new node; may be NULL.
637  * @param aNodeName The fully qualified name of the new node. The nemaspace
638  * binding implied by this name will be added to the namespaces
639  * of P. If the name prefix is "xml" and the local name is
640  * "base", then the base-uri property of P will be set or
641  * updated accordingly.
642  * @param aTypeName The fully qualified name of the new node's type.
643  * @param aTypedValue The typed value of the new node.
644  * @return The new node N created by this method
645  */
646  virtual Item
647  createAttributeNode(Item aParent,
648  Item aNodeName,
649  Item aTypeName,
650  Item aTypedValue) = 0;
651 
652  virtual Item
653  createAttributeNode(Item aParent,
654  Item aNodeName,
655  Item aTypeName,
656  std::vector<Item> aTypedValue) = 0;
657 
658  /**
659  * Create a new comment node N and place it as the last child of a given
660  * parent node. If no parent is given, N becomes the root (and single node)
661  * of a new XML tree.
662  *
663  * @param aParent The parent P of the new node; may be NULL.
664  * @param aContent The content of the new node.
665  * @return The new node N created by this method
666  */
667  virtual Item createCommentNode (
668  Item aParent,
669  String &aContent) = 0;
670 
671  /**
672  * Create a new Processing Instruction node N and place it among the
673  * children of a given parent node. If no parent is given, N becomes the
674  * root (and single node) of a new XML tree.
675  *
676  * @param aParent The parent P of the new node; may be NULL.
677  * @param aTarget The Target of the new node.
678  * @param aContent The Content of the new node.
679  * @param aBaseUri The Base URI of the new node, may be NULL.
680  * @return The new node N created by this method
681  */
682  virtual Item createPiNode (
683  Item aParent,
684  String &aTarget,
685  String &aContent,
686  String &aBaseUri)=0;
687 
688  /**
689  * Create a new text node N and place it among the
690  * children of a given parent node. If no parent is given, N becomes the
691  * root (and single node) of a new XML tree.
692  *
693  * @param parent The parent P of the new node; may be NULL.
694  * @param content The content of the new node.
695  * @return The new node N created by this method
696  */
697  virtual Item createTextNode(
698  Item parent,
699  String content) = 0;
700 
701  /**
702  * @brief Assigns a simple typed value to an element node.
703  *
704  * Creates a simple typed value for an element. Note that this may only
705  * be done once per element. This method should only be used during
706  * creation of a new tree. Using this method to modify elements after
707  * processing has begun has undefined results.
708  *
709  *
710  * @param aElement The element for the typed value; may not be NULL.
711  * @param aTypedValue The typed value for the element.
712  */
713  virtual void
714  assignElementTypedValue(Item& aElement,
715  Item aTypedValue) = 0;
716  /**
717  * @brief Assigns a simple typed value to an element node.
718  *
719  * Creates a simple typed value for an element. Note that this may only
720  * be done once per element. This method should only be used during
721  * creation of a new tree. Using this method to modify elements after
722  * processing has begun has undefined results.
723  *
724  *
725  * @param aElement The element for the typed value; may not be NULL.
726  * @param aTypedValue The typed value for the element.
727  */
728  virtual void
729  assignElementTypedValue(Item& aElement,
730  std::vector<Item>& aTypedValue) = 0;
731 
732  }; // class ItemFactory
733 
734 } // namespace zorba
735 #endif
736 /* vim:set et sw=2 ts=2: */
blog comments powered by Disqus