#include "Util.h"
|
static std::string | trim (const std::string &str, bool left, bool right) |
|
static void | trim (std::string &str, bool left, bool right) |
|
static std::wstring | trim (const std::wstring &str, bool left, bool right) |
|
static void | trim (std::wstring &str, bool left, bool right) |
|
static std::string | toUpperCase (const std::string &TString) |
|
static void | toUpperCase (std::string &TString) |
|
static std::wstring | toUpperCase (const std::wstring &TString) |
|
static void | toUpperCase (std::wstring &TString) |
|
static std::string | toLowerCase (const std::string &TString) |
|
static void | toLowerCase (std::string &TString) |
|
static std::wstring | toLowerCase (const std::wstring &TString) |
|
static void | toLowerCase (std::wstring &TString) |
|
static std::string | CaseFold (std::string &str) |
|
static std::wstring | CaseFold (std::wstring &str) |
|
static std::wstring | StringToWString (std::string &wstr) |
|
Definition at line 97 of file Util.h.
std::string Utils::Strings::CaseFold |
( |
std::string & |
str | ) |
|
|
static |
CaseFold
Folds a a strings case.
Definition at line 757 of file util.cpp.
References toLowerCase(), and toUpperCase().
759 std::string s2 = str;
static std::string toUpperCase(const std::string &TString)
static std::string toLowerCase(const std::string &TString)
static std::string CaseFold(std::string &str)
std::wstring Utils::Strings::CaseFold |
( |
std::wstring & |
str | ) |
|
|
static |
CaseFold
Folds a a strings case.
Definition at line 767 of file util.cpp.
References toLowerCase(), and toUpperCase().
769 std::wstring s2 = str;
static std::string toUpperCase(const std::string &TString)
static std::string toLowerCase(const std::string &TString)
static std::string CaseFold(std::string &str)
std::wstring Utils::Strings::StringToWString |
( |
std::string & |
wstr | ) |
|
|
static |
StringToWString
Converts a std::string to std::wstring
Definition at line 777 of file util.cpp.
References sLog.
781 wstr.resize( str.size() );
782 size_t ret_len = mbstowcs( &wstr[0], str.c_str(), str.size() );
784 if (ret_len != str.size()) {
786 sLog.Error(
"Utils::Strings::StringToWString",
"unable to convert std::string to std::wstring, wide character string");
#define sLog
Evaluates to a NewLog instance.
std::string Utils::Strings::toLowerCase |
( |
const std::string & |
TString | ) |
|
|
static |
Definition at line 729 of file util.cpp.
Referenced by CaseFold().
731 std::string retval(TString);
732 std::transform(retval.begin(), retval.end(), retval.begin(),
static_cast<int(*)(
int)
>(::tolower));
void Utils::Strings::toLowerCase |
( |
std::string & |
TString | ) |
|
|
static |
Definition at line 736 of file util.cpp.
738 std::transform(TString.begin(), TString.end(), TString.begin(),
static_cast<int(*)(
int)
>(::tolower));
std::wstring Utils::Strings::toLowerCase |
( |
const std::wstring & |
TString | ) |
|
|
static |
Definition at line 741 of file util.cpp.
743 std::wstring retval(TString);
744 std::transform(retval.begin(), retval.end(), retval.begin(),
static_cast<int(*)(
int)
>(::tolower));
void Utils::Strings::toLowerCase |
( |
std::wstring & |
TString | ) |
|
|
static |
Definition at line 748 of file util.cpp.
750 std::transform(TString.begin(), TString.end(), TString.begin(),
static_cast<int(*)(
int)
>(::tolower));
std::string Utils::Strings::toUpperCase |
( |
const std::string & |
TString | ) |
|
|
static |
Definition at line 705 of file util.cpp.
Referenced by CaseFold().
707 std::string retval(TString);
708 std::transform(retval.begin(), retval.end(), retval.begin(),
static_cast<int(*)(
int)
>(::toupper));
void Utils::Strings::toUpperCase |
( |
std::string & |
TString | ) |
|
|
static |
Definition at line 712 of file util.cpp.
714 std::transform(TString.begin(), TString.end(), TString.begin(),
static_cast<int(*)(
int)
>(::toupper));
std::wstring Utils::Strings::toUpperCase |
( |
const std::wstring & |
TString | ) |
|
|
static |
Definition at line 717 of file util.cpp.
719 std::wstring retval(TString);
720 std::transform(retval.begin(), retval.end(), retval.begin(),
static_cast<int(*)(
int)
>(::toupper));
void Utils::Strings::toUpperCase |
( |
std::wstring & |
TString | ) |
|
|
static |
Definition at line 724 of file util.cpp.
726 std::transform(TString.begin(), TString.end(), TString.begin(),
static_cast<int(*)(
int)
>(::toupper));
std::string Utils::Strings::trim |
( |
const std::string & |
str, |
|
|
bool |
left, |
|
|
bool |
right |
|
) |
| |
|
static |
Definition at line 611 of file util.cpp.
613 size_t lspaces, rspaces, len = str.length(), i;
615 lspaces = rspaces = 0;
620 i < len && (str[i] ==
' ' || str[i] ==
'\t' || str[i] ==
'\r');
624 if(right ==
true && lspaces < len)
627 i >= 0 && (str[i] ==
' ' || str[i] ==
'\t' || str[i] ==
'\r');
631 return str.substr(lspaces, len-lspaces-rspaces);
void Utils::Strings::trim |
( |
std::string & |
str, |
|
|
bool |
left, |
|
|
bool |
right |
|
) |
| |
|
static |
Definition at line 634 of file util.cpp.
636 size_t lspaces, rspaces, len = str.length(), i;
638 lspaces = rspaces = 0;
643 i < len && (str[i] ==
' ' || str[i] ==
'\t' || str[i] ==
'\r');
647 if(right ==
true && lspaces < len)
650 i >= 0 && (str[i] ==
' ' || str[i] ==
'\t' || str[i] ==
'\r');
655 str = str.substr(lspaces, len-lspaces-rspaces);
std::wstring Utils::Strings::trim |
( |
const std::wstring & |
str, |
|
|
bool |
left, |
|
|
bool |
right |
|
) |
| |
|
static |
Definition at line 658 of file util.cpp.
660 size_t lspaces, rspaces, len = str.length(), i;
662 lspaces = rspaces = 0;
667 i < len && (str[i] ==
' ' || str[i] ==
'\t' || str[i] ==
'\r');
671 if(right ==
true && lspaces < len)
674 i >= 0 && (str[i] ==
' ' || str[i] ==
'\t' || str[i] ==
'\r');
678 return str.substr(lspaces, len-lspaces-rspaces);
void Utils::Strings::trim |
( |
std::wstring & |
str, |
|
|
bool |
left, |
|
|
bool |
right |
|
) |
| |
|
static |
Definition at line 681 of file util.cpp.
683 size_t lspaces, rspaces, len = str.length(), i;
685 lspaces = rspaces = 0;
690 i < len && (str[i] ==
' ' || str[i] ==
'\t' || str[i] ==
'\r');
694 if(right ==
true && lspaces < len)
697 i >= 0 && (str[i] ==
' ' || str[i] ==
'\t' || str[i] ==
'\r');
702 str = str.substr(lspaces, len-lspaces-rspaces);
The documentation for this class was generated from the following files:
- /backups/local/src/eve/EvEmu_Crucible/src/eve-common/utils/Util.h
- /backups/local/src/eve/EvEmu_Crucible/src/eve-common/utils/util.cpp