/src/aspell/lib/config-c.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* Automatically generated file. Do not edit directly. */ |
2 | | |
3 | | /* This file is part of The New Aspell |
4 | | * Copyright (C) 2001-2002 by Kevin Atkinson under the GNU LGPL |
5 | | * license version 2.0 or 2.1. You should have received a copy of the |
6 | | * LGPL license along with this library if you did not you can find it |
7 | | * at http://www.gnu.org/. */ |
8 | | |
9 | | #include "config.hpp" |
10 | | #include "error.hpp" |
11 | | #include "posib_err.hpp" |
12 | | #include "string.hpp" |
13 | | |
14 | | namespace acommon { |
15 | | |
16 | | class Config; |
17 | | struct Error; |
18 | | struct KeyInfo; |
19 | | class KeyInfoEnumeration; |
20 | | class MutableContainer; |
21 | | class StringPairEnumeration; |
22 | | |
23 | | extern "C" int aspell_key_info_enumeration_at_end(const KeyInfoEnumeration * ths) |
24 | 0 | { |
25 | 0 | return ths->at_end(); |
26 | 0 | } |
27 | | |
28 | | extern "C" const KeyInfo * aspell_key_info_enumeration_next(KeyInfoEnumeration * ths) |
29 | 0 | { |
30 | 0 | return ths->next(); |
31 | 0 | } |
32 | | |
33 | | extern "C" void delete_aspell_key_info_enumeration(KeyInfoEnumeration * ths) |
34 | 0 | { |
35 | 0 | delete ths; |
36 | 0 | } |
37 | | |
38 | | extern "C" KeyInfoEnumeration * aspell_key_info_enumeration_clone(const KeyInfoEnumeration * ths) |
39 | 0 | { |
40 | 0 | return ths->clone(); |
41 | 0 | } |
42 | | |
43 | | extern "C" void aspell_key_info_enumeration_assign(KeyInfoEnumeration * ths, const KeyInfoEnumeration * other) |
44 | 0 | { |
45 | 0 | ths->assign(other); |
46 | 0 | } |
47 | | |
48 | | extern "C" Config * new_aspell_config() |
49 | 991 | { |
50 | 991 | return new_config(); |
51 | 991 | } |
52 | | |
53 | | extern "C" void delete_aspell_config(Config * ths) |
54 | 991 | { |
55 | 991 | delete ths; |
56 | 991 | } |
57 | | |
58 | | extern "C" Config * aspell_config_clone(const Config * ths) |
59 | 0 | { |
60 | 0 | return ths->clone(); |
61 | 0 | } |
62 | | |
63 | | extern "C" void aspell_config_assign(Config * ths, const Config * other) |
64 | 0 | { |
65 | 0 | ths->assign(other); |
66 | 0 | } |
67 | | |
68 | | extern "C" unsigned int aspell_config_error_number(const Config * ths) |
69 | 0 | { |
70 | 0 | return ths->err_ == 0 ? 0 : 1; |
71 | 0 | } |
72 | | |
73 | | extern "C" const char * aspell_config_error_message(const Config * ths) |
74 | 0 | { |
75 | 0 | return ths->err_ ? ths->err_->mesg : ""; |
76 | 0 | } |
77 | | |
78 | | extern "C" const Error * aspell_config_error(const Config * ths) |
79 | 0 | { |
80 | 0 | return ths->err_; |
81 | 0 | } |
82 | | |
83 | | extern "C" void aspell_config_set_extra(Config * ths, const KeyInfo * begin, const KeyInfo * end) |
84 | 0 | { |
85 | 0 | ths->set_extra(begin, end); |
86 | 0 | } |
87 | | |
88 | | extern "C" const KeyInfo * aspell_config_keyinfo(Config * ths, const char * key) |
89 | 0 | { |
90 | 0 | PosibErr<const KeyInfo *> ret = ths->keyinfo(key); |
91 | 0 | ths->err_.reset(ret.release_err()); |
92 | 0 | if (ths->err_ != 0) return 0; |
93 | 0 | return ret.data; |
94 | 0 | } |
95 | | |
96 | | extern "C" KeyInfoEnumeration * aspell_config_possible_elements(Config * ths, int include_extra) |
97 | 0 | { |
98 | 0 | return ths->possible_elements(include_extra); |
99 | 0 | } |
100 | | |
101 | | extern "C" const char * aspell_config_get_default(Config * ths, const char * key) |
102 | 0 | { |
103 | 0 | PosibErr<String> ret = ths->get_default(key); |
104 | 0 | ths->err_.reset(ret.release_err()); |
105 | 0 | if (ths->err_ != 0) return 0; |
106 | 0 | ths->temp_str = ret.data; |
107 | 0 | return ths->temp_str.c_str(); |
108 | 0 | } |
109 | | |
110 | | extern "C" StringPairEnumeration * aspell_config_elements(Config * ths) |
111 | 0 | { |
112 | 0 | return ths->elements(); |
113 | 0 | } |
114 | | |
115 | | extern "C" int aspell_config_replace(Config * ths, const char * key, const char * value) |
116 | 29.4k | { |
117 | 29.4k | PosibErr<void> ret = ths->replace(key, value); |
118 | 29.4k | ths->err_.reset(ret.release_err()); |
119 | 29.4k | if (ths->err_ != 0) return 0; |
120 | 12.3k | return 1; |
121 | 29.4k | } |
122 | | |
123 | | extern "C" int aspell_config_remove(Config * ths, const char * key) |
124 | 0 | { |
125 | 0 | PosibErr<void> ret = ths->remove(key); |
126 | 0 | ths->err_.reset(ret.release_err()); |
127 | 0 | if (ths->err_ != 0) return 0; |
128 | 0 | return 1; |
129 | 0 | } |
130 | | |
131 | | extern "C" int aspell_config_have(const Config * ths, const char * key) |
132 | 0 | { |
133 | 0 | return ths->have(key); |
134 | 0 | } |
135 | | |
136 | | extern "C" const char * aspell_config_retrieve(Config * ths, const char * key) |
137 | 0 | { |
138 | 0 | PosibErr<String> ret = ths->retrieve(key); |
139 | 0 | ths->err_.reset(ret.release_err()); |
140 | 0 | if (ths->err_ != 0) return 0; |
141 | 0 | ths->temp_str = ret.data; |
142 | 0 | return ths->temp_str.c_str(); |
143 | 0 | } |
144 | | |
145 | | extern "C" int aspell_config_retrieve_list(Config * ths, const char * key, MutableContainer * lst) |
146 | 0 | { |
147 | 0 | PosibErr<void> ret = ths->retrieve_list(key, lst); |
148 | 0 | ths->err_.reset(ret.release_err()); |
149 | 0 | if (ths->err_ != 0) return 0; |
150 | 0 | return 1; |
151 | 0 | } |
152 | | |
153 | | extern "C" int aspell_config_retrieve_bool(Config * ths, const char * key) |
154 | 0 | { |
155 | 0 | PosibErr<bool> ret = ths->retrieve_bool(key); |
156 | 0 | ths->err_.reset(ret.release_err()); |
157 | 0 | if (ths->err_ != 0) return -1; |
158 | 0 | return ret.data; |
159 | 0 | } |
160 | | |
161 | | extern "C" int aspell_config_retrieve_int(Config * ths, const char * key) |
162 | 0 | { |
163 | 0 | PosibErr<unsigned int> ret = ths->retrieve_int(key); |
164 | 0 | ths->err_.reset(ret.release_err()); |
165 | 0 | if (ths->err_ != 0) return -1; |
166 | 0 | return ret.data; |
167 | 0 | } |
168 | | |
169 | | |
170 | | |
171 | | } |
172 | | |