Skip to content

Commit

Permalink
Make tokenize parameter const
Browse files Browse the repository at this point in the history
  • Loading branch information
uroni committed Jul 6, 2020
1 parent a2e4ac7 commit 4d838b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions stringtools.cpp
Expand Up @@ -667,7 +667,7 @@ std::string replaceonce(std::string tor, std::string tin, std::string data)
between the tokens) - strings, which are declared by two \" are not
tokenized = treated as a single token
*/
void Tokenize(std::string& str, std::vector<std::string> &tokens, std::string seps)
void Tokenize(const std::string& str, std::vector<std::string> &tokens, std::string seps)
{
// one-space line for storing blank lines in the file
std::string blankLine = " ";
Expand Down Expand Up @@ -723,7 +723,7 @@ void Tokenize(std::string& str, std::vector<std::string> &tokens, std::string se
if(tokens[i]=="") tokens.erase(tokens.begin()+(i--));
}

void Tokenize(std::wstring& str, std::vector<std::wstring> &tokens, std::wstring seps)
void Tokenize(const std::wstring& str, std::vector<std::wstring> &tokens, std::wstring seps)
{
// one-space line for storing blank lines in the file
std::wstring blankLine = L" ";
Expand Down Expand Up @@ -779,7 +779,7 @@ void Tokenize(std::wstring& str, std::vector<std::wstring> &tokens, std::wstring
if(tokens[i].empty()) tokens.erase(tokens.begin()+(i--));
}

void TokenizeMail(std::string& str, std::vector<std::string> &tokens, std::string seps)
void TokenizeMail(const std::string& str, std::vector<std::string> &tokens, std::string seps)
{
// one-space line for storing blank lines in the file
std::string blankLine = "";
Expand Down
6 changes: 3 additions & 3 deletions stringtools.h
Expand Up @@ -66,9 +66,9 @@ std::string wnarrow(const std::wstring& pStr);
std::wstring widen(std::string tw);
std::string replaceonce(std::string tor, std::string tin, std::string data);
std::wstring replaceonce(std::wstring tor, std::wstring tin, std::wstring data);
void Tokenize(std::string& str, std::vector<std::string> &tokens, std::string seps);
void Tokenize(std::wstring& str, std::vector<std::wstring> &tokens, std::wstring seps);
void TokenizeMail(std::string& str, std::vector<std::string> &tokens, std::string seps);
void Tokenize(const std::string& str, std::vector<std::string> &tokens, std::string seps);
void Tokenize(const std::wstring& str, std::vector<std::wstring> &tokens, std::wstring seps);
void TokenizeMail(const std::string& str, std::vector<std::string> &tokens, std::string seps);
bool isnumber(char ch);
bool isletter(char ch);
bool isnumber(wchar_t ch);
Expand Down

0 comments on commit 4d838b2

Please sign in to comment.