better parameter datatype
This commit is contained in:
parent
59c5eed635
commit
9bf18ad709
|
|
@ -118,7 +118,7 @@ std::string string_trim(std::string s, const std::string &chars_to_trim, const s
|
|||
return s;
|
||||
}
|
||||
|
||||
std::string string_padd(const std::string &str, int pad_len, char fill_char, bool from_right) {
|
||||
std::string string_padd(const std::string &str, size_t pad_len, char fill_char, bool from_right) {
|
||||
auto str_len = str.length();
|
||||
|
||||
if (str_len == pad_len)
|
||||
|
|
@ -148,7 +148,7 @@ std::string string_substring(const std::string & str, long pos, long count) {
|
|||
return str.substr(start_pos, count);
|
||||
}
|
||||
|
||||
size_t string_find_substr(const std::string & str, const std::string & pattern, long pos) {
|
||||
size_t string_find_substr(const std::string & str, const std::string & pattern, size_t pos) {
|
||||
if (pos >= str.size()) {
|
||||
throw std::invalid_argument("Invalid parameter(s) for string-find.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ std::string string_lucase(std::string s, const std::string &strcase);
|
|||
|
||||
std::string string_trim(std::string s, const std::string &chars_to_trim, const std::string &rltrim);
|
||||
|
||||
std::string string_padd(const std::string & str, int pad_len, char fill_char, bool from_right);
|
||||
std::string string_padd(const std::string & str, size_t pad_len, char fill_char, bool from_right);
|
||||
|
||||
std::string string_substring(const std::string & str, long pos, long count);
|
||||
|
||||
size_t string_find_substr(const std::string & str, const std::string & pattern, long pos);
|
||||
size_t string_find_substr(const std::string & str, const std::string & pattern, size_t pos);
|
||||
|
|
|
|||
Loading…
Reference in New Issue