jaula API Reference version 1.4.0
|
00001 00002 /* 00003 * jaula_value_object.h : JSON Analysis User Library Acronym 00004 * JSON object values definitions 00005 * 00006 * Copyright (C) 2007, 2008, 2009 Kombo Morongo <morongo666@gmail.com> 00007 * 00008 * This library is free software; you can redistribute it and/or modify it 00009 * under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation; either version 2.1 of the License, or (at 00011 * your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, but 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00015 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00016 * License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with this library; if not, write to the Free Software Foundation, 00020 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 00021 * 00022 * svn info: 00023 * $Author: morongo $ 00024 * $HeadURL: https://jaula.svn.sourceforge.net/svnroot/jaula/tags/jaula-1.4.0/jaula/jaula_value_object.h $ 00025 * $Id: jaula_value_object.h 45 2009-01-11 16:17:03Z morongo $ 00026 * $Revision: 45 $ 00027 */ 00028 00029 #ifndef _JAULA_VALUE_OBJECT_H_ 00030 #define _JAULA_VALUE_OBJECT_H_ 00031 00032 #include <map> 00033 00034 #include <jaula/jaula_name_duplicated.h> 00035 #include <jaula/jaula_value_complex.h> 00036 00041 namespace JAULA 00042 { // namespace JAULA 00043 00054 class Value_Object : public Value_Complex 00055 { // class Value_Object 00056 public: 00057 00069 typedef std::map<std::string, Value *> dataType; 00070 00077 Value_Object(void); 00078 00088 Value_Object(dataType const &data); 00089 00098 virtual ~Value_Object(); 00099 00103 dataType const &getData(void) const; 00104 00113 virtual void repr(std::ostream &ostr) const; 00114 00121 virtual bool empty(void) const; 00122 00128 virtual size_t size(void) const; 00129 00139 void set(dataType const &data); 00140 00154 virtual void set(Value const &origin) throw(Bad_Data_Type); 00155 00171 void insertItem(std::string const &name, Value const &item) 00172 throw(Name_Duplicated); 00173 00184 virtual void clear(void); 00185 00186 private: 00187 00191 dataType data_; 00192 }; // class Value_Object 00193 00194 } // namespace JAULA 00195 #endif 00196 00197 // EOF $Id: jaula_value_object.h 45 2009-01-11 16:17:03Z morongo $