mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-30 09:37:55 +00:00
Implement stack counts
This commit is contained in:
+5
-1
@@ -64,7 +64,7 @@ std::vector<std::string> Strings::Split(const std::string &str, const char delim
|
||||
}
|
||||
|
||||
// this one takes delimiter length into consideration
|
||||
std::vector<std::string> Strings::Split(std::string s, std::string delimiter)
|
||||
std::vector<std::string> Strings::Split(const std::string& s, const std::string& delimiter)
|
||||
{
|
||||
size_t pos_start = 0, pos_end, delim_len = delimiter.length();
|
||||
std::string token;
|
||||
@@ -674,3 +674,7 @@ std::string Strings::ConvertToDigit(int n, std::string suffix)
|
||||
return NUM_TO_ENGLISH_X[n] + suffix;
|
||||
}
|
||||
}
|
||||
bool Strings::Contains(const std::string& subject, const std::string& search)
|
||||
{
|
||||
return subject.find(search) != std::string::npos;
|
||||
}
|
||||
|
||||
+2
-1
@@ -84,6 +84,7 @@ namespace EQ {
|
||||
class Strings {
|
||||
public:
|
||||
static bool Contains(std::vector<std::string> container, std::string element);
|
||||
static bool Contains(const std::string& subject, const std::string& search);
|
||||
static bool IsNumber(const std::string &s);
|
||||
static const std::string ToLower(std::string s);
|
||||
static const std::string ToUpper(std::string s);
|
||||
@@ -105,7 +106,7 @@ public:
|
||||
static std::string SecondsToTime(int duration, bool is_milliseconds = false);
|
||||
static std::string::size_type SearchDelim(const std::string &haystack, const std::string &needle, const char deliminator = ',');
|
||||
static std::vector<std::string> Split(const std::string &s, const char delim = ',');
|
||||
static std::vector<std::string> Split(std::string s, std::string delimiter);
|
||||
static std::vector<std::string> Split(const std::string& s, const std::string& delimiter);
|
||||
static std::vector<std::string> Wrap(std::vector<std::string> &src, std::string character);
|
||||
static void FindReplace(std::string &string_subject, const std::string &search_string, const std::string &replace_string);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user