OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |