jaula API Reference
version 1.4.0
|
Base class for handling values. More...
#include <jaula_value.h>
Public Types | |
enum | ValueType { TYPE_NULL, TYPE_BOOLEAN, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER_INT, TYPE_ARRAY, TYPE_OBJECT } |
Enumeration of available value types. More... | |
Public Member Functions | |
ValueType | getType (void) const |
Retrieves the value type for the instance. More... | |
Value & | operator= (Value const &orig) throw (Bad_Data_Type) |
Assignment operator. More... | |
virtual void | repr (std::ostream &ostr) const =0 |
Represents the instance in a stream. More... | |
virtual void | set (Value const &origin) throw (Bad_Data_Type) |
Copies the contents of one instance into another. More... | |
virtual | ~Value () |
Destructor. More... | |
Static Public Member Functions | |
static Value * | duplicate (Value const &orig) |
Creates a duplicate of a value. More... | |
Protected Member Functions | |
Value (ValueType Type) | |
Constructor. More... | |
Private Attributes | |
ValueType | Type_ |
Container for error code. More... | |
Base class for handling values.
|
virtual |
Destructor.
|
protected |
Constructor.
Type | Type of value to be contained by the instance |
Creates a duplicate of a value.
orig | Original instance to duplicate. |
References JAULA::Exception::addOrigin(), JAULA::Value_String::getData(), JAULA::Value_Number::getData(), JAULA::Value_Boolean::getData(), JAULA::Value_Number_Int::getData(), JAULA::Value_Array::getData(), and JAULA::Value_Object::getData().
Referenced by JAULA::Value_Array::addItem(), JAULA::Value_Object::insertItem(), JAULA::Value_Array::set(), JAULA::Value_Object::set(), JAULA::Value_Array::Value_Array(), and JAULA::Value_Object::Value_Object().
Value::ValueType JAULA::Value::getType | ( | void | ) | const |
Value & JAULA::Value::operator= | ( | Value const & | orig | ) | |
throw | ( | Bad_Data_Type | |||
) |
Assignment operator.
orig | Original instance to copy |
Bad_Data_Type | This exception is launched in case that origin and destination value types are different. |
References JAULA::Exception::addOrigin().
|
pure virtual |
Represents the instance in a stream.
ostr | Stream where the instance is to be represented. |
Implemented in JAULA::Value_Object, JAULA::Value_Array, JAULA::Value_Number_Int, JAULA::Value_Boolean, JAULA::Value_Number, JAULA::Value_String, and JAULA::Value_Null.
Referenced by operator<<().
|
virtual |
Copies the contents of one instance into another.
origin | Reference to the value to be copied. |
Bad_Data_Type | This exception is launched in case that origin and destination value types are different. |
Reimplemented in JAULA::Value_Object, JAULA::Value_Array, JAULA::Value_Number_Int, JAULA::Value_Boolean, JAULA::Value_Number, JAULA::Value_String, and JAULA::Value_Null.
References Type_.
Referenced by JAULA::Value_Null::set(), JAULA::Value_String::set(), JAULA::Value_Number::set(), JAULA::Value_Boolean::set(), JAULA::Value_Number_Int::set(), JAULA::Value_Array::set(), and JAULA::Value_Object::set().
Copyright (c) 2007, 2008, 2009 Kombo Morongo.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".