Code Cleanup
- Removed unused util.cpp escape function.
This commit is contained in:
21
src/util.cpp
21
src/util.cpp
@@ -325,27 +325,6 @@ int execute (
|
||||
// Collides with std::numeric_limits methods
|
||||
#undef max
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Escapes any unescaped character of type c within the given string
|
||||
// e.g. ' ' -> '\ '
|
||||
const std::string escape (const std::string& value, char c)
|
||||
{
|
||||
std::string modified = value;
|
||||
char tmp[2] = {c, '\0'};
|
||||
std::string search = tmp;
|
||||
std::string replace = "\\" + search;
|
||||
|
||||
std::string::size_type pos = modified.find (search);
|
||||
while (pos != std::string::npos) {
|
||||
if ( modified[pos-1] != '\\' )
|
||||
modified.replace (pos, 1, replace);
|
||||
|
||||
pos = modified.find (search, pos+1);
|
||||
}
|
||||
|
||||
return modified;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Accept a list of projects, and return an indented list
|
||||
// that reflects the hierarchy.
|
||||
|
||||
@@ -61,8 +61,6 @@ int execute (const std::string&, const std::vector <std::string>&, const std::st
|
||||
int flock (int, int);
|
||||
#endif
|
||||
|
||||
const std::string escape (const std::string&, char);
|
||||
|
||||
const std::vector<std::string> indentTree (
|
||||
const std::vector<std::string>&,
|
||||
const std::string& whitespace = " ",
|
||||
|
||||
Reference in New Issue
Block a user