Debian Codegraph @

src/options.icc

raw
1 /* Inline Functions for options.{h,cc}.
2
3 Copyright (C) 1989-1998, 2000, 2002-2004, 2011 Free Software Foundation, Inc.
4 Written by Douglas C. Schmidt <[email protected]>
5 and Bruno Haible <[email protected]>.
6
7 This file is part of GNU GPERF.
8
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <https://www.gnu.org/licenses/>. */
21
22 /* ----------------------------- Class Options ----------------------------- */
23
24 /* Tests a given boolean option. Returns true if set, false otherwise. */
25 INLINE bool
26 Options::operator[] (Option_Type option) const
27 {
28 return _option_word & option;
29 }
30
31 /* Sets a given boolean option. */
32 INLINE void
33 Options::set (Option_Type option)
34 {
35 _option_word |= option;
36 }
37
38 /* Returns the input file name. */
39 INLINE const char *
40 Options::get_input_file_name () const
41 {
42 return _input_file_name;
43 }
44
45 /* Returns the output file name. */
46 INLINE const char *
47 Options::get_output_file_name () const
48 {
49 return _output_file_name;
50 }
51
52 /* Returns the jump value. */
53 INLINE int
54 Options::get_jump () const
55 {
56 return _jump;
57 }
58
59 /* Returns the initial associated character value. */
60 INLINE int
61 Options::get_initial_asso_value () const
62 {
63 return _initial_asso_value;
64 }
65
66 /* Returns the number of iterations for finding finding good asso_values. */
67 INLINE int
68 Options::get_asso_iterations () const
69 {
70 return _asso_iterations;
71 }
72
73 /* Returns the total number of switch statements to generate. */
74 INLINE int
75 Options::get_total_switches () const
76 {
77 return _total_switches;
78 }
79
80 /* Returns the factor by which to multiply the generated table's size. */
81 INLINE float
82 Options::get_size_multiple () const
83 {
84 return _size_multiple;
85 }
86
87 /* Returns the generated function name. */
88 INLINE const char *
89 Options::get_function_name () const
90 {
91 return _function_name;
92 }
93
94 /* Returns the keyword key name. */
95 INLINE const char *
96 Options::get_slot_name () const
97 {
98 return _slot_name;
99 }
100
101 /* Returns the struct initializer suffix. */
102 INLINE const char *
103 Options::get_initializer_suffix () const
104 {
105 return _initializer_suffix;
106 }
107
108 /* Returns the generated class name. */
109 INLINE const char *
110 Options::get_class_name () const
111 {
112 return _class_name;
113 }
114
115 /* Returns the hash function name. */
116 INLINE const char *
117 Options::get_hash_name () const
118 {
119 return _hash_name;
120 }
121
122 /* Returns the hash table array name. */
123 INLINE const char *
124 Options::get_wordlist_name () const
125 {
126 return _wordlist_name;
127 }
128
129 /* Returns the length table array name. */
130 INLINE const char *
131 Options::get_lengthtable_name () const
132 {
133 return _lengthtable_name;
134 }
135
136 /* Returns the string pool name. */
137 INLINE const char *
138 Options::get_stringpool_name () const
139 {
140 return _stringpool_name;
141 }
142
143 /* Returns the prefix for the constants. */
144 INLINE const char *
145 Options::get_constants_prefix () const
146 {
147 return _constants_prefix;
148 }
149
150 /* Returns the string used to delimit keywords from other attributes. */
151 INLINE const char *
152 Options::get_delimiters () const
153 {
154 return _delimiters;
155 }
156
157 /* Returns key positions. */
158 INLINE const Positions&
159 Options::get_key_positions () const
160 {
161 return _key_positions;
162 }