fix warnings

This commit is contained in:
2023-12-14 09:06:30 -06:00
parent e959a9e795
commit f3ea2ccc21
2 changed files with 61 additions and 50 deletions

View File

@@ -22,15 +22,17 @@
#ifndef INCLUDE_UTILS_STRING_UTILS_HPP_
#define INCLUDE_UTILS_STRING_UTILS_HPP_
REPERTORY_IGNORE_WARNINGS_ENABLE()
#include <boost/dynamic_bitset.hpp>
#include <string>
#include <string_view>
#include <vector>
REPERTORY_IGNORE_WARNINGS_DISABLE()
namespace repertory::utils::string {
// Prototypes
constexpr auto begins_with(std::string_view str, std::string_view val) -> bool {
return (str.find(val) == 0u);
return (str.find(val) == 0U);
}
constexpr auto contains(std::string_view str, std::string_view search) -> bool {
@@ -48,14 +50,15 @@ constexpr auto contains(std::string_view str, std::string_view search) -> bool {
[[nodiscard]] auto from_utf8(const std::string &str) -> std::wstring;
[[nodiscard]] /* constexpr c++20 */ auto is_numeric(std::string_view s) -> bool;
[[nodiscard]] /* constexpr c++20 */ auto is_numeric(std::string_view str)
-> bool;
[[nodiscard]] auto join(const std::vector<std::string> &arr, const char &delim)
-> std::string;
auto left_trim(std::string &s) -> std::string &;
auto left_trim(std::string &str) -> std::string &;
auto left_trim(std::string &s, const char &c) -> std::string &;
auto left_trim(std::string &str, const char &trim_ch) -> std::string &;
auto replace(std::string &src, const char &character, const char &with)
-> std::string &;
@@ -70,9 +73,9 @@ auto replace(std::string &src, const std::string &find, const std::string &with,
const std::string &with, size_t start_pos = 0)
-> std::string;
auto right_trim(std::string &s) -> std::string &;
auto right_trim(std::string &str) -> std::string &;
auto right_trim(std::string &s, const char &c) -> std::string &;
auto right_trim(std::string &str, const char &trim_ch) -> std::string &;
[[nodiscard]] auto split(const std::string &str, const char &delim,
bool should_trim = true) -> std::vector<std::string>;
@@ -108,11 +111,12 @@ auto right_trim(std::string &s, const char &c) -> std::string &;
auto trim(std::string &str) -> std::string &;
auto trim(std::string &str, const char &c) -> std::string &;
auto trim(std::string &str, const char &trim_ch) -> std::string &;
[[nodiscard]] auto trim_copy(std::string str) -> std::string;
[[nodiscard]] auto trim_copy(std::string str, const char &c) -> std::string;
[[nodiscard]] auto trim_copy(std::string str, const char &trim_ch)
-> std::string;
} // namespace repertory::utils::string
#endif // INCLUDE_UTILS_STRING_UTILS_HPP_