NCBI C++ ToolKit
ncbiargs_p.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: ncbiargs_p.hpp 69077 2015-09-30 15:30:00Z vakatov $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Denis Vakatov
27  *
28  * File Description:
29  * PRIVATE header -- for inclusion by "ncbiargs.cpp" only!
30  * Command-line arguments' processing:
31  * descriptions -- CArgDescriptions, CArgDesc
32  * constraints -- CArgAllow; CArgAllow_{Strings,Integers,Int8s,Doubles}
33  * parsed values -- CArgs, CArgValue
34  * exceptions -- CArgException, ARG_THROW()
35  *
36  */
37 
38 
39 #if !defined(NCBIARGS__CPP)
40 # error "PRIVATE header -- for inclusion by ncbiargs.cpp only!"
41 #endif
42 
43 
44 /////////////////////////////////////////////////////////////////////////////
45 /////////////////////////////////////////////////////////////////////////////
46 // CArg_***:: classes representing various types of argument value
47 //
48 // CArg_NoValue : CArgValue
49 //
50 // CArg_String : CArgValue
51 //
52 // CArg_Alnum : CArg_String
53 // CArg_Int8 : CArg_String
54 // CArg_Integer : CArg_Int8
55 // CArg_DataSize : CArg_String
56 // CArg_Double : CArg_String
57 // CArg_Boolean : CArg_String
58 // CArg_InputFile : CArg_String
59 // CArg_OutputFile : CArg_String
60 // CArg_IOFile : CArg_String
61 // CArg_Dir : CArg_String
62 // CArg_DateTime : CArg_String
63 //
64 
65 
66 class CArg_NoValue : public CArgValue
67 {
68 public:
69  CArg_NoValue(const string& name);
70  virtual bool HasValue(void) const;
71 
72  virtual const string& AsString (void) const;
73  virtual Int8 AsInt8 (void) const;
74  virtual int AsInteger(void) const;
75  virtual double AsDouble (void) const;
76  virtual bool AsBoolean(void) const;
77  virtual const CDir& AsDirectory(void) const;
78  virtual const CTime& AsDateTime(void) const;
79 
80  virtual CNcbiIstream& AsInputFile (TFileFlags flags = 0) const;
81  virtual CNcbiOstream& AsOutputFile(TFileFlags flags = 0) const;
82  virtual CNcbiIostream& AsIOFile(TFileFlags flags = 0) const;
83  virtual void CloseFile (void) const;
84 };
85 
86 
87 // Generates error (like CArg_NoValue) for excluded arguments.
89 {
90 public:
91  CArg_ExcludedValue(const string& name);
92  virtual bool HasValue(void) const;
93 
94  virtual const string& AsString (void) const;
95  virtual Int8 AsInt8 (void) const;
96  virtual int AsInteger(void) const;
97  virtual double AsDouble (void) const;
98  virtual bool AsBoolean(void) const;
99  virtual const CDir& AsDirectory(void) const;
100  virtual const CTime& AsDateTime(void) const;
101 
102  virtual CNcbiIstream& AsInputFile (TFileFlags flags = 0) const;
103  virtual CNcbiOstream& AsOutputFile(TFileFlags flags = 0) const;
104  virtual CNcbiIostream& AsIOFile(TFileFlags flags = 0) const;
105  virtual void CloseFile (void) const;
106 };
107 
108 
109 class CArg_String : public CArgValue
110 {
111 public:
112  CArg_String(const string& name, const string& value);
113  virtual bool HasValue(void) const;
114 
115  virtual const string& AsString (void) const;
116  virtual Int8 AsInt8 (void) const;
117  virtual int AsInteger(void) const;
118  virtual double AsDouble (void) const;
119  virtual bool AsBoolean(void) const;
120  virtual const CDir& AsDirectory(void) const;
121  virtual const CTime& AsDateTime(void) const;
122 
123  virtual CNcbiIstream& AsInputFile (TFileFlags flags = 0) const;
124  virtual CNcbiOstream& AsOutputFile(TFileFlags flags = 0) const;
125  virtual CNcbiIostream& AsIOFile(TFileFlags flags = 0) const;
126  virtual void CloseFile (void) const;
127 
128  virtual const TStringArray& GetStringList() const;
129  virtual TStringArray& SetStringList();
130 
131 private:
132  /// Value of the argument as passed to the constructor ("value")
133  /// becomes the first element in the value list
134  /// AsString() and other methods then use it
136 };
137 
138 
139 
140 class CArg_Int8 : public CArg_String
141 {
142 public:
143  CArg_Int8(const string& name, const string& value);
144  virtual Int8 AsInt8(void) const;
145 protected:
147 };
148 
149 
150 
151 class CArg_Integer : public CArg_Int8
152 {
153 public:
154  CArg_Integer(const string& name, const string& value);
155  virtual int AsInteger(void) const;
156 };
157 
158 
159 
161 {
162 public:
163  CArg_DataSize(const string& name, const string& value);
164  virtual Int8 AsInt8(void) const;
165 protected:
167 };
168 
169 
170 
171 class CArg_Double : public CArg_String
172 {
173 public:
174  CArg_Double(const string& name, const string& value);
175  virtual double AsDouble(void) const;
176 private:
177  double m_Double;
178 };
179 
180 
181 
182 class CArg_Boolean : public CArg_String
183 {
184 public:
185  CArg_Boolean(const string& name, bool value);
186  CArg_Boolean(const string& name, const string& value);
187  virtual bool AsBoolean(void) const;
188 private:
189  bool m_Boolean;
190 };
191 
192 
193 
194 class CArg_Flag : public CArg_Boolean
195 {
196 public:
197  CArg_Flag(const string& name, bool value);
198  virtual bool HasValue(void) const;
199 };
200 
201 
202 class CArg_Dir : public CArg_String
203 {
204 public:
205  CArg_Dir(const string& name, const string& value,
207  virtual ~CArg_Dir(void);
208  virtual const CDir& AsDirectory() const;
209 protected:
212 };
213 
214 
216 {
217 public:
218  CArg_DateTime(const string& name, const string& value);
219  virtual const CTime& AsDateTime() const;
220 protected:
222 };
223 
224 
225 class CArg_Ios : public CArg_String
226 {
227 public:
228  CArg_Ios(const string& name, const string& value,
230  virtual ~CArg_Ios(void);
231 
232  virtual CNcbiIstream& AsInputFile( TFileFlags flags = 0) const;
233  virtual CNcbiOstream& AsOutputFile( TFileFlags flags = 0) const;
234  virtual CNcbiIostream& AsIOFile( TFileFlags flags = 0) const;
235 
236  virtual void CloseFile(void) const;
237  static IOS_BASE::openmode IosMode(TFileFlags flags);
238 
239 protected:
240  virtual void x_Open(TFileFlags flags) const;
241  bool x_CreatePath(TFileFlags flags) const;
242 
245  mutable CNcbiIos* m_Ios;
246  mutable bool m_DeleteFlag;
248 };
249 
250 
251 class CArg_InputFile : public CArg_Ios
252 {
253 public:
254  CArg_InputFile(const string& name, const string& value,
256 protected:
257  virtual void x_Open(TFileFlags flags) const;
258 };
259 
260 
261 
262 class CArg_OutputFile : public CArg_Ios
263 {
264 public:
265  CArg_OutputFile(const string& name, const string& value,
267 protected:
268  virtual void x_Open(TFileFlags flags) const;
269 };
270 
271 
272 
273 class CArg_IOFile : public CArg_Ios
274 {
275 public:
276  CArg_IOFile(const string& name, const string& value,
278 protected:
279  virtual void x_Open(TFileFlags flags) const;
280 };
281 
282 
283 /////////////////////////////////////////////////////////////////////////////
284 /////////////////////////////////////////////////////////////////////////////
285 // CArgDesc***:: abstract base classes for argument descriptions
286 //
287 // CArgDesc
288 //
289 // CArgDescMandatory : CArgDesc
290 // CArgDescOptional : virtual CArgDescMandatory
291 // CArgDescDefault : virtual CArgDescOptional
292 //
293 // CArgDescSynopsis
294 //
295 
296 
297 
299 {
300 public:
301  CArgDescMandatory(const string& name,
302  const string& comment,
305  virtual ~CArgDescMandatory(void);
306 
307  CArgDescriptions::EType GetType (void) const { return m_Type; }
308  virtual CArgDescriptions::TFlags GetFlags(void) const { return m_Flags; }
309 
310  virtual string GetUsageSynopsis(bool name_only = false) const = 0;
311  virtual string GetUsageCommentAttr(void) const;
312 
313  virtual CArgValue* ProcessArgument(const string& value) const;
314  virtual CArgValue* ProcessDefault(void) const;
315 
316  virtual
317  void SetConstraint(const CArgAllow* constraint,
319  virtual const CArgAllow* GetConstraint(void) const;
320  virtual bool IsConstraintInverted() const;
321 
322  virtual const CArgErrorHandler* GetErrorHandler(void) const
323  { return m_ErrorHandler.GetPointerOrNull(); }
325  { m_ErrorHandler.Reset(err_handler); }
326 
327 private:
333 };
334 
335 
336 class CArgDescOptional : virtual public CArgDescMandatory
337 {
338 public:
339  CArgDescOptional(const string& name,
340  const string& comment,
343  virtual ~CArgDescOptional(void);
344  virtual CArgValue* ProcessDefault(void) const;
345  virtual size_t GetGroup(void) const { return m_Group; }
346  virtual void SetGroup(size_t group) { m_Group = group; }
347 
348 private:
349  size_t m_Group;
350 };
351 
352 
353 
354 class CArgDescDefault : virtual public CArgDescOptional
355 {
356 public:
357  CArgDescDefault(const string& name,
358  const string& comment,
361  const string& default_value,
362  const string& env_var,
363  const char* display_value);
364  virtual ~CArgDescDefault(void);
365 
366  const string& GetDefaultValue(void) const;
367  const string& GetDisplayValue(void) const;
368 
369  virtual CArgValue* ProcessDefault(void) const;
370  virtual void VerifyDefault (void) const;
371 
372 private:
374  string m_EnvVar;
377 };
378 
379 
380 
382 {
383 public:
384  CArgDescSynopsis(const string& synopsis);
385  const string& GetSynopsis(void) const { return m_Synopsis; }
386 private:
387  string m_Synopsis;
388 };
389 
390 
391 
392 
393 /////////////////////////////////////////////////////////////////////////////
394 /////////////////////////////////////////////////////////////////////////////
395 // CArgDesc_***:: classes for argument descriptions
396 //
397 // CArgDesc_Flag : CArgDesc
398 //
399 // CArgDesc_Pos : virtual CArgDescMandatory
400 // CArgDesc_PosOpt : virtual CArgDescOptional, CArgDesc_Pos
401 // CArgDesc_PosDef : CArgDescDefault, CArgDesc_PosOpt
402 //
403 // CArgDescSynopsis
404 //
405 // CArgDesc_Key : CArgDesc_Pos, CArgDescSynopsis
406 // CArgDesc_KeyOpt : CArgDesc_PosOpt, CArgDescSynopsis
407 // CArgDesc_KeyDef : CArgDesc_PosDef, CArgDescSynopsis
408 //
409 
410 
411 class CArgDesc_Flag : public CArgDesc
412 {
413 public:
414  CArgDesc_Flag(const string& name,
415  const string& comment,
416  bool set_value = true);
417  virtual ~CArgDesc_Flag(void);
418 
419  virtual string GetUsageSynopsis(bool name_only = false) const;
420  virtual string GetUsageCommentAttr(void) const;
421 
422  virtual CArgValue* ProcessArgument(const string& value) const;
423  virtual CArgValue* ProcessDefault(void) const;
424  virtual size_t GetGroup(void) const { return m_Group; }
425  virtual void SetGroup(size_t group) { m_Group = group; }
426 
427  bool GetSetValue(void) const { return m_SetValue;}
428 
429 private:
430  size_t m_Group;
431  bool m_SetValue; // value to set if the arg is provided
432 };
433 
434 
435 
436 class CArgDesc_Pos : virtual public CArgDescMandatory
437 {
438 public:
439  CArgDesc_Pos(const string& name,
440  const string& comment,
443  virtual ~CArgDesc_Pos(void);
444  virtual string GetUsageSynopsis(bool name_only = false) const;
445 };
446 
447 
448 
449 class CArgDesc_Opening : virtual public CArgDescMandatory
450 {
451 public:
452  CArgDesc_Opening(const string& name,
453  const string& comment,
456  virtual ~CArgDesc_Opening(void);
457  virtual string GetUsageSynopsis(bool name_only = false) const;
458 };
459 
460 
461 
462 class CArgDesc_PosOpt : virtual public CArgDescOptional,
463  public CArgDesc_Pos
464 {
465 public:
466  CArgDesc_PosOpt(const string& name,
467  const string& comment,
470  virtual ~CArgDesc_PosOpt(void);
471 };
472 
473 
474 
476  public CArgDesc_PosOpt
477 {
478 public:
479  CArgDesc_PosDef(const string& name,
480  const string& comment,
483  const string& default_value,
484  const string& env_var,
485  const char* display_value);
486  virtual ~CArgDesc_PosDef(void);
487 };
488 
489 
490 
492 {
493 public:
494  CArgDesc_Key(const string& name,
495  const string& comment,
498  const string& synopsis);
499  virtual ~CArgDesc_Key(void);
500  virtual string GetUsageSynopsis(bool name_only = false) const;
501 };
502 
503 
504 
506 {
507 public:
508  CArgDesc_KeyOpt(const string& name,
509  const string& comment,
512  const string& synopsis);
513  virtual ~CArgDesc_KeyOpt(void);
514  virtual string GetUsageSynopsis(bool name_only = false) const;
515 };
516 
517 
518 
520 {
521 public:
522  CArgDesc_KeyDef(const string& name,
523  const string& comment,
526  const string& synopsis,
527  const string& default_value,
528  const string& env_var,
529  const char* display_value);
530  virtual ~CArgDesc_KeyDef(void);
531  virtual string GetUsageSynopsis(bool name_only = false) const;
532 };
533 
534 
535 // Special case - arg synonym. Can be used e.g. to create short and
536 // long argument names.
537 
538 class CArgDesc_Alias : public CArgDesc
539 {
540 public:
541  // Create an argument alias.
542  // alias is a new name for the existing argument, arg_name is
543  // its original name. Any search functions will return the original
544  // argument rather than the alias.
545  CArgDesc_Alias(const string& alias,
546  const string& arg_name,
547  const string& comment);
548  virtual ~CArgDesc_Alias(void);
549 
550  const string& GetAliasedName(void) const;
551 
552  // Dummy methods - to make the class not abstract
553  virtual string GetUsageSynopsis(bool name_only) const;
554  virtual string GetUsageCommentAttr(void) const;
555  virtual CArgValue* ProcessArgument(const string& value) const;
556  virtual CArgValue* ProcessDefault(void) const;
557 
558  void SetNegativeFlag(bool value) { m_NegativeFlag = value; }
559  bool GetNegativeFlag(void) const { return m_NegativeFlag; }
560 private:
561  string m_ArgName;
563 };
bool m_DeleteFlag
Definition: ncbiargs_p.hpp:246
virtual const CArgErrorHandler * GetErrorHandler(void) const
Get error handler for the argument.
Definition: ncbiargs_p.hpp:322
virtual Int8 AsInt8(void) const
Get the argument's integer (8-byte long) value.
Definition: ncbiargs.cpp:209
virtual bool AsBoolean(void) const
Get the argument's boolean value.
Definition: ncbiargs.cpp:245
virtual string GetUsageSynopsis(bool name_only=false) const =0
Get usage synopsis.
CArgDescriptions::EConstraintNegate m_NegateConstraint
Definition: ncbiargs_p.hpp:331
virtual bool HasValue(void) const
Check if argument holds a value.
Definition: ncbiargs.cpp:264
CArgDesc_Alias(const string &alias, const string &arg_name, const string &comment)
Definition: ncbiargs.cpp:1632
bool GetNegativeFlag(void) const
Definition: ncbiargs_p.hpp:559
virtual Int8 AsInt8(void) const
Get the argument's integer (8-byte long) value.
Definition: ncbiargs.cpp:388
virtual CNcbiIstream & AsInputFile(TFileFlags flags=0) const
Get the argument as an input file stream.
Definition: ncbiargs.cpp:215
virtual ~CArgDesc_KeyOpt(void)
Definition: ncbiargs.cpp:1583
TFileFlags m_CurrentFlags
Definition: ncbiargs_p.hpp:244
virtual ~CArgDesc_Alias(void)
Definition: ncbiargs.cpp:1642
virtual double AsDouble(void) const
Get the argument's double value.
Definition: ncbiargs.cpp:409
virtual ~CArgDesc_PosOpt(void)
Definition: ncbiargs.cpp:1487
CArgDescriptions::TFlags m_Flags
Definition: ncbiargs_p.hpp:329
virtual bool HasValue(void) const
Check if argument holds a value.
Definition: ncbiargs.cpp:450
virtual void x_Open(TFileFlags flags) const
Definition: ncbiargs.cpp:632
unsigned NCBI_INT8_TYPE Uint8
Unsigned 8 byte sized integer.
Definition: ncbitype.h:146
virtual string GetUsageCommentAttr(void) const
Get usage comment attribute.
Definition: ncbiargs.cpp:1659
Int8 m_Integer
Definition: ncbiargs_p.hpp:146
CArgDesc_Key(const string &name, const string &comment, CArgDescriptions::EType type, CArgDescriptions::TFlags flags, const string &synopsis)
Definition: ncbiargs.cpp:1525
virtual string GetUsageSynopsis(bool name_only) const
Get usage synopsis.
Definition: ncbiargs.cpp:1653
virtual CNcbiIostream & AsIOFile(TFileFlags flags=0) const
Get the argument as a file stream.
Definition: ncbiargs.cpp:591
IO_PREFIX::iostream CNcbiIostream
Portable alias for iostream.
Definition: ncbistre.hpp:145
void SetNegativeFlag(bool value)
Definition: ncbiargs_p.hpp:558
virtual CArgValue * ProcessDefault(void) const
Process argument default.
Definition: ncbiargs.cpp:1407
virtual void x_Open(TFileFlags flags) const
Definition: ncbiargs.cpp:552
virtual double AsDouble(void) const
Get the argument's double value.
Definition: ncbiargs.cpp:211
virtual bool IsConstraintInverted() const
Returns TRUE if associated constraint is inverted (NOT)
Definition: ncbiargs.cpp:1227
virtual CNcbiIostream & AsIOFile(TFileFlags flags=0) const
Get the argument as a file stream.
Definition: ncbiargs.cpp:250
IO_PREFIX::ios CNcbiIos
Portable alias for ios.
Definition: ncbistre.hpp:133
virtual ~CArg_Ios(void)
Definition: ncbiargs.cpp:546
CArg_String(const string &name, const string &value)
Definition: ncbiargs.cpp:257
unsigned int TFileFlags
Bitwise OR of "EFileFlags".
Definition: ncbiargs.hpp:246
unsigned int TFlags
Bitwise OR of "EFlags".
Definition: ncbiargs.hpp:649
virtual string GetUsageSynopsis(bool name_only=false) const
Get usage synopsis.
Definition: ncbiargs.cpp:1464
virtual CArgValue * ProcessDefault(void) const
Process argument default.
Definition: ncbiargs.cpp:1254
CArgDesc_Opening(const string &name, const string &comment, CArgDescriptions::EType type, CArgDescriptions::TFlags flags)
Definition: ncbiargs.cpp:1448
string m_DefaultValue
Definition: ncbiargs_p.hpp:373
virtual CNcbiIstream & AsInputFile(TFileFlags flags=0) const
Get the argument as an input file stream.
Definition: ncbiargs.cpp:569
virtual void VerifyDefault(void) const
Verify argument default value.
Definition: ncbiargs.cpp:1317
virtual CArgValue * ProcessArgument(const string &value) const
Process argument with specified value.
Definition: ncbiargs.cpp:1665
virtual TStringArray & SetStringList()
Get reference on value list for further modification.
Definition: ncbiargs.cpp:285
TFileFlags m_DescriptionFlags
Definition: ncbiargs_p.hpp:211
virtual string GetUsageCommentAttr(void) const
Get usage comment attribute.
Definition: ncbiargs.cpp:1391
CArgDesc_Pos(const string &name, const string &comment, CArgDescriptions::EType type, CArgDescriptions::TFlags flags)
Definition: ncbiargs.cpp:1422
signed NCBI_INT8_TYPE Int8
Signed 8 byte sized integer.
Definition: ncbitype.h:143
CArgValue –.
Definition: ncbiargs.hpp:181
virtual CArgValue * ProcessArgument(const string &value) const
Process argument with specified value.
Definition: ncbiargs.cpp:1114
CFastMutex –.
Definition: ncbimtx.hpp:666
virtual void SetGroup(size_t group)
Set argument group.
Definition: ncbiargs_p.hpp:425
virtual ~CArg_Dir(void)
Definition: ncbiargs.cpp:465
virtual bool HasValue(void) const
Check if argument holds a value.
Definition: ncbiargs.cpp:231
CArg_ExcludedValue(const string &name)
Definition: ncbiargs.cpp:224
virtual const CDir & AsDirectory(void) const
Get the argument as a directory.
Definition: ncbiargs.cpp:213
CArg_Flag(const string &name, bool value)
Definition: ncbiargs.cpp:446
virtual bool AsBoolean(void) const
Get the argument's boolean value.
Definition: ncbiargs.cpp:437
virtual const CDir & AsDirectory(void) const
Get the argument as a directory.
Definition: ncbiargs.cpp:246
const string & GetAliasedName(void) const
Definition: ncbiargs.cpp:1647
CNcbiIos * m_Ios
Definition: ncbiargs_p.hpp:245
virtual void SetErrorHandler(CArgErrorHandler *err_handler)
Set error handler for the argument.
Definition: ncbiargs_p.hpp:324
virtual const CDir & AsDirectory(void) const
Get the argument as a directory.
Definition: ncbiargs.cpp:307
CArg_NoValue(const string &name)
Definition: ncbiargs.cpp:191
TObjectType * GetPointerOrNull(void) THROWS_NONE
Get pointer value.
Definition: ncbiobj.hpp:977
virtual size_t GetGroup(void) const
Get argument group.
Definition: ncbiargs_p.hpp:424
TStringArray m_StringList
Value of the argument as passed to the constructor ("value") becomes the first element in the value l...
Definition: ncbiargs_p.hpp:135
virtual double AsDouble(void) const
Get the argument's double value.
Definition: ncbiargs.cpp:244
CArgDesc_Flag(const string &name, const string &comment, bool set_value=true)
Definition: ncbiargs.cpp:1367
virtual ~CArgDesc_Pos(void)
Definition: ncbiargs.cpp:1432
virtual ~CArgDescDefault(void)
Definition: ncbiargs.cpp:1285
CArgDescMandatory(const string &name, const string &comment, CArgDescriptions::EType type, CArgDescriptions::TFlags flags)
Definition: ncbiargs.cpp:1046
virtual ~CArgDesc_Key(void)
Definition: ncbiargs.cpp:1538
bool x_CreatePath(TFileFlags flags) const
Definition: ncbiargs.cpp:560
CArg_Double(const string &name, const string &value)
Definition: ncbiargs.cpp:397
virtual CArgValue * ProcessDefault(void) const
Process argument default.
Definition: ncbiargs.cpp:1671
CArgDescSynopsis(const string &synopsis)
Definition: ncbiargs.cpp:1335
virtual string GetUsageCommentAttr(void) const
Get usage comment attribute.
Definition: ncbiargs.cpp:1095
virtual void CloseFile(void) const
Close the file.
Definition: ncbiargs.cpp:327
CArg_Dir(const string &name, const string &value, CArgDescriptions::TFlags flags)
Definition: ncbiargs.cpp:459
virtual CNcbiIstream & AsInputFile(TFileFlags flags=0) const
Get the argument as an input file stream.
Definition: ncbiargs.cpp:315
virtual const CTime & AsDateTime(void) const
Get the argument as a DateTime.
Definition: ncbiargs.cpp:214
virtual int AsInteger(void) const
Get the argument's integer value.
Definition: ncbiargs.cpp:243
CArgDescriptions::EType m_Type
Definition: ncbiargs_p.hpp:328
virtual ~CArgDesc_PosDef(void)
Definition: ncbiargs.cpp:1514
virtual bool HasValue(void) const
Check if argument holds a value.
Definition: ncbiargs.cpp:198
CArgDesc –.
Definition: ncbiargs.hpp:1743
CDir –.
Definition: ncbifile.hpp:1687
CArgDesc_KeyDef(const string &name, const string &comment, CArgDescriptions::EType type, CArgDescriptions::TFlags flags, const string &synopsis, const string &default_value, const string &env_var, const char *display_value)
Definition: ncbiargs.cpp:1600
virtual int AsInteger(void) const
Get the argument's integer value.
Definition: ncbiargs.cpp:295
virtual CNcbiOstream & AsOutputFile(TFileFlags flags=0) const
Get the argument as an output file stream.
Definition: ncbiargs.cpp:319
Definition: type.c:5
virtual void CloseFile(void) const
Close the file.
Definition: ncbiargs.cpp:603
static IOS_BASE::openmode IosMode(TFileFlags flags)
Definition: ncbiargs.cpp:517
vector< string > TStringArray
Some values types can contain several value lists.
Definition: ncbiargs.hpp:271
virtual CArgDescriptions::TFlags GetFlags(void) const
Get argument flags.
Definition: ncbiargs_p.hpp:308
CArg_Integer(const string &name, const string &value)
Definition: ncbiargs.cpp:358
virtual const CDir & AsDirectory() const
Get the argument as a directory.
Definition: ncbiargs.cpp:469
CArg_Ios(const string &name, const string &value, CArgDescriptions::TFlags flags)
Definition: ncbiargs.cpp:532
virtual void SetConstraint(const CArgAllow *constraint, CArgDescriptions::EConstraintNegate negate)
Set argument constraint.
Definition: ncbiargs.cpp:1213
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:142
virtual ~CArgDesc_KeyDef(void)
Definition: ncbiargs.cpp:1617
virtual CNcbiOstream & AsOutputFile(TFileFlags flags=0) const
Get the argument as an output file stream.
Definition: ncbiargs.cpp:249
virtual bool AsBoolean(void) const
Get the argument's boolean value.
Definition: ncbiargs.cpp:212
virtual CNcbiOstream & AsOutputFile(TFileFlags flags=0) const
Get the argument as an output file stream.
Definition: ncbiargs.cpp:216
const string & GetDisplayValue(void) const
Definition: ncbiargs.cpp:1302
virtual size_t GetGroup(void) const
Get argument group.
Definition: ncbiargs_p.hpp:345
CArg_OutputFile(const string &name, const string &value, CArgDescriptions::TFlags flags)
Definition: ncbiargs.cpp:681
virtual string GetUsageSynopsis(bool name_only=false) const
Get usage synopsis.
Definition: ncbiargs.cpp:1438
CTime –.
Definition: ncbitime.hpp:290
virtual CArgValue * ProcessDefault(void) const
Process argument default.
Definition: ncbiargs.cpp:1307
const string & GetDefaultValue(void) const
Definition: ncbiargs.cpp:1290
virtual ~CArgDesc_Flag(void)
Definition: ncbiargs.cpp:1379
virtual CNcbiIostream & AsIOFile(TFileFlags flags=0) const
Get the argument as a file stream.
Definition: ncbiargs.cpp:323
CArg_Boolean(const string &name, bool value)
Definition: ncbiargs.cpp:419
EType
Available argument types.
Definition: ncbiargs.hpp:562
virtual CArgValue * ProcessArgument(const string &value) const
Process argument with specified value.
Definition: ncbiargs.cpp:1397
CArg_IOFile(const string &name, const string &value, CArgDescriptions::TFlags flags)
Definition: ncbiargs.cpp:744
virtual void x_Open(TFileFlags flags) const
Definition: ncbiargs.cpp:754
virtual CNcbiIostream & AsIOFile(TFileFlags flags=0) const
Get the argument as a file stream.
Definition: ncbiargs.cpp:217
virtual Int8 AsInt8(void) const
Get the argument's integer (8-byte long) value.
Definition: ncbiargs.cpp:348
virtual string GetUsageSynopsis(bool name_only=false) const
Get usage synopsis.
Definition: ncbiargs.cpp:1589
virtual const CTime & AsDateTime(void) const
Get the argument as a DateTime.
Definition: ncbiargs.cpp:247
virtual const CTime & AsDateTime(void) const
Get the argument as a DateTime.
Definition: ncbiargs.cpp:311
CArgDescriptions::EType GetType(void) const
Definition: ncbiargs_p.hpp:307
virtual double AsDouble(void) const
Get the argument's double value.
Definition: ncbiargs.cpp:299
CArgDesc_PosOpt(const string &name, const string &comment, CArgDescriptions::EType type, CArgDescriptions::TFlags flags)
Definition: ncbiargs.cpp:1475
CArg_Int8(const string &name, const string &value)
Definition: ncbiargs.cpp:336
CArgAllow –.
Definition: ncbiargs.hpp:1413
static uch flags
virtual CNcbiIstream & AsInputFile(TFileFlags flags=0) const
Get the argument as an input file stream.
Definition: ncbiargs.cpp:248
virtual CNcbiOstream & AsOutputFile(TFileFlags flags=0) const
Get the argument as an output file stream.
Definition: ncbiargs.cpp:580
virtual ~CArgDesc_Opening(void)
Definition: ncbiargs.cpp:1458
EConstraintNegate
Flag to invert constraint logically.
Definition: ncbiargs.hpp:894
virtual void CloseFile(void) const
Close the file.
Definition: ncbiargs.cpp:218
virtual string GetUsageSynopsis(bool name_only=false) const
Get usage synopsis.
Definition: ncbiargs.cpp:1385
virtual const TStringArray & GetStringList() const
Get the value list.
Definition: ncbiargs.cpp:279
double m_Double
Definition: ncbiargs_p.hpp:177
virtual const string & AsString(void) const
Get the argument's string value.
Definition: ncbiargs.cpp:208
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1185
bool GetSetValue(void) const
Definition: ncbiargs_p.hpp:427
virtual string GetUsageSynopsis(bool name_only=false) const
Get usage synopsis.
Definition: ncbiargs.cpp:1558
virtual int AsInteger(void) const
Get the argument's integer value.
Definition: ncbiargs.cpp:210
CArg_InputFile(const string &name, const string &value, CArgDescriptions::TFlags flags)
Definition: ncbiargs.cpp:623
virtual ~CArgDescOptional(void)
Definition: ncbiargs.cpp:1248
CArgErrorHandler –.
Definition: ncbiargs.hpp:479
CArgDesc_KeyOpt(const string &name, const string &comment, CArgDescriptions::EType type, CArgDescriptions::TFlags flags, const string &synopsis)
Definition: ncbiargs.cpp:1569
virtual Int8 AsInt8(void) const
Get the argument's integer (8-byte long) value.
Definition: ncbiargs.cpp:291
virtual const CArgAllow * GetConstraint(void) const
Get argument constraint.
Definition: ncbiargs.cpp:1221
string m_DisplayValue
Definition: ncbiargs_p.hpp:375
virtual const CTime & AsDateTime() const
Get the argument as a DateTime.
Definition: ncbiargs.cpp:508
CRef< CArgErrorHandler > m_ErrorHandler
Definition: ncbiargs_p.hpp:332
static int err_handler(DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr)
CArgDesc_PosDef(const string &name, const string &comment, CArgDescriptions::EType type, CArgDescriptions::TFlags flags, const string &default_value, const string &env_var, const char *display_value)
Definition: ncbiargs.cpp:1498
CFastMutex m_AccessMutex
Definition: ncbiargs_p.hpp:247
virtual CArgValue * ProcessDefault(void) const
Process argument default.
Definition: ncbiargs.cpp:1204
CArg_DataSize(const string &name, const string &value)
Definition: ncbiargs.cpp:377
virtual void CloseFile(void) const
Close the file.
Definition: ncbiargs.cpp:251
virtual void SetGroup(size_t group)
Set argument group.
Definition: ncbiargs_p.hpp:346
virtual void x_Open(TFileFlags flags) const
Definition: ncbiargs.cpp:691
TFileFlags m_DescriptionFlags
Definition: ncbiargs_p.hpp:243
const string & GetSynopsis(void) const
Definition: ncbiargs_p.hpp:385
CArg_DateTime(const string &name, const string &value)
Definition: ncbiargs.cpp:480
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
Definition: ncbistre.hpp:139
virtual bool AsBoolean(void) const
Get the argument's boolean value.
Definition: ncbiargs.cpp:303
CDir m_Dir
Definition: ncbiargs_p.hpp:210
virtual int AsInteger(void) const
Get the argument's integer value.
Definition: ncbiargs.cpp:368
CArgDescDefault(const string &name, const string &comment, CArgDescriptions::EType type, CArgDescriptions::TFlags flags, const string &default_value, const string &env_var, const char *display_value)
Definition: ncbiargs.cpp:1266
virtual const string & AsString(void) const
Get the argument's string value.
Definition: ncbiargs.cpp:270
CArgDescOptional(const string &name, const string &comment, CArgDescriptions::EType type, CArgDescriptions::TFlags flags)
Definition: ncbiargs.cpp:1237
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:768
virtual Int8 AsInt8(void) const
Get the argument's integer (8-byte long) value.
Definition: ncbiargs.cpp:242
virtual const string & AsString(void) const
Get the argument's string value.
Definition: ncbiargs.cpp:241
CConstRef< CArgAllow > m_Constraint
Definition: ncbiargs_p.hpp:330
virtual ~CArgDescMandatory(void)
Definition: ncbiargs.cpp:1089
virtual string GetUsageSynopsis(bool name_only=false) const
Get usage synopsis.
Definition: ncbiargs.cpp:1623
Modified on Sat Apr 21 13:52:04 2018 by modify_doxy.py rev. 546573