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

Side by Side Diff: base/i18n/build_utf8_validator_tables.cc

Issue 468253002: Move file_util to base/files/ directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to add forwarding header to patch Created 6 years, 4 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 | « base/files/scoped_temp_dir_unittest.cc ('k') | base/i18n/file_util_icu_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // Create a state machine for validating UTF-8. The algorithm in brief: 5 // Create a state machine for validating UTF-8. The algorithm in brief:
6 // 1. Convert the complete unicode range of code points, except for the 6 // 1. Convert the complete unicode range of code points, except for the
7 // surrogate code points, to an ordered array of sequences of bytes in 7 // surrogate code points, to an ordered array of sequences of bytes in
8 // UTF-8. 8 // UTF-8.
9 // 2. Convert individual bytes to ranges, starting from the right of each byte 9 // 2. Convert individual bytes to ranges, starting from the right of each byte
10 // sequence. For each range, ensure the bytes on the left and the ranges 10 // sequence. For each range, ensure the bytes on the left and the ranges
(...skipping 19 matching lines...) Expand all
30 #include <stdlib.h> 30 #include <stdlib.h>
31 #include <string.h> 31 #include <string.h>
32 32
33 #include <algorithm> 33 #include <algorithm>
34 #include <map> 34 #include <map>
35 #include <string> 35 #include <string>
36 #include <vector> 36 #include <vector>
37 37
38 #include "base/basictypes.h" 38 #include "base/basictypes.h"
39 #include "base/command_line.h" 39 #include "base/command_line.h"
40 #include "base/file_util.h"
41 #include "base/files/file_path.h" 40 #include "base/files/file_path.h"
41 #include "base/files/file_util.h"
42 #include "base/logging.h" 42 #include "base/logging.h"
43 #include "base/numerics/safe_conversions.h" 43 #include "base/numerics/safe_conversions.h"
44 #include "base/strings/stringprintf.h" 44 #include "base/strings/stringprintf.h"
45 #include "third_party/icu/source/common/unicode/utf8.h" 45 #include "third_party/icu/source/common/unicode/utf8.h"
46 46
47 namespace { 47 namespace {
48 48
49 const char kHelpText[] = 49 const char kHelpText[] =
50 "Usage: build_utf8_validator_tables [ --help ] [ --output=<file> ]\n"; 50 "Usage: build_utf8_validator_tables [ --help ] [ --output=<file> ]\n";
51 51
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 PrintStates(states, output); 457 PrintStates(states, output);
458 458
459 if (!filename.empty()) { 459 if (!filename.empty()) {
460 if (!base::CloseFile(output)) 460 if (!base::CloseFile(output))
461 PLOG(FATAL) << "Couldn't finish writing '" << filename.AsUTF8Unsafe() 461 PLOG(FATAL) << "Couldn't finish writing '" << filename.AsUTF8Unsafe()
462 << "'"; 462 << "'";
463 } 463 }
464 464
465 return EXIT_SUCCESS; 465 return EXIT_SUCCESS;
466 } 466 }
OLDNEW
« no previous file with comments | « base/files/scoped_temp_dir_unittest.cc ('k') | base/i18n/file_util_icu_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698