Project

Profile

Help

How to connect?
Download (2.86 KB) Statistics
| Branch: | Tag: | Revision:

he / latest10 / hec / Saxon.C.API / XdmItem.h @ 6304fb8b

1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright (c) 2015 Saxonica Limited.
3
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7

    
8
#ifndef SAXON_XDMITEM_h
9
#define SAXON_XDMITEM_h
10

    
11
#include "XdmValue.h"
12

    
13
class SaxonProcessor;
14

    
15
class XdmItem : public XdmValue
16
{
17

    
18
public:
19

    
20
     XdmItem();
21

    
22
     explicit XdmItem(jobject);
23

    
24
    XdmItem(const XdmItem &item);
25

    
26
        
27
    virtual ~XdmItem();
28

    
29
    virtual void incrementRefCount();
30

    
31
    virtual void decrementRefCount();
32
    
33
    virtual bool isAtomic();
34

    
35
    virtual bool isNode();
36

    
37
    virtual bool isFunction();
38

    
39
    /**
40
     * Get Java XdmValue object.
41
     * @return jobject - The Java object of the XdmValue in its JNI representation
42
     */
43
     virtual  jobject getUnderlyingValue();
44

    
45

    
46

    
47
    /**
48
     * Get the string value of the item. For a node, this gets the string value
49
     * of the node. For an atomic value, it has the same effect as casting the value
50
     * to a string. In all cases the result is the same as applying the XPath string()
51
     * function.
52
     * <p>For atomic values, the result is the same as the result of calling
53
     * <code>toString</code>. This is not the case for nodes, where <code>toString</code>
54
     * returns an XML serialization of the node.</p>
55
     *
56
     * @return the result of converting the item to a string.
57
     * @deprecated the SaxonProcessor argument. It has been removed from release version 1.2.1
58
     */
59
     virtual const char * getStringValue();
60

    
61
 /**
62
     * Get the first item in the sequence
63
     * @return XdmItem or nullptr if sequence is empty
64
     */
65
        XdmItem * getHead();
66

    
67
  /**
68
     * Get the n'th item in the value, counting from zero.
69
     *
70
     * @param n the item that is required, counting the first item in the sequence as item zero
71
     * @return the n'th item in the sequence making up the value, counting from zero
72
     * return nullptr  if n is less than zero or greater than or equal to the number
73
     *                                    of items in the value
74
     * return nullptr if the value is lazily evaluated and the delayed
75
     *                                    evaluation fails with a dynamic error.
76
     */
77
        XdmItem * itemAt(int n);
78

    
79
    /**
80
     * Get the number of items in the sequence
81
     *
82
     */
83
      int size();
84

    
85

    
86

    
87
        /**
88
        * Get the type of the object
89
        */
90
        virtual XDM_TYPE getType();
91

    
92
 protected:  
93
        jobject value;
94
        std::string stringValue;  /*!< Cached. String representation of the XdmValue, if available */
95
};
96

    
97

    
98
#endif
(26-26/49)