adding theoritcally basic parsing

This commit is contained in:
Clément Le Bihan
2021-06-17 01:04:27 +02:00
parent 5b1f9d18e6
commit fbe36b2323
6 changed files with 93 additions and 17 deletions
+9 -9
View File
@@ -10,14 +10,14 @@
namespace BBM
{
inline void Utils::ltrim(std::string &s)
inline void Utils::lTrim(std::string &s)
{
s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) {
return !std::isspace(ch);
}));
}
inline void Utils::rtrim(std::string &s)
inline void Utils::rTrim(std::string &s)
{
s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) {
return !std::isspace(ch);
@@ -26,23 +26,23 @@ namespace BBM
inline void Utils::trim(std::string &s)
{
ltrim(s);
rtrim(s);
lTrim(s);
rTrim(s);
}
inline std::string Utils::ltrim_copy(std::string s)
inline std::string Utils::lTrimCopy(std::string s)
{
ltrim(s);
lTrim(s);
return s;
}
inline std::string Utils::rtrim_copy(std::string s)
inline std::string Utils::rTrimCopy(std::string s)
{
rtrim(s);
rTrim(s);
return s;
}
inline std::string Utils::trim_copy(std::string s)
inline std::string Utils::trimCopy(std::string s)
{
trim(s);
return s;