THRIFT-1815 Code generators line buffer output
authorJens Geyer <jensg@apache.org>
Fri, 4 Jan 2013 18:33:29 +0000 (19:33 +0100)
committerJens Geyer <jensg@apache.org>
Fri, 4 Jan 2013 18:33:29 +0000 (19:33 +0100)
Patch: Andrew Gaul

21 files changed:
compiler/cpp/src/generate/t_as3_generator.cc
compiler/cpp/src/generate/t_c_glib_generator.cc
compiler/cpp/src/generate/t_cocoa_generator.cc
compiler/cpp/src/generate/t_cpp_generator.cc
compiler/cpp/src/generate/t_csharp_generator.cc
compiler/cpp/src/generate/t_d_generator.cc
compiler/cpp/src/generate/t_delphi_generator.cc
compiler/cpp/src/generate/t_erl_generator.cc
compiler/cpp/src/generate/t_go_generator.cc
compiler/cpp/src/generate/t_hs_generator.cc
compiler/cpp/src/generate/t_html_generator.cc
compiler/cpp/src/generate/t_java_generator.cc
compiler/cpp/src/generate/t_javame_generator.cc
compiler/cpp/src/generate/t_js_generator.cc
compiler/cpp/src/generate/t_ocaml_generator.cc
compiler/cpp/src/generate/t_perl_generator.cc
compiler/cpp/src/generate/t_php_generator.cc
compiler/cpp/src/generate/t_py_generator.cc
compiler/cpp/src/generate/t_rb_generator.cc
compiler/cpp/src/generate/t_st_generator.cc
compiler/cpp/src/generate/t_xsd_generator.cc

index 05514f1..9f72eac 100644 (file)
 
 #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.
index bdee1bf..8012770 100644 (file)
 #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);
index 3a7e2c1..c4265f7 100644 (file)
 #include <sstream>
 #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.
index a495741..d75b7de 100644 (file)
 
 #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.
index 31e4d0b..6dc8605 100644 (file)
 
 #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
 {
index db5e17f..58dbb9a 100644 (file)
 
 #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.
index c7a1107..6010a7d 100644 (file)
 #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
 {
index 324b1da..ae1a122 100644 (file)
 #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.
index cb54ba6..0b9f16e 100644 (file)
 #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.
index f275261..bbfaba5 100644 (file)
 #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.
index 6838706..fb319ac 100644 (file)
 #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 };
 
index aa7f843..2f31a37 100644 (file)
 
 #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.
index 00503e1..aa847ac 100644 (file)
 
 #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.
index 2776cd4..bff6423 100644 (file)
@@ -17,6 +17,7 @@
  * under the License.
  */
 
+#include <map>
 #include <string>
 #include <fstream>
 #include <iostream>
 #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"
 
index 39ddb82..8ee870f 100644 (file)
 #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.
index 7fdad33..a40f85b 100644 (file)
 #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.
index d728fbf..ef8185d 100644 (file)
 #include <sstream>
 #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 )
index 48e104f..8f79c37 100644 (file)
 #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.
index 9471860..082f316 100644 (file)
 #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.
index 18e8a3b..32ffd88 100644 (file)
 #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.
index 923ec70..ef00e51 100644 (file)
 #include <sstream>
 #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.