From d3c71827f87cc25a6469af5fd8f30e38454832e1 Mon Sep 17 00:00:00 2001 From: Jens Geyer Date: Tue, 28 May 2013 03:09:04 +0200 Subject: [PATCH] THRIFT-1977 C# compiler should generate constant files prefixed with thrift file name Patch: Deniss Afonin & Jens Geyer --- compiler/cpp/src/generate/t_csharp_generator.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/cpp/src/generate/t_csharp_generator.cc b/compiler/cpp/src/generate/t_csharp_generator.cc index a1041fd9..26f1bdf9 100644 --- a/compiler/cpp/src/generate/t_csharp_generator.cc +++ b/compiler/cpp/src/generate/t_csharp_generator.cc @@ -291,7 +291,7 @@ void t_csharp_generator::generate_consts(std::vector consts) { if (consts.empty()){ return; } - string f_consts_name = namespace_dir_ + "/Constants.cs"; + string f_consts_name = namespace_dir_ + '/' + program_name_ + ".Constants.cs"; ofstream f_consts; f_consts.open(f_consts_name.c_str()); @@ -302,7 +302,7 @@ void t_csharp_generator::generate_consts(std::vector consts) { start_csharp_namespace(f_consts); indent(f_consts) << - "public class Constants" << endl; + "public static class " << program_name_ << "Constants" << endl; scope_up(f_consts); vector::iterator c_iter; @@ -372,7 +372,7 @@ void t_csharp_generator::print_const_def_value(std::ofstream& out, string name, } void t_csharp_generator::print_const_constructor(std::ofstream& out, std::vector consts) { - indent(out) << "static Constants()" << endl; + indent(out) << "static " << program_name_ << "Constants()" << endl; scope_up(out); vector::iterator c_iter; for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) { -- 2.17.1