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. | |
Value & | operator= (Value const &orig) throw (Bad_Data_Type) |
Assignment operator. | |
virtual void | repr (std::ostream &ostr) const =0 |
Represents the instance in a stream. | |
virtual void | set (Value const &origin) throw (Bad_Data_Type) |
Copies the contents of one instance into another. | |
virtual | ~Value () |
Destructor. | |
Static Public Member Functions | |
static Value * | duplicate (Value const &orig) |
Creates a duplicate of a value. | |
Protected Member Functions | |
Value (ValueType Type) | |
Constructor. | |
Private Attributes | |
ValueType | Type_ |
Container for error code. | |
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_Array::getData(), JAULA::Value_Boolean::getData(), JAULA::Value_Number::getData(), JAULA::Value_Number_Int::getData(), JAULA::Value_Object::getData(), and JAULA::Value_String::getData().
Referenced by JAULA::Value_Array::addItem(), 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_Array, JAULA::Value_Boolean, JAULA::Value_Null, JAULA::Value_Number, JAULA::Value_Number_Int, JAULA::Value_Object, and JAULA::Value_String.
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_Array, JAULA::Value_Boolean, JAULA::Value_Null, JAULA::Value_Number, JAULA::Value_Number_Int, JAULA::Value_Object, and JAULA::Value_String.
Referenced by JAULA::Value_Array::set(), JAULA::Value_Boolean::set(), JAULA::Value_Null::set(), JAULA::Value_Number::set(), JAULA::Value_Number_Int::set(), JAULA::Value_Object::set(), and JAULA::Value_String::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".
jaula project hosted by