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

Side by Side Diff: base/string_util.h

Issue 18452: Adding a HexEncode function to string_utils.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/string_util.cc » ('j') | base/string_util.cc » ('J')
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 <string> 10 #include <string>
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 bool ElideString(const std::wstring& input, int max_len, std::wstring* output); 521 bool ElideString(const std::wstring& input, int max_len, std::wstring* output);
522 522
523 // Returns true if the string passed in matches the pattern. The pattern 523 // Returns true if the string passed in matches the pattern. The pattern
524 // string can contain wildcards like * and ? 524 // string can contain wildcards like * and ?
525 // TODO(iyengar) This function may not work correctly for CJK strings as 525 // TODO(iyengar) This function may not work correctly for CJK strings as
526 // it does individual character matches. 526 // it does individual character matches.
527 // The backslash character (\) is an escape character for * and ? 527 // The backslash character (\) is an escape character for * and ?
528 bool MatchPattern(const std::wstring& string, const std::wstring& pattern); 528 bool MatchPattern(const std::wstring& string, const std::wstring& pattern);
529 bool MatchPattern(const std::string& string, const std::string& pattern); 529 bool MatchPattern(const std::string& string, const std::string& pattern);
530 530
531 // Returns a hex string representation of a binary buffer.
532 // The returned hex string will be in upper case.
533 // This function does not check if |size| is within reasonable limits since
534 // it's written with trusted data in mind.
535 // If you suspect that the data you want to format might be large,
536 // the absolute max size for |size| should be is
537 // std::numeric_limits<size_t>::max() / 2
538 std::string HexEncode(const void* bytes, size_t size);
539
531 #endif // BASE_STRING_UTIL_H_ 540 #endif // BASE_STRING_UTIL_H_
532
OLDNEW
« no previous file with comments | « no previous file | base/string_util.cc » ('j') | base/string_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698