26 #ifndef _QORE_QORESTRINGNODE_H
28 #define _QORE_QORESTRINGNODE_H
30 #include <qore/AbstractQoreNode.h>
31 #include <qore/QoreString.h>
46 DLLLOCAL QoreStringNode& operator=(
const QoreStringNode&);
48 DLLLOCAL
virtual bool getAsBoolImpl()
const;
49 DLLLOCAL
virtual int getAsIntImpl()
const;
50 DLLLOCAL
virtual int64 getAsBigIntImpl()
const;
51 DLLLOCAL
virtual double getAsFloatImpl()
const;
200 DLLEXPORT QoreStringNode *
reverse()
const;
203 DLLEXPORT QoreStringNode *copy()
const;
272 DLLLOCAL QoreStringNodeMaker(
const QoreStringNodeMaker& str);
275 DLLLOCAL QoreStringNodeMaker&
operator=(
const QoreStringNodeMaker&);
278 DLLEXPORT QoreStringNodeMaker(
const char* fmt, ...);
299 DLLLOCAL QoreStringValueHelper& operator=(
const QoreStringValueHelper&);
302 DLLLOCAL
void*
operator new(size_t);
417 DLLLOCAL QoreStringNodeValueHelper& operator=(
const QoreStringNodeValueHelper&);
420 DLLLOCAL
void*
operator new(size_t);
474 #include <qore/ReferenceHolder.h>
503 DLLLOCAL QoreNodeAsStringHelper& operator=(
const QoreNodeAsStringHelper&);
506 DLLLOCAL
void*
operator new(size_t);
virtual DLLEXPORT ~QoreStringNode()
destructor only called when references = 0, use deref() instead
DLLLOCAL QoreString * giveString()
returns a copy of the QoreString that the caller owns
Definition: QoreStringNode.h:382
DLLLOCAL const QoreStringNode * operator->()
returns the object being managed
Definition: QoreStringNode.h:452
DLLEXPORT QoreStringNode * substr(qore_offset_t offset, ExceptionSink *xsink) const
returns a new string consisting of all the characters from the current string starting with character...
defines string encoding functions in Qore
Definition: QoreEncoding.h:72
static DLLEXPORT QoreStringNode * createAndConvertEncoding(const char *str, const QoreEncoding *from, const QoreEncoding *to, ExceptionSink *xsink)
creates a new QoreStringNode from a string and converts its encoding
DLLLOCAL const QoreString * operator*()
returns the object being managed
Definition: QoreStringNode.h:528
DLLEXPORT const QoreEncoding * QCS_DEFAULT
the default encoding for the Qore library
safely manages the return values to AbstractQoreNode::getAsString(), stack only, cannot be dynamicall...
Definition: QoreStringNode.h:494
DLLLOCAL QoreStringValueHelper(const AbstractQoreNode *n, const QoreEncoding *enc, ExceptionSink *xsink)
gets the QoreString representation and ensures that it's in the desired encoding
Definition: QoreStringNode.h:335
Holds absolute and relative date/time values in Qore with precision to the microsecond.
Definition: DateTime.h:85
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:47
DLLLOCAL const QoreString * operator->()
returns the object being managed
Definition: QoreStringNode.h:522
DLLEXPORT QoreStringNode * reverse() const
return a QoreStringNode with the characters reversed
size_t qore_size_t
used for sizes (same range as a pointer)
Definition: common.h:62
virtual DLLEXPORT QoreString * getStringRepresentation(bool &del) const
returns the value of the type converted to a string, default implementation: returns the empty string...
long qore_offset_t
used for offsets that could be negative
Definition: common.h:65
DLLLOCAL const QoreString * operator*()
returns the object being managed
Definition: QoreStringNode.h:376
virtual DLLEXPORT bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const
tests for equality ("deep compare" including all contained values for container types) with possible ...
virtual DLLEXPORT QoreString * getStringRepresentation(bool &del) const
returns the current string and sets del to false
DLLLOCAL bool is_temp() const
returns true if the pointer being managed is temporary
Definition: QoreStringNode.h:395
DLLLOCAL QoreStringNode * getReferencedValue()
returns a referenced value - the caller will own the reference
Definition: QoreStringNode.h:465
signed short qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode) ...
Definition: common.h:59
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:42
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:40
DLLEXPORT QoreString * convertEncoding(const QoreEncoding *nccs, ExceptionSink *xsink) const
converts the encoding of the string to the specified encoding, returns 0 if an error occurs...
DLLLOCAL ~QoreStringNodeValueHelper()
destroys the object and dereferences the QoreStringNode if it is a temporary pointer ...
Definition: QoreStringNode.h:443
DLLEXPORT qore_size_t length() const
returns the number of characters (not bytes) in the string
virtual DLLEXPORT const char * getTypeName() const
returns the type name as a c string
DLLEXPORT QoreStringNode * convertEncoding(const QoreEncoding *nccs, ExceptionSink *xsink) const
converts the encoding of the string to the specified encoding, returns 0 if an error occurs...
this class is used to safely manage calls to AbstractQoreNode::getStringRepresentation() when a simpl...
Definition: QoreStringNode.h:290
DLLEXPORT QoreStringNode * parseBase64ToString(ExceptionSink *xsink) const
parses the string as a base64-encoded binary and returns the decoded value as a QoreStringNode ...
DLLEXPORT QoreStringNode()
creates an empty string and assigns the default encoding QCS_DEFAULT
virtual DLLEXPORT DateTime * getDateTimeRepresentation(bool &del) const
returns the DateTime representation of this string
DLLLOCAL ~QoreStringValueHelper()
destroys the object and deletes the QoreString pointer being managed if it was a temporary pointer ...
Definition: QoreStringNode.h:361
DLLLOCAL QoreStringValueHelper(const AbstractQoreNode *n)
creates the object and acquires a pointer to the QoreString representation of the AbstractQoreNode pa...
Definition: QoreStringNode.h:306
DLLEXPORT const QoreEncoding * getEncoding() const
returns the encoding for the string
const qore_type_t NT_STRING
type value for QoreStringNode
Definition: node_types.h:37
DLLEXPORT void ref() const
increments the reference count
DLLEXPORT QoreStringNode * extract(qore_offset_t offset, ExceptionSink *xsink)
removes characters from the string starting at position "offset" and returns a string of the characte...
DLLLOCAL const QoreString * operator->()
returns the object being managed
Definition: QoreStringNode.h:370
DLLEXPORT QoreString * copy() const
returns an exact copy of the string
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:35
DLLEXPORT int getAsString(QoreString &str, int format_offset, ExceptionSink *xsink) const
concatenates the string data in double quotes to an existing QoreString
manages a reference count of a pointer to a class that takes a simple "deref()" call with no argument...
Definition: ReferenceHolder.h:103
DLLEXPORT QoreStringNode * stringRefSelf() const
references the object and returns a non-const pointer to "this"
virtual DLLLOCAL AbstractQoreNode * parseInit(LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo)
returns the type information
this class is used to safely manage calls to AbstractQoreNode::getStringRepresentation() when a QoreS...
Definition: QoreStringNode.h:408
static DLLLOCAL qore_type_t getStaticTypeCode()
returns the type code (useful in templates)
Definition: QoreStringNode.h:261
DLLLOCAL qore_type_t getType() const
returns the data type
Definition: AbstractQoreNode.h:286
DLLLOCAL QoreString * giveString()
returns a copy of the QoreString that the caller owns
Definition: QoreStringNode.h:534
DLLLOCAL const QoreStringNode * operator*()
returns the object being managed
Definition: QoreStringNode.h:458
DLLLOCAL ~QoreNodeAsStringHelper()
destroys the object and deletes the QoreString pointer being managed if it was a temporary pointer ...
Definition: QoreStringNode.h:513
base class for simple value types
Definition: AbstractQoreNode.h:417
virtual DLLEXPORT bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const
tests for equality ("deep compare" including all contained values for container types) without type o...
virtual DLLEXPORT AbstractQoreNode * realCopy() const
returns a copy of the object, the caller owns the reference count
static DLLLOCAL const char * getStaticTypeName()
returns the type name (useful in templates)
Definition: QoreStringNode.h:256
DLLEXPORT QoreString & operator=(const QoreString &other)
assigns the value of one string to another
holds arbitrary binary data
Definition: BinaryNode.h:33