filters
Swinder::Value Class Reference
#include <value.h>
Detailed Description
Provides a wrapper for cell value.Each cell in a worksheet must hold a value, either as enterred by user or as a result of formula evaluation. Default cell holds empty value.
Value uses implicit data sharing to reduce memory usage.
Definition at line 42 of file value.h.
Public Types | |
enum | Type { Empty, Boolean, Integer, Float, String, CellRange, Array, Error } |
Public Member Functions | |
Value () | |
Value (Type _type) | |
virtual | ~Value () |
Value (const Value &_value) | |
Value & | operator= (const Value &_value) |
Value & | assign (const Value &_value) |
Value (bool b) | |
Value (int i) | |
Value (double f) | |
Value (const UString &s) | |
Type | type () const |
bool | isEmpty () const |
bool | isBoolean () const |
bool | isInteger () const |
bool | isFloat () const |
bool | isNumber () const |
bool | isString () const |
bool | isError () const |
void | setValue (const Value &v) |
void | setValue (bool b) |
void | setValue (int i) |
void | setValue (double f) |
void | setValue (const UString &s) |
void | setError (const UString &msg) |
bool | asBoolean () const |
int | asInteger () const |
double | asFloat () const |
UString | asString () const |
UString | errorMessage () const |
void | detach () |
Static Public Member Functions | |
static const Value & | empty () |
static const Value & | errorDIV0 () |
static const Value & | errorNA () |
static const Value & | errorNAME () |
static const Value & | errorNUM () |
static const Value & | errorNULL () |
static const Value & | errorREF () |
static const Value & | errorVALUE () |
Protected Attributes | |
ValueData * | d |
Constructor & Destructor Documentation
|
Creates an empty value, i.e holds nothing.
|
|
Creates a value of certain type.
|
|
Destroys the value.
|
|
Creates a copy from another value.
|
|
Creates a boolean value.
|
|
Creates an integer value.
|
|
Create a floating-point value.
|
|
Create a string value.
|
Member Function Documentation
|
Returns the boolean value of this value. Call this function only if isBoolean() returns true. |
|
Returns the floating-point value of this value. Call this function only if isNumber() returns true. |
|
Returns the integer value of this value. Call this function only if isNumber() returns true. |
|
Assigns from another value. Same as above. |
|
Returns the string value of this value. Call this function only if isString() returns true. |
|
Detaches itself from shared value data, i.e make a private, deep copy of the data. Usually this function is called automatically so you don't have to care about it. |
|
Returns constant reference to empty value.
|
|
Returns constant reference to DIV/0! error. This is used to indicate that a formula divides by 0 (zero). |
|
Returns error message associated with this value. Call this function only if isError() returns true. |
|
Returns constant reference to N/A error. This is to indicate that a value is not available to a function. |
|
Returns constant reference to NAME? error. This is to indicate that certain text inside formula is not recognized, possibly a misspelled name or name that does not exist. |
|
Returns constant reference to NULL! error. This is to indicate that two area do not intersect. |
|
Returns constant reference to NUM! error. This is to indicate a problem with a number in a formula. |
|
Returns constant reference to REF! error. This is used to indicate an invalid cell reference. |
|
Returns constant reference to VALUE! error. This is to indicate that wrong type of argument or operand is used, usually within a function call, e.g SIN("some text"). |
|
Returns true if the type of this value is Boolean.
|
|
Returns true if empty.
|
|
Returns true if this value holds error information.
|
|
Returns true if the type of this value is floating-point.
|
|
Returns true if the type of this value is integer.
|
|
Returns true if the type of this value is either integer or floating-point.
|
|
Returns true if the type of this value is string.
|
|
Assigns from another value. Because the data is implicitly shared, such assignment is very fast and doesn't consume additional memory. |
|
Sets this value to hold error message.
|
|
Sets this value to string value.
|
|
Sets this value to floating-point value.
|
|
Sets this value to integer value.
|
|
Sets this value to boolean value.
|
|
Returns the type of the value.
|
The documentation for this class was generated from the following files: