From 0fe685ed570790468053082a2b47be188f2f5a6a Mon Sep 17 00:00:00 2001 From: tomoaki Date: Wed, 13 Jun 2012 02:14:59 +0900 Subject: [PATCH] [gcc] to_string.hpp gcc fixx --- roast/include/roast/lexical2/to_string.hpp | 172 +++++++++++++++-------------- 1 file changed, 88 insertions(+), 84 deletions(-) diff --git a/roast/include/roast/lexical2/to_string.hpp b/roast/include/roast/lexical2/to_string.hpp index 44022ff7..fd9b5f2b 100644 --- a/roast/include/roast/lexical2/to_string.hpp +++ b/roast/include/roast/lexical2/to_string.hpp @@ -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 -#include "roast/stream/string_stream.hpp" -#include "roast/stream/console_stream.hpp" - -namespace roast -{ - namespace lexical - { - ////////////////////////////////////////////////////////////////////////////////// - - // to_string() - template - ::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 - ::std::string& to_string(const Lexer &lexer, ::std::string& buffer) - { - return to_string(lexer, buffer, EmptyType()); - } - - // to_string() : No Buffer - template - ::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 - ::std::string to_string(const Lexer &lexer) - { - return to_string(lexer, EmptyType()); - } - - ////////////////////////////////////////////////////////////////////////////////// - - // print - template - void print(const Lexer &lexer, Param& param) - { - lexer.generate(::roast::stream::cout, param); - } - - template - void print(const Lexer &lexer) - { - print(lexer, EmptyType()); - } - - // println - template - void println(const Lexer &lexer, Param& param) - { - lexer.generate(::roast::stream::cout, param); - ::roast::stream::cout << '\n'; - } - - template - void println(const Lexer &lexer) - { - println(lexer, EmptyType()); - } - - ////////////////////////////////////////////////////////////////////////////////// - } -} - -#endif//__SFJP_ROAST__lexical2__to_string_HPP__ +// Roast+ License +/* +*/ +#ifndef __SFJP_ROAST__lexical2__to_string_HPP__ +#define __SFJP_ROAST__lexical2__to_string_HPP__ + +#include "roast/lexical2/lexical2_util.hpp" +#include +#include "roast/stream/string_stream.hpp" +#include "roast/stream/console_stream.hpp" + +namespace roast +{ + namespace lexical + { + ////////////////////////////////////////////////////////////////////////////////// + + // to_string() + template + ::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 + ::std::string& to_string(const Lexer &lexer, ::std::string& buffer) + { + EmptyType e; + return to_string(lexer, buffer, e); + } + + // to_string() : No Buffer + template + ::std::string to_string(const Lexer &lexer, Param& param) + { + ::std::string str; + return to_string(lexer, str, param); + } + + // to_string() : No Buffer, No Param + template + ::std::string to_string(const Lexer &lexer) + { + EmptyType e; + return to_string(lexer, e); + } + + ////////////////////////////////////////////////////////////////////////////////// + + // print + template + void print(const Lexer &lexer, Param& param) + { + lexer.generate(::roast::stream::cout, param); + } + + template + void print(const Lexer &lexer) + { + EmptyType e; + print(lexer, e); + } + + // println + template + void println(const Lexer &lexer, Param& param) + { + lexer.generate(::roast::stream::cout, param); + ::roast::stream::cout << '\n'; + } + + template + void println(const Lexer &lexer) + { + EmptyType e; + println(lexer, e); + } + + ////////////////////////////////////////////////////////////////////////////////// + } +} + +#endif//__SFJP_ROAST__lexical2__to_string_HPP__ -- 2.11.0