szaszm commented on code in PR #2182:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2182#discussion_r3275198376
##########
minifi_main/AgentDocs.cpp:
##########
@@ -315,4 +339,19 @@ void AgentDocs::generate(const std::filesystem::path&
docs_dir) {
ModularDocumentation::write(docs_dir);
}
+void AgentDocs::generateManifest() {
+ auto all_components = Components{};
+ for (const auto& components :
minifi::ClassDescriptionRegistry::getClassDescriptions() | std::views::values) {
+ std::ranges::copy(components.processors,
std::back_inserter(all_components.processors));
+ std::ranges::copy(components.controller_services,
std::back_inserter(all_components.controller_services));
+ std::ranges::copy(components.parameter_providers,
std::back_inserter(all_components.parameter_providers));
+ std::ranges::copy(components.other_components,
std::back_inserter(all_components.other_components));
+ }
+
+ sortComponents(all_components);
+ auto serialized =
minifi::state::response::serializeComponentManifest(all_components);
+ for (const auto& ser : serialized) {
+ std::cout << ser.to_pretty_string() << std::endl;
Review Comment:
`std::endl` starts a new line and flushes the stream. Flushing is rarely
required, it's just a bad habit developed through countless low quality
tutorials and learning resources, similar to `using namespace std;`.
```suggestion
std::cout << ser.to_pretty_string() << '\n';
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]