params.h
Go to the documentation of this file.
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
params.h
Qore Programming Language
Copyright (C) 2003 - 2015 David Nichols
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Note that the Qore library is released under a choice of three open-source
licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
information.
*/
#ifndef _QORE_PARAMS_H
#define _QORE_PARAMS_H
#include <qore/AbstractQoreNode.h>
static inline unsigned num_args(const QoreListNode* n) {
return n ? (unsigned)n->size() : 0;
}
static inline unsigned num_args(const QoreValueList* n) {
return n ? (unsigned)n->size() : 0;
}
static inline unsigned num_params(const QoreListNode* n) {
return n ? (unsigned)n->size() : 0;
}
static inline const AbstractQoreNode* get_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
return is_nothing(p) ? 0 : p;
}
static inline qore_type_t get_param_type(const QoreListNode* n, qore_size_t i) {
if (!n) return NT_NOTHING;
const AbstractQoreNode* p = n->retrieve_entry(i);
return p ? p->getType() : NT_NOTHING;
}
static inline int get_int_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
return is_nothing(p) ? 0 : p->getAsInt();
}
static inline int64 get_bigint_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
return is_nothing(p) ? 0 : p->getAsBigInt();
}
static inline int get_int_param_with_default(const QoreListNode* n, qore_size_t i, int def) {
if (!n) return def;
const AbstractQoreNode* p = n->retrieve_entry(i);
return is_nothing(p) ? def : p->getAsInt();
}
static inline int64 get_bigint_param_with_default(const QoreListNode* n, qore_size_t i, int64 def) {
if (!n) return def;
const AbstractQoreNode* p = n->retrieve_entry(i);
return is_nothing(p) ? def : p->getAsBigInt();
}
static inline double get_float_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
return is_nothing(p) ? 0 : p->getAsFloat();
}
static inline bool get_bool_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
return is_nothing(p) ? false : p->getAsBool();
}
static inline const BinaryNode* test_binary_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
// the following is faster than a dynamic_cast
return p && p->getType() == NT_BINARY ? reinterpret_cast<const BinaryNode*>(p) : 0;
}
static inline const QoreStringNode* test_string_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
// the following is faster than a dynamic_cast
return p && p->getType() == NT_STRING ? reinterpret_cast<const QoreStringNode*>(p) : 0;
}
static inline QoreObject* test_object_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
// the following is faster than a dynamic_cast
return p && p->getType() == NT_OBJECT ? const_cast< QoreObject*>(reinterpret_cast<const QoreObject*>(p)) : 0;
}
static inline const DateTimeNode* test_date_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
// the following is faster than a dynamic_cast
return p && p->getType() == NT_DATE ? reinterpret_cast<const DateTimeNode*>(p) : 0;
}
static inline const QoreHashNode* test_hash_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
// the following is faster than a dynamic_cast
return p && p->getType() == NT_HASH ? reinterpret_cast<const QoreHashNode*>(p) : 0;
}
static inline const QoreListNode* test_list_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
// the following is faster than a dynamic_cast
return p && p->getType() == NT_LIST ? reinterpret_cast<const QoreListNode*>(p) : 0;
}
static inline const ResolvedCallReferenceNode* test_callref_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
// the following is faster than a dynamic_cast
return p && (p->getType() == NT_FUNCREF || p->getType() == NT_RUNTIME_CLOSURE) ? reinterpret_cast<const ResolvedCallReferenceNode*>(p) : 0;
}
static inline const ResolvedCallReferenceNode* test_funcref_param(const QoreListNode* n, qore_size_t i) {
return test_callref_param(n, i);
}
static inline const ReferenceNode* test_reference_param(const QoreListNode* n, qore_size_t i) {
if (!n) return 0;
const AbstractQoreNode* p = n->retrieve_entry(i);
// the following is faster than a dynamic_cast
return p && p->getType() == NT_REFERENCE ? reinterpret_cast<const ReferenceNode*>(p) : 0;
}
static inline bool test_nothing_param(const QoreListNode* n, qore_size_t i) {
if (!n) return true;
return is_nothing(n->retrieve_entry(i));
}
static inline const QoreEncoding* get_encoding_param(const QoreListNode* n, qore_size_t i, const QoreEncoding* def = QCS_DEFAULT) {
const QoreStringNode* str = test_string_param(n, i);
return str ? QEM.findCreate(str) : def;
}
template <typename T>
static inline T* get_hard_or_nothing_param(const QoreListNode* n, qore_size_t i) {
assert(n);
return reinterpret_cast<T*>(n->retrieve_entry(i));
}
template <typename T>
static inline T* get_hard_param(const QoreListNode* n, qore_size_t i) {
assert(n);
assert(dynamic_cast<T*>(n->retrieve_entry(i)));
return reinterpret_cast<T*>(n->retrieve_entry(i));
}
static inline void HARD_QORE_DATA(const QoreListNode* n, qore_size_t i, const void*& ptr, qore_size_t& len) {
const AbstractQoreNode* p = get_hard_param<const AbstractQoreNode>(n, i);
if (p->getType() == NT_STRING) {
const QoreStringNode* str = reinterpret_cast<const QoreStringNode*>(p);
ptr = (const void*)str->getBuffer();
len = str->size();
return;
}
const BinaryNode* b = reinterpret_cast<const BinaryNode*>(p);
ptr = b->getPtr();
len = b->size();
}
#define HARD_QORE_OR_NOTHING_PARAM(name, Type, list, i) Type* name = get_hard_or_nothing_param<Type>(list, i)
#define HARD_QORE_PARAM(name, Type, list, i) Type* name = get_hard_param<Type>(list, i)
#define HARD_QORE_INT(list, i) get_hard_param<const QoreBigIntNode>(list, i)->val
#define HARD_QORE_FLOAT(list, i) get_hard_param<const QoreFloatNode>(list, i)->f
#define HARD_QORE_NUMBER(list, i) get_hard_param<const QoreNumberNode>(list, i)
#define HARD_QORE_BOOL(list, i) get_hard_param<const QoreBoolNode>(list, i)->getValue()
#define HARD_QORE_STRING(list, i) get_hard_param<const QoreStringNode>(list, i)
#define HARD_QORE_DATE(list, i) get_hard_param<const DateTimeNode>(list, i)
#define HARD_QORE_BINARY(list, i) get_hard_param<const BinaryNode>(list, i)
#define HARD_QORE_LIST(list, i) get_hard_param<const QoreListNode>(list, i)
#define HARD_QORE_HASH(list, i) get_hard_param<const QoreHashNode>(list, i)
#define HARD_QORE_REF(list, i) get_hard_param<const ReferenceNode>(list, i)
#define HARD_QORE_OBJECT(list, i) const_cast<QoreObject*>(get_hard_param<const QoreObject>(list, i))
// sets up an object pointer
#define HARD_QORE_OBJ_DATA(vname, Type, list, i, cid, dname, cname, xsink) HARD_QORE_PARAM(obj_##vname, const QoreObject, list, i); Type* vname = reinterpret_cast<Type*>(obj_##vname->getReferencedPrivateData(cid, xsink)); if (!vname && !*xsink) xsink->raiseException("OBJECT-ALREADY-DELETED", "cannot complete call setup to %s() because parameter %d (<class %s>) has already been deleted", cname, i + 1, dname)
// destructively sets up an object pointer; caller owns the pointer
#define TAKE_HARD_QORE_OBJ_DATA(vname, Type, list, i, cid, dname, cname, xsink) HARD_QORE_PARAM(obj_##vname, const QoreObject, list, i); Type* vname = reinterpret_cast<Type*>(const_cast<QoreObject*>(obj_##vname)->getAndClearPrivateData(cid, xsink)); if (!vname && !*xsink) xsink->raiseException("OBJECT-ALREADY-DELETED", "cannot complete call setup to %s() because parameter %d (<class %s>) has already been deleted", cname, i + 1, dname); else if (vname) const_cast<QoreObject*>(obj_##vname)->doDelete(xsink)
// sets up an object pointer
#define HARD_QORE_OBJ_OR_NOTHING_DATA(vname, Type, list, i, cid, xsink) HARD_QORE_OR_NOTHING_PARAM(obj_##vname, const QoreObject, list, i); Type* vname = obj_##vname ? reinterpret_cast<Type*>(obj_##vname->getReferencedPrivateData(cid, xsink)) : 0;
static inline const QoreEncoding* get_hard_qore_encoding_param(const QoreListNode* n, qore_size_t i) {
HARD_QORE_PARAM(str, const QoreStringNode, n, i);
return QEM.findCreate(str);
}
static inline QoreValue get_param_value(const QoreValueList* n, qore_size_t i) {
return n ? n->retrieveEntry(i) : QoreValue();
}
template <typename T>
static inline T* get_hard_value_or_nothing_param(const QoreValueList* n, qore_size_t i) {
assert(n);
return n->retrieveEntry(i).get<T>();
}
static QoreValue get_hard_value_param(const QoreValueList* n, qore_size_t i) {
assert(n);
assert(n->size() > i);
return n->retrieveEntry(i);
}
#define HARD_QORE_VALUE_OR_NOTHING_PARAM(name, Type, list, i) Type* name = get_hard_value_or_nothing_param<Type>(list, i)
#define HARD_QORE_VALUE_PARAM(name, Type, list, i) Type* name = get_hard_value_param(list, i).get<Type>()
#define HARD_QORE_VALUE_INT(list, i) get_hard_value_param(list, i).getAsBigInt()
#define HARD_QORE_VALUE_FLOAT(list, i) get_hard_value_param(list, i).getAsFloat()
#define HARD_QORE_VALUE_NUMBER(list, i) get_hard_value_param(list, i).get<const QoreNumberNode>()
#define HARD_QORE_VALUE_BOOL(list, i) get_hard_value_param(list, i).getAsBool()
#define HARD_QORE_VALUE_STRING(list, i) get_hard_value_param(list, i).get<const QoreStringNode>()
#define HARD_QORE_VALUE_DATE(list, i) get_hard_value_param(list, i).get<const DateTimeNode>()
#define HARD_QORE_VALUE_BINARY(list, i) get_hard_value_param(list, i).get<const BinaryNode>()
#define HARD_QORE_VALUE_LIST(list, i) get_hard_value_param(list, i).get<const QoreListNode>()
#define HARD_QORE_VALUE_HASH(list, i) get_hard_value_param(list, i).get<const QoreHashNode>()
#define HARD_QORE_VALUE_REF(list, i) get_hard_value_param(list, i).get<const ReferenceNode>()
#define HARD_QORE_VALUE_OBJECT(list, i) const_cast<QoreObject*>(get_hard_value_param(list, i).get<const QoreObject>())
#define HARD_QORE_VALUE_OBJ_DATA(vname, Type, list, i, cid, dname, cname, xsink) HARD_QORE_VALUE_PARAM(obj_##vname, const QoreObject, list, i); Type* vname = reinterpret_cast<Type*>(obj_##vname->getReferencedPrivateData(cid, xsink)); if (!vname && !*xsink) xsink->raiseException("OBJECT-ALREADY-DELETED", "cannot complete call setup to %s() because parameter %d (<class %s>) has already been deleted", cname, i + 1, dname)
#define TAKE_HARD_QORE_VALUE_OBJ_DATA(vname, Type, list, i, cid, dname, cname, xsink) HARD_QORE_VALUE_PARAM(obj_##vname, const QoreObject, list, i); Type* vname = reinterpret_cast<Type*>(const_cast<QoreObject*>(obj_##vname)->getAndClearPrivateData(cid, xsink)); if (!vname && !*xsink) xsink->raiseException("OBJECT-ALREADY-DELETED", "cannot complete call setup to %s() because parameter %d (<class %s>) has already been deleted", cname, i + 1, dname); else if (vname) const_cast<QoreObject*>(obj_##vname)->doDelete(xsink)
#define HARD_QORE_VALUE_OBJ_OR_NOTHING_DATA(vname, Type, list, i, cid, xsink) HARD_QORE_VALUE_OR_NOTHING_PARAM(obj_##vname, const QoreObject, list, i); Type* vname = obj_##vname ? reinterpret_cast<Type*>(obj_##vname->getReferencedPrivateData(cid, xsink)) : 0;
static inline const QoreEncoding* get_value_encoding_param(const QoreValueList* n, qore_size_t i, const QoreEncoding* def = QCS_DEFAULT) {
const QoreStringNode* str = HARD_QORE_VALUE_STRING(n, i);
return str ? QEM.findCreate(str) : def;
}
static inline const QoreEncoding* get_hard_qore_value_encoding_param(const QoreValueList* n, qore_size_t i) {
HARD_QORE_VALUE_PARAM(str, const QoreStringNode, n, i);
return QEM.findCreate(str);
}
#endif
NT_BINARY
const qore_type_t NT_BINARY
type value for BinaryNode
Definition: node_types.h:49
QoreEncoding
defines string encoding functions in Qore
Definition: QoreEncoding.h:85
HARD_QORE_PARAM
#define HARD_QORE_PARAM(name, Type, list, i)
returns a hard typed parameter
Definition: params.h:296
get_hard_value_param
static QoreValue get_hard_value_param(const QoreValueList *n, qore_size_t i)
returns the given type for hard typed parameters
Definition: params.h:364
QoreHashNode
This is the hash or associative list container type in Qore, dynamically allocated only...
Definition: QoreHashNode.h:49
AbstractQoreNode::getAsBool
DLLEXPORT bool getAsBool() const
returns the boolean value of the object
test_callref_param
static const ResolvedCallReferenceNode * test_callref_param(const QoreListNode *n, qore_size_t i)
returns a ResolvedCallReferenceNode pointer for the argument position given or 0 if there is no argum...
Definition: params.h:216
QCS_DEFAULT
DLLEXPORT const QoreEncoding * QCS_DEFAULT
the default encoding for the Qore library
get_int_param_with_default
static int get_int_param_with_default(const QoreListNode *n, qore_size_t i, int def)
returns an integer corresponding to the argument given or a default value if there is none ...
Definition: params.h:105
test_funcref_param
static const ResolvedCallReferenceNode * test_funcref_param(const QoreListNode *n, qore_size_t i)
returns a ResolvedCallReferenceNode pointer for the argument position given or 0 if there is no argum...
Definition: params.h:229
AbstractQoreNode::getAsFloat
DLLEXPORT double getAsFloat() const
returns the float value of the object
test_hash_param
static const QoreHashNode * test_hash_param(const QoreListNode *n, qore_size_t i)
returns a QoreHashNode pointer for the argument position given or 0 if there is no argument there or ...
Definition: params.h:190
NT_LIST
const qore_type_t NT_LIST
type value for QoreListNode
Definition: node_types.h:50
QoreValueList
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreValueList.h:45
BinaryNode::size
DLLEXPORT qore_size_t size() const
returns the number of bytes in the object
AbstractQoreNode
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:55
get_param_value
static QoreValue get_param_value(const QoreValueList *n, qore_size_t i)
returns the argument in the position given or 0 if there is none
Definition: params.h:352
get_hard_or_nothing_param
static T * get_hard_or_nothing_param(const QoreListNode *n, qore_size_t i)
returns the given type for hard typed parameters
Definition: params.h:266
NT_NOTHING
const qore_type_t NT_NOTHING
type value for QoreNothingNode
Definition: node_types.h:42
get_hard_value_or_nothing_param
static T * get_hard_value_or_nothing_param(const QoreValueList *n, qore_size_t i)
returns the given type for hard typed parameters
Definition: params.h:358
NT_OBJECT
const qore_type_t NT_OBJECT
type value for QoreObject
Definition: node_types.h:52
qore_size_t
size_t qore_size_t
used for sizes (same range as a pointer)
Definition: common.h:71
test_date_param
static const DateTimeNode * test_date_param(const QoreListNode *n, qore_size_t i)
returns a DateTimeNode pointer for the argument position given or 0 if there is no argument there or ...
Definition: params.h:177
test_reference_param
static const ReferenceNode * test_reference_param(const QoreListNode *n, qore_size_t i)
returns a ReferenceNode pointer for the argument position given or 0 if there is no argument there or...
Definition: params.h:240
NT_DATE
const qore_type_t NT_DATE
type value for DateTimeNode
Definition: node_types.h:46
get_hard_qore_encoding_param
static const QoreEncoding * get_hard_qore_encoding_param(const QoreListNode *n, qore_size_t i)
returns the QoreEncoding corresponding to the string passed or a default encoding ...
Definition: params.h:341
NT_FUNCREF
const qore_type_t NT_FUNCREF
type value for AbstractCallReferenceNode
Definition: node_types.h:71
test_object_param
static QoreObject * test_object_param(const QoreListNode *n, qore_size_t i)
returns a QoreObject pointer for the argument position given or 0 if there is no argument there or if...
Definition: params.h:164
test_binary_param
static const BinaryNode * test_binary_param(const QoreListNode *n, qore_size_t i)
returns a const BinaryNode pointer for the argument position given or 0 if there is no argument there...
Definition: params.h:138
AbstractQoreNode::getAsInt
DLLEXPORT int getAsInt() const
returns the integer value of the object
QoreListNode::retrieve_entry
DLLEXPORT AbstractQoreNode * retrieve_entry(qore_size_t index)
returns the element at "index" (first element is index 0)
AbstractQoreNode::getAsBigInt
DLLEXPORT int64 getAsBigInt() const
returns the 64-bit integer value of the object
QoreStringNode
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:50
num_args
static unsigned num_args(const QoreListNode *n)
returns the number of arguments passed to the function
Definition: params.h:46
is_nothing
static bool is_nothing(const AbstractQoreNode *n)
to check if an AbstractQoreNode object is NOTHING
Definition: QoreLib.h:314
get_value_encoding_param
static const QoreEncoding * get_value_encoding_param(const QoreValueList *n, qore_size_t i, const QoreEncoding *def=QCS_DEFAULT)
returns the QoreEncoding corresponding to the string passed or a default encoding ...
Definition: params.h:419
get_hard_param
static T * get_hard_param(const QoreListNode *n, qore_size_t i)
returns the given type for hard typed parameters
Definition: params.h:273
QoreListNode
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
QEM
DLLEXPORT QoreEncodingManager QEM
the QoreEncodingManager object
DateTimeNode
Qore's parse tree/value type for date-time values, reference-counted, dynamically-allocated only...
Definition: DateTimeNode.h:44
get_bool_param
static bool get_bool_param(const QoreListNode *n, qore_size_t i)
returns a boolean value corresponding to the argument given or false if there is none ...
Definition: params.h:126
ReferenceNode
parse type: reference to a lvalue expression
Definition: ReferenceNode.h:45
NT_RUNTIME_CLOSURE
const qore_type_t NT_RUNTIME_CLOSURE
type value for ResolvedCallReferenceNode (QoreClosureNode, QoreObjectClosureNode) ...
Definition: node_types.h:74
NT_HASH
const qore_type_t NT_HASH
type value for QoreHashNode
Definition: node_types.h:51
test_nothing_param
static bool test_nothing_param(const QoreListNode *n, qore_size_t i)
returns true if the arugment position given is NOTHING
Definition: params.h:253
NT_REFERENCE
const qore_type_t NT_REFERENCE
type value for ReferenceNode
Definition: node_types.h:64
QoreEncodingManager::findCreate
static DLLEXPORT const QoreEncoding * findCreate(const char *name)
finds an encoding if it exists (also looks up against alias names) and creates a new one if it doesn'...
test_list_param
static const QoreListNode * test_list_param(const QoreListNode *n, qore_size_t i)
returns a QoreListNode pointer for the argument position given or 0 if there is no argument there or ...
Definition: params.h:203
NT_STRING
const qore_type_t NT_STRING
type value for QoreStringNode
Definition: node_types.h:45
QoreListNode::size
DLLEXPORT qore_size_t size() const
returns the number of elements in the list
test_string_param
static const QoreStringNode * test_string_param(const QoreListNode *n, qore_size_t i)
returns a const QoreStringNode pointer for the argument position given or 0 if there is no argument t...
Definition: params.h:151
QoreObject
the implementation of Qore's object data type, reference counted, dynamically-allocated only ...
Definition: QoreObject.h:64
num_params
static unsigned num_params(const QoreListNode *n)
returns the number of arguments passed to the function
Definition: params.h:62
HARD_QORE_VALUE_PARAM
#define HARD_QORE_VALUE_PARAM(name, Type, list, i)
returns a hard typed parameter
Definition: params.h:374
int64
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition: common.h:228
get_bigint_param
static int64 get_bigint_param(const QoreListNode *n, qore_size_t i)
returns a 64-bit integer corresponding to the argument given or 0 if there is none ...
Definition: params.h:98
HARD_QORE_VALUE_STRING
#define HARD_QORE_VALUE_STRING(list, i)
returns a const QoreStringNode* from a hard typed string param
Definition: params.h:389
QoreValueList::size
DLLEXPORT size_t size() const
returns the number of elements in the list
AbstractQoreNode::getType
DLLLOCAL qore_type_t getType() const
returns the data type
Definition: AbstractQoreNode.h:297
ResolvedCallReferenceNode
base class for resolved call references
Definition: CallReferenceNode.h:130
get_bigint_param_with_default
static int64 get_bigint_param_with_default(const QoreListNode *n, qore_size_t i, int64 def)
returns a 64-bit integer corresponding to the argument given or a default value if there is none ...
Definition: params.h:112
QoreValueList::retrieveEntry
DLLEXPORT QoreValue retrieveEntry(size_t index)
returns the element at "index" (first element is index 0)
qore_type_t
int16_t qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode) ...
Definition: common.h:68
get_encoding_param
static const QoreEncoding * get_encoding_param(const QoreListNode *n, qore_size_t i, const QoreEncoding *def=QCS_DEFAULT)
returns the QoreEncoding corresponding to the string passed or a default encoding ...
Definition: params.h:259
get_float_param
static double get_float_param(const QoreListNode *n, qore_size_t i)
returns a float corresponding to the argument given or 0 if there is none
Definition: params.h:119
BinaryNode::getPtr
DLLEXPORT const void * getPtr() const
returns the pointer to the data
get_int_param
static int get_int_param(const QoreListNode *n, qore_size_t i)
returns an integer corresponding to the argument given or 0 if there is none
Definition: params.h:91
get_param
static const AbstractQoreNode * get_param(const QoreListNode *n, qore_size_t i)
returns the argument in the position given or 0 if there is none
Definition: params.h:72
QoreString::size
DLLEXPORT qore_size_t size() const
returns number of bytes in the string (not including the null pointer)
get_param_type
static qore_type_t get_param_type(const QoreListNode *n, qore_size_t i)
returns the argument type in the position given or 0 if there is none
Definition: params.h:84
BinaryNode
holds arbitrary binary data
Definition: BinaryNode.h:41
QoreString::getBuffer
DLLEXPORT const char * getBuffer() const
returns the string's buffer; this data should not be changed