SaxonC 12.5
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
XdmFunctionItem.h
1
2// Copyright (c) 2022 - 2023 Saxonica Limited.
3// This Source Code Form is subject to the terms of the Mozilla Public License,
4// v. 2.0. If a copy of the MPL was not distributed with this file, You can
5// obtain one at http://mozilla.org/MPL/2.0/. This Source Code Form is
6// "Incompatible With Secondary Licenses", as defined by the Mozilla Public
7// License, v. 2.0.
9
10#ifndef SAXON_XDMFUNCTIONITEM_h
11#define SAXON_XDMFUNCTIONITEM_h
12
13#include "XdmAtomicValue.h"
14#include "XdmItem.h"
15#include "XdmNode.h"
16
17#include <string>
18
19#include <stdlib.h>
20#include <string.h>
21
25class XdmFunctionItem : public XdmItem {
26
27public:
29
33
35
41 XdmFunctionItem(int64_t obj);
42
44
48
50
53 virtual ~XdmFunctionItem() {
54 if (fname != nullptr) {
55 delete fname;
56 }
57 }
58
60
69 const char *getName();
70
72
78 virtual int getArity();
79
81
86 const char *getStringValue();
87
89
103 const char *name, int arity);
104
108 XdmValue **createXdmValueArray(int len) { return (new XdmValue *[len]); }
109
111
122 XdmValue *call(SaxonProcessor *processor, XdmValue **arguments,
123 int argument_length);
124
129 bool isAtomic() { return false; }
130
134 XDM_TYPE getType() { return XDM_FUNCTION_ITEM; }
135
137
142 bool isFunction() { return true; }
143
144protected:
147 char *fname;
149private:
150 int arity;
151};
152
153#endif
Definition SaxonProcessor.h:117
Definition XdmFunctionItem.h:25
const char * getStringValue()
Get the string value of the XdmArray item.
Definition XdmFunctionItem.cpp:120
XdmValue * getXdmValueSubClass(int64_t value)
Definition XdmFunctionItem.cpp:23
XdmFunctionItem()
Default constructor for XdmFunctionItem.
Definition XdmFunctionItem.cpp:13
char * fname
Definition XdmFunctionItem.h:147
XDM_TYPE getType()
Definition XdmFunctionItem.h:134
virtual ~XdmFunctionItem()
Destructor.
Definition XdmFunctionItem.h:53
bool isFunction()
Determine whether the item is a function or some other type of item.
Definition XdmFunctionItem.h:142
XdmValue * call(SaxonProcessor *processor, XdmValue **arguments, int argument_length)
Call the function.
Definition XdmFunctionItem.cpp:125
static XdmFunctionItem * getSystemFunction(SaxonProcessor *processor, const char *name, int arity)
Get a system function.
Definition XdmFunctionItem.cpp:100
XdmValue ** createXdmValueArray(int len)
Definition XdmFunctionItem.h:108
bool isAtomic()
Definition XdmFunctionItem.h:129
const char * getName()
Get the name of the function as EQName.
Definition XdmFunctionItem.cpp:76
virtual int getArity()
Get the arity of the function.
Definition XdmFunctionItem.cpp:87
Definition XdmItem.h:30
int64_t value
Definition XdmItem.h:170
Definition XdmValue.h:42