00001 #pragma ident "$Id: CommandOptionWithTimeArg.hpp 70 2006-08-01 18:36:21Z ehagen $"
00002
00003
00004
00010 #ifndef COMMANDOPTIONWITHTIMEARG_HPP
00011 #define COMMANDOPTIONWITHTIMEARG_HPP
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #include "CommandOption.hpp"
00055 #include "DayTime.hpp"
00056
00057 namespace gpstk
00058 {
00061
00069 class CommandOptionWithTimeArg : public gpstk::CommandOptionWithAnyArg
00070 {
00071 public:
00082 CommandOptionWithTimeArg(const char shOpt,
00083 const std::string& loOpt,
00084 const std::string& timeFormat,
00085 const std::string& desc,
00086 const bool required = false)
00087 : gpstk::CommandOptionWithAnyArg(shOpt, loOpt, desc, required),
00088 timeSpec(timeFormat)
00089 {}
00090
00092 virtual ~CommandOptionWithTimeArg() {}
00093
00096 virtual std::string getArgString() const
00097 { return "TIME"; }
00098
00100 virtual std::string checkArguments();
00101
00103 std::vector<DayTime> getTime() const { return times; }
00104
00105 protected:
00107 std::vector<DayTime> times;
00109 std::string timeSpec;
00110
00112 CommandOptionWithTimeArg() {}
00113
00115 virtual std::string getTimeSpec(std::vector<std::string>::size_type index) const
00116 { return timeSpec; }
00117 };
00118
00119
00129 class CommandOptionWithSimpleTimeArg : public CommandOptionWithTimeArg
00130 {
00131 public:
00140 CommandOptionWithSimpleTimeArg(const char shOpt,
00141 const std::string& loOpt,
00142 const std::string& desc,
00143 const bool required = false)
00144 : CommandOptionWithTimeArg(shOpt, loOpt, "", desc, required)
00145 {}
00146
00148 virtual ~CommandOptionWithSimpleTimeArg() {}
00149
00150 protected:
00152 CommandOptionWithSimpleTimeArg() {}
00153
00155 virtual std::string getTimeSpec(std::vector<std::string>::size_type index) const;
00156 };
00157
00159
00160 }
00161
00162 #endif