From a92bf8266c04709bd5a3d0161513703c51859ebf Mon Sep 17 00:00:00 2001 From: randomdan Date: Thu, 17 Apr 2014 19:11:56 +0000 Subject: Support writing variable types to streams natively --- project2/common/variableType.cpp | 14 ++++++++++++++ project2/common/variableType.h | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/project2/common/variableType.cpp b/project2/common/variableType.cpp index b19d2fd..2902638 100644 --- a/project2/common/variableType.cpp +++ b/project2/common/variableType.cpp @@ -264,3 +264,17 @@ VariableType::isNull() const return (get()); } +std::basic_ostream & +operator<<(std::basic_ostream & s, const Null &) +{ + s << "(null)"; + return s; +} + +std::basic_ostream & +operator<<(std::basic_ostream & s, const Null &) +{ + s << "(null)"; + return s; +} + diff --git a/project2/common/variableType.h b/project2/common/variableType.h index 5bf4c53..f2a6890 100644 --- a/project2/common/variableType.h +++ b/project2/common/variableType.h @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -28,6 +29,9 @@ class Null { bool operator==(const Null &) const { return true; } }; +std::basic_ostream & operator<<(std::basic_ostream &, const Null &); +std::basic_ostream & operator<<(std::basic_ostream &, const Null &); + class Boolean { public: Boolean(bool v); -- cgit v1.2.3