[svn] commit: r2123 - in /branches/trac172/src/lib/cc: data.cc data.h

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Jun 16 08:41:42 UTC 2010


Author: jelte
Date: Wed Jun 16 08:41:42 2010
New Revision: 2123

Log:
changed stringstream argument in toJSON to the more general ostream

Modified:
    branches/trac172/src/lib/cc/data.cc
    branches/trac172/src/lib/cc/data.h

Modified: branches/trac172/src/lib/cc/data.cc
==============================================================================
--- branches/trac172/src/lib/cc/data.cc (original)
+++ branches/trac172/src/lib/cc/data.cc Wed Jun 16 08:41:42 2010
@@ -615,19 +615,19 @@
 // to JSON format
 
 void
-IntElement::toJSON(std::stringstream& ss)
+IntElement::toJSON(std::ostream& ss)
 {
     ss << intValue();
 }
 
 void
-DoubleElement::toJSON(std::stringstream& ss)
+DoubleElement::toJSON(std::ostream& ss)
 {
     ss << doubleValue();
 }
 
 void
-BoolElement::toJSON(std::stringstream& ss)
+BoolElement::toJSON(std::ostream& ss)
 {
     if (b) {
         ss << "true";
@@ -637,13 +637,13 @@
 }
 
 void
-NullElement::toJSON(std::stringstream& ss)
+NullElement::toJSON(std::ostream& ss)
 {
     ss << "null";
 }
 
 void
-StringElement::toJSON(std::stringstream& ss)
+StringElement::toJSON(std::ostream& ss)
 {
     ss << "\"";
     ss << stringValue();
@@ -651,7 +651,7 @@
 }
 
 void
-ListElement::toJSON(std::stringstream& ss)
+ListElement::toJSON(std::ostream& ss)
 {
     ss << "[ ";
 
@@ -667,7 +667,7 @@
 }
 
 void
-MapElement::toJSON(std::stringstream& ss)
+MapElement::toJSON(std::ostream& ss)
 {
     ss << "{ ";
 

Modified: branches/trac172/src/lib/cc/data.h
==============================================================================
--- branches/trac172/src/lib/cc/data.h (original)
+++ branches/trac172/src/lib/cc/data.h Wed Jun 16 08:41:42 2010
@@ -118,7 +118,7 @@
 
     /// Converts the Element to JSON format and appends it to
     /// the given stringstream.
-    virtual void toJSON(std::stringstream& ss) = 0;
+    virtual void toJSON(std::ostream& ss) = 0;
 
     /// \name Type-specific getters
     ///
@@ -355,7 +355,7 @@
     bool getValue(int& t) { t = i; return true; };
     using Element::setValue;
     bool setValue(const int v) { i = v; return true; };
-    void toJSON(std::stringstream& ss);
+    void toJSON(std::ostream& ss);
     bool equals(ElementPtr other);
 };
 
@@ -369,7 +369,7 @@
     bool getValue(double& t) { t = d; return true; };
     using Element::setValue;
     bool setValue(const double v) { d = v; return true; };
-    void toJSON(std::stringstream& ss);
+    void toJSON(std::ostream& ss);
     bool equals(ElementPtr other);
 };
 
@@ -383,14 +383,14 @@
     bool getValue(bool& t) { t = b; return true; };
     using Element::setValue;
     bool setValue(const bool v) { b = v; return true; };
-    void toJSON(std::stringstream& ss);
+    void toJSON(std::ostream& ss);
     bool equals(ElementPtr other);
 };
 
 class NullElement : public Element {
 public:
     NullElement() : Element(null) {};
-    void toJSON(std::stringstream& ss);
+    void toJSON(std::ostream& ss);
     bool equals(ElementPtr other);
 };
 
@@ -404,7 +404,7 @@
     bool getValue(std::string& t) { t = s; return true; };
     using Element::setValue;
     bool setValue(const std::string& v) { s = v; return true; };
-    void toJSON(std::stringstream& ss);
+    void toJSON(std::ostream& ss);
     bool equals(ElementPtr other);
 };
 
@@ -425,7 +425,7 @@
     void add(ElementPtr e) { l.push_back(e); };
     using Element::remove;
     void remove(int i) { l.erase(l.begin() + i); };
-    void toJSON(std::stringstream& ss);
+    void toJSON(std::ostream& ss);
     size_t size() { return l.size(); }
     bool equals(ElementPtr other);
 };
@@ -448,7 +448,7 @@
     using Element::remove;
     void remove(const std::string& s) { m.erase(s); }
     bool contains(const std::string& s) { return m.find(s) != m.end(); }
-    void toJSON(std::stringstream& ss);
+    void toJSON(std::ostream& ss);
     
     // we should name the two finds better...
     // find the element at id; raises TypeError if one of the




More information about the bind10-changes mailing list