jaula_value.h
/*
* jaula_value.h : JSON Analysis User Library Acronym
* Generic values definitions
*
* Copyright (C) 2007, 2008, 2009 Kombo Morongo <morongo666@gmail.com>
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* svn info:
* $Author: morongo $
* $HeadURL: https://jaula.svn.sourceforge.net/svnroot/jaula/tags/jaula-1.4.0/jaula/jaula_value.h $
* $Id: jaula_value.h 45 2009-01-11 16:17:03Z morongo $
* $Revision: 45 $
*/
#ifndef _JAULA_VALUE_H_
#define _JAULA_VALUE_H_
#include <jaula/jaula_bad_data_type.h>
namespace JAULA
{ // namespace JAULA
class Value
{ // class Value
public:
enum ValueType
{ // enum ValueType
TYPE_NULL
, TYPE_BOOLEAN
, TYPE_STRING
, TYPE_NUMBER
, TYPE_NUMBER_INT
, TYPE_ARRAY
, TYPE_OBJECT
}; // enum ValueType
virtual ~Value();
ValueType getType(void) const;
virtual void repr(std::ostream &ostr) const = 0;
virtual void set(Value const &origin) throw(Bad_Data_Type);
Value &operator=(Value const &orig) throw(Bad_Data_Type);
static Value *duplicate(Value const &orig);
protected:
Value(ValueType Type);
private:
ValueType Type_;
}; // class Value
} // namespace JAULA
std::ostream &operator<<(std::ostream &ostr, JAULA::Value const &val);
#endif
// EOF $Id: jaula_value.h 45 2009-01-11 16:17:03Z morongo $
JAULA::Bad_Data_Type
class for incompatible data type exceptions
Definition jaula_bad_data_type.h:53
JAULA::Value
Base class for handling values.
Definition jaula_value.h:53
JAULA::Value::Value
Value(ValueType Type)
Constructor.
Definition jaula_value.cc:150
JAULA::Value::set
virtual void set(Value const &origin)
Copies the contents of one instance into another.
Definition jaula_value.cc:61
JAULA::Value::getType
ValueType getType(void) const
Retrieves the value type for the instance.
Definition jaula_value.cc:56
JAULA::Value::~Value
virtual ~Value()
Destructor.
Definition jaula_value.cc:53
JAULA::Value::ValueType
ValueType
Enumeration of available value types.
Definition jaula_value.h:60
JAULA::Value::TYPE_STRING
@ TYPE_STRING
Definition jaula_value.h:66
JAULA::Value::TYPE_BOOLEAN
@ TYPE_BOOLEAN
Definition jaula_value.h:64
JAULA::Value::TYPE_NUMBER_INT
@ TYPE_NUMBER_INT
Definition jaula_value.h:70
JAULA::Value::TYPE_NULL
@ TYPE_NULL
Definition jaula_value.h:62
JAULA::Value::TYPE_NUMBER
@ TYPE_NUMBER
Definition jaula_value.h:68
JAULA::Value::TYPE_ARRAY
@ TYPE_ARRAY
Definition jaula_value.h:72
JAULA::Value::duplicate
static Value * duplicate(Value const &orig)
Creates a duplicate of a value.
Definition jaula_value.cc:85
JAULA::Value::repr
virtual void repr(std::ostream &ostr) const =0
Represents the instance in a stream.
JAULA::Value::Type_
ValueType Type_
Container for error code.
Definition jaula_value.h:168
JAULA::Value::operator=
Value & operator=(Value const &orig)
Assignment operator.
Definition jaula_value.cc:69
operator<<
std::ostream & operator<<(std::ostream &ostr, JAULA::Value const &val)
Insertion operator extension for values.
Definition jaula_value.cc:157
JAULA
Namespace for all library definitions.
Definition jaula.h:439

Back to JAULA Project Documentation Page.

Go to JAULA Project Home Page.

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".

SourceForge.net