/src/aspell/common/info.hpp
Line | Count | Source (jump to first uncovered line) |
1 | | // This file is part of The New Aspell |
2 | | // Copyright (C) 2001 by Kevin Atkinson under the GNU LGPL license |
3 | | // version 2.0 or 2.1. You should have received a copy of the LGPL |
4 | | // license along with this library if you did not you can find |
5 | | // it at http://www.gnu.org/. |
6 | | |
7 | | #ifndef ASPELL_INFO__HPP |
8 | | #define ASPELL_INFO__HPP |
9 | | |
10 | | #include "posib_err.hpp" |
11 | | #include "type_id.hpp" |
12 | | |
13 | | namespace acommon { |
14 | | |
15 | | typedef int c_boolean; |
16 | | |
17 | | class Config; |
18 | | struct DictInfo; |
19 | | class DictInfoEnumeration; |
20 | | class DictInfoList; |
21 | | struct ModuleInfo; |
22 | | class ModuleInfoEnumeration; |
23 | | class ModuleInfoList; |
24 | | class StringList; |
25 | | struct StringListImpl; |
26 | | class FStream; |
27 | | class StringMap; |
28 | | |
29 | | struct ModuleInfo { |
30 | | const char * name; |
31 | | double order_num; |
32 | | const char * lib_dir; |
33 | | StringList * dict_exts; |
34 | | StringList * dict_dirs; |
35 | | }; |
36 | | |
37 | | PosibErr<void> get_dict_file_name(const DictInfo *, |
38 | | String & main_wl, String & flags); |
39 | | |
40 | | struct DictInfo { |
41 | | const char * name; |
42 | | const char * code; |
43 | | const char * variety; |
44 | | int size; |
45 | | const char * size_str; |
46 | | const ModuleInfo * module; |
47 | | }; |
48 | | |
49 | | struct MDInfoListAll; |
50 | | |
51 | | struct ModuleInfoNode; |
52 | | |
53 | | class ModuleInfoList { |
54 | | public: |
55 | 4.37k | ModuleInfoList() : size_(0), head_(0) {} |
56 | | void clear(); |
57 | | PosibErr<void> fill(MDInfoListAll &, Config *); |
58 | | bool empty() const; |
59 | | unsigned int size() const; |
60 | | ModuleInfoEnumeration * elements() const; |
61 | | PosibErr<void> proc_info(MDInfoListAll &, |
62 | | Config *, |
63 | | const char * name, |
64 | | unsigned int name_size, |
65 | | IStream &); |
66 | | ModuleInfoNode * find(const char * to_find, |
67 | | unsigned int to_find_len); |
68 | | public: // but don't use |
69 | | unsigned int size_; |
70 | | ModuleInfoNode * head_; |
71 | | }; |
72 | | |
73 | | PosibErr<const ModuleInfoList *> get_module_info_list(Config *); |
74 | | |
75 | | struct DictInfoNode; |
76 | | |
77 | | class DictInfoList { |
78 | | public: |
79 | 4.37k | DictInfoList() : size_(0), head_(0) {} |
80 | | void clear(); |
81 | | PosibErr<void> fill(MDInfoListAll &, Config *); |
82 | | bool empty() const; |
83 | | unsigned int size() const; |
84 | | DictInfoEnumeration * elements() const; |
85 | | PosibErr<void> proc_file(MDInfoListAll &, |
86 | | Config *, |
87 | | const char * dir, |
88 | | const char * name, |
89 | | unsigned int name_size, |
90 | | const ModuleInfo *); |
91 | | public: // but don't use |
92 | | unsigned int size_; |
93 | | DictInfoNode * head_; |
94 | | }; |
95 | | |
96 | | PosibErr<const DictInfoList *> get_dict_info_list(Config *); |
97 | | |
98 | | PosibErr<const StringMap *> get_dict_aliases(Config *); |
99 | | |
100 | | class ModuleInfoEnumeration { |
101 | | public: |
102 | | typedef const ModuleInfo * Value; |
103 | | |
104 | | const ModuleInfoNode * node_; |
105 | 1.06k | ModuleInfoEnumeration(const ModuleInfoNode * n) : node_(n) {} |
106 | | |
107 | | bool at_end() const; |
108 | | const ModuleInfo * next(); |
109 | | int ref_count_; |
110 | | TypeId type_id_; |
111 | 0 | unsigned int type_id() { return type_id_.num; } |
112 | | int copyable_; |
113 | 0 | int copyable() { return copyable_; } |
114 | | ModuleInfoEnumeration * clone() const; |
115 | | void assign(const ModuleInfoEnumeration * other); |
116 | 0 | ModuleInfoEnumeration() : ref_count_(0), copyable_(2) {} |
117 | 1.06k | virtual ~ModuleInfoEnumeration() {} |
118 | | }; |
119 | | |
120 | | struct DictInfoNode; |
121 | | |
122 | | class DictInfoEnumeration { |
123 | | public: |
124 | | const DictInfoNode * node_; |
125 | 1.06k | DictInfoEnumeration(const DictInfoNode * n) : node_(n) {} |
126 | | |
127 | | typedef const DictInfo * Value; |
128 | | |
129 | | bool at_end() const; |
130 | | const DictInfo * next(); |
131 | | int ref_count_; |
132 | | TypeId type_id_; |
133 | 0 | unsigned int type_id() { return type_id_.num; } |
134 | | int copyable_; |
135 | 0 | int copyable() { return copyable_; } |
136 | | DictInfoEnumeration * clone() const; |
137 | | void assign(const DictInfoEnumeration * other); |
138 | 0 | DictInfoEnumeration() : ref_count_(0), copyable_(2) {} |
139 | 1.06k | virtual ~DictInfoEnumeration() {} |
140 | | }; |
141 | | |
142 | | |
143 | | |
144 | | |
145 | | } |
146 | | |
147 | | #endif /* ASPELL_INFO__HPP */ |