OSDN Git Service

[gcc] to_string.hpp gcc fixx
authortomoaki <tomoaki@edge-vpc-debian6.yahagi>
Tue, 12 Jun 2012 17:14:59 +0000 (02:14 +0900)
committertomoaki <tomoaki@edge-vpc-debian6.yahagi>
Tue, 12 Jun 2012 17:14:59 +0000 (02:14 +0900)
roast/include/roast/lexical2/to_string.hpp

index 44022ff..fd9b5f2 100644 (file)
@@ -1,84 +1,88 @@
-//     Roast+ License
-/*
-*/
-#ifndef __SFJP_ROAST__lexical2__to_string_HPP__
-#define __SFJP_ROAST__lexical2__to_string_HPP__
-
-#include "roast/lexical2/lexical2_util.hpp"
-#include <string>
-#include "roast/stream/string_stream.hpp"
-#include "roast/stream/console_stream.hpp"
-
-namespace roast
-{
-       namespace lexical
-       {
-               //////////////////////////////////////////////////////////////////////////////////
-               
-               //      to_string()
-               template <typename Lexer, typename Param>
-               ::std::string& to_string(const Lexer &lexer, ::std::string& buffer, Param& param)
-               {
-                       ::roast::string_output_stream sos(buffer);
-
-                       //if ( r.generate(sos,doc) == false )
-                       lexer.generate(sos, param);
-                       return buffer;
-               }
-               
-               //      to_string() : No Param
-               template <typename Lexer>
-               ::std::string& to_string(const Lexer &lexer, ::std::string& buffer)
-               {
-                       return to_string(lexer, buffer, EmptyType());
-               }
-               
-               //      to_string() : No Buffer
-               template <typename Lexer, typename Param>
-               ::std::string to_string(const Lexer &lexer, Param& param = EmptyType())
-               {
-                       ::std::string str;
-                       return to_string(lexer, str, param);
-               }
-               
-               //      to_string() : No Buffer, No Param
-               template <typename Lexer>
-               ::std::string to_string(const Lexer &lexer)
-               {
-                       return to_string(lexer, EmptyType());
-               }
-               
-               //////////////////////////////////////////////////////////////////////////////////
-
-               //      print
-               template <typename Lexer, typename Param>
-               void print(const Lexer &lexer, Param& param)
-               {
-                       lexer.generate(::roast::stream::cout, param);
-               }
-
-               template <typename Lexer>
-               void print(const Lexer &lexer)
-               {
-                       print(lexer, EmptyType());
-               }
-               
-               //      println
-               template <typename Lexer, typename Param>
-               void println(const Lexer &lexer, Param& param)
-               {
-                       lexer.generate(::roast::stream::cout, param);
-                       ::roast::stream::cout << '\n';
-               }
-
-               template <typename Lexer>
-               void println(const Lexer &lexer)
-               {
-                       println(lexer, EmptyType());
-               }
-               
-               //////////////////////////////////////////////////////////////////////////////////
-       }
-}
-
-#endif//__SFJP_ROAST__lexical2__to_string_HPP__
+//     Roast+ License\r
+/*\r
+*/\r
+#ifndef __SFJP_ROAST__lexical2__to_string_HPP__\r
+#define __SFJP_ROAST__lexical2__to_string_HPP__\r
+\r
+#include "roast/lexical2/lexical2_util.hpp"\r
+#include <string>\r
+#include "roast/stream/string_stream.hpp"\r
+#include "roast/stream/console_stream.hpp"\r
+\r
+namespace roast\r
+{\r
+       namespace lexical\r
+       {\r
+               //////////////////////////////////////////////////////////////////////////////////\r
+               \r
+               //      to_string()\r
+               template <typename Lexer, typename Param>\r
+               ::std::string& to_string(const Lexer &lexer, ::std::string& buffer, Param& param)\r
+               {\r
+                       ::roast::string_output_stream sos(buffer);\r
+\r
+                       //if ( r.generate(sos,doc) == false )\r
+                       lexer.generate(sos, param);\r
+                       return buffer;\r
+               }\r
+               \r
+               //      to_string() : No Param\r
+               template <typename Lexer>\r
+               ::std::string& to_string(const Lexer &lexer, ::std::string& buffer)\r
+               {\r
+                       EmptyType e;\r
+                       return to_string(lexer, buffer, e);\r
+               }\r
+               \r
+               //      to_string() : No Buffer\r
+               template <typename Lexer, typename Param>\r
+               ::std::string to_string(const Lexer &lexer, Param& param)\r
+               {\r
+                       ::std::string str;\r
+                       return to_string(lexer, str, param);\r
+               }\r
+               \r
+               //      to_string() : No Buffer, No Param\r
+               template <typename Lexer>\r
+               ::std::string to_string(const Lexer &lexer)\r
+               {\r
+                       EmptyType e;\r
+                       return to_string(lexer, e);\r
+               }\r
+               \r
+               //////////////////////////////////////////////////////////////////////////////////\r
+\r
+               //      print\r
+               template <typename Lexer, typename Param>\r
+               void print(const Lexer &lexer, Param& param)\r
+               {\r
+                       lexer.generate(::roast::stream::cout, param);\r
+               }\r
+\r
+               template <typename Lexer>\r
+               void print(const Lexer &lexer)\r
+               {\r
+                       EmptyType e;\r
+                       print(lexer, e);\r
+               }\r
+               \r
+               //      println\r
+               template <typename Lexer, typename Param>\r
+               void println(const Lexer &lexer, Param& param)\r
+               {\r
+                       lexer.generate(::roast::stream::cout, param);\r
+                       ::roast::stream::cout << '\n';\r
+               }\r
+\r
+               template <typename Lexer>\r
+               void println(const Lexer &lexer)\r
+               {\r
+                       EmptyType e;\r
+                       println(lexer, e);\r
+               }\r
+               \r
+               //////////////////////////////////////////////////////////////////////////////////\r
+       }\r
+}\r
+\r
+#endif//__SFJP_ROAST__lexical2__to_string_HPP__\r