adamdebreceni commented on a change in pull request #955:
URL: https://github.com/apache/nifi-minifi-cpp/pull/955#discussion_r551217433



##########
File path: libminifi/include/core/TypedValues.h
##########
@@ -128,72 +130,35 @@ class DataSizeValue : public TransformableValue, public 
state::response::UInt64V
   }
 
 
-// Convert String to Integer
+  // Convert String to Integer
   template<typename T, typename std::enable_if<
       std::is_integral<T>::value>::type* = nullptr>
   static bool StringToInt(const std::string &input, T &output) {
-    if (input.size() == 0) {
+    static std::map<std::string, int64_t> unit_map{
+      {"B", 1},
+      {"K", 1_KB}, {"M", 1_MB}, {"G", 1_GB}, {"T", 1_TB}, {"P", 1_PB},
+      {"KB", 1_KiB}, {"MB", 1_MiB}, {"GB", 1_GiB}, {"TB", 1_TiB}, {"PB", 
1_PiB},

Review comment:
       this mapping is to preserve backwards compatibility, we should entertain 
the idea of moving to standardized units (i.e. K = 1000, Ki = 1024)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to