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

Side by Side Diff: chrome/tools/convert_dict/dic_reader.h

Issue 12163003: Add FilePath to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « chrome/tools/convert_dict/aff_reader.h ('k') | chrome/utility/chrome_content_utility_client.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_TOOLS_CONVERT_DICT_DIC_READER_H__ 5 #ifndef CHROME_TOOLS_CONVERT_DICT_DIC_READER_H__
6 #define CHROME_TOOLS_CONVERT_DICT_DIC_READER_H__ 6 #define CHROME_TOOLS_CONVERT_DICT_DIC_READER_H__
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 namespace base {
13 class FilePath; 14 class FilePath;
15 }
14 16
15 namespace convert_dict { 17 namespace convert_dict {
16 18
17 class AffReader; 19 class AffReader;
18 20
19 // Reads Hunspell .dic files. 21 // Reads Hunspell .dic files.
20 class DicReader { 22 class DicReader {
21 public: 23 public:
22 // Associated with each word is a list of affix group IDs. This will typically 24 // Associated with each word is a list of affix group IDs. This will typically
23 // be only one long, but may be more if there are multiple groups of 25 // be only one long, but may be more if there are multiple groups of
24 // independent affix rules for a base word. 26 // independent affix rules for a base word.
25 typedef std::pair<std::string, std::vector<int> > WordEntry; 27 typedef std::pair<std::string, std::vector<int> > WordEntry;
26 typedef std::vector<WordEntry> WordList; 28 typedef std::vector<WordEntry> WordList;
27 29
28 explicit DicReader(const FilePath& path); 30 explicit DicReader(const base::FilePath& path);
29 ~DicReader(); 31 ~DicReader();
30 32
31 // Non-numeric affixes will be added to the given AffReader and converted into 33 // Non-numeric affixes will be added to the given AffReader and converted into
32 // indices. 34 // indices.
33 bool Read(AffReader* aff_reader); 35 bool Read(AffReader* aff_reader);
34 36
35 // Returns the words read by Read(). These will be in order. 37 // Returns the words read by Read(). These will be in order.
36 const WordList& words() const { return words_; } 38 const WordList& words() const { return words_; }
37 39
38 private: 40 private:
39 FILE* file_; 41 FILE* file_;
40 FILE* additional_words_file_; 42 FILE* additional_words_file_;
41 43
42 // Contains all words and their corresponding affix index. 44 // Contains all words and their corresponding affix index.
43 WordList words_; 45 WordList words_;
44 }; 46 };
45 47
46 } // namespace convert_dict 48 } // namespace convert_dict
47 49
48 #endif // CHROME_TOOLS_CONVERT_DICT_DIC_READER_H__ 50 #endif // CHROME_TOOLS_CONVERT_DICT_DIC_READER_H__
OLDNEW
« no previous file with comments | « chrome/tools/convert_dict/aff_reader.h ('k') | chrome/utility/chrome_content_utility_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698