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

Side by Side Diff: base/string_util.h

Issue 3366011: base: Move SplitStringDontTrim functions from string_util.h to string_split.h (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: remove dchecks Created 10 years, 3 months 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
« no previous file with comments | « base/string_split_unittest.cc ('k') | base/string_util.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #pragma once 9 #pragma once
10 10
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 void SplitString(const std::wstring& str, 516 void SplitString(const std::wstring& str,
517 wchar_t s, 517 wchar_t s,
518 std::vector<std::wstring>* r); 518 std::vector<std::wstring>* r);
519 void SplitString(const string16& str, 519 void SplitString(const string16& str,
520 char16 s, 520 char16 s,
521 std::vector<string16>* r); 521 std::vector<string16>* r);
522 void SplitString(const std::string& str, 522 void SplitString(const std::string& str,
523 char s, 523 char s,
524 std::vector<std::string>* r); 524 std::vector<std::string>* r);
525 525
526 // The same as SplitString, but don't trim white space.
527 void SplitStringDontTrim(const std::wstring& str,
528 wchar_t s,
529 std::vector<std::wstring>* r);
530 void SplitStringDontTrim(const string16& str,
531 char16 s,
532 std::vector<string16>* r);
533 void SplitStringDontTrim(const std::string& str,
534 char s,
535 std::vector<std::string>* r);
536
537 // Splits a string into its fields delimited by any of the characters in 526 // Splits a string into its fields delimited by any of the characters in
538 // |delimiters|. Each field is added to the |tokens| vector. Returns the 527 // |delimiters|. Each field is added to the |tokens| vector. Returns the
539 // number of tokens found. 528 // number of tokens found.
540 size_t Tokenize(const std::wstring& str, 529 size_t Tokenize(const std::wstring& str,
541 const std::wstring& delimiters, 530 const std::wstring& delimiters,
542 std::vector<std::wstring>* tokens); 531 std::vector<std::wstring>* tokens);
543 size_t Tokenize(const string16& str, 532 size_t Tokenize(const string16& str,
544 const string16& delimiters, 533 const string16& delimiters,
545 std::vector<string16>* tokens); 534 std::vector<string16>* tokens);
546 size_t Tokenize(const std::string& str, 535 size_t Tokenize(const std::string& str,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 #elif defined(WCHAR_T_IS_UTF32) 614 #elif defined(WCHAR_T_IS_UTF32)
626 typedef uint32 Unsigned; 615 typedef uint32 Unsigned;
627 #endif 616 #endif
628 }; 617 };
629 template<> 618 template<>
630 struct ToUnsigned<short> { 619 struct ToUnsigned<short> {
631 typedef unsigned short Unsigned; 620 typedef unsigned short Unsigned;
632 }; 621 };
633 622
634 #endif // BASE_STRING_UTIL_H_ 623 #endif // BASE_STRING_UTIL_H_
OLDNEW
« no previous file with comments | « base/string_split_unittest.cc ('k') | base/string_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698