~zorba-coders/zorba/bugs-912586-912593-912722

« back to all changes in this revision

Viewing changes to include/zorba/item.h

  • Committer: Cezar Andrei
  • Date: 2012-03-28 15:42:12 UTC
  • mfrom: (10606.1.129 zorba)
  • Revision ID: cezar.lp@cezarandrei.com-20120328154212-jh2heq49xcqjppce
Merge from trunck and resolve ChangeLog conflict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <iostream>
20
20
#include <zorba/config.h>
21
21
#include <zorba/api_shared_types.h>
 
22
#include <zorba/store_consts.h>
 
23
#include <vector>
22
24
 
23
25
namespace zorba {
24
26
 
31
33
  void operator&(zorba::serialization::Archiver &ar, zorba::Item &obj);
32
34
}
33
35
 
 
36
/**
 
37
 * Used for Item::getNamespaceBindings() and ItemFactory::createElementNode().
 
38
 */
 
39
typedef std::vector<std::pair<String, String> > NsBindings;
 
40
 
34
41
/** \brief The Zorba Item interface.
35
42
 *
36
43
 * This class is the Zorba representation of an Item as defined in the
266
273
  /** \brief Get an iterator for the children of this (node) Item.
267
274
   *
268
275
   * Note that this function is only available for node Items.
269
 
   * The file \link simple.cpp \endlink contains some basic examples the demonstrate
 
276
   * The file \link simple.cpp \endlink contains some basic examples that demonstrate
270
277
   * the use of this function.
271
278
   *
272
279
   * @return Iterator over the children of this node.
278
285
  /** \brief Get an iterator for the attributes of this (node) Item.
279
286
   *
280
287
   * Note that this function is only available for node Items.
281
 
   * The file \link simple.cpp \endlink contains some basic examples the demonstrate
 
288
   * The file \link simple.cpp \endlink contains some basic examples that demonstrate
282
289
   * the use of this function.
283
290
   *
284
291
   * @return Iterator over the attributes of this node.
287
294
  Iterator_t
288
295
  getAttributes() const;
289
296
 
 
297
  /** \brief Get an iterator for the namespace bindings of this (element) Item.
 
298
    *
 
299
    * Note that this function is only available for element Items.
 
300
    * The file \link simple.cpp \endlink contains some basic examples that demonstrate
 
301
    * the use of this function.
 
302
    *
 
303
    * @param aBindings An STL list to receive the namespace bindings of this node (each
 
304
    * represented as a std::pair<zorba::String,zorba::String> where the
 
305
    * first string is the namespace prefix and the second is the namespace URI).
 
306
    * @param aNsScoping An instance of NsScoping to declare which bindings to return:
 
307
    * those local to the element; those local to all parent elements; or all bindings
 
308
    * (the default).
 
309
    * @throw ZorbaException if an error occured, e.g. the Item is not of type element.
 
310
    */
 
311
  void
 
312
  getNamespaceBindings(NsBindings& aBindings,
 
313
    store::StoreConsts::NsScoping aNsScoping = store::StoreConsts::ALL_NAMESPACES)
 
314
    const;
 
315
 
290
316
  /** \brief Get parent of this (node) Item.
291
317
   *
292
318
   * Note that this function is only available for node Items.
300
326
  /** \brief Get the name of this (node) Item.
301
327
   *
302
328
   * Note that this function is only available for node Items.
303
 
   * The file \link simple.cpp \endlink contains some basic examples the demonstrate
 
329
   * The file \link simple.cpp \endlink contains some basic examples that demonstrate
304
330
   * the use of this function.
305
331
   *
306
332
   * @return bool if the name of the node was retrieved successfully
337
363
  std::istream&
338
364
  getStream();
339
365
 
 
366
  /**
 
367
   * Returns true if the contents of a binary item is already encoded
 
368
   * 
 
369
   * @return true if the content is already encoded, false otherwise
 
370
   */
 
371
  bool
 
372
  isEncoded() const;
 
373
 
 
374
  /**
 
375
   * Returns the value and size of the given base64Binary item
 
376
   *
 
377
   * The value is a string which is base64 encoded if isEncoded()
 
378
   * returns true. Otherwise, it is the original unencoded binary
 
379
   * data.
 
380
   *
 
381
   * If the given item is streamable (i.e. isStreamable() returns true),
 
382
   * the stream returned by getStream() should to be used to retrieve
 
383
   * the value. Otherwise, the contents of the stream will be materialized
 
384
   * in main memory.
 
385
   */
 
386
  const char*
 
387
  getBase64BinaryValue(size_t& s) const;
 
388
 
340
389
  /** \brief Returns the name of the collection this node is stored in.
341
390
   *
342
391
   * @return The name of the collection or 0 if the given item is not