From: Jens Geyer Date: Fri, 4 Jan 2013 18:33:29 +0000 (+0100) Subject: THRIFT-1815 Code generators line buffer output X-Git-Tag: 0.9.1~209 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=945537c1fc88ae27ac8231d423927fb7b40d10a6;p=common%2Fthrift.git THRIFT-1815 Code generators line buffer output Patch: Andrew Gaul --- diff --git a/compiler/cpp/src/generate/t_as3_generator.cc b/compiler/cpp/src/generate/t_as3_generator.cc index 05514f15..9f72eaca 100644 --- a/compiler/cpp/src/generate/t_as3_generator.cc +++ b/compiler/cpp/src/generate/t_as3_generator.cc @@ -29,8 +29,15 @@ #include "platform.h" #include "t_oop_generator.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * AS3 code generator. diff --git a/compiler/cpp/src/generate/t_c_glib_generator.cc b/compiler/cpp/src/generate/t_c_glib_generator.cc index bdee1bf9..8012770f 100644 --- a/compiler/cpp/src/generate/t_c_glib_generator.cc +++ b/compiler/cpp/src/generate/t_c_glib_generator.cc @@ -31,7 +31,14 @@ #include "platform.h" #include "t_oop_generator.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /* forward declarations */ string initial_caps_to_underscores(string name); diff --git a/compiler/cpp/src/generate/t_cocoa_generator.cc b/compiler/cpp/src/generate/t_cocoa_generator.cc index 3a7e2c14..c4265f74 100644 --- a/compiler/cpp/src/generate/t_cocoa_generator.cc +++ b/compiler/cpp/src/generate/t_cocoa_generator.cc @@ -27,8 +27,15 @@ #include #include "t_oop_generator.h" #include "platform.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * Objective-C code generator. diff --git a/compiler/cpp/src/generate/t_cpp_generator.cc b/compiler/cpp/src/generate/t_cpp_generator.cc index a4957417..d75b7de5 100644 --- a/compiler/cpp/src/generate/t_cpp_generator.cc +++ b/compiler/cpp/src/generate/t_cpp_generator.cc @@ -33,8 +33,14 @@ #include "platform.h" #include "t_oop_generator.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostream; +using std::string; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * C++ code generator. This is legitimacy incarnate. diff --git a/compiler/cpp/src/generate/t_csharp_generator.cc b/compiler/cpp/src/generate/t_csharp_generator.cc index 31e4d0b2..6dc86051 100644 --- a/compiler/cpp/src/generate/t_csharp_generator.cc +++ b/compiler/cpp/src/generate/t_csharp_generator.cc @@ -32,8 +32,15 @@ #include "platform.h" #include "t_oop_generator.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes class t_csharp_generator : public t_oop_generator { diff --git a/compiler/cpp/src/generate/t_d_generator.cc b/compiler/cpp/src/generate/t_d_generator.cc index db5e17fd..58dbb9aa 100644 --- a/compiler/cpp/src/generate/t_d_generator.cc +++ b/compiler/cpp/src/generate/t_d_generator.cc @@ -34,8 +34,16 @@ #include "platform.h" #include "t_oop_generator.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostream; +using std::ostringstream; +using std::set; +using std::string; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * D code generator. diff --git a/compiler/cpp/src/generate/t_delphi_generator.cc b/compiler/cpp/src/generate/t_delphi_generator.cc index c7a11072..6010a7d3 100644 --- a/compiler/cpp/src/generate/t_delphi_generator.cc +++ b/compiler/cpp/src/generate/t_delphi_generator.cc @@ -35,8 +35,15 @@ #include "platform.h" #include "t_oop_generator.h" -using namespace std; - +using std::map; +using std::ofstream; +using std::ostream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes class t_delphi_generator : public t_oop_generator { diff --git a/compiler/cpp/src/generate/t_erl_generator.cc b/compiler/cpp/src/generate/t_erl_generator.cc index 324b1dab..ae1a1221 100644 --- a/compiler/cpp/src/generate/t_erl_generator.cc +++ b/compiler/cpp/src/generate/t_erl_generator.cc @@ -30,8 +30,15 @@ #include "platform.h" #include "version.h" -using namespace std; - +using std::map; +using std::ofstream; +using std::ostream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const std::string endl = "\n"; // avoid ostream << std::endl flushes /** * Erlang code generator. diff --git a/compiler/cpp/src/generate/t_go_generator.cc b/compiler/cpp/src/generate/t_go_generator.cc index cb54ba66..0b9f16e9 100644 --- a/compiler/cpp/src/generate/t_go_generator.cc +++ b/compiler/cpp/src/generate/t_go_generator.cc @@ -31,8 +31,14 @@ #include "platform.h" #include "version.h" -using namespace std; - +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * Go code generator. diff --git a/compiler/cpp/src/generate/t_hs_generator.cc b/compiler/cpp/src/generate/t_hs_generator.cc index f2752618..bbfaba56 100644 --- a/compiler/cpp/src/generate/t_hs_generator.cc +++ b/compiler/cpp/src/generate/t_hs_generator.cc @@ -31,7 +31,14 @@ #include "platform.h" #include "version.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * Haskell code generator. diff --git a/compiler/cpp/src/generate/t_html_generator.cc b/compiler/cpp/src/generate/t_html_generator.cc index 6838706d..fb319ace 100644 --- a/compiler/cpp/src/generate/t_html_generator.cc +++ b/compiler/cpp/src/generate/t_html_generator.cc @@ -29,8 +29,16 @@ #include "t_generator.h" #include "t_html_generator.h" #include "platform.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostringstream; +using std::pair; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes enum input_type { INPUT_UNKNOWN, INPUT_UTF8, INPUT_PLAIN }; diff --git a/compiler/cpp/src/generate/t_java_generator.cc b/compiler/cpp/src/generate/t_java_generator.cc index aa7f843c..2f31a373 100644 --- a/compiler/cpp/src/generate/t_java_generator.cc +++ b/compiler/cpp/src/generate/t_java_generator.cc @@ -29,8 +29,15 @@ #include "platform.h" #include "t_oop_generator.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * Java code generator. diff --git a/compiler/cpp/src/generate/t_javame_generator.cc b/compiler/cpp/src/generate/t_javame_generator.cc index 00503e15..aa847ac9 100644 --- a/compiler/cpp/src/generate/t_javame_generator.cc +++ b/compiler/cpp/src/generate/t_javame_generator.cc @@ -29,8 +29,15 @@ #include "platform.h" #include "t_oop_generator.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * Java code generator. diff --git a/compiler/cpp/src/generate/t_js_generator.cc b/compiler/cpp/src/generate/t_js_generator.cc index 2776cd42..bff64236 100644 --- a/compiler/cpp/src/generate/t_js_generator.cc +++ b/compiler/cpp/src/generate/t_js_generator.cc @@ -17,6 +17,7 @@ * under the License. */ +#include #include #include #include @@ -29,8 +30,14 @@ #include "platform.h" #include "version.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; +static const string endl = "\n"; // avoid ostream << std::endl flushes #include "t_oop_generator.h" diff --git a/compiler/cpp/src/generate/t_ocaml_generator.cc b/compiler/cpp/src/generate/t_ocaml_generator.cc index 39ddb825..8ee870f6 100644 --- a/compiler/cpp/src/generate/t_ocaml_generator.cc +++ b/compiler/cpp/src/generate/t_ocaml_generator.cc @@ -30,8 +30,15 @@ #include "platform.h" #include "version.h" -using namespace std; - +using std::ios; +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * OCaml code generator. diff --git a/compiler/cpp/src/generate/t_perl_generator.cc b/compiler/cpp/src/generate/t_perl_generator.cc index 7fdad333..a40f85bd 100644 --- a/compiler/cpp/src/generate/t_perl_generator.cc +++ b/compiler/cpp/src/generate/t_perl_generator.cc @@ -30,8 +30,14 @@ #include "platform.h" #include "version.h" -using namespace std; - +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * PERL code generator. diff --git a/compiler/cpp/src/generate/t_php_generator.cc b/compiler/cpp/src/generate/t_php_generator.cc index d728fbfd..ef8185dc 100644 --- a/compiler/cpp/src/generate/t_php_generator.cc +++ b/compiler/cpp/src/generate/t_php_generator.cc @@ -27,7 +27,15 @@ #include #include "t_oop_generator.h" #include "platform.h" -using namespace std; + +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes #define NSGLOBAL (nsglobal_.size() ? nsglobal_ : "") #define NSGLOBAL_A ("\\" + NSGLOBAL ) diff --git a/compiler/cpp/src/generate/t_py_generator.cc b/compiler/cpp/src/generate/t_py_generator.cc index 48e104f9..8f79c377 100644 --- a/compiler/cpp/src/generate/t_py_generator.cc +++ b/compiler/cpp/src/generate/t_py_generator.cc @@ -31,8 +31,14 @@ #include "platform.h" #include "version.h" -using namespace std; - +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * Python code generator. diff --git a/compiler/cpp/src/generate/t_rb_generator.cc b/compiler/cpp/src/generate/t_rb_generator.cc index 94718602..082f3163 100644 --- a/compiler/cpp/src/generate/t_rb_generator.cc +++ b/compiler/cpp/src/generate/t_rb_generator.cc @@ -36,7 +36,14 @@ #include "platform.h" #include "version.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * A subclass of std::ofstream that includes indenting functionality. diff --git a/compiler/cpp/src/generate/t_st_generator.cc b/compiler/cpp/src/generate/t_st_generator.cc index 18e8a3b0..32ffd88a 100644 --- a/compiler/cpp/src/generate/t_st_generator.cc +++ b/compiler/cpp/src/generate/t_st_generator.cc @@ -36,8 +36,14 @@ #include "t_oop_generator.h" #include "version.h" -using namespace std; - +using std::map; +using std::ofstream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * Smalltalk code generator. diff --git a/compiler/cpp/src/generate/t_xsd_generator.cc b/compiler/cpp/src/generate/t_xsd_generator.cc index 923ec705..ef00e51f 100644 --- a/compiler/cpp/src/generate/t_xsd_generator.cc +++ b/compiler/cpp/src/generate/t_xsd_generator.cc @@ -26,8 +26,16 @@ #include #include "t_generator.h" #include "platform.h" -using namespace std; +using std::map; +using std::ofstream; +using std::ostream; +using std::ostringstream; +using std::string; +using std::stringstream; +using std::vector; + +static const string endl = "\n"; // avoid ostream << std::endl flushes /** * XSD generator, creates an XSD for the base types etc.