QoreNothingNode Class Reference

Qore's SQL "NOTHING" parse tree/value type, not-referenced counted, not dynamically allocated. More...

#include <QoreNothingNode.h>

Inheritance diagram for QoreNothingNode:
UniqueValueQoreNode SimpleValueQoreNode SimpleQoreNode AbstractQoreNode QoreReferenceCounter

List of all members.

Public Member Functions

virtual DLLEXPORT int getAsString (QoreString &str, int foff, class ExceptionSink *xsink) const
 concatenate "<NOTHING>" to an existing QoreString
virtual DLLEXPORT QoreStringgetAsString (bool &del, int foff, class ExceptionSink *xsink) const
 returns a QoreString with the text: "<NOTHING>"
virtual DLLEXPORT bool is_equal_soft (const AbstractQoreNode *v, ExceptionSink *xsink) const
 tests for equality with possible type conversion (soft compare)
virtual DLLEXPORT bool is_equal_hard (const AbstractQoreNode *v, ExceptionSink *xsink) const
 tests for equality without type conversions (hard compare)
virtual DLLEXPORT const char * getTypeName () const
 returns the type name as a c string
virtual DLLLOCAL AbstractQoreNodeparseInit (LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo)
 returns the type information

Protected Member Functions

DLLLOCAL AbstractQoreNodeevalImpl (ExceptionSink *xsink) const
 should never be called for value types

Detailed Description

Qore's SQL "NOTHING" parse tree/value type, not-referenced counted, not dynamically allocated.

This class cannot be instantiated; there will only be one single QoreNothingNode object instantiated and used everywhere in the Qore library. Use the nothing() function or simply &Nothing to acquire a pointer to an object of this class. This value can be represented in Qore code as the keyword "NOTHING"

Note:
Qore's "NULL" is not equal to "NOTHING"
in C++ code, use the is_nothing() function to test an AbstractQoreNode* to see if it's "NOTHING" (because also a null pointer is equivalent to NOTHING)
See also:
QoreNullNode

Member Function Documentation

DLLLOCAL AbstractQoreNode* QoreNothingNode::evalImpl ( ExceptionSink xsink  )  const [protected, virtual]

should never be called for value types

in debugging builds of the library, calls to this function will abort

Reimplemented from SimpleValueQoreNode.

virtual DLLEXPORT QoreString* QoreNothingNode::getAsString ( bool &  del,
int  foff,
class ExceptionSink xsink 
) const [virtual]

returns a QoreString with the text: "<NOTHING>"

used for n and N printf formatting

Parameters:
del is always set to true for this implementation of the function, meaning that the returned QoreString pointer should be deleted
foff for multi-line formatting offset, -1 = no line breaks (ignored by this version of the function)
xsink ignored by this version of the function NOTE: Use the QoreNodeAsStringHelper class (defined in QoreStringNode.h) instead of using this function directly
See also:
QoreNodeAsStringHelper

Implements AbstractQoreNode.

virtual DLLEXPORT int QoreNothingNode::getAsString ( QoreString str,
int  foff,
class ExceptionSink xsink 
) const [virtual]

concatenate "<NOTHING>" to an existing QoreString

used for n and N printf formatting

Parameters:
str the string representation of the type will be concatenated to this QoreString reference
foff for multi-line formatting offset, -1 = no line breaks
xsink if an error occurs, the Qore-language exception information will be added here
Returns:
-1 for exception raised, 0 = OK

Implements AbstractQoreNode.

virtual DLLEXPORT bool QoreNothingNode::is_equal_hard ( const AbstractQoreNode v,
ExceptionSink xsink 
) const [virtual]

tests for equality without type conversions (hard compare)

Parameters:
v the value to compare
xsink ignored for this version of the function
virtual DLLEXPORT bool QoreNothingNode::is_equal_soft ( const AbstractQoreNode v,
ExceptionSink xsink 
) const [virtual]

tests for equality with possible type conversion (soft compare)

since no type can be implicitly converted to NOTHING, this comparison is the same as is_equal_hard() for QoreNothingNode

Parameters:
v the value to compare
xsink ignored for this version of the function

The documentation for this class was generated from the following file:

Generated on 14 Jun 2010 for Qore Programming Language by  doxygen 1.6.1