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

Side by Side Diff: chrome/tools/convert_dict/convert_dict.cc

Issue 22875025: base: Minor cleanups in icu_util.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/test/test_suite.cc ('k') | content/app/content_main_runner.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 (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 tool converts Hunspell .aff/.dic pairs to a combined binary dictionary 5 // This tool converts Hunspell .aff/.dic pairs to a combined binary dictionary
6 // format (.bdic). This format is more compact, and can be more efficiently 6 // format (.bdic). This format is more compact, and can be more efficiently
7 // read by the client application. 7 // read by the client application.
8 // 8 //
9 // We do this conversion manually before publishing dictionary files. It is not 9 // We do this conversion manually before publishing dictionary files. It is not
10 // part of any build process. 10 // part of any build process.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 #if defined(OS_WIN) 86 #if defined(OS_WIN)
87 int wmain(int argc, wchar_t* argv[]) { 87 int wmain(int argc, wchar_t* argv[]) {
88 #else 88 #else
89 int main(int argc, char* argv[]) { 89 int main(int argc, char* argv[]) {
90 #endif 90 #endif
91 base::EnableTerminationOnHeapCorruption(); 91 base::EnableTerminationOnHeapCorruption();
92 if (argc != 2) 92 if (argc != 2)
93 return PrintHelp(); 93 return PrintHelp();
94 94
95 base::AtExitManager exit_manager; 95 base::AtExitManager exit_manager;
96 icu_util::Initialize(); 96 base::i18n::InitializeICU();
97 97
98 base::FilePath file_base = base::FilePath(argv[1]); 98 base::FilePath file_base = base::FilePath(argv[1]);
99 99
100 base::FilePath aff_path = 100 base::FilePath aff_path =
101 file_base.ReplaceExtension(FILE_PATH_LITERAL(".aff")); 101 file_base.ReplaceExtension(FILE_PATH_LITERAL(".aff"));
102 printf("Reading %" PRFilePath " ...\n", aff_path.value().c_str()); 102 printf("Reading %" PRFilePath " ...\n", aff_path.value().c_str());
103 convert_dict::AffReader aff_reader(aff_path); 103 convert_dict::AffReader aff_reader(aff_path);
104 if (!aff_reader.Read()) { 104 if (!aff_reader.Read()) {
105 printf("Unable to read the aff file.\n"); 105 printf("Unable to read the aff file.\n");
106 return 1; 106 return 1;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 if (!out_file) { 140 if (!out_file) {
141 printf("ERROR writing file\n"); 141 printf("ERROR writing file\n");
142 return 1; 142 return 1;
143 } 143 }
144 size_t written = fwrite(&serialized[0], 1, serialized.size(), out_file); 144 size_t written = fwrite(&serialized[0], 1, serialized.size(), out_file);
145 CHECK(written == serialized.size()); 145 CHECK(written == serialized.size());
146 file_util::CloseFile(out_file); 146 file_util::CloseFile(out_file);
147 147
148 return 0; 148 return 0;
149 } 149 }
OLDNEW
« no previous file with comments | « base/test/test_suite.cc ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698