Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

shellext: remove unused Trim.. functions

Changeset 26c42d2f947a

Parent e413d13942e1

by Adrian Buehlmann

Changes to 2 files · Browse files at 26c42d2f947a Showing diff from parent e413d13942e1 Diff from another changeset...

 
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
 
29
30
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
33
34
@@ -29,40 +29,6 @@
 }     -// Remove leading whitespaces from a string -std::string TrimLeft(const std::string& str) -{ - std::string::const_iterator iter = std::find_if(str.begin(), str.end(), - std::not1(std::ptr_fun(myisspace))); - if (iter == str.end()) - iter = str.begin(); - return std::string(iter, str.end()); -} - -// Remove trailing whitespaces from a string -std::string TrimRight(const std::string& str) -{ - std::string::const_reverse_iterator iter = std::find_if(str.rbegin(), - str.rend(), std::not1(std::ptr_fun(myisspace))); - return std::string(str.begin(), iter.base()); -} - - - -// Remove leading and trailing whitespaces from a string -std::string Trim(const std::string& str) -{ - std::string::const_iterator begin = std::find_if(str.begin(), str.end(), - std::not1(std::ptr_fun(myisspace))); - if (begin == str.end()) - begin = str.begin(); - std::string::const_reverse_iterator end = std::find_if(str.rbegin(), - str.rend(), std::not1(std::ptr_fun(myisspace))); - return std::string(begin, end.base()); -} - - -  // Test if string starts with substr  bool StartsWith(const std::string& str, const std::string& substr)  {
 
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
23
24
25
 
 
 
 
 
 
 
 
 
 
 
 
26
27
28
@@ -23,18 +23,6 @@
 #include <string>  #include <windows.h>   - -// Remove leading whitespaces from a string -std::string TrimLeft(const std::string& str); - - -// Remove trailing whitespaces from a string -std::string TrimRight(const std::string& str); - - -// Remove leading and trailing whitespaces from a string -std::string Trim(const std::string& str); -  // Test if string starts with substr  bool StartsWith(const std::string& str, const std::string& substr);