Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: base/string_util.h

Issue 464075: Move two generic string split functions from sync API to their own API in base/string_split. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: added .gypi Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/string_split_unittest.cc ('k') | chrome/browser/sync/engine/net/gaia_authenticator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file defines utility functions for working with strings. 5 // This file defines utility functions for working with strings.
6 6
7 #ifndef BASE_STRING_UTIL_H_ 7 #ifndef BASE_STRING_UTIL_H_
8 #define BASE_STRING_UTIL_H_ 8 #define BASE_STRING_UTIL_H_
9 9
10 #include <stdarg.h> // va_list 10 #include <stdarg.h> // va_list
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 } 512 }
513 }; 513 };
514 514
515 template<typename Char> struct CaseInsensitiveCompareASCII { 515 template<typename Char> struct CaseInsensitiveCompareASCII {
516 public: 516 public:
517 bool operator()(Char x, Char y) const { 517 bool operator()(Char x, Char y) const {
518 return ToLowerASCII(x) == ToLowerASCII(y); 518 return ToLowerASCII(x) == ToLowerASCII(y);
519 } 519 }
520 }; 520 };
521 521
522 // TODO(timsteele): Move these split string functions into their own API on
523 // string_split.cc/.h files.
522 //----------------------------------------------------------------------------- 524 //-----------------------------------------------------------------------------
523 525
524 // Splits |str| into a vector of strings delimited by |s|. Append the results 526 // Splits |str| into a vector of strings delimited by |s|. Append the results
525 // into |r| as they appear. If several instances of |s| are contiguous, or if 527 // into |r| as they appear. If several instances of |s| are contiguous, or if
526 // |str| begins with or ends with |s|, then an empty string is inserted. 528 // |str| begins with or ends with |s|, then an empty string is inserted.
527 // 529 //
528 // Every substring is trimmed of any leading or trailing white space. 530 // Every substring is trimmed of any leading or trailing white space.
529 void SplitString(const std::wstring& str, 531 void SplitString(const std::wstring& str,
530 wchar_t s, 532 wchar_t s,
531 std::vector<std::wstring>* r); 533 std::vector<std::wstring>* r);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 #elif defined(WCHAR_T_IS_UTF32) 632 #elif defined(WCHAR_T_IS_UTF32)
631 typedef uint32 Unsigned; 633 typedef uint32 Unsigned;
632 #endif 634 #endif
633 }; 635 };
634 template<> 636 template<>
635 struct ToUnsigned<short> { 637 struct ToUnsigned<short> {
636 typedef unsigned short Unsigned; 638 typedef unsigned short Unsigned;
637 }; 639 };
638 640
639 #endif // BASE_STRING_UTIL_H_ 641 #endif // BASE_STRING_UTIL_H_
OLDNEW
« no previous file with comments | « base/string_split_unittest.cc ('k') | chrome/browser/sync/engine/net/gaia_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698