objreader.cc

Go to the documentation of this file.
00001 
00003 
00004 //
00005 // Copyright (c) 2005-2007 University of Southern California
00006 // Rob Peters <rjpeters at usc dot edu>
00007 //
00008 // created: Tue Nov  8 15:38:06 2005
00009 // commit: $Id: objreader.cc 10065 2007-04-12 05:54:56Z rjpeters $
00010 // $HeadURL: file:///lab/rjpeters/svnrepo/code/trunk/groovx/src/tcl-io/objreader.cc $
00011 //
00012 // --------------------------------------------------------------------
00013 //
00014 // This file is part of GroovX.
00015 //   [http://www.klab.caltech.edu/rjpeters/groovx/]
00016 //
00017 // GroovX is free software; you can redistribute it and/or modify it
00018 // under the terms of the GNU General Public License as published by
00019 // the Free Software Foundation; either version 2 of the License, or
00020 // (at your option) any later version.
00021 //
00022 // GroovX is distributed in the hope that it will be useful, but
00023 // WITHOUT ANY WARRANTY; without even the implied warranty of
00024 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00025 // General Public License for more details.
00026 //
00027 // You should have received a copy of the GNU General Public License
00028 // along with GroovX; if not, write to the Free Software Foundation,
00029 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00030 //
00032 
00033 #ifndef GROOVX_TCL_IO_OBJREADER_CC_UTC20051108233806_DEFINED
00034 #define GROOVX_TCL_IO_OBJREADER_CC_UTC20051108233806_DEFINED
00035 
00036 #include "tcl-io/objreader.h"
00037 
00038 #include "io/io.h"
00039 #include "nub/ref.h"
00040 #include "rutz/error.h"
00041 #include "rutz/trace.h"
00042 #include "rutz/value.h"
00043 #include "tcl/conversions.h"
00044 
00045 tcl::obj_reader::obj_reader(tcl::obj x)
00046   :
00047   m_obj(x)
00048 {
00049 GVX_TRACE("tcl::obj_reader::obj_reader");
00050 }
00051 
00052 tcl::obj_reader::~obj_reader() throw()
00053 {
00054 GVX_TRACE("tcl::obj_reader::~obj_reader");
00055 }
00056 
00057 io::version_id tcl::obj_reader::input_version_id()
00058 {
00059   throw rutz::error("not implemented", SRC_POS);
00060 }
00061 
00062 char tcl::obj_reader::read_char(const rutz::fstring& /*name*/)
00063 {
00064   return static_cast<char>(tcl::convert_to<int>(m_obj));
00065 }
00066 
00067 int tcl::obj_reader::read_int(const rutz::fstring& /*name*/)
00068 {
00069   return tcl::convert_to<int>(m_obj);
00070 }
00071 
00072 bool tcl::obj_reader::read_bool(const rutz::fstring& /*name*/)
00073 {
00074   return tcl::convert_to<bool>(m_obj);
00075 }
00076 
00077 double tcl::obj_reader::read_double(const rutz::fstring& /*name*/)
00078 {
00079   return tcl::convert_to<double>(m_obj);
00080 }
00081 
00082 void tcl::obj_reader::read_value_obj(const rutz::fstring& /*name*/,
00083                                      rutz::value& v)
00084 {
00085   v.set_string(tcl::convert_to<rutz::fstring>(m_obj));
00086 }
00087 
00088 void tcl::obj_reader::read_byte_array(const rutz::fstring& name,
00089                                       rutz::byte_array& data)
00090 {
00091   this->default_read_byte_array(name, data);
00092 }
00093 
00094 nub::ref<io::serializable>
00095 tcl::obj_reader::read_object(const rutz::fstring& /*name*/)
00096 {
00097   throw rutz::error("not implemented", SRC_POS);
00098 }
00099 
00100 nub::soft_ref<io::serializable>
00101 tcl::obj_reader::read_weak_object(const rutz::fstring& /*name*/)
00102 {
00103   throw rutz::error("not implemented", SRC_POS);
00104 }
00105 
00106 void tcl::obj_reader::read_owned_object(const rutz::fstring& /*name*/,
00107                                         nub::ref<io::serializable> /*obj*/)
00108 {
00109   throw rutz::error("not implemented", SRC_POS);
00110 }
00111 
00112 void tcl::obj_reader::read_base_class(const rutz::fstring& /*base_class_name*/,
00113                                       nub::ref<io::serializable> /*base_part*/)
00114 {
00115   throw rutz::error("not implemented", SRC_POS);
00116 }
00117 
00118 nub::ref<io::serializable>
00119 tcl::obj_reader::read_root(io::serializable* /*root*/)
00120 {
00121   throw rutz::error("not implemented", SRC_POS);
00122 }
00123 
00124 rutz::fstring tcl::obj_reader::read_string_impl(const rutz::fstring& /*name*/)
00125 {
00126   return tcl::convert_to<rutz::fstring>(m_obj);
00127 }
00128 
00129 static const char __attribute__((used)) vcid_groovx_tcl_io_objreader_cc_utc20051108233806[] = "$Id: objreader.cc 10065 2007-04-12 05:54:56Z rjpeters $ $HeadURL: file:
00130 #endif // !GROOVX_TCL_IO_OBJREADER_CC_UTC20051108233806DEFINED

The software described here is Copyright (c) 1998-2005, Rob Peters.
This page was generated Wed Dec 3 06:49:41 2008 by Doxygen version 1.5.5.