Skip to content

Commit

Permalink
StringUtil: Comply with variable naming style
Browse files Browse the repository at this point in the history
  • Loading branch information
JosJuice committed Jul 23, 2019
1 parent a2a1e04 commit 117a60c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions Source/Core/Common/StringUtil.cpp
Expand Up @@ -334,8 +334,8 @@ std::string ValueToString(bool value)
return value ? "True" : "False"; return value ? "True" : "False";
} }


bool SplitPath(std::string_view full_path, std::string* _pPath, std::string* _pFilename, bool SplitPath(std::string_view full_path, std::string* path, std::string* filename,
std::string* _pExtension) std::string* extension)
{ {
if (full_path.empty()) if (full_path.empty())
return false; return false;
Expand All @@ -355,29 +355,29 @@ bool SplitPath(std::string_view full_path, std::string* _pPath, std::string* _pF
if (fname_end < dir_end || std::string::npos == fname_end) if (fname_end < dir_end || std::string::npos == fname_end)
fname_end = full_path.size(); fname_end = full_path.size();


if (_pPath) if (path)
*_pPath = full_path.substr(0, dir_end); *path = full_path.substr(0, dir_end);


if (_pFilename) if (filename)
*_pFilename = full_path.substr(dir_end, fname_end - dir_end); *filename = full_path.substr(dir_end, fname_end - dir_end);


if (_pExtension) if (extension)
*_pExtension = full_path.substr(fname_end); *extension = full_path.substr(fname_end);


return true; return true;
} }


void BuildCompleteFilename(std::string& _CompleteFilename, std::string_view _Path, void BuildCompleteFilename(std::string& complete_filename, std::string_view path,
std::string_view _Filename) std::string_view filename)
{ {
_CompleteFilename = _Path; complete_filename = path;


// check for seperator // check for seperator
if (DIR_SEP_CHR != *_CompleteFilename.rbegin()) if (DIR_SEP_CHR != *complete_filename.rbegin())
_CompleteFilename += DIR_SEP_CHR; complete_filename += DIR_SEP_CHR;


// add the filename // add the filename
_CompleteFilename += _Filename; complete_filename += filename;
} }


std::vector<std::string> SplitString(const std::string& str, const char delim) std::vector<std::string> SplitString(const std::string& str, const char delim)
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/Common/StringUtil.h
Expand Up @@ -113,11 +113,11 @@ std::vector<std::string> SplitString(const std::string& str, char delim);
std::string JoinStrings(const std::vector<std::string>& strings, const std::string& delimiter); std::string JoinStrings(const std::vector<std::string>& strings, const std::string& delimiter);


// "C:/Windows/winhelp.exe" to "C:/Windows/", "winhelp", ".exe" // "C:/Windows/winhelp.exe" to "C:/Windows/", "winhelp", ".exe"
bool SplitPath(std::string_view full_path, std::string* _pPath, std::string* _pFilename, bool SplitPath(std::string_view full_path, std::string* path, std::string* filename,
std::string* _pExtension); std::string* extension);


void BuildCompleteFilename(std::string& _CompleteFilename, std::string_view _Path, void BuildCompleteFilename(std::string& complete_filename, std::string_view path,
std::string_view _Filename); std::string_view filename);
std::string ReplaceAll(std::string result, std::string_view src, std::string_view dest); std::string ReplaceAll(std::string result, std::string_view src, std::string_view dest);


bool StringBeginsWith(std::string_view str, std::string_view begin); bool StringBeginsWith(std::string_view str, std::string_view begin);
Expand Down

0 comments on commit 117a60c

Please sign in to comment.