szaszm commented on code in PR #2232:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2232#discussion_r3728419145
##########
extension-framework/include/utils/ProcessorConfigUtils.h:
##########
@@ -55,6 +55,18 @@ inline int64_t parseI64Property(const core::ProcessContext&
ctx, const core::Pro
| orThrow(fmt::format("Expected parsable int64_t from \"{}\"",
property.name));
}
+inline double parseF64Property(const core::ProcessContext& ctx, const
core::PropertyReference& property, const core::FlowFile* flow_file = nullptr) {
+ return ctx.getProperty(property.name, flow_file)
+ | andThen(parsing::parseFloatingPoint<double>)
+ | orThrow(fmt::format("Expected parsable double from \"{}\"",
property.name));
Review Comment:
```suggestion
| andThen(parsing::parseFloatingPoint<double>)
| orThrow(fmt::format("Expected parsable double from \"{}\"",
property.name));
```
##########
extension-framework/include/utils/ProcessorConfigUtils.h:
##########
@@ -55,6 +55,18 @@ inline int64_t parseI64Property(const core::ProcessContext&
ctx, const core::Pro
| orThrow(fmt::format("Expected parsable int64_t from \"{}\"",
property.name));
}
+inline double parseF64Property(const core::ProcessContext& ctx, const
core::PropertyReference& property, const core::FlowFile* flow_file = nullptr) {
+ return ctx.getProperty(property.name, flow_file)
+ | andThen(parsing::parseFloatingPoint<double>)
+ | orThrow(fmt::format("Expected parsable double from \"{}\"",
property.name));
+}
+
+inline float parseF32Property(const core::ProcessContext& ctx, const
core::PropertyReference& property, const core::FlowFile* flow_file = nullptr) {
+ return ctx.getProperty(property.name, flow_file)
+ | andThen(parsing::parseFloatingPoint<float>)
+ | orThrow(fmt::format("Expected parsable float from \"{}\"", property.name));
Review Comment:
```suggestion
| andThen(parsing::parseFloatingPoint<float>)
| orThrow(fmt::format("Expected parsable float from \"{}\"",
property.name));
```
--
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]