SaxonC 12.4
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
102 const char *name, int arity);
103
107 XdmValue **createXdmValueArray(int len) { return (new XdmValue *[len]); }
108
110
121 XdmValue *call(SaxonProcessor *processor, XdmValue **arguments,
122 int argument_length);
123
128 bool isAtomic() { return false; }
129
133 XDM_TYPE getType() { return XDM_FUNCTION_ITEM; }
134
136
141 bool isFunction() { return true; }
142
143protected:
144 XdmValue *getXdmValueSubClass(int64_t value);
145
146 char *fname;
148private:
149 int arity;
150};
151
152#endif
Definition SaxonProcessor.h:117
Definition XdmFunctionItem.h:25
const char * getStringValue()
Get the string value of the XdmArray item.
Definition XdmFunctionItem.cpp:120
XdmFunctionItem()
Default constructor for XdmFunctionItem.
Definition XdmFunctionItem.cpp:13
char * fname
Definition XdmFunctionItem.h:146
XDM_TYPE getType()
Definition XdmFunctionItem.h:133
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:141
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:107
bool isAtomic()
Definition XdmFunctionItem.h:128
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