This is an automated email from the ASF dual-hosted git repository.

szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit a30037b945a783befc73fbd522f6df973b62fe92
Author: Martin Zink <[email protected]>
AuthorDate: Wed Mar 25 00:54:35 2026 +0100

    MINIFICPP-2751 Remove MinifiStatusToString before C Api is finalized
    
    Since these are well known static string literals we can omit this function 
from the C API, and let the consumers implement it if they require it.
    
    Closes #2140
    
    Signed-off-by: Marton Szasz <[email protected]>
---
 libminifi/src/minifi-c.cpp             | 15 ---------------
 minifi-api/include/minifi-c/minifi-c.h |  2 --
 minifi-api/minifi-c-api.def            |  1 -
 3 files changed, 18 deletions(-)

diff --git a/libminifi/src/minifi-c.cpp b/libminifi/src/minifi-c.cpp
index ebceb9f02..ba15ee0cf 100644
--- a/libminifi/src/minifi-c.cpp
+++ b/libminifi/src/minifi-c.cpp
@@ -403,21 +403,6 @@ int64_t MinifiOutputStreamWrite(MinifiOutputStream* 
stream, const char* data, si
   return 
gsl::narrow<int64_t>(reinterpret_cast<minifi::io::OutputStream*>(stream)->write(as_bytes(std::span(data,
 size))));
 }
 
-void MinifiStatusToString(MinifiStatus status, void(*cb)(void* user_ctx, 
MinifiStringView str), void* user_ctx) {
-  std::string message = [&] () -> std::string {
-    switch (status) {
-      case MINIFI_STATUS_SUCCESS: return "Success";
-      case MINIFI_STATUS_UNKNOWN_ERROR: return "Unknown error";
-      case MINIFI_STATUS_NOT_SUPPORTED_PROPERTY: return 
minifi::core::PropertyErrorCategory{}.message(static_cast<int>(minifi::core::PropertyErrorCode::NotSupportedProperty));
-      case MINIFI_STATUS_DYNAMIC_PROPERTIES_NOT_SUPPORTED: return 
minifi::core::PropertyErrorCategory{}.message(static_cast<int>(minifi::core::PropertyErrorCode::DynamicPropertiesNotSupported));
-      case MINIFI_STATUS_PROPERTY_NOT_SET: return 
minifi::core::PropertyErrorCategory{}.message(static_cast<int>(minifi::core::PropertyErrorCode::PropertyNotSet));
-      case MINIFI_STATUS_VALIDATION_FAILED: return 
minifi::core::PropertyErrorCategory{}.message(static_cast<int>(minifi::core::PropertyErrorCode::ValidationFailed));
-      default: return "Unknown error";
-    }
-  }();
-  cb(user_ctx, MinifiStringView{.data = message.data(), .length = 
message.size()});
-}
-
 MinifiStatus MinifiFlowFileSetAttribute(MinifiProcessSession* session, 
MinifiFlowFile* flowfile, MinifiStringView attribute_name, const 
MinifiStringView* attribute_value) {
   gsl_Assert(session != MINIFI_NULL);
   gsl_Assert(flowfile != MINIFI_NULL);
diff --git a/minifi-api/include/minifi-c/minifi-c.h 
b/minifi-api/include/minifi-c/minifi-c.h
index 5be2bbb2f..484865546 100644
--- a/minifi-api/include/minifi-c/minifi-c.h
+++ b/minifi-api/include/minifi-c/minifi-c.h
@@ -213,8 +213,6 @@ size_t MinifiInputStreamSize(MinifiInputStream*);
 int64_t MinifiInputStreamRead(MinifiInputStream* stream, char* buffer, size_t 
size);
 int64_t MinifiOutputStreamWrite(MinifiOutputStream* stream, const char* data, 
size_t size);
 
-void MinifiStatusToString(MinifiStatus, void(*cb)(void* user_ctx, 
MinifiStringView str), void* user_ctx);
-
 MinifiStatus MinifiFlowFileSetAttribute(MinifiProcessSession* session, 
MinifiFlowFile* flowfile, MinifiStringView attribute_name, const 
MinifiStringView* attribute_value);
 MinifiBool MinifiFlowFileGetAttribute(MinifiProcessSession* session, 
MinifiFlowFile* flowfile, MinifiStringView attribute_name,
                                       void(*cb)(void* user_ctx, 
MinifiStringView attribute_value), void* user_ctx);
diff --git a/minifi-api/minifi-c-api.def b/minifi-api/minifi-c-api.def
index ee225e7c1..67802f40b 100644
--- a/minifi-api/minifi-c-api.def
+++ b/minifi-api/minifi-c-api.def
@@ -18,7 +18,6 @@ EXPORTS
   MinifiInputStreamSize
   MinifiInputStreamRead
   MinifiOutputStreamWrite
-  MinifiStatusToString
   MinifiFlowFileSetAttribute
   MinifiFlowFileGetAttribute
   MinifiFlowFileGetAttributes
\ No newline at end of file

Reply via email to