Project

Profile

Help

Download (1.63 KB) Statistics
| Branch: | Revision:

he / src / main / c / Saxon.C.API / XdmArray.h @ 55b80284

1 72bf04c6 Norman Walsh
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright (c) 2019 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_XDM_ARRAY_h
9
#define SAXON_XDM_ARRAY_h
10
11
12
#include "XdmFunctionItem.h"
13
#include <string>
14
15
#include <stdlib.h>
16
#include <string.h>
17
#include <set>
18
19
class XdmArray : public XdmFunctionItem {
20
21
public:
22
23
    XdmArray();
24
25
    XdmArray(const XdmArray &d);
26
27
28
    virtual ~XdmArray(){
29
        //std::cerr<<"destructor called fpr XdmFunctionItem"<<std::endl;
30
31
    }
32
33 ead48a5d O'Neil Delpratt
    XdmArray(jobject);
34 72bf04c6 Norman Walsh
35 ead48a5d O'Neil Delpratt
    int arrayLength() const;
36 72bf04c6 Norman Walsh
37
    XdmValue* get(int n);
38
39
    XdmArray* put(int n, XdmValue * value);
40
41
    XdmArray* addMember(XdmValue* value);
42
43
    XdmArray* concat(XdmArray * value);
44
45
    std::list<XdmValue *> asList();
46
47
    int getArity(){return 1;}
48
49 501beb26 O'Neil Delpratt
    /**
50
     * Determine whether the item is a function or some other type of item
51
     *
52
     * @return true if the item is a Xdm function item, false if it is an atomic value or a function (including maps and arrays)
53
     */
54
    bool isFunction(){
55
        return true;
56
    }
57
58 72bf04c6 Norman Walsh
        /**
59
        * Get the type of the object
60
        */
61
        XDM_TYPE getType() {
62
                return XDM_FUNCTION_ITEM;
63
        }
64
65
66
private:
67
68
69
    std::string fname;
70 ead48a5d O'Neil Delpratt
    int arity{};
71 72bf04c6 Norman Walsh
72
};
73
74
75
76
77
#endif