Generate a documentation comment, if available.
| 174 | |
| 175 | // Generate a documentation comment, if available. |
| 176 | void GenComment(const std::vector<std::string> &dc, std::string *code_ptr, |
| 177 | const CommentConfig *config, const char *prefix) { |
| 178 | if (dc.begin() == dc.end()) { |
| 179 | // Don't output empty comment blocks with 0 lines of comment content. |
| 180 | return; |
| 181 | } |
| 182 | |
| 183 | std::string &code = *code_ptr; |
| 184 | if (config != nullptr && config->first_line != nullptr) { |
| 185 | code += std::string(prefix) + std::string(config->first_line) + "\n"; |
| 186 | } |
| 187 | std::string line_prefix = |
| 188 | std::string(prefix) + |
| 189 | ((config != nullptr && config->content_line_prefix != nullptr) |
| 190 | ? config->content_line_prefix |
| 191 | : "///"); |
| 192 | for (auto it = dc.begin(); it != dc.end(); ++it) { |
| 193 | code += line_prefix + *it + "\n"; |
| 194 | } |
| 195 | if (config != nullptr && config->last_line != nullptr) { |
| 196 | code += std::string(prefix) + std::string(config->last_line) + "\n"; |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | template<typename T> |
| 201 | std::string FloatConstantGenerator::GenFloatConstantImpl( |
no test coverage detected