diff options
Diffstat (limited to '')
-rw-r--r-- | src/object.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/object.cpp b/src/object.cpp index 9176b49..f5148ad 100644 --- a/src/object.cpp +++ b/src/object.cpp | |||
@@ -7,6 +7,7 @@ | |||
7 | #include "gats/list.h" | 7 | #include "gats/list.h" |
8 | #include "gats/dictionary.h" | 8 | #include "gats/dictionary.h" |
9 | 9 | ||
10 | #include <bu/formatter.h> | ||
10 | #include <bu/stream.h> | 11 | #include <bu/stream.h> |
11 | 12 | ||
12 | Gats::Object::Object() | 13 | Gats::Object::Object() |
@@ -61,3 +62,30 @@ Gats::Object *Gats::Object::read( Bu::Stream &rIn ) | |||
61 | return pObj; | 62 | return pObj; |
62 | } | 63 | } |
63 | 64 | ||
65 | Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Object &obj ) | ||
66 | { | ||
67 | switch( obj.getType() ) | ||
68 | { | ||
69 | case Gats::typeDictionary: | ||
70 | return f << dynamic_cast<const Gats::Dictionary &>(obj); | ||
71 | |||
72 | case Gats::typeList: | ||
73 | return f << dynamic_cast<const Gats::List &>(obj); | ||
74 | |||
75 | case Gats::typeString: | ||
76 | return f << dynamic_cast<const Gats::String &>(obj); | ||
77 | |||
78 | case Gats::typeInteger: | ||
79 | return f << dynamic_cast<const Gats::Integer &>(obj); | ||
80 | |||
81 | case Gats::typeFloat: | ||
82 | return f << dynamic_cast<const Gats::Float &>(obj); | ||
83 | |||
84 | case Gats::typeBoolean: | ||
85 | return f << dynamic_cast<const Gats::Boolean &>(obj); | ||
86 | |||
87 | default: | ||
88 | return f << "***ERROR: Bad Gats type***"; | ||
89 | } | ||
90 | } | ||
91 | |||