SaxonC 12.7.0
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 "saxonc_export.h"
14#include "saxonc/XdmAtomicValue.h"
15#include "saxonc/XdmItem.h"
16#include "saxonc/XdmNode.h"
17
18#include <string>
19
20#include <stdlib.h>
21#include <string.h>
22
26class SAXONC_EXPORT XdmFunctionItem : public XdmItem {
27
28public:
34
39 XdmFunctionItem(int64_t obj);
40
46
50 virtual ~XdmFunctionItem() {
51 if (fname != nullptr) {
52 delete fname;
53 }
54 }
55
67 const char *getName();
68
75 virtual int getArity();
76
85 const char *getStringValue(const char *encoding = nullptr);
86
101 static XdmFunctionItem *getSystemFunction(SaxonProcessor *processor,
102 const char *name, int arity);
103
115 XdmValue *call(SaxonProcessor *processor, XdmValue **arguments,
116 int argument_length);
117
122 bool isAtomic() { return false; }
123
128 XDM_TYPE getType() { return XDM_FUNCTION_ITEM; }
129
134 bool isFunction() { return true; }
135
136protected:
137 XdmValue *getXdmValueSubClass(int64_t value);
139 char *fname;
141private:
142 int arity;
143};
144
145#endif
The SaxonProcessor class acts as a factory for generating XQuery, XPath, Schema and XSLT compilers.
Definition SaxonProcessor.h:117
The class XdmFunctionItem represents a function item.
Definition XdmFunctionItem.h:26
char * fname
Definition XdmFunctionItem.h:139
XDM_TYPE getType()
Get the type of this XDM value.
Definition XdmFunctionItem.h:128
virtual ~XdmFunctionItem()
Destructor method for XdmFunctionItem.
Definition XdmFunctionItem.h:50
bool isFunction()
Determine whether the item is a function or some other type of item.
Definition XdmFunctionItem.h:134
bool isAtomic()
Determine whether the item is an atomic value or some other type of item.
Definition XdmFunctionItem.h:122
The class XdmItem represents an item in a sequence, as defined by the XDM data model.
Definition XdmItem.h:31
virtual const char * getStringValue(const char *encoding=nullptr)
Get the string value of the item.
Definition XdmItem.cpp:56
An XdmValue represents a value in the XDM data model.
Definition XdmValue.h:43