| Index: base/string_util.cc
|
| ===================================================================
|
| --- base/string_util.cc (revision 4621)
|
| +++ base/string_util.cc (working copy)
|
| @@ -659,6 +659,19 @@
|
| return base::strncasecmp(str.c_str(), search.c_str(), search.length()) == 0;
|
| }
|
|
|
| +bool StartsWith(const std::wstring& str,
|
| + const std::wstring& search,
|
| + bool case_sensitive) {
|
| + if (case_sensitive)
|
| + return str.compare(0, search.length(), search) == 0;
|
| + else {
|
| + if (search.size() > str.size())
|
| + return false;
|
| + return std::equal(search.begin(), search.end(), str.begin(),
|
| + CaseInsensitiveCompare<wchar_t>());
|
| + }
|
| +}
|
| +
|
| DataUnits GetByteDisplayUnits(int64 bytes) {
|
| // The byte thresholds at which we display amounts. A byte count is displayed
|
| // in unit U when kUnitThresholds[U] <= bytes < kUnitThresholds[U+1].
|
|
|