lua console library

This commit is contained in:
MihailRis
2024-05-10 23:35:46 +03:00
parent 9dc3c40b69
commit c2ea0d5326
12 changed files with 156 additions and 34 deletions
+2 -2
View File
@@ -151,7 +151,7 @@ std::wstring util::str2wstr_utf8(const std::string s) {
return std::wstring(chars.data(), chars.size());
}
bool util::is_integer(std::string text) {
bool util::is_integer(const std::string& text) {
for (char c : text) {
if (c < '0' || c > '9')
return false;
@@ -159,7 +159,7 @@ bool util::is_integer(std::string text) {
return true;
}
bool util::is_integer(std::wstring text) {
bool util::is_integer(const std::wstring& text) {
for (wchar_t c : text) {
if (c < L'0' || c > L'9')
return false;
+2 -2
View File
@@ -20,8 +20,8 @@ namespace util {
uint32_t decode_utf8(uint& size, const char* bytes);
std::string wstr2str_utf8(const std::wstring ws);
std::wstring str2wstr_utf8(const std::string s);
bool is_integer(std::string text);
bool is_integer(std::wstring text);
bool is_integer(const std::string& text);
bool is_integer(const std::wstring& text);
bool is_valid_filename(std::wstring name);
void ltrim(std::string &s);