diff --git a/support/include/utils/encrypting_reader.hpp b/support/include/utils/encrypting_reader.hpp index c49eb8a0..ead01442 100644 --- a/support/include/utils/encrypting_reader.hpp +++ b/support/include/utils/encrypting_reader.hpp @@ -25,11 +25,10 @@ #include "utils/config.hpp" -#include "utils/file.hpp" #include "utils/hash.hpp" +#include "utils/types/file/i_file.hpp" namespace repertory::utils::encryption { - class encrypting_reader final { public: encrypting_reader(std::string_view file_name, std::string_view source_path, diff --git a/support/include/utils/file.hpp b/support/include/utils/file.hpp index d40ffea4..6675d49c 100644 --- a/support/include/utils/file.hpp +++ b/support/include/utils/file.hpp @@ -25,6 +25,7 @@ #include "utils/config.hpp" #include "utils/path.hpp" +#include "utils/string.hpp" #include "utils/types/file/i_directory.hpp" #include "utils/types/file/i_file.hpp" #include "utils/types/file/i_fs_item.hpp" diff --git a/support/test/include/test.hpp b/support/test/include/test.hpp index 8d9b9cdf..df9498e9 100644 --- a/support/test/include/test.hpp +++ b/support/test/include/test.hpp @@ -19,8 +19,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef FIFTHGRID_TEST_INCLUDE_TEST_HPP_ -#define FIFTHGRID_TEST_INCLUDE_TEST_HPP_ +#ifndef REPERTORY_TEST_INCLUDE_TEST_HPP_ +#define REPERTORY_TEST_INCLUDE_TEST_HPP_ #if defined(U) #undef U @@ -36,7 +36,7 @@ using namespace ::testing; #include "utils/all.hpp" -namespace fifthgrid::test { +namespace repertory::test { #if defined(PROJECT_ENABLE_LIBSODIUM) [[nodiscard]] auto create_random_file(std::size_t size) -> utils::file::i_file &; @@ -58,6 +58,6 @@ auto generate_test_directory() -> utils::file::i_directory &; [[nodiscard]] auto get_test_input_dir() -> std::string; [[nodiscard]] auto get_test_output_dir() -> std::string; -} // namespace fifthgrid::test +} // namespace repertory::test -#endif // FIFTHGRID_TEST_INCLUDE_TEST_HPP_ +#endif // REPERTORY_TEST_INCLUDE_TEST_HPP_ diff --git a/support/test/src/test.cpp b/support/test/src/test.cpp index a7c4d182..42bcf44d 100644 --- a/support/test/src/test.cpp +++ b/support/test/src/test.cpp @@ -24,15 +24,15 @@ namespace { static std::recursive_mutex file_mtx{}; -static std::vector> +static std::vector> generated_files{}; static void delete_generated_files() { - fifthgrid::recur_mutex_lock lock{file_mtx}; + repertory::recur_mutex_lock lock{file_mtx}; std::optional parent_path; for (auto &&path : generated_files) { if (parent_path->empty()) { - parent_path = fifthgrid::utils::path::get_parent_path(path->get_path()); + parent_path = repertory::utils::path::get_parent_path(path->get_path()); } [[maybe_unused]] auto removed = path->remove(); @@ -41,7 +41,7 @@ static void delete_generated_files() { if (parent_path.has_value()) { EXPECT_TRUE( - fifthgrid::utils::file::directory(*parent_path).remove_recursively()); + repertory::utils::file::directory(*parent_path).remove_recursively()); } } @@ -52,7 +52,7 @@ struct file_deleter final { static auto deleter{std::make_unique()}; } // namespace -namespace fifthgrid::test { +namespace repertory::test { #if defined(PROJECT_ENABLE_LIBSODIUM) auto create_random_file(std::size_t size) -> utils::file::i_file & { recur_mutex_lock lock{file_mtx}; @@ -134,4 +134,4 @@ auto get_test_output_dir() -> std::string { return test_path; } -} // namespace fifthgrid::test +} // namespace repertory::test diff --git a/support/test/src/utils/collection_test.cpp b/support/test/src/utils/collection_test.cpp index fcc0927d..39d85bb5 100644 --- a/support/test/src/utils/collection_test.cpp +++ b/support/test/src/utils/collection_test.cpp @@ -21,7 +21,7 @@ */ #include "test.hpp" -namespace fifthgrid { +namespace repertory { TEST(utils_collection, excludes) { auto data = {"cow", "moose", "dog", "chicken"}; EXPECT_FALSE(utils::collection::excludes(data, "chicken")); @@ -247,4 +247,4 @@ TEST(utils_collection, remove_element) { EXPECT_EQ(static_cast(0xEE), col.at(1U)); } } -} // namespace fifthgrid +} // namespace repertory diff --git a/support/test/src/utils/common_test.cpp b/support/test/src/utils/common_test.cpp index 451ae98c..f07eabb3 100644 --- a/support/test/src/utils/common_test.cpp +++ b/support/test/src/utils/common_test.cpp @@ -21,7 +21,7 @@ */ #include "test.hpp" -namespace fifthgrid { +namespace repertory { TEST(utils_common, calculate_read_size) { auto read_size = utils::calculate_read_size(0U, 0U, 0U); EXPECT_EQ(0U, read_size); @@ -273,7 +273,7 @@ TEST(utils_common, get_environment_variable) { std::string path; #if defined(_WIN32) - path.resize(fifthgrid::max_path_length + 1U); + path.resize(repertory::max_path_length + 1U); auto size = ::GetEnvironmentVariableA(path_env.c_str(), path.data(), 0U); path.resize(size); @@ -305,4 +305,4 @@ TEST(utils_common, get_next_available_port_fails_if_starting_point_is_zero) { EXPECT_EQ(0U, available_port); } #endif // defined(PROJECT_ENABLE_BOOST) -} // namespace fifthgrid +} // namespace repertory diff --git a/support/test/src/utils/encrypting_reader_test.cpp b/support/test/src/utils/encrypting_reader_test.cpp index e1c4643e..078dba8a 100644 --- a/support/test/src/utils/encrypting_reader_test.cpp +++ b/support/test/src/utils/encrypting_reader_test.cpp @@ -23,7 +23,7 @@ #if defined(PROJECT_ENABLE_LIBSODIUM) && defined(PROJECT_ENABLE_BOOST) -namespace fifthgrid { +namespace repertory { TEST(utils_encrypting_reader, read_file_data) { const auto token = std::string("moose"); auto &source_file = test::create_random_file( @@ -220,6 +220,6 @@ TEST(utils_encrypting_reader, read_file_data_in_multiple_chunks_as_stream) { } } } -} // namespace fifthgrid +} // namespace repertory #endif // defined(PROJECT_ENABLE_LIBSODIUM) && defined(PROJECT_ENABLE_BOOST) diff --git a/support/test/src/utils/encryption_test.cpp b/support/test/src/utils/encryption_test.cpp index 8a03815d..6a0e1913 100644 --- a/support/test/src/utils/encryption_test.cpp +++ b/support/test/src/utils/encryption_test.cpp @@ -23,7 +23,7 @@ #if defined(PROJECT_ENABLE_LIBSODIUM) -namespace fifthgrid { +namespace repertory { static constexpr const std::string_view token{"moose"}; static constexpr const std::wstring_view token_w{L"moose"}; @@ -278,6 +278,6 @@ TEST(utils_encryption, decrypt_file_path) { } } #endif // defined(PROJECT_ENABLE_BOOST) -} // namespace fifthgrid +} // namespace repertory #endif // defined(PROJECT_ENABLE_LIBSODIUM) diff --git a/support/test/src/utils/error_test.cpp b/support/test/src/utils/error_test.cpp index a31a26f6..ccb710cb 100644 --- a/support/test/src/utils/error_test.cpp +++ b/support/test/src/utils/error_test.cpp @@ -21,7 +21,7 @@ */ #include "test.hpp" -namespace fifthgrid { +namespace repertory { template constexpr bool is_decay_equ = std::is_same_v, U>; @@ -63,4 +63,4 @@ TEST(utils_error, can_override_exception_handler) { utils::error::set_exception_handler(&utils::error::default_exception_handler); } -} // namespace fifthgrid +} // namespace repertory diff --git a/support/test/src/utils/file_test.cpp b/support/test/src/utils/file_test.cpp index 159b9f65..330898b6 100644 --- a/support/test/src/utils/file_test.cpp +++ b/support/test/src/utils/file_test.cpp @@ -25,7 +25,7 @@ namespace { static constexpr const auto file_type_count{1U}; } -namespace fifthgrid { +namespace repertory { TEST(utils_file, can_create_file) { for (auto idx = 0U; idx < file_type_count; ++idx) { auto path = test::generate_test_file_name("utils_file"); @@ -300,4 +300,4 @@ TEST(util_file, file_exists_in_path) { utils::string::from_utf8(test_dir.get_path()), L"moose.txt")); } } -} // namespace fifthgrid +} // namespace repertory diff --git a/support/test/src/utils/hash_test.cpp b/support/test/src/utils/hash_test.cpp index c3f47d72..13287bbd 100644 --- a/support/test/src/utils/hash_test.cpp +++ b/support/test/src/utils/hash_test.cpp @@ -23,7 +23,7 @@ #if defined(PROJECT_ENABLE_LIBSODIUM) -namespace fifthgrid { +namespace repertory { TEST(utils_hash, hash_type_sizes) { EXPECT_EQ(32U, utils::encryption::hash_256_t{}.size()); EXPECT_EQ(48U, utils::encryption::hash_384_t{}.size()); @@ -181,6 +181,6 @@ TEST(utils_hash, sha512) { "5ac3bcc80844b7d50b1cc6603444bbe7cfcf8fc0aa1ee3c636d9e339", hash.c_str()); } -} // namespace fifthgrid +} // namespace repertory #endif // defined(PROJECT_ENABLE_LIBSODIUM) diff --git a/support/test/src/utils/path_test.cpp b/support/test/src/utils/path_test.cpp index 57a6b91f..fff28838 100644 --- a/support/test/src/utils/path_test.cpp +++ b/support/test/src/utils/path_test.cpp @@ -25,27 +25,27 @@ namespace { static const auto test_path = [](std::string str) -> std::string { #if defined(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES) - if (fifthgrid::utils::string::begins_with(str, "\\")) { - str = fifthgrid::utils::string::to_lower( + if (repertory::utils::string::begins_with(str, "\\")) { + str = repertory::utils::string::to_lower( std::filesystem::current_path().string().substr(0U, 2U)) + str; } - str = std::string{fifthgrid::utils::path::long_notation} + str; + str = std::string{repertory::utils::path::long_notation} + str; #else // !defined(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES) - if (fifthgrid::utils::string::begins_with(str, "\\")) { - str = fifthgrid::utils::string::to_lower( + if (repertory::utils::string::begins_with(str, "\\")) { + str = repertory::utils::string::to_lower( std::filesystem::current_path().string().substr(0U, 2U)) + str; } #endif // defined(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES) - return fifthgrid::utils::string::right_trim(str, '\\'); + return repertory::utils::string::right_trim(str, '\\'); }; } // namespace #endif // defined(_WIN32) -namespace fifthgrid { +namespace repertory { TEST(utils_path, constants) { EXPECT_EQ(std::string_view{"\\"}, utils::path::backslash); EXPECT_EQ(std::wstring_view{L"\\"}, utils::path::backslash_w); @@ -400,7 +400,7 @@ TEST(utils_path, absolute_can_resolve_path_variables) { std::string home{}; #if defined(_WIN32) - home.resize(fifthgrid::max_path_length + 1U); + home.resize(repertory::max_path_length + 1U); auto size = ::GetEnvironmentVariableA("USERPROFILE", home.data(), 0U); home.resize(size); @@ -546,4 +546,4 @@ TEST(utils_path, does_not_contain_trash_directory) { } #endif // defined(_WIN32) } -} // namespace fifthgrid +} // namespace repertory diff --git a/support/test/src/utils/string_test.cpp b/support/test/src/utils/string_test.cpp index 023dbe65..f25bc9d6 100644 --- a/support/test/src/utils/string_test.cpp +++ b/support/test/src/utils/string_test.cpp @@ -21,7 +21,7 @@ */ #include "test.hpp" -namespace fifthgrid { +namespace repertory { TEST(utils_string, begins_with) { std::string str{"moose"}; EXPECT_TRUE(utils::string::begins_with(str, "m")); @@ -134,4 +134,4 @@ TEST(utils_string, to_bool) { EXPECT_FALSE(utils::string::to_bool("0")); EXPECT_FALSE(utils::string::to_bool("00000.00000")); } -} // namespace fifthgrid +} // namespace repertory