3#include <StormByte/exception.hxx>
4#include <StormByte/expected.hxx>
5#include <StormByte/visibility.h>
25namespace StormByte::String {
32 enum class STORMBYTE_PUBLIC Format :
unsigned short {
47 constexpr STORMBYTE_PUBLIC std::string Indent(
const int& level)
noexcept {
48 return level == 0 ? std::string() : std::string(level,
'\t');
59 constexpr STORMBYTE_PUBLIC
bool IsNumeric(
const std::string& str)
noexcept {
60 return !str.empty() && std::all_of(str.begin(), str.end(), ::isdigit);
71 STORMBYTE_PUBLIC std::string ToLower(
const std::string& str)
noexcept;
81 STORMBYTE_PUBLIC std::string ToUpper(
const std::string& str)
noexcept;
93 STORMBYTE_PUBLIC std::queue<std::string> Explode(
const std::string& str,
const char delimiter);
104 STORMBYTE_PUBLIC std::vector<std::string> Split(
const std::string& str);
118 template <
typename T,
typename = std::enable_if_t<std::is_arithmetic_v<T> && !std::is_same_v<T,
wchar_t>>>
119 STORMBYTE_PUBLIC std::string HumanReadable(
const T& number,
const Format& format,
const std::string& locale =
"en_US.UTF-8") noexcept;
130 STORMBYTE_PUBLIC std::
string UTF8Encode(const std::wstring& ws);
141 STORMBYTE_PUBLIC std::wstring UTF8Decode(const std::
string& s);
151 STORMBYTE_PUBLIC std::
string SanitizeNewlines(const std::
string& str) noexcept;
161 STORMBYTE_PUBLIC std::
string FromByteVector(const std::vector<std::
byte>& byte_vector) noexcept;
171 STORMBYTE_PUBLIC std::vector<std::
byte> ToByteVector(const std::
string& str) noexcept;
181 STORMBYTE_PUBLIC std::
string RemoveWhitespace(const std::
string& str) noexcept;
191 STORMBYTE_PUBLIC
bool IsInteger(const std::
string& str) noexcept;