OSDN Git Service

base_stream.hpp: write(c) バグってたので直し
authorMyun2 <myun2@nwhite.info>
Thu, 24 May 2012 07:23:13 +0000 (16:23 +0900)
committerMyun2 <myun2@nwhite.info>
Thu, 24 May 2012 07:23:13 +0000 (16:23 +0900)
roast/include/roast/stream/base_stream.hpp
roast/include/roast/stream/string_stream.hpp

index 7be09e7..2695a11 100644 (file)
@@ -77,15 +77,15 @@ namespace roast
                                int ret = write(p, size);
                                if ( ret != size )
                                {
-                                       throw ostream_exception("ostream: write error.", p, size, ret);
+                                       throw ostream_exception("roast::ostream_base::_write(const void*, size): write size is not match.", p, size, ret);
                                }
                                return ret;
                        }
                        int _write(char c){
                                int ret = write(c);
-                               if ( c != 1 )
+                               if ( ret != 1 )
                                {
-                                       throw ostream_exception("ostream: write error.");
+                                       throw ostream_exception("roast::ostream_base::_write(char): write size is not 1.");
                                }
                                return ret;
                        }
index b7bd509..efe5189 100644 (file)
@@ -17,6 +17,9 @@ namespace roast
                private:
                        ::std::string m_strbuf;
                        ::std::string &m_ref;
+               
+               public:
+                       static const char* class_name;
                public:
                        string_output_stream() : m_ref(m_strbuf) {}
                        string_output_stream(::std::string &s) : m_ref(s) {}
@@ -45,6 +48,8 @@ namespace roast
                                return m_ref;
                        }
                };
+               
+               const char* string_output_stream::class_name = "string_output_stream";
        }
        using stream::string_output_stream;
 }