LRAUV  revA
Command.h
Go to the documentation of this file.
1 
9 #ifndef COMMAND_H_
10 #define COMMAND_H_
11 
12 #include <stdio.h>
13 #include <string.h>
14 
16 #include "logger/Logger.h"
17 #include "utils/FlexArray.h"
18 #include "utils/Str.h"
19 
20 #define MAX_ARGS 9
21 
23 {
44 };
45 
47 {
51 };
52 
54 {
58 };
59 
61 {
62 public:
63  CommandArg( const char* keyword, const RequiredType required )
64  : argType_( ARG_KEYWORD ),
65  keyword_( keyword ),
66  required_( required ),
67  keywordLen_( strlen( keyword_ ) )
68  {}
69  CommandArg( const CommandArgType argType, const RequiredType required, const char* altName = NULL )
70  : argType_( argType ),
71  keyword_( altName ),
72  required_( required ),
73  keywordLen_( NULL == altName ? 0 : strlen( altName ) )
74  {}
76  {
77  return argType_;
78  }
79  const char* getKeyword() const
80  {
81  return keyword_;
82  }
83  const int getKeywordLen() const
84  {
85  return keywordLen_;
86  }
88  {
89  return required_;
90  }
91  bool equals( CommandArg* commandArg ) const
92  {
93  if( argType_ != commandArg->argType_
94  || keywordLen_ != commandArg->keywordLen_ )
95  {
96  return false;
97  }
98  if( keywordLen_ == 0 )
99  {
100  return true;
101  }
102  return 0 == strncmp( keyword_, commandArg->keyword_, keywordLen_ );
103  }
104  void help( FILE* out ) const
105  {
106  if( argType_ != ARG_KEYWORD && keywordLen_ > 0 )
107  {
108  fprintf( out, "<%s>", keyword_ );
109  return;
110  }
111  switch( argType_ )
112  {
113  case ARG_NONE:
114  break;
115  case ARG_COMMAND:
116  fprintf( out, "<commandName>" );
117  break;
118  case ARG_COMPONENT:
119  fprintf( out, "<componentName>" );
120  break;
121  case ARG_CONFIG_DIR:
122  fprintf( out, "<configDir>" );
123  break;
124  case ARG_CONFIG_VARIABLE:
125  fprintf( out, "<configVariable>" );
126  break;
127  case ARG_DECIMATION_TYPE:
128  fprintf( out, "<decimationType>" );
129  break;
130  case ARG_FLOAT:
131  fprintf( out, "<number>" );
132  break;
133  case ARG_INT:
134  fprintf( out, "<integer>" );
135  break;
136  case ARG_KEYWORD:
137  fprintf( out, "%s", keyword_ );
138  break;
139  case ARG_MISSION:
140  fprintf( out, "<missionPath>" );
141  break;
142  case ARG_QUOTED_STRING:
143  fprintf( out, "<\"quotedString\">" );
144  break;
145  case ARG_REGEX:
146  fprintf( out, "<regularExpression>" );
147  break;
148  case ARG_SECONDS:
149  fprintf( out, "<#seconds>" );
150  break;
151  case ARG_SERVICE_TYPE:
152  fprintf( out, "<serviceType>" );
153  break;
154  case ARG_STRING:
155  fprintf( out, "<anyString>" );
156  break;
157  case ARG_TIMESTAMP:
158  fprintf( out, "<timestamp>" );
159  break;
160  case ARG_TOKEN:
161  fprintf( out, "<anyWord>" );
162  break;
163  case ARG_UNIT:
164  fprintf( out, "<unit>" );
165  break;
166  case ARG_UNIVERSAL:
167  fprintf( out, "<universal>" );
168  break;
169  case ARG_VARIABLE:
170  fprintf( out, "<variable>" );
171  break;
172  }
173  }
174 protected:
176  const char* keyword_;
179 
180 private:
181  // Note that the copy constructor below is private and not given a body.
182  // Any attempt to call it will return a compiler error.
183  CommandArg( const CommandArg& old ); // disallow copy constructor
184 };
185 
186 class ParsedCommand;
187 
189 {
190 public:
191  CommandSyntax( const char* help, void( *syntaxCall )( ParsedCommand*, int ), const int mode )
192  : args_( true ),
193  argCount_( 0 ),
194  help_( help ),
195  syntaxCall_( syntaxCall ),
196  mode_( mode ),
197  altSyntax_( NULL )
198  {}
199  void addArg( CommandArg* arg )
200  {
201  args_.push( arg );
202  ++argCount_;
203  }
204  CommandArg* getArg( int index ) const
205  {
206  return args_.get( index );
207  }
208  int getRequiredArgSize( unsigned int currentArgs )
209  {
210  if( args_.size() == 0 )
211  {
212  return 0;
213  }
214  int required = currentArgs;
215  for( unsigned int i = required; i < args_.size(); ++i )
216  {
217  RequiredType requiredType = args_.get( i )->getRequired();
218  if( requiredType == REQUIRED || requiredType == REQUIRED_AFTER_PREVIOUS )
219  {
220  ++required;
221  }
222  else
223  {
224  break;
225  }
226  }
227  return required;
228  }
229  int getArgCount() const
230  {
231  return argCount_;
232  }
233 
234  void call( ParsedCommand* parsedCommand )
235  {
236  syntaxCall_( parsedCommand, mode_ );
237  }
238 
239  // Get an entry in a linked list of possible syntaxes
241  {
242  return altSyntax_;
243  }
244 
245  // Set an entry in a linked list of possible syntaxes
246  void setAltSyntax( CommandSyntax* altSyntax )
247  {
248  altSyntax_ = altSyntax;
249  }
250 
251  void help( const char* keyword, FILE* out ) const
252  {
253  fprintf( out, "%s\n ", help_ );
254  fprintf( out, "%s", keyword );
255  for( int i = 0; i < argCount_; ++i )
256  {
257  CommandArg* arg = args_.get( i );
258  RequiredType req = arg->getRequired();
259  fputc( ' ', out );
260  if( req == NOT_REQUIRED )
261  {
262  fprintf( out, "[" );
263  }
264  arg->help( out );
265  if( req == REQUIRED_AFTER_PREVIOUS
266  || ( req == NOT_REQUIRED
267  && ( i + 1 >= argCount_
268  || ( i + 1 < argCount_
269  && args_.get( i + 1 )->getRequired() != REQUIRED_AFTER_PREVIOUS ) ) ) )
270  {
271  fprintf( out, "]" );
272  }
273  }
274  fprintf( out, "\n" );
275  }
276 
277 protected:
280  const char* help_;
281  void( *syntaxCall_ )( ParsedCommand*, int );
282  int mode_;
283  // Used for forming a linked list of possible syntaxes
285 
286 private:
287  // Note that the copy constructor below is private and not given a body.
288  // Any attempt to call it will return a compiler error.
289  CommandSyntax( const CommandSyntax& old ); // disallow copy constructor
290 };
291 
292 class Command
293 {
294 public:
295  Command( const char* keyword, const char* description, bool advanced )
296  : syntaxes_( true ),
297  syntaxCount_( 0 ),
298  keyword_( keyword ),
299  description_( description ),
300  advanced_( advanced ),
301  keywordLen_( strlen( keyword_ ) )
302  {}
303  Command& addSyntax( const char* syntaxHelp, void( *syntaxCall )( ParsedCommand*, int ), const int mode = 0 )
304  {
305  CommandSyntax* syntax = new CommandSyntax( syntaxHelp, syntaxCall, mode );
306  syntaxes_.push( syntax );
307  ++syntaxCount_;
308  return *this;
309  }
311  {
312  CommandSyntax* syntax = syntaxes_.peek();
313  if( syntax != NULL )
314  {
315  syntax->addArg( arg );
316  }
317  return *this;
318  }
319  Command& addArg( const char* keyword, const RequiredType required = REQUIRED )
320  {
321  return addArg( new CommandArg( keyword, required ) );
322  }
323  Command& addArg( const CommandArgType argType, const RequiredType required = REQUIRED, const char* altName = NULL )
324  {
325  return addArg( new CommandArg( argType, required, altName ) );
326  }
327  const char* getKeyword()
328  {
329  return keyword_;
330  }
331  const int getKeywordLen()
332  {
333  return keywordLen_;
334  }
335  CommandSyntax* getSyntax( int index )
336  {
337  return syntaxes_.get( index );
338  }
340  {
341  return syntaxCount_;
342  }
343  void help( bool full, FILE* out ) const
344  {
345  fprintf( out, "%s: %s\n", keyword_, description_ );
346  if( full )
347  {
348  for( int i = 0; i < syntaxCount_; ++i )
349  {
350  syntaxes_.get( i )->help( keyword_, out );
351  }
352  }
353  }
354 protected:
357  const char* keyword_;
358  const char* description_;
359  bool advanced_;
361 
362 private:
363  // Note that the copy constructor below is private and not given a body.
364  // Any attempt to call it will return a compiler error.
365  Command( const Command& old ); // disallow copy constructor
366 
367 };
368 
369 class CodedStr;
370 class CommandLine;
371 class ElementURI;
372 class Unit;
373 class UniversalURI;
374 
375 
377 {
378 public:
379  ParsedCommand();
380 
383  {
384  return argCount_;
385  }
386 
388  void undefTopArg();
389 
391  void clearTopArg();
392 
394  void clearAll();
395 
397  int getStart()
398  {
399  return start_;
400  }
401 
403  void setStart( int start )
404  {
405  start_ = start;
406  }
407 
410  int getArgStart( int index )
411  {
412  if( index < 0 )
413  {
414  index = argCount_ + index;
415  }
416  if( index < 0 || index >= argCount_ )
417  {
418  return -1;
419  }
420  return argStart_[index];
421  }
422 
425  int getArgLen( int index )
426  {
427  if( index < 0 )
428  {
429  index = argCount_ + index;
430  }
431  if( index < 0 || index >= argCount_ )
432  {
433  return -1;
434  }
435  return argStart_[index];
436  }
437 
438  const Command* getCommand() const
439  {
440  return command_;
441  }
442 
443  const CommandSyntax* getSyntax() const
444  {
445  return syntax_;
446  }
447 
448  const Command* getCommandArg() const
449  {
450  return commandArg_;
451  }
452 
453  const CodedStr* getComponentArg() const
454  {
455  return componentArg_;
456  }
457 
458  const Str& getConfigDirArg() const
459  {
460  return configDirArg_;
461  }
462 
464  {
465  return decimationTypeArg_;
466  }
467 
468  const Str& getMissionArg() const
469  {
470  return missionArg_;
471  }
472 
474  {
475  return serviceTypeArg_;
476  }
477 
478  const Str& getStringArg() const
479  {
480  return stringArg_;
481  }
482 
483  const bool isInQuotedString() const
484  {
485  return inQuotedString_;
486  }
487 
488  void setStringArg( const Str& stringArg )
489  {
490  stringArg_ = stringArg;
491  }
492 
493  const Str& getRegexArg() const
494  {
495  return regexArg_;
496  }
497 
498  int getIntegerArg() const
499  {
500  return integerArg_;
501  }
502 
503  float getNumberArg() const
504  {
505  return numberArg_;
506  }
507 
508  const Timestamp& getTimestampArg() const
509  {
510  return timestampArg_;
511  }
512 
513  const Str& getTokenArg() const
514  {
515  return tokenArg_;
516  }
517 
518  const Unit* getUnitArg() const
519  {
520  return unitArg_;
521  }
522 
524  {
525  return universalArg_;
526  }
527 
528  const ElementURI* getVariableArg() const
529  {
530  return variableArg_;
531  }
532 
535  bool parseBufferEnd( FlexArray<Command*>& commands, const char* buffer, int index );
536 
537  bool completeArg( FlexArray<Command*>& commands, CommandLine* commandLine, const char* buffer, int index );
538 
539  void execute( Logger& logger );
540 
541  Str toString();
542 
543  bool hasArgIndex( int argIndex );
544 
546 
547 protected:
548  int start_;
555 
568  float numberArg_;
571  const Unit* unitArg_;
575 
578  bool findArg( FlexArray<Command*>& commands, const char *buffer, int len );
579 
580  void implySyntax();
581 
582  bool syntaxOk();
583 
585  {
586  if( mt1 == MATCH_NONE && mt2 == MATCH_NONE ) return MATCH_NONE;
587  if( ( mt1 == MATCH_NONE && mt2 == MATCH_UNIQUE )
588  || ( mt1 == MATCH_UNIQUE && mt2 == MATCH_NONE ) ) return MATCH_UNIQUE;
589  return MATCH_MANY;
590  }
591 
592  MatchType matchArg( FlexArray<Command*>& commands, const CommandArg* arg, int argIndex, const char *buffer, int len );
593 
594  MatchType matchUnique( int synArgIndex, CommandArgType argType );
595 
598  MatchType matchCommand( FlexArray<Command*>& commands, Command*& command, int synArgIndex, const char *buffer, int len );
599 
600  bool completeCommand( FlexArray<Command*>& commands, CommandLine* commandLine, const char *buffer, int len );
601 
602  MatchType matchComponent( int synArgIndex, const char *buffer, int len );
603 
604  MatchType matchConfigDir( int synArgIndex, const char *buffer, int len );
605 
606  MatchType matchConfigSubDir( const Str& subDir, int synArgIndex, const char *buffer, int len );
607 
608  MatchType matchConfigVariable( int synArgIndex, const char *buffer, int len );
609 
610  MatchType matchDecimationType( int synArgIndex, const char *buffer, int len );
611 
612  MatchType matchFloat( int synArgIndex, const char *buffer, int len );
613 
614  MatchType matchInteger( int synArgIndex, const char *buffer, int len );
615 
616  MatchType matchKeyword( const char* keyword, int keywordLen, int synArgIndex, const char *buffer, int len );
617 
618  MatchType matchMission( int synArgIndex, const char *buffer, int len );
619 
620  MatchType matchQuotedString( int synArgIndex, const char *buffer, int len );
621 
622  MatchType matchRegex( int synArgIndex, const char *buffer, int len );
623 
624  MatchType matchSeconds( int synArgIndex, const char *buffer, int len );
625 
626  MatchType matchServiceType( int synArgIndex, const char *buffer, int len );
627 
628  MatchType matchString( int synArgIndex, const char *buffer, int len );
629 
630  MatchType matchTimestamp( int synArgIndex, const char *buffer, int len );
631 
632  MatchType matchToken( int synArgIndex, const char *buffer, int len );
633 
634  MatchType matchUnit( int synArgIndex, const char *buffer, int len );
635 
636  MatchType matchUniversal( int synArgIndex, const char *buffer, int len );
637 
638  MatchType matchVariable( int synArgIndex, const char *buffer, int len );
639 
640 
641 private:
642  // Note that the copy constructor below is private and not given a body.
643  // Any attempt to call it will return a compiler error.
644  ParsedCommand( const ParsedCommand& old ); // disallow copy constructor
645 
646 };
647 
648 #endif /*COMMANDLINE_H_*/
Client-side interface for injecting log data into the log queue.
Definition: Logger.h:30
const T & get(int index=-1) const
Definition: FlexArray.h:134
const Str & getStringArg() const
Definition: Command.h:478
const UniversalURI * getUniversalArg() const
Definition: Command.h:523
Str missionArg_
Definition: Command.h:563
void help(bool full, FILE *out) const
Definition: Command.h:343
Command & addArg(CommandArg *arg)
Definition: Command.h:310
int keywordLen_
Definition: Command.h:360
Contains the DecimationLogWriter class definition.
bool parseBufferEnd(FlexArray< Command * > &commands, const char *buffer, int index)
If the last word in buffer is a valid arg, deal with it.
Definition: Command.cpp:162
int getArgCount() const
Definition: Command.h:229
#define MAX_ARGS
Definition: Command.h:20
int integerArg_
Definition: Command.h:567
int argCount_
Definition: Command.h:279
const RequiredType required_
Definition: Command.h:177
Str toString()
Definition: Command.cpp:272
MatchType matchInteger(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:784
const Command * getCommand() const
Definition: Command.h:438
RequiredType
Definition: Command.h:46
const char * getKeyword()
Definition: Command.h:327
int syntaxCount_
Definition: Command.h:356
Definition: Command.h:25
int getRequiredArgSize(unsigned int currentArgs)
Definition: Command.h:208
CommandArg * getArg(int index) const
Definition: Command.h:204
MatchType matchCommand(FlexArray< Command * > &commands, Command *&command, int synArgIndex, const char *buffer, int len)
Report if a command name matches the supplied arg.
Definition: Command.cpp:476
const int getKeywordLen()
Definition: Command.h:331
void push(T item)
Definition: FlexArray.h:160
int getIntegerArg() const
Definition: Command.h:498
bool equals(CommandArg *commandArg) const
Definition: Command.h:91
float getNumberArg() const
Definition: Command.h:503
int argStart_[MAX_ARGS]
Definition: Command.h:550
const Unit * getUnitArg() const
Definition: Command.h:518
Definition: Command.h:60
const Str & getRegexArg() const
Definition: Command.h:493
const CodedStr * componentArg_
Definition: Command.h:560
RequiredType getRequired() const
Definition: Command.h:87
Definition: Command.h:376
MatchType matchUniversal(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:1082
MatchType matchServiceType(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:933
const UniversalURI * universalArg_
Definition: Command.h:572
int mode_
Definition: Command.h:282
FlexArray< CommandSyntax * > syntaxes_
Definition: Command.h:355
const char * description_
Definition: Command.h:358
const Str & getTokenArg() const
Definition: Command.h:513
Definition: Command.h:49
void help(const char *keyword, FILE *out) const
Definition: Command.h:251
Definition: Command.h:43
const DecimationLogWriter::DecimationType getDecimationTypeArg() const
Definition: Command.h:463
void execute(Logger &logger)
Definition: Command.cpp:251
bool completeCommand(FlexArray< Command * > &commands, CommandLine *commandLine, const char *buffer, int len)
Definition: Command.cpp:540
const Timestamp & getTimestampArg() const
Definition: Command.h:508
const CommandSyntax * getSyntax() const
Definition: Command.h:443
Definition: Command.h:33
FlexArray< CommandArg * > args_
Definition: Command.h:278
Str regexArg_
Definition: Command.h:566
MatchType matchArg(FlexArray< Command * > &commands, const CommandArg *arg, int argIndex, const char *buffer, int len)
Definition: Command.cpp:389
int getArgCount()
Returns the parsed arg count.
Definition: Command.h:382
MatchType matchConfigSubDir(const Str &subDir, int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:651
int getStart()
Returns first argStart.
Definition: Command.h:397
MatchType matchToken(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:1049
Definition: Command.h:30
Code unit that represents a unique name for a measured quantity.
Definition: UniversalURI.h:29
void clearTopArg()
Clears the top arg on the stack.
Definition: Command.cpp:129
Provides a simple command line interface to the LRAUV.
Definition: CommandLine.h:38
Definition: Command.h:28
Extends the Str class, adding an unsigned short code (actually, the codes are limited to 14 bits...
Definition: CodedStr.h:23
Contains the FlexArrayBase and FlexArray class declarations.
Definition: Command.h:55
MatchType matchSeconds(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:910
const CommandArgType argType_
Definition: Command.h:175
ServiceType
Definition: LogWriter.h:29
CommandArgType getArgType() const
Definition: Command.h:75
CommandSyntax * getAltSyntax()
Definition: Command.h:240
int keywordLen_
Definition: Command.h:178
Definition: Command.h:57
CommandSyntax * altSyntax_
Definition: Command.h:284
void(* syntaxCall_)(ParsedCommand *, int)
Definition: Command.h:281
unsigned int size() const
Definition: FlexArray.cpp:69
MatchType matchConfigDir(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:614
Command & addArg(const char *keyword, const RequiredType required=REQUIRED)
Definition: Command.h:319
void setStringArg(const Str &stringArg)
Definition: Command.h:488
Str configDirArg_
Definition: Command.h:561
DecimationType
Definition: DecimationLogWriter.h:26
const Unit * unitArg_
Definition: Command.h:571
Definition: Command.h:56
MatchType matchUnit(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:1059
const Command * getCommandArg() const
Definition: Command.h:448
bool advanced_
Definition: Command.h:359
MatchType matchComponent(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:576
Replacement for standard template class string.
Definition: Str.h:12
CommandArg(const CommandArgType argType, const RequiredType required, const char *altName=NULL)
Definition: Command.h:69
const ElementURI * getVariableArg() const
Definition: Command.h:528
const char * keyword_
Definition: Command.h:357
MatchType
Definition: Command.h:53
Definition: Command.h:42
CommandSyntax * getSyntax(int index)
Definition: Command.h:335
LogWriter::ServiceType serviceTypeArg_
Definition: Command.h:564
MatchType matchDecimationType(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:728
Command & addSyntax(const char *syntaxHelp, void(*syntaxCall)(ParsedCommand *, int), const int mode=0)
Definition: Command.h:303
MatchType matchFloat(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:742
Command * command_
Definition: Command.h:556
void setStart(int start)
Sets first argStart.
Definition: Command.h:403
MatchType matchMission(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:815
Command * commandArg_
Definition: Command.h:558
MatchType matchTimestamp(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:958
Definition: Command.h:50
MatchType argMatch_[MAX_ARGS]
Definition: Command.h:553
MatchType matchString(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:948
Definition: Command.h:35
Definition: Command.h:32
int getArgStart(int index)
Returns argStart at the specified index Negative indices count backwards from the top...
Definition: Command.h:410
MatchType matchVariable(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:1114
void call(ParsedCommand *parsedCommand)
Definition: Command.h:234
const Str & getConfigDirArg() const
Definition: Command.h:458
Definition: Command.h:188
Definition: Command.h:24
CommandSyntax(const char *help, void(*syntaxCall)(ParsedCommand *, int), const int mode)
Definition: Command.h:191
Contains the Logger class definition.
const char * keyword_
Definition: Command.h:176
MatchType matchUnique(int synArgIndex, CommandArgType argType)
Definition: Command.cpp:468
MatchType matchKeyword(const char *keyword, int keywordLen, int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:805
Definition: Command.h:27
const ElementURI * variableArg_
Definition: Command.h:573
bool hasArgIndex(int argIndex)
Definition: Command.cpp:372
const LogWriter::ServiceType getServiceTypeArg() const
Definition: Command.h:473
int getSyntaxCount()
Definition: Command.h:339
void undefTopArg()
Undefine top arg on the stack.
Definition: Command.cpp:60
void implySyntax()
If the last word in buffer is a valid arg, deal with it.
Definition: Command.cpp:1301
Definition: Command.h:26
int argLen_[MAX_ARGS]
Definition: Command.h:552
bool syntaxOk()
Definition: Command.cpp:1323
DecimationLogWriter::DecimationType decimationTypeArg_
Definition: Command.h:562
bool completeArg(FlexArray< Command * > &commands, CommandLine *commandLine, const char *buffer, int index)
Definition: Command.cpp:238
ParsedCommand()
Definition: Command.cpp:26
Definition: Command.h:292
MatchType matchConfigVariable(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:695
int start_
Definition: Command.h:548
CommandArgType argType_[MAX_ARGS]
Definition: Command.h:554
int argCount_
Definition: Command.h:549
Command(const char *keyword, const char *description, bool advanced)
Definition: Command.h:295
CommandArg(const char *keyword, const RequiredType required)
Definition: Command.h:63
Definition: Command.h:48
Str tokenArg_
Definition: Command.h:570
float numberArg_
Definition: Command.h:568
bool findArg(FlexArray< Command * > &commands, const char *buffer, int len)
Report if a valid arg matches the supplied arg.
Definition: Command.cpp:1148
const char * help_
Definition: Command.h:280
Command & addArg(const CommandArgType argType, const RequiredType required=REQUIRED, const char *altName=NULL)
Definition: Command.h:323
const CodedStr * getComponentArg() const
Definition: Command.h:453
Code unit that represents a unique name for a DataElement.
Definition: ElementURI.h:27
Definition: Command.h:38
void help(FILE *out) const
Definition: Command.h:104
Definition: Command.h:36
Str stringArg_
Definition: Command.h:565
Definition: Command.h:41
Definition: Command.h:37
void addArg(CommandArg *arg)
Definition: Command.h:199
const char * getKeyword() const
Definition: Command.h:79
Definition: Command.h:40
MatchType matchRegex(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:904
int argIndex_[MAX_ARGS]
Definition: Command.h:551
Definition: Command.h:39
MatchType orMatch(MatchType mt1, MatchType mt2)
Definition: Command.h:584
Definition: Command.h:34
MatchType matchQuotedString(int synArgIndex, const char *buffer, int len)
Definition: Command.cpp:883
void clearAll()
Clears everything.
Definition: Command.cpp:153
CommandArgType getCurrentArgType()
Definition: Command.cpp:384
Definition: Command.h:31
Code that represents an engineering unit.
Definition: Unit.h:24
const Str & getMissionArg() const
Definition: Command.h:468
Definition: Command.h:29
const int getKeywordLen() const
Definition: Command.h:83
int getArgLen(int index)
Returns argLen at the specified index Negative indices count backwards from the top.
Definition: Command.h:425
bool inQuotedString_
Definition: Command.h:574
void setAltSyntax(CommandSyntax *altSyntax)
Definition: Command.h:246
Timestamp timestampArg_
Definition: Command.h:569
Represents absolute times.
Definition: Timestamp.h:31
CommandArg * currentArg_
Definition: Command.h:559
CommandArgType
Definition: Command.h:22
CommandSyntax * syntax_
Definition: Command.h:557
const bool isInQuotedString() const
Definition: Command.h:483
T peek(int index=-1)
Definition: FlexArray.h:165