OLD | NEW |
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. |
11 // | 11 // |
12 // See PrintHelp() below for usage. | 12 // See PrintHelp() below for usage. |
13 | 13 |
14 #include <stdio.h> | 14 #include <stdio.h> |
15 | 15 |
16 #include "base/at_exit.h" | 16 #include "base/at_exit.h" |
17 #include "base/file_util.h" | |
18 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
| 18 #include "base/files/file_util.h" |
19 #include "base/i18n/icu_util.h" | 19 #include "base/i18n/icu_util.h" |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "base/process/memory.h" | 21 #include "base/process/memory.h" |
22 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
23 #include "chrome/tools/convert_dict/aff_reader.h" | 23 #include "chrome/tools/convert_dict/aff_reader.h" |
24 #include "chrome/tools/convert_dict/dic_reader.h" | 24 #include "chrome/tools/convert_dict/dic_reader.h" |
25 #include "third_party/hunspell/google/bdict_reader.h" | 25 #include "third_party/hunspell/google/bdict_reader.h" |
26 #include "third_party/hunspell/google/bdict_writer.h" | 26 #include "third_party/hunspell/google/bdict_writer.h" |
27 | 27 |
28 namespace { | 28 namespace { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 base::CloseFile(out_file); | 146 base::CloseFile(out_file); |
147 | 147 |
148 return 0; | 148 return 0; |
149 } | 149 } |
OLD | NEW |