[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044871408


##
extensions/jni/jvm/JniReferenceObjects.h:
##
@@ -299,24 +278,26 @@ class JniSessionFactory : public core::WeakReference {
 }
   }
 
-  jobject getJavaReference() const {
+  [[nodiscard]] jobject getJavaReference() const {
 return java_object_;
   }
 
-  std::shared_ptr getServicer() const {
+  [[nodiscard]] std::shared_ptr getServicer() const {
 return servicer_;
   }
 
-  std::shared_ptr getFactory() const {
+  [[nodiscard]] std::shared_ptr getFactory() 
const {
 return factory_;
   }
 
   /**
*/
-  JniSession *addSession(std::shared_ptr session) {
+  JniSession *addSession(const std::shared_ptr& session) {
 std::lock_guard guard(session_mutex_);
 
-sessions_.erase(std::remove_if(sessions_.begin(), sessions_.end(), 
check_empty()), sessions_.end());
+const auto check_empty = [](const std::shared_ptr& session) { 
return session->prune(); };
+
+sessions_.erase(std::remove_if(sessions_.begin(), sessions_.end(), 
check_empty), sessions_.end());

Review Comment:
   good idea, I've simplified this and the empty() function in this file 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/1b8eb634cf2055efc79d7f49f780715c6730a6dc



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044842683


##
libminifi/test/unit/FileStreamTests.cpp:
##
@@ -301,32 +267,25 @@ TEST_CASE("Existing file read/write test") {
   stream.seek(0);
 }
 
-#if !defined(WIN32) || defined(USE_BOOST)
-// This could be simplified with C++17 std::filesystem
 TEST_CASE("Opening file without permission creates error logs") {
   TestController test_controller;
   auto dir = test_controller.createTempDirectory();
-  std::string path_to_permissionless_file(utils::file::concat_path(dir, 
"permissionless_file.txt"));
+  auto path_to_permissionless_file = dir / "permissionless_file.txt";
   {
 std::ofstream outfile(path_to_permissionless_file);
 outfile << "this file has been just created" << std::endl;
 outfile.close();
-#ifndef WIN32
 utils::file::FileUtils::set_permissions(path_to_permissionless_file, 0);
-#else
-boost::filesystem::permissions(path_to_permissionless_file, 
boost::filesystem::no_perms);
-#endif
   }
-  minifi::io::FileStream stream(path_to_permissionless_file, 0, false);
+  minifi::io::FileStream stream(path_to_permissionless_file, 0, true);

Review Comment:
   sure thing, 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/eb00f1b247b813448334cb1b9a019164e7e07b28#diff-c3a81806f45337794ecf51dd1a4507b18fd009557635c9775d29d1a5c77c7800R280



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044840784


##
extensions/sftp/tests/ListThenFetchSFTPTests.cpp:
##
@@ -121,7 +120,7 @@ class ListThenFetchSFTPTestsFixture {
 plan->setProperty(list_sftp, "Minimum File Size", "0 B");
 plan->setProperty(list_sftp, "Target System Timestamp Precision", 
"Seconds");
 plan->setProperty(list_sftp, "Remote Path", "nifi_test/");
-plan->setProperty(list_sftp, "State File", src_dir + "/state");
+plan->setProperty(list_sftp, "State File", src_dir.string() + "/state");

Review Comment:
   good idea, 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/eb00f1b247b813448334cb1b9a019164e7e07b28#diff-dfaf51b7f8862c8ffdda0f89bd11d14b8fa83ef70ba0d9e5e686acb1afa51e5fR123



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044839048


##
extensions/sftp/tests/PutSFTPTests.cpp:
##
@@ -244,7 +240,7 @@ TEST_CASE_METHOD(PutSFTPTestsFixture, "PutSFTP bad 
password", "[PutSFTP][authent
 }
 
 TEST_CASE_METHOD(PutSFTPTestsFixture, "PutSFTP public key authentication 
success", "[PutSFTP][authentication]") {
-  plan->setProperty(put, "Private Key Path", 
utils::file::concat_path(get_sftp_test_dir(), "resources/id_rsa"));
+  plan->setProperty(put, "Private Key Path", get_sftp_test_dir() / 
"resources/id_rsa");

Review Comment:
   I've changed these and the ones in ListSFTPTests in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/b7fce3d7cf85180b6054df874a0ad7b5b6f2e31e
   I havent changed the occurrences where the root is a string aswell (e.g. 
["nifi_test/tstFile.ext"](https://github.com/martinzink/nifi-minifi-cpp/blob/MINIFICPP-1862-2/extensions/sftp/tests/ListSFTPTests.cpp#L209),
 because I think that could hinder the readability and std::filesystem is 
capable to correctly parse those forward slashes even on windows, but I am 
curious about your opinion.



##
extensions/sftp/tests/ListSFTPTests.cpp:
##
@@ -187,7 +180,7 @@ TEST_CASE_METHOD(ListSFTPTestsFixture, "ListSFTP list one 
file", "[ListSFTP][bas
 
 TEST_CASE_METHOD(ListSFTPTestsFixture, "ListSFTP public key authentication", 
"[ListSFTP][basic]") {
   plan->setProperty(list_sftp, "Remote File", "nifi_test/tstFile.ext");
-  plan->setProperty(list_sftp, "Private Key Path", 
utils::file::FileUtils::concat_path(get_sftp_test_dir(), "resources/id_rsa"));
+  plan->setProperty(list_sftp, "Private Key Path", get_sftp_test_dir() / 
"resources/id_rsa");

Review Comment:
   I've changed these and the ones in PutSFTPTests in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/b7fce3d7cf85180b6054df874a0ad7b5b6f2e31e
   I havent changed the occurrences where the root is a string aswell (e.g. 
["nifi_test/tstFile.ext"](https://github.com/martinzink/nifi-minifi-cpp/blob/MINIFICPP-1862-2/extensions/sftp/tests/ListSFTPTests.cpp#L209),
 because I think that could hinder the readability and std::filesystem is 
capable to correctly parse those forward slashes even on windows, but I am 
curious about your opinion.



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044596070


##
extensions/sftp/tests/ListSFTPTests.cpp:
##
@@ -139,15 +139,8 @@ class ListSFTPTestsFixture {
 std::fstream file;
 std::stringstream ss;
 ss << src_dir << "/vfs/" << relative_path;
-auto full_path = ss.str();
-std::deque parent_dirs;
-std::string parent_dir = full_path;
-while (!(parent_dir = 
utils::file::FileUtils::get_parent_path(parent_dir)).empty()) {
-  parent_dirs.push_front(parent_dir);
-}
-for (const auto& dir : parent_dirs) {
-  utils::file::FileUtils::create_dir(dir);
-}
+std::filesystem::path full_path = ss.str();

Review Comment:
   Good idea changed this in 
[extensions/sftp/tests/ListSFTPTests.cpp](https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-ac90fb77395d946dce409066d0015e9308fb4151efdb0d2cc146edc1abfe1552R155)
 
[extensions/sftp/tests/ListThenFetchSFTPTests.cpp](https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-dfaf51b7f8862c8ffdda0f89bd11d14b8fa83ef70ba0d9e5e686acb1afa51e5fR191)
 



##
extensions/standard-processors/tests/unit/ProcessorTests.cpp:
##
@@ -197,10 +196,8 @@ TEST_CASE("Test GetFile Ignore", "[getfileCreate3]") {
   REQUIRE(record == nullptr);
   REQUIRE(records.empty());
 
-  const std::string hidden_file_name = [&] {
-std::stringstream ss;
-ss << dir << utils::file::FileUtils::get_separator() << 
".filewithoutanext";
-return ss.str();
+  const std::filesystem::path hidden_file_name = [&] {
+return dir / ".filewithoutanext";
   }();

Review Comment:
   :sweat_smile: 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-8caa2f65fe058d943caa4cd2c876226de0a63bea73ce1f7ffcb0550be1d7ed4fR199



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044593149


##
extensions/standard-processors/tests/unit/TailFileTests.cpp:
##
@@ -99,18 +89,16 @@ TEST_CASE("TailFile reads the file until the first 
delimiter", "[simple]") {
   plan->addProcessor("LogAttribute", "logattribute", 
core::Relationship("success", "description"), true);
 
   auto dir = testController.createTempDirectory();
-  std::stringstream temp_file;
-  temp_file << dir << utils::file::get_separator() << TMP_FILE;
+  auto temp_file_path = dir / TMP_FILE;
 
   std::ofstream tmpfile;
-  tmpfile.open(temp_file.str(), std::ios::out | std::ios::binary);
+  tmpfile.open(temp_file_path, std::ios::out | std::ios::binary);
   tmpfile << NEWLINE_FILE;
   tmpfile.close();
 
-  std::stringstream state_file;
-  state_file << dir << utils::file::get_separator() << STATE_FILE;
+  auto state_file_path = dir / STATE_FILE;

Review Comment:
   you are right :+1:  
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-0f2d0f56e01853fa6b0ed53098d1da12deaef25aca6b36c29ee8d3174a5556f5L99-L100



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044592592


##
libminifi/src/core/ProcessSessionReadCallback.cpp:
##
@@ -22,18 +22,19 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "core/logging/LoggerConfiguration.h"
 #include "utils/gsl.h"
 
 namespace org::apache::nifi::minifi::core {
 
-ProcessSessionReadCallback::ProcessSessionReadCallback(const std::string 
,
-   std::string destFile,
+ProcessSessionReadCallback::ProcessSessionReadCallback(std::filesystem::path 
tmpFile,
+   std::filesystem::path 
destFile,

std::shared_ptr logger)
 : logger_(std::move(logger)),
 _tmpFileOs(tmpFile, std::ios::binary),
-_tmpFile(tmpFile),
+_tmpFile(std::move(tmpFile)),
 _destFile(std::move(destFile)) {

Review Comment:
   sure thing, 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-80c661dbc9b1b934d1581bb3e000acad44a92a93a18726f09b1a6f85bae27d38R32-R38



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044592071


##
libminifi/test/rocksdb-tests/EncryptionTests.cpp:
##
@@ -77,8 +75,8 @@ TEST_CASE_METHOD(FFRepoFixture, "FlowFileRepository creates 
checkpoint and loads
 // pass
   }
   SECTION("With encryption") {
-utils::file::FileUtils::create_dir((home_ / "conf").str());
-std::ofstream{(home_ / "conf" / "bootstrap.conf").str()}
+utils::file::FileUtils::create_dir((home_ / "conf"));
+std::ofstream{(home_ / "conf" / "bootstrap.conf")}

Review Comment:
   you are right :+1:  
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-ec160d83c141c2946b29793ff7e36a270fcd74259377bc1615e408b95ef70065R79



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044591718


##
libminifi/test/rocksdb-tests/RocksDBTests.cpp:
##
@@ -232,9 +231,9 @@ void 
withDefaultEnv(minifi::internal::Writable& db_opts) {
 }
 
 TEST_CASE_METHOD(RocksDBTest, "Error is logged if different encryption keys 
are used", "[rocksDBTest10]") {
-  utils::Path home_dir{createTempDirectory()};
-  utils::file::FileUtils::create_dir((home_dir / "conf").str());
-  std::ofstream{(home_dir / "conf" / "bootstrap.conf").str()}
+  auto home_dir = createTempDirectory();
+  utils::file::FileUtils::create_dir((home_dir / "conf"));
+  std::ofstream{(home_dir / "conf" / "bootstrap.conf")}

Review Comment:
   :+1: fixed in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-8c2ecfdba8d618439b859597953f3011d805da3004421c49631fb947488b555fR236



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044590030


##
minifi_main/MainHelper.cpp:
##
@@ -133,43 +128,41 @@ std::string determineMinifiHome(const 
std::shared_ptr& logger)
 return "";
   }();
 
-  if (minifiHome.empty()) {
+  if (minifi_home.empty()) {
 logger->log_error("No " MINIFI_HOME_ENV_KEY " could be inferred. "
   "Please set " MINIFI_HOME_ENV_KEY " or run minifi from a 
valid location.");
 return "";
   }
 
   /* Verify that MINIFI_HOME is valid */
-  bool minifiHomeValid = false;
-  if (validHome(minifiHome)) {
-minifiHomeValid = true;
+  bool minifi_home_is_valid = false;
+  if (validHome(minifi_home)) {
+minifi_home_is_valid = true;
   } else {
-logger->log_info("%s is not a valid " MINIFI_HOME_ENV_KEY ", because there 
is no " DEFAULT_NIFI_PROPERTIES_FILE " file in it.", minifiHome);
-
-std::string minifiHomeWithoutBin;
-std::string binDir;
-std::tie(minifiHomeWithoutBin, binDir) = 
minifi::utils::file::split_path(minifiHome);
-if (!minifiHomeWithoutBin.empty() && (binDir == "bin" || binDir == 
std::string("bin") + minifi::utils::file::get_separator())) {
-  if (validHome(minifiHomeWithoutBin)) {
-logger->log_info("%s is a valid " MINIFI_HOME_ENV_KEY ", falling back 
to it.", minifiHomeWithoutBin);
-minifiHomeValid = true;
-minifiHome = std::move(minifiHomeWithoutBin);
+logger->log_info("%s is not a valid %s, because there is no %s file in 
it.", minifi_home.string(), MINIFI_HOME_ENV_KEY, 
DEFAULT_NIFI_PROPERTIES_FILE.string());
+
+auto minifi_home_without_bin = minifi_home.parent_path();
+auto bin_dir = minifi_home.filename();
+if (!minifi_home_without_bin.empty() && (bin_dir == 
std::filesystem::path("bin") || bin_dir == (std::filesystem::path("bin")/""))) {

Review Comment:
   makes sense, fixed it in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-4ceccfbc1ea6c4b068f7f198d1fc53d5650ec2c057f2145e5bf41040325262c0R146



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044589812


##
minifi_main/MainHelper.cpp:
##
@@ -133,43 +128,41 @@ std::string determineMinifiHome(const 
std::shared_ptr& logger)
 return "";
   }();
 
-  if (minifiHome.empty()) {
+  if (minifi_home.empty()) {
 logger->log_error("No " MINIFI_HOME_ENV_KEY " could be inferred. "
   "Please set " MINIFI_HOME_ENV_KEY " or run minifi from a 
valid location.");
 return "";
   }
 
   /* Verify that MINIFI_HOME is valid */
-  bool minifiHomeValid = false;
-  if (validHome(minifiHome)) {
-minifiHomeValid = true;
+  bool minifi_home_is_valid = false;
+  if (validHome(minifi_home)) {
+minifi_home_is_valid = true;
   } else {
-logger->log_info("%s is not a valid " MINIFI_HOME_ENV_KEY ", because there 
is no " DEFAULT_NIFI_PROPERTIES_FILE " file in it.", minifiHome);
-
-std::string minifiHomeWithoutBin;
-std::string binDir;
-std::tie(minifiHomeWithoutBin, binDir) = 
minifi::utils::file::split_path(minifiHome);
-if (!minifiHomeWithoutBin.empty() && (binDir == "bin" || binDir == 
std::string("bin") + minifi::utils::file::get_separator())) {
-  if (validHome(minifiHomeWithoutBin)) {
-logger->log_info("%s is a valid " MINIFI_HOME_ENV_KEY ", falling back 
to it.", minifiHomeWithoutBin);
-minifiHomeValid = true;
-minifiHome = std::move(minifiHomeWithoutBin);
+logger->log_info("%s is not a valid %s, because there is no %s file in 
it.", minifi_home.string(), MINIFI_HOME_ENV_KEY, 
DEFAULT_NIFI_PROPERTIES_FILE.string());
+
+auto minifi_home_without_bin = minifi_home.parent_path();
+auto bin_dir = minifi_home.filename();
+if (!minifi_home_without_bin.empty() && (bin_dir == 
std::filesystem::path("bin") || bin_dir == (std::filesystem::path("bin")/""))) {
+  if (validHome(minifi_home_without_bin)) {
+logger->log_info("%s is a valid %s, falling back to it.", 
minifi_home_without_bin.string());

Review Comment:
   good catch :+1: , fixed it in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-4ceccfbc1ea6c4b068f7f198d1fc53d5650ec2c057f2145e5bf41040325262c0R148



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044587720


##
libminifi/test/unit/FileStreamTests.cpp:
##
@@ -301,32 +267,25 @@ TEST_CASE("Existing file read/write test") {
   stream.seek(0);
 }
 
-#if !defined(WIN32) || defined(USE_BOOST)
-// This could be simplified with C++17 std::filesystem
 TEST_CASE("Opening file without permission creates error logs") {
   TestController test_controller;
   auto dir = test_controller.createTempDirectory();
-  std::string path_to_permissionless_file(utils::file::concat_path(dir, 
"permissionless_file.txt"));
+  auto path_to_permissionless_file = dir / "permissionless_file.txt";
   {
 std::ofstream outfile(path_to_permissionless_file);
 outfile << "this file has been just created" << std::endl;
 outfile.close();
-#ifndef WIN32
 utils::file::FileUtils::set_permissions(path_to_permissionless_file, 0);
-#else
-boost::filesystem::permissions(path_to_permissionless_file, 
boost::filesystem::no_perms);
-#endif
   }
-  minifi::io::FileStream stream(path_to_permissionless_file, 0, false);
+  minifi::io::FileStream stream(path_to_permissionless_file, 0, true);

Review Comment:
   It never worked on windows (with boost enabled), this is due to the fact 
that the test and (iirc filesystem::permissions aswell) only sets the old 
windows permissions (which doesnt have the concept of an unreadable file) so 
setting a file to permission  only sets the read-only flag on windows.
   
   So for the FileStream to fail due to permission issues we must try to write 
to it on windows.
   
   Maybe we could test the newer ACL permission model on windows aswell, but to 
be honest I am not sure if that worth the effort.



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044576534


##
libminifi/include/core/ConfigurableComponent.h:
##
@@ -59,6 +59,18 @@ class ConfigurableComponent {
   template
   bool getProperty(const std::string name, T ) const;
 
+  template
+  std::enable_if_t::value, std::optional>
+  getProperty(const std::string& property_name) const {

Review Comment:
   It would be nicer I agree, I tried 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-15b7e52fd974b055c6f71955af2eb1742390e7916dd98c549b9031a9c4b77e9bR62-R63
 but it turns out concepts on apple clang are only partially supported (source: 
https://en.cppreference.com/w/cpp/compiler_support), [here is the failed 
CI](https://github.com/martinzink/nifi-minifi-cpp/actions/runs/3647371508/jobs/6159525208)
 maybe with some time we could make it work :man_shrugging: , but I dont have 
macOS workstation and didnt want to put too much effort into this so I just 
reverted the change in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/a1a262a18fbfbdfd6cd0b3c6bf0dd53e94f4af87



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044570304


##
extensions/standard-processors/tests/unit/GenerateFlowFileTests.cpp:
##
@@ -57,9 +57,9 @@ TEST_CASE("GenerateFlowFileTest", "[generateflowfiletest]") {
 
   std::vector file_contents;
 
-  auto lambda = [_contents](const std::string& path, const std::string& 
filename) -> bool {
-std::ifstream is(path + utils::file::get_separator() + filename, 
std::ifstream::binary);
-file_contents.push_back(std::string((std::istreambuf_iterator(is)), 
std::istreambuf_iterator()));
+  auto lambda = [_contents](const std::filesystem::path& path, const 
std::filesystem::path& filename) -> bool {
+std::ifstream is(path / filename, std::ifstream::binary);
+file_contents.emplace_back((std::istreambuf_iterator(is)), 
std::istreambuf_iterator());

Review Comment:
   fixed them in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-5aa458ae662cf99a08e2c71b3db9668cff5b9343a864e20a16b19c37388e7bf6R62



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044569637


##
extensions/standard-processors/processors/GetFile.cpp:
##
@@ -154,36 +154,32 @@ void GetFile::onTrigger(core::ProcessContext* 
/*context*/, core::ProcessSession*
 return;
   }
 
-  std::queue list_of_file_names = pollListing(request_.batchSize);
+  std::queue list_of_file_names = 
pollListing(request_.batchSize);
   while (!list_of_file_names.empty()) {
-std::string file_name = list_of_file_names.front();
+auto file_name = list_of_file_names.front();
 list_of_file_names.pop();
 getSingleFile(*session, file_name);
   }
 }
 
-void GetFile::getSingleFile(core::ProcessSession& session, const std::string& 
file_name) const {
-  logger_->log_info("GetFile process %s", file_name);
+void GetFile::getSingleFile(core::ProcessSession& session, const 
std::filesystem::path& file_path) const {
+  logger_->log_info("GetFile process %s", file_path.string());
   auto flow_file = session.create();
   gsl_Expects(flow_file);
-  std::string path;
-  std::string name;
-  std::tie(path, name) = utils::file::split_path(file_name);
-  flow_file->setAttribute(core::SpecialFlowAttribute::FILENAME, name);
-  flow_file->setAttribute(core::SpecialFlowAttribute::PATH, path);
-  flow_file->addAttribute(core::SpecialFlowAttribute::ABSOLUTE_PATH, 
file_name);
+  flow_file->setAttribute(core::SpecialFlowAttribute::FILENAME, 
file_path.filename().string());
+  flow_file->setAttribute(core::SpecialFlowAttribute::PATH, 
(file_path.parent_path() / "").string());
+  flow_file->addAttribute(core::SpecialFlowAttribute::ABSOLUTE_PATH, 
file_path.string());
 
   try {
-session.write(flow_file, utils::FileReaderCallback{file_name});
+session.write(flow_file, utils::FileReaderCallback{file_path});
 session.transfer(flow_file, Success);
 if (!request_.keepSourceFile) {
-  auto remove_status = remove(file_name.c_str());
-  if (remove_status != 0) {
-logger_->log_error("GetFile could not delete file '%s', error %d: %s", 
file_name, errno, strerror(errno));
+  if (!std::filesystem::remove(file_path)) {
+logger_->log_error("GetFile could not delete file '%s', error %d: %s", 
file_path.string(), errno, strerror(errno));

Review Comment:
   Nope, that wasnt intentional, good thing you caught it. Fixed it in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-3f192172f343b26308cbdbb6f28836bcd8ca11f0484d3aa95450dde45970fa1fR175-R177



##
extensions/standard-processors/processors/TailFile.cpp:
##
@@ -530,21 +530,20 @@ bool 
TailFile::getStateFromStateManager(std::map _ta
 readOptionalInt64(state_map, "file." + std::to_string(i) + 
".last_read_time")
 }};
 
-std::string fileLocation;
-std::string fileName;
-if (utils::file::getFileNameAndPath(current, fileLocation, fileName)) {
-  logger_->log_debug("Received path %s, file %s", fileLocation, 
fileName);
-  new_tail_states.emplace(current, TailState{fileLocation, fileName, 
position, last_read_time, checksum});
+std::filesystem::path file_path = current;
+if (file_path.has_filename() && file_path.has_parent_path()) {
+  logger_->log_debug("Received path %s, file %s", 
file_path.parent_path().string(), file_path.filename().string());
+  new_tail_states.emplace(current, TailState{file_path.parent_path(), 
file_path.filename(), position, last_read_time, checksum});
 } else {
-  new_tail_states.emplace(current, TailState{fileLocation, current, 
position, last_read_time, checksum});
+  new_tail_states.emplace(current, TailState{file_path.parent_path(), 
current, position, last_read_time, checksum});

Review Comment:
   fixed it in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-16a8df4d25f85ca2144b3e61d418c99e06ffc578461f288db8d32cd02d45307dR550



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044566428


##
extensions/sftp/processors/FetchSFTP.cpp:
##
@@ -87,12 +87,11 @@ void FetchSFTP::onTrigger(const 
std::shared_ptr ,
 return;
   }
 
-  /* Parse processor-specific properties */
-  std::string remote_file;
-  std::string move_destination_directory;
-
-  context->getProperty(RemoteFile, remote_file, flow_file);
-  context->getProperty(MoveDestinationDirectory, move_destination_directory, 
flow_file);
+  std::string path_str;
+  context->getProperty(RemoteFile, path_str, flow_file);
+  auto remote_file = std::filesystem::path(path_str, 
std::filesystem::path::format::generic_format);
+  context->getProperty(MoveDestinationDirectory, path_str, flow_file);

Review Comment:
   great catch, reworked this in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-1681c2dbfafc5cbbb437de97c560fabdb639b547d6a368f3e65c8e6c5c03d3ecR90-R98



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044565861


##
extensions/script/tests/TestExecuteScriptProcessorWithPythonScript.cpp:
##
@@ -295,124 +291,119 @@ TEST_CASE("Python: Test Update Attribute", 
"[executescriptPythonUpdateAttribute]
 session.transfer(flow_file, REL_SUCCESS)
   )");
 
-  auto getFileDir = testController.createTempDirectory();
-  plan->setProperty(getFile, minifi::processors::GetFile::Directory.getName(), 
getFileDir);
+  auto get_file_dir = test_controller.createTempDirectory();
+  plan->setProperty(getFile, minifi::processors::GetFile::Directory.getName(), 
get_file_dir.string());
 
-  utils::putFileToDir(getFileDir, "tstFile.ext", "tempFile");
+  utils::putFileToDir(get_file_dir, "tstFile.ext", "tempFile");
 
-  testController.runSession(plan, false);
-  testController.runSession(plan, false);
-  testController.runSession(plan, false);
+  test_controller.runSession(plan, false);
+  test_controller.runSession(plan, false);
+  test_controller.runSession(plan, false);
 
   REQUIRE(LogTestController::getInstance().contains("key:test_attr value:2"));
 
-  logTestController.reset();
+  log_test_controller.reset();
 }
 
 TEST_CASE("Python: Test Get Context Property", 
"[executescriptPythonGetContextProperty]") {
-  TestController testController;
+  TestController test_controller;
 
-  LogTestController  = LogTestController::getInstance();
-  logTestController.setDebug();
-  logTestController.setDebug();
-  logTestController.setDebug();
+  LogTestController& log_test_controller = LogTestController::getInstance();
+  log_test_controller.setDebug();
+  log_test_controller.setDebug();
+  log_test_controller.setDebug();
 
-  auto plan = testController.createPlan();
+  auto plan = test_controller.createPlan();
 
-  auto getFile = plan->addProcessor("GetFile", "getFile");
-  auto executeScript = plan->addProcessor("ExecuteScript",
+  auto get_file = plan->addProcessor("GetFile", "getFile");
+  auto execute_script = plan->addProcessor("ExecuteScript",
   "executeScript",
   core::Relationship("success", 
"description"),
   true);
-  auto logAttribute = plan->addProcessor("LogAttribute", "logAttribute",
+  auto log_attribute = plan->addProcessor("LogAttribute", "logAttribute",
  core::Relationship("success", 
"description"),
  true);
 
-  plan->setProperty(executeScript, 
minifi::processors::ExecuteScript::ScriptBody.getName(), R"(
+  plan->setProperty(execute_script, 
minifi::processors::ExecuteScript::ScriptBody.getName(), R"(
 def onTrigger(context, session):
   script_engine = context.getProperty('Script Engine')
   log.info('got Script Engine property: %s' % script_engine)
   )");
 
-  auto getFileDir = testController.createTempDirectory();
-  plan->setProperty(getFile, minifi::processors::GetFile::Directory.getName(), 
getFileDir);
+  auto get_file_dir = test_controller.createTempDirectory();
+  plan->setProperty(get_file, 
minifi::processors::GetFile::Directory.getName(), get_file_dir.string());
 
-  utils::putFileToDir(getFileDir, "tstFile.ext", "tempFile");
+  utils::putFileToDir(get_file_dir, "tstFile.ext", "tempFile");
 
-  testController.runSession(plan, false);
-  testController.runSession(plan, false);
-  testController.runSession(plan, false);
+  test_controller.runSession(plan, false);
+  test_controller.runSession(plan, false);
+  test_controller.runSession(plan, false);
 
   REQUIRE(LogTestController::getInstance().contains("[info] got Script Engine 
property: python"));
 
-  logTestController.reset();
+  log_test_controller.reset();
 }
 
 TEST_CASE("Python: Test Module Directory property", 
"[executescriptPythonModuleDirectoryProperty]") {
-  using org::apache::nifi::minifi::utils::file::concat_path;
   using org::apache::nifi::minifi::utils::file::get_executable_dir;
 
-  TestController testController;
+  TestController test_controller;
 
-  LogTestController  = LogTestController::getInstance();
-  logTestController.setDebug();
-  logTestController.setDebug();
+  LogTestController& log_test_controller = LogTestController::getInstance();
+  log_test_controller.setDebug();
+  log_test_controller.setDebug();
 
-  std::string path;
-  std::string filename;
-  minifi::utils::file::getFileNameAndPath(__FILE__, path, filename);
-  const std::string SCRIPT_FILES_DIRECTORY = 
minifi::utils::file::getFullPath(concat_path(path, "test_python_scripts"));
+  const auto script_files_directory = 
std::filesystem::path(__FILE__).parent_path() / "test_python_scripts";
 
-  auto getScriptFullPath = [_FILES_DIRECTORY](const std::string& 
script_file_name) {
-return concat_path(SCRIPT_FILES_DIRECTORY, script_file_name);
-  };
+  auto plan = test_controller.createPlan();
 
-  auto plan = 

[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044561423


##
extensions/script/tests/TestExecuteScriptProcessorWithLuaScript.cpp:
##
@@ -421,8 +412,10 @@ TEST_CASE("Lua: Test Module Directory property", 
"[executescriptLuaModuleDirecto
   true);
 
   plan->setProperty(executeScript, 
minifi::processors::ExecuteScript::ScriptEngine.getName(), "lua");
-  plan->setProperty(executeScript, 
minifi::processors::ExecuteScript::ScriptFile.getName(), 
getScriptFullPath("foo_bar_processor.lua"));
-  plan->setProperty(executeScript, 
minifi::processors::ExecuteScript::ModuleDirectory.getName(), 
getScriptFullPath("foo_modules/foo.lua") + "," + 
getScriptFullPath("bar_modules"));
+  plan->setProperty(executeScript, 
minifi::processors::ExecuteScript::ScriptFile.getName(), script_files_directory 
/ "foo_bar_processor.lua");
+  plan->setProperty(executeScript,
+
minifi::processors::ExecuteScript::ModuleDirectory.getName(),
+(script_files_directory / "foo_modules/foo.lua").string() 
+ "," + (script_files_directory / "bar_modules").string());

Review Comment:
   Looks like this was fixed in 
https://github.com/apache/nifi-minifi-cpp/commit/9a3616ff1557eb9d35a8a3c477b8ae6954808021#diff-8838aae70901899c9da68b92dbe0a0209a9aaeb6565af72cefbe088b6a377f51R422



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044558281


##
extensions/script/python/PythonCreator.h:
##
@@ -140,26 +136,18 @@ class PythonCreator : public minifi::core::CoreComponent {
 return python_package;
   }
 
-  std::string getPath(const std::string ) {
-return std::filesystem::path(pythonscript).parent_path().string();
+  std::filesystem::path getFileName(const std::filesystem::path& 
python_script) {
+return std::filesystem::path(python_script).filename();

Review Comment:
   :+1: good idea, went with the later approach 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-0a5612bbb1831ede9a5b11ebe105ddb1fd97b399d44f51c34cebb87832769145R66



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044557769


##
extensions/jni/jvm/JniReferenceObjects.h:
##
@@ -244,23 +228,24 @@ class JniSession : public core::WeakReference {
   }
 
   bool prune() {
-global_ff_objects_.erase(std::remove_if(global_ff_objects_.begin(), 
global_ff_objects_.end(), check_empty_ff()), global_ff_objects_.end());
+const auto check_empty_ff = [](const std::shared_ptr& 
flow_file) { return flow_file->empty(); };
+global_ff_objects_.erase(std::remove_if(global_ff_objects_.begin(), 
global_ff_objects_.end(), check_empty_ff), global_ff_objects_.end());

Review Comment:
   good idea, changed it in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-a981b563c7f8e990402f120b51a94b4330574c37633c40b192bf944e69a95af0R232



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044557458


##
extensions/http-curl/tests/C2VerifyServeResults.cpp:
##
@@ -82,8 +82,8 @@ class VerifyC2Server : public HTTPIntegrationBase {
   }
 
  protected:
-  std::string dir;
-  std::stringstream ss;
+  std::filesystem::path dir_;
+  std::filesystem::path path_;

Review Comment:
   good idea, changed it in 
[extensions/http-curl/tests/C2VerifyServeResults.cpp](https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-69e06ea0333f54d2cc4e70adc182466ab3a05c7aca36ed64b973bb31c6c042b8R86)
 
[extensions/http-curl/tests/HttpPostIntegrationTest.cpp](https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-1c8f5d88f728bfc1c2ef82eed5ef340df4422e4b2d3365f33a0725577db754edR82)
 
[extensions/http-curl/tests/SiteToSiteRestTest.cpp](https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-1fc35039eb1d5a8bb80ebe997ef71780d7752ac4933bd4f3cbe53de0df28dd01R104)



##
extensions/http-curl/tests/HttpPostIntegrationTest.cpp:
##
@@ -78,9 +78,9 @@ class HttpTestHarness : public HTTPIntegrationBase {
   }
 
  protected:
-  std::string dir;
-  std::stringstream ss;
-  TestController testController;
+  std::filesystem::path dir_;
+  std::filesystem::path path_;

Review Comment:
   good idea, changed it in 
[extensions/http-curl/tests/C2VerifyServeResults.cpp](https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-69e06ea0333f54d2cc4e70adc182466ab3a05c7aca36ed64b973bb31c6c042b8R86)
 
[extensions/http-curl/tests/HttpPostIntegrationTest.cpp](https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-1c8f5d88f728bfc1c2ef82eed5ef340df4422e4b2d3365f33a0725577db754edR82)
 
[extensions/http-curl/tests/SiteToSiteRestTest.cpp](https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-1fc35039eb1d5a8bb80ebe997ef71780d7752ac4933bd4f3cbe53de0df28dd01R104)



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044555660


##
extensions/expression-language/tests/ExpressionLanguageTests.cpp:
##
@@ -218,7 +216,7 @@ TEST_CASE("GetFile PutFile dynamic attribute", 
"[expressionLanguageTestGetFilePu
   plan->setProperty(extract_text, 
minifi::processors::ExtractText::Attribute.getName(), "extracted_attr_name");
   plan->addProcessor("LogAttribute", "LogAttribute", 
core::Relationship("success", "description"), true);
   auto put_file = plan->addProcessor("PutFile", "PutFile", 
core::Relationship("success", "description"), true);
-  plan->setProperty(put_file, 
minifi::processors::PutFile::Directory.getName(), out_dir + 
"/${extracted_attr_name}");
+  plan->setProperty(put_file, 
minifi::processors::PutFile::Directory.getName(), out_dir.string() + 
"/${extracted_attr_name}");

Review Comment:
   :+1: changed it in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-f6418e5a4d678b633f2a69e64bc97df66407255f1ad86dd4e6052845b5e31b51R219



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1424: MINIFICPP-1862 use std::filesystem::path instead of std::string where appropriate

2022-12-09 Thread GitBox


martinzink commented on code in PR #1424:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1424#discussion_r1044555022


##
Windows.md:
##
@@ -93,7 +93,7 @@ A basic working CMake configuration can be inferred from the 
`win_build_vs.bat`.
 ```
 mkdir build
 cd build
-cmake -G "Visual Studio 16 2019" -DINSTALLER_MERGE_MODULES=OFF 
-DENABLE_SQL=OFF -DCMAKE_BUILD_TYPE_INIT=Release -DCMAKE_BUILD_TYPE=Release 
-DWIN32=WIN32 -DENABLE_LIBRDKAFKA=OFF -DENABLE_JNI=OFF -DOPENSSL_OFF=OFF 
-DENABLE_COAP=OFF -DUSE_SHARED_LIBS=OFF -DDISABLE_CONTROLLER=ON  
-DBUILD_ROCKSDB=ON -DFORCE_WINDOWS=ON -DUSE_SYSTEM_UUID=OFF 
-DDISABLE_LIBARCHIVE=OFF -DDISABLE_SCRIPTING=ON -DEXCLUDE_BOOST=ON 
-DENABLE_WEL=TRUE -DFAIL_ON_WARNINGS=OFF -DSKIP_TESTS=OFF ..

Review Comment:
   Good catch, removed it in 
https://github.com/apache/nifi-minifi-cpp/pull/1424/commits/6c775d116236c92105c7be38bb284f309c27887c#diff-cca060aa16d15639b5869bc21923825c304b01e4f22c181aaa0c087a586113f5R123



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org