File tree 1 file changed +13
-2
lines changed
compiler/cpp/src/generate
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -130,9 +130,20 @@ class t_json_generator : public t_generator {
130
130
};
131
131
132
132
void t_json_generator::init_generator () {
133
- MKDIR ( get_out_dir (). c_str () );
133
+ string subdir = get_out_dir ();
134
134
135
- string f_json_name = get_out_dir () + program_->get_name () + " .json" ;
135
+ MKDIR (subdir.c_str ());
136
+
137
+ std::string dir = program_->get_namespace (" json" );
138
+ string::size_type loc;
139
+
140
+ while ((loc = dir.find (" ." )) != string::npos) {
141
+ subdir = subdir + underscore (dir.substr (0 , loc)) + " /" ;
142
+ MKDIR (subdir.c_str ());
143
+ dir = dir.substr (loc + 1 );
144
+ }
145
+
146
+ string f_json_name = subdir + program_->get_name () + " .json" ;
136
147
f_json_.open (f_json_name.c_str ());
137
148
138
149
// Merge all included programs into this one so we can output one big file.
You can’t perform that action at this time.
0 commit comments