| 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 | 9 |
| 10 #include <stdarg.h> // va_list | 10 #include <stdarg.h> // va_list |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 // number of tokens found. | 594 // number of tokens found. |
| 595 size_t Tokenize(const std::wstring& str, | 595 size_t Tokenize(const std::wstring& str, |
| 596 const std::wstring& delimiters, | 596 const std::wstring& delimiters, |
| 597 std::vector<std::wstring>* tokens); | 597 std::vector<std::wstring>* tokens); |
| 598 size_t Tokenize(const string16& str, | 598 size_t Tokenize(const string16& str, |
| 599 const string16& delimiters, | 599 const string16& delimiters, |
| 600 std::vector<string16>* tokens); | 600 std::vector<string16>* tokens); |
| 601 size_t Tokenize(const std::string& str, | 601 size_t Tokenize(const std::string& str, |
| 602 const std::string& delimiters, | 602 const std::string& delimiters, |
| 603 std::vector<std::string>* tokens); | 603 std::vector<std::string>* tokens); |
| 604 size_t Tokenize(const base::StringPiece& str, |
| 605 const base::StringPiece& delimiters, |
| 606 std::vector<base::StringPiece>* tokens); |
| 604 | 607 |
| 605 // Does the opposite of SplitString(). | 608 // Does the opposite of SplitString(). |
| 606 std::wstring JoinString(const std::vector<std::wstring>& parts, wchar_t s); | 609 std::wstring JoinString(const std::vector<std::wstring>& parts, wchar_t s); |
| 607 string16 JoinString(const std::vector<string16>& parts, char16 s); | 610 string16 JoinString(const std::vector<string16>& parts, char16 s); |
| 608 std::string JoinString(const std::vector<std::string>& parts, char s); | 611 std::string JoinString(const std::vector<std::string>& parts, char s); |
| 609 | 612 |
| 610 // WARNING: this uses whitespace as defined by the HTML5 spec. If you need | 613 // WARNING: this uses whitespace as defined by the HTML5 spec. If you need |
| 611 // a function similar to this but want to trim all types of whitespace, then | 614 // a function similar to this but want to trim all types of whitespace, then |
| 612 // factor this out into a function that takes a string containing the characters | 615 // factor this out into a function that takes a string containing the characters |
| 613 // that are treated as whitespace. | 616 // that are treated as whitespace. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 #elif defined(WCHAR_T_IS_UTF32) | 688 #elif defined(WCHAR_T_IS_UTF32) |
| 686 typedef uint32 Unsigned; | 689 typedef uint32 Unsigned; |
| 687 #endif | 690 #endif |
| 688 }; | 691 }; |
| 689 template<> | 692 template<> |
| 690 struct ToUnsigned<short> { | 693 struct ToUnsigned<short> { |
| 691 typedef unsigned short Unsigned; | 694 typedef unsigned short Unsigned; |
| 692 }; | 695 }; |
| 693 | 696 |
| 694 #endif // BASE_STRING_UTIL_H_ | 697 #endif // BASE_STRING_UTIL_H_ |
| OLD | NEW |