~ubuntu-branches/ubuntu/hardy/gengetopt/hardy

« back to all changes in this revision

Viewing changes to src/gm_utils.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-01-29 14:55:40 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080129145540-bkah1bl330gpelmh
Tags: 2.22-1ubuntu1
* Merge with Debian; remaining changes:
  - Fix build failures with g++-4.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
}
80
80
 
81
81
bool
 
82
has_multiple_options_all_string()
 
83
{
 
84
  if (! has_multiple_options ())
 
85
    return false;
 
86
 
 
87
  struct gengetopt_option * opt = 0;
 
88
 
 
89
  foropt
 
90
  {
 
91
    if (opt->multiple && (opt->type && opt->type != ARG_STRING))
 
92
      return false;
 
93
  }
 
94
 
 
95
  return true;
 
96
}
 
97
 
 
98
bool
82
99
has_multiple_options_string()
83
100
{
84
101
  if (! has_multiple_options ())
124
141
}
125
142
 
126
143
bool
 
144
has_multiple_options_with_default()
 
145
{
 
146
  gengetopt_option * opt = 0;
 
147
 
 
148
  for (gengetopt_option_list::iterator it = gengetopt_options.begin();
 
149
                    it != gengetopt_options.end() && (opt = *it);
 
150
                    ++it)
 
151
    if (opt->multiple && opt->default_given)
 
152
      return true;
 
153
 
 
154
  return false;
 
155
}
 
156
 
 
157
bool
 
158
has_options_with_details()
 
159
{
 
160
  gengetopt_option * opt = 0;
 
161
 
 
162
  for (gengetopt_option_list::iterator it = gengetopt_options.begin();
 
163
                    it != gengetopt_options.end() && (opt = *it);
 
164
                    ++it)
 
165
    if (opt->details)
 
166
      return true;
 
167
 
 
168
  return false;
 
169
}
 
170
 
 
171
bool
 
172
has_options_with_type()
 
173
{
 
174
  gengetopt_option * opt = 0;
 
175
 
 
176
  for (gengetopt_option_list::iterator it = gengetopt_options.begin();
 
177
                    it != gengetopt_options.end() && (opt = *it);
 
178
                    ++it)
 
179
    if (opt->type)
 
180
      return true;
 
181
 
 
182
  return false;
 
183
}
 
184
 
 
185
bool
 
186
has_options_with_mode()
 
187
{
 
188
  gengetopt_option * opt = 0;
 
189
 
 
190
  for (gengetopt_option_list::iterator it = gengetopt_options.begin();
 
191
                    it != gengetopt_options.end() && (opt = *it);
 
192
                    ++it)
 
193
    if (opt->mode_value)
 
194
      return true;
 
195
 
 
196
  return false;
 
197
}
 
198
 
 
199
bool
127
200
has_required()
128
201
{
129
202
  struct gengetopt_option * opt = 0;