Remove t_xsd_generator.h.
t_xsd_generator.h is no longer included anywhere, because
the XSD generator uses the new dynamic generator framework.
Therefore, we can collapse the class definition into the .cc file.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745235 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/Makefile.am b/compiler/cpp/Makefile.am
index 6b21c67..fe2a2d7 100644
--- a/compiler/cpp/Makefile.am
+++ b/compiler/cpp/Makefile.am
@@ -36,8 +36,7 @@
src/parse/t_const_value.h \
src/generate/t_generator.h \
src/generate/t_oop_generator.h \
- src/generate/t_php_generator.h \
- src/generate/t_xsd_generator.h
+ src/generate/t_php_generator.h
if THRIFT_GEN_cpp
thrift_SOURCES += src/generate/t_cpp_generator.cc
diff --git a/compiler/cpp/src/generate/t_xsd_generator.cc b/compiler/cpp/src/generate/t_xsd_generator.cc
index 6b02038..10c1556 100644
--- a/compiler/cpp/src/generate/t_xsd_generator.cc
+++ b/compiler/cpp/src/generate/t_xsd_generator.cc
@@ -4,13 +4,82 @@
// See accompanying file LICENSE or visit the Thrift site at:
// http://developers.facebook.com/thrift/
+#include <fstream>
+#include <iostream>
+#include <sstream>
+
#include <stdlib.h>
#include <sys/stat.h>
#include <sstream>
-#include "t_xsd_generator.h"
+#include "t_generator.h"
#include "platform.h"
using namespace std;
+
+/**
+ * XSD generator, creates an XSD for the base types etc.
+ *
+ * @author Mark Slee <mcslee@facebook.com>
+ */
+class t_xsd_generator : public t_generator {
+ public:
+ t_xsd_generator(
+ t_program* program,
+ const std::map<std::string, std::string>& parsed_options,
+ const std::string& option_string)
+ : t_generator(program)
+ {
+ out_dir_base_ = "gen-xsd";
+ }
+
+ virtual ~t_xsd_generator() {}
+
+ /**
+ * Init and close methods
+ */
+
+ void init_generator();
+ void close_generator();
+
+ /**
+ * Program-level generation functions
+ */
+
+ void generate_typedef(t_typedef* ttypedef);
+ void generate_enum(t_enum* tenum) {}
+
+ void generate_service(t_service* tservice);
+ void generate_struct(t_struct* tstruct);
+
+ private:
+
+ void generate_element(std::ostream& out, std::string name, t_type* ttype, t_struct* attrs=NULL, bool optional=false, bool nillable=false, bool list_element=false);
+
+ std::string ns(std::string in, std::string ns) {
+ return ns + ":" + in;
+ }
+
+ std::string xsd(std::string in) {
+ return ns(in, "xsd");
+ }
+
+ std::string type_name(t_type* ttype);
+ std::string base_type_name(t_base_type::t_base tbase);
+
+ /**
+ * Output xsd/php file
+ */
+ std::ofstream f_xsd_;
+ std::ofstream f_php_;
+
+ /**
+ * Output string stream
+ */
+ std::ostringstream s_xsd_types_;
+
+};
+
+
void t_xsd_generator::init_generator() {
// Make output directory
MKDIR(get_out_dir().c_str());
diff --git a/compiler/cpp/src/generate/t_xsd_generator.h b/compiler/cpp/src/generate/t_xsd_generator.h
deleted file mode 100644
index d2e4e4b..0000000
--- a/compiler/cpp/src/generate/t_xsd_generator.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2006- Facebook
-// Distributed under the Thrift Software License
-//
-// See accompanying file LICENSE or visit the Thrift site at:
-// http://developers.facebook.com/thrift/
-
-#ifndef T_XSD_GENERATOR_H
-#define T_XSD_GENERATOR_H
-
-#include <fstream>
-#include <iostream>
-#include <sstream>
-#include "t_generator.h"
-
-/**
- * XSD generator, creates an XSD for the base types etc.
- *
- * @author Mark Slee <mcslee@facebook.com>
- */
-class t_xsd_generator : public t_generator {
- public:
- t_xsd_generator(
- t_program* program,
- const std::map<std::string, std::string>& parsed_options,
- const std::string& option_string)
- : t_generator(program)
- {
- out_dir_base_ = "gen-xsd";
- }
-
- virtual ~t_xsd_generator() {}
-
- /**
- * Init and close methods
- */
-
- void init_generator();
- void close_generator();
-
- /**
- * Program-level generation functions
- */
-
- void generate_typedef(t_typedef* ttypedef);
- void generate_enum(t_enum* tenum) {}
-
- void generate_service(t_service* tservice);
- void generate_struct(t_struct* tstruct);
-
- private:
-
- void generate_element(std::ostream& out, std::string name, t_type* ttype, t_struct* attrs=NULL, bool optional=false, bool nillable=false, bool list_element=false);
-
- std::string ns(std::string in, std::string ns) {
- return ns + ":" + in;
- }
-
- std::string xsd(std::string in) {
- return ns(in, "xsd");
- }
-
- std::string type_name(t_type* ttype);
- std::string base_type_name(t_base_type::t_base tbase);
-
- /**
- * Output xsd/php file
- */
- std::ofstream f_xsd_;
- std::ofstream f_php_;
-
- /**
- * Output string stream
- */
- std::ostringstream s_xsd_types_;
-
-};
-
-#endif