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

Side by Side Diff: base/strings/string_util.h

Issue 1493503002: base: get rid of deprecated TrimWhitespace() function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE Created 5 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
« no previous file with comments | « base/command_line.cc ('k') | base/strings/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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_STRINGS_STRING_UTIL_H_ 7 #ifndef BASE_STRINGS_STRING_UTIL_H_
8 #define BASE_STRINGS_STRING_UTIL_H_ 8 #define BASE_STRINGS_STRING_UTIL_H_
9 9
10 #include <ctype.h> 10 #include <ctype.h>
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 TrimPositions positions, 236 TrimPositions positions,
237 string16* output); 237 string16* output);
238 BASE_EXPORT StringPiece16 TrimWhitespace(StringPiece16 input, 238 BASE_EXPORT StringPiece16 TrimWhitespace(StringPiece16 input,
239 TrimPositions positions); 239 TrimPositions positions);
240 BASE_EXPORT TrimPositions TrimWhitespaceASCII(const std::string& input, 240 BASE_EXPORT TrimPositions TrimWhitespaceASCII(const std::string& input,
241 TrimPositions positions, 241 TrimPositions positions,
242 std::string* output); 242 std::string* output);
243 BASE_EXPORT StringPiece TrimWhitespaceASCII(StringPiece input, 243 BASE_EXPORT StringPiece TrimWhitespaceASCII(StringPiece input,
244 TrimPositions positions); 244 TrimPositions positions);
245 245
246 // Deprecated. This function is only for backward compatibility and calls
247 // TrimWhitespaceASCII().
248 BASE_EXPORT TrimPositions TrimWhitespace(const std::string& input,
249 TrimPositions positions,
250 std::string* output);
251
252 // Searches for CR or LF characters. Removes all contiguous whitespace 246 // Searches for CR or LF characters. Removes all contiguous whitespace
253 // strings that contain them. This is useful when trying to deal with text 247 // strings that contain them. This is useful when trying to deal with text
254 // copied from terminals. 248 // copied from terminals.
255 // Returns |text|, with the following three transformations: 249 // Returns |text|, with the following three transformations:
256 // (1) Leading and trailing whitespace is trimmed. 250 // (1) Leading and trailing whitespace is trimmed.
257 // (2) If |trim_sequences_with_line_breaks| is true, any other whitespace 251 // (2) If |trim_sequences_with_line_breaks| is true, any other whitespace
258 // sequences containing a CR or LF are trimmed. 252 // sequences containing a CR or LF are trimmed.
259 // (3) All other whitespace sequences are converted to single spaces. 253 // (3) All other whitespace sequences are converted to single spaces.
260 BASE_EXPORT string16 CollapseWhitespace( 254 BASE_EXPORT string16 CollapseWhitespace(
261 const string16& text, 255 const string16& text,
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 450
457 #if defined(OS_WIN) 451 #if defined(OS_WIN)
458 #include "base/strings/string_util_win.h" 452 #include "base/strings/string_util_win.h"
459 #elif defined(OS_POSIX) 453 #elif defined(OS_POSIX)
460 #include "base/strings/string_util_posix.h" 454 #include "base/strings/string_util_posix.h"
461 #else 455 #else
462 #error Define string operations appropriately for your platform 456 #error Define string operations appropriately for your platform
463 #endif 457 #endif
464 458
465 #endif // BASE_STRINGS_STRING_UTIL_H_ 459 #endif // BASE_STRINGS_STRING_UTIL_H_
OLDNEW
« no previous file with comments | « base/command_line.cc ('k') | base/strings/string_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698