| 168 | } |
| 169 | |
| 170 | void t_generator::generate_docstring_comment(ostream& out, |
| 171 | const string& comment_start, |
| 172 | const string& line_prefix, |
| 173 | const string& contents, |
| 174 | const string& comment_end) { |
| 175 | if (!comment_start.empty()) |
| 176 | indent(out) << comment_start; |
| 177 | stringstream docs(contents, ios_base::in); |
| 178 | while (!(docs.eof() || docs.fail())) { |
| 179 | char line[1024]; |
| 180 | docs.getline(line, 1024); |
| 181 | |
| 182 | if (strlen(line) > 0) { |
| 183 | indent(out) << line_prefix << line << '\n'; |
| 184 | } else if (line_prefix.empty()){ |
| 185 | out << '\n'; |
| 186 | } else if(!docs.eof()) { |
| 187 | indent(out) << line_prefix << '\n'; |
| 188 | } |
| 189 | } |
| 190 | if (!comment_end.empty()) |
| 191 | indent(out) << comment_end; |
| 192 | } |
| 193 | |
| 194 | void t_generator_registry::register_generator(t_generator_factory* factory) { |
| 195 | gen_map_t& the_map = get_generator_map(); |