#include "gats/object.h" #include "gats/integer.h" #include "gats/float.h" #include "gats/boolean.h" #include "gats/string.h" #include "gats/list.h" #include "gats/dictionary.h" #include Gats::Object::Object() { } Gats::Object::~Object() { } Gats::Object *Gats::Object::read( Bu::Stream &rIn ) { char buf; rIn.read( &buf, 1 ); Object *pObj = NULL; switch( buf ) { case 'i': pObj = new Gats::Integer(); break; case 's': pObj = new Gats::String(); break; case '0': case '1': pObj = new Gats::Boolean(); break; case 'l': pObj = new Gats::List(); break; case 'd': pObj = new Gats::Dictionary(); break; case 'f': pObj = new Gats::Float(); break; case 'e': return NULL; default: throw Bu::ExceptionBase("Invalid Gats type discovered: %c.", buf ); } pObj->read( rIn, buf ); return pObj; }