Browse Source

Remove RegexUtils class

Patrick-Christopher Mattulat 1 year ago
parent
commit
4ef8e2c9e2

+ 0 - 2
CMakeLists.txt

@@ -163,7 +163,6 @@ set(SOURCE_FILES_CORE
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/ISerializable.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IStorable.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IWriter.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/utils/RegexUtils.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/Class.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/LibraryVersion.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/Version.cpp)
@@ -232,7 +231,6 @@ if (${LS_STD_BUILD_WITH_TESTS})
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IllegalArithmeticOperationExceptionTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IncompleteJsonExceptionTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/NullPointerExceptionTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/utils/RegexUtilsTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/utils/StlUtilsTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/ClassTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/LibraryVersionTest.cpp

+ 0 - 29
include/ls-std/core/utils/RegexUtils.hpp

@@ -1,29 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-18
- * Changed:         2023-02-05
- *
- * */
-
-#ifndef LS_STD_REGEX_UTILS_HPP
-#define LS_STD_REGEX_UTILS_HPP
-
-#include <ls-std/os/dynamic-goal.hpp>
-#include <string>
-
-namespace ls::std::core
-{
-  class LS_STD_DYNAMIC_GOAL RegexUtils
-  {
-    public:
-
-      RegexUtils();
-      ~RegexUtils();
-
-      static ::std::string escapeString(const ::std::string &_text);
-  };
-}
-
-#endif

+ 1 - 2
include/ls-std/ls-std-core.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2022-05-13
- * Changed:         2023-02-04
+ * Changed:         2023-02-06
  *
  * */
 
@@ -32,7 +32,6 @@
 #include <ls-std/core/types/KvTypes.hpp>
 #include <ls-std/core/types/Types.hpp>
 
-#include <ls-std/core/utils/RegexUtils.hpp>
 #include <ls-std/core/utils/StlUtils.hpp>
 #if _WIN32
   #include <ls-std/core/utils/WindowsUtils.hpp>

+ 0 - 21
source/ls-std/core/utils/RegexUtils.cpp

@@ -1,21 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2023-02-04
- * Changed:         2023-02-04
- *
- * */
-
-#include <ls-std/core/utils/RegexUtils.hpp>
-#include <regex>
-
-ls::std::core::RegexUtils::RegexUtils() = default;
-
-ls::std::core::RegexUtils::~RegexUtils() = default;
-
-::std::string ls::std::core::RegexUtils::escapeString(const ::std::string &_text)
-{
-  static ::std::regex regexMetaEscape(R"(([\^\$\\\.\*\+\?\(\)\[\]\{\}\|]))");
-  return ::std::regex_replace(_text, regexMetaEscape, R"(\$1)");
-}

+ 0 - 40
test/cases/core/utils/RegexUtilsTest.cpp

@@ -1,40 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-18
- * Changed:         2023-02-03
- *
- * */
-
-#include <gtest/gtest.h>
-#include <ls-std/ls-std-core.hpp>
-
-using namespace ls::std::core;
-using namespace ::std;
-
-namespace
-{
-  class RegexUtilsTest : public ::testing::Test
-  {
-    protected:
-
-      RegexUtilsTest() = default;
-      ~RegexUtilsTest() override = default;
-
-      void SetUp() override
-      {}
-
-      void TearDown() override
-      {}
-  };
-
-  TEST_F(RegexUtilsTest, escapeString)
-  {
-    string escapedString = RegexUtils::escapeString("Hello?!");
-    ASSERT_STREQ(R"(Hello\?!)", escapedString.c_str());
-
-    escapedString = RegexUtils::escapeString(R"(\)");
-    ASSERT_STREQ(R"(\\)", escapedString.c_str());
-  }
-}