CommandOptionWithTimeArg.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
44 #ifndef COMMANDOPTIONWITHTIMEARG_HPP
45 #define COMMANDOPTIONWITHTIMEARG_HPP
46 
47 #include "CommandOption.hpp"
48 #include "CommonTime.hpp"
49 
50 namespace gnsstk
51 {
53 
54 
62  {
63  public:
74  CommandOptionWithTimeArg(const char shOpt,
75  const std::string& loOpt,
76  const std::string& timeFormat,
77  const std::string& desc,
78  const bool required = false)
79  : gnsstk::CommandOptionWithAnyArg(shOpt, loOpt, desc, required),
80  timeSpec(timeFormat)
81  {}
82 
85 
88  virtual std::string getArgString() const
89  { return "TIME"; }
90 
92  virtual std::string checkArguments();
93 
95  std::vector<CommonTime> getTime() const { return times; }
96 
97  protected:
99  std::vector<CommonTime> times;
101  std::string timeSpec;
102 
105 
107  virtual std::string getTimeSpec(std::vector<std::string>::size_type index) const
108  { return timeSpec; }
109  }; // class CommandOptionWithTimeArg
110 
111 
121  {
122  public:
132  const std::string& loOpt,
133  const std::string& desc,
134  const bool required = false)
135  : CommandOptionWithTimeArg(shOpt, loOpt, "", desc, required)
136  {}
137 
140 
141  protected:
144 
146  virtual std::string getTimeSpec(std::vector<std::string>::size_type index) const;
147  }; // class CommandOptionWithSimpleTimeArg
148 
150 
151 } // namespace gnsstk
152 
153 #endif
gnsstk::CommandOption::required
bool required
Whether or not this is a required command line option.
Definition: CommandOption.hpp:252
gnsstk::CommandOptionWithTimeArg::getArgString
virtual std::string getArgString() const
Definition: CommandOptionWithTimeArg.hpp:88
gnsstk::CommandOptionWithTimeArg::CommandOptionWithTimeArg
CommandOptionWithTimeArg()
Default Constructor.
Definition: CommandOptionWithTimeArg.hpp:104
gnsstk::CommandOptionWithSimpleTimeArg::getTimeSpec
virtual std::string getTimeSpec(std::vector< std::string >::size_type index) const
Return the appropriate time scanning format for value[index].
Definition: CommandOptionWithTimeArg.cpp:83
gnsstk::CommandOptionWithSimpleTimeArg::CommandOptionWithSimpleTimeArg
CommandOptionWithSimpleTimeArg(const char shOpt, const std::string &loOpt, const std::string &desc, const bool required=false)
Definition: CommandOptionWithTimeArg.hpp:131
gnsstk::CommandOptionWithTimeArg::times
std::vector< CommonTime > times
Collection of times scanned in from the command line.
Definition: CommandOptionWithTimeArg.hpp:99
gnsstk::CommandOptionWithTimeArg::checkArguments
virtual std::string checkArguments()
Validate arguments passed using this option (and store them).
Definition: CommandOptionWithTimeArg.cpp:52
gnsstk::CommandOptionWithAnyArg
Definition: CommandOption.hpp:342
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::CommandOptionWithTimeArg::timeSpec
std::string timeSpec
Format used to scan times in.
Definition: CommandOptionWithTimeArg.hpp:101
CommandOption.hpp
gnsstk::CommandOptionWithTimeArg::getTimeSpec
virtual std::string getTimeSpec(std::vector< std::string >::size_type index) const
Return the appropriate time scanning format for value[index].
Definition: CommandOptionWithTimeArg.hpp:107
gnsstk::CommandOptionWithTimeArg::CommandOptionWithTimeArg
CommandOptionWithTimeArg(const char shOpt, const std::string &loOpt, const std::string &timeFormat, const std::string &desc, const bool required=false)
Definition: CommandOptionWithTimeArg.hpp:74
gnsstk::CommandOptionWithSimpleTimeArg
Definition: CommandOptionWithTimeArg.hpp:120
gnsstk::CommandOptionWithSimpleTimeArg::CommandOptionWithSimpleTimeArg
CommandOptionWithSimpleTimeArg()
Default Constructor.
Definition: CommandOptionWithTimeArg.hpp:143
gnsstk::CommandOptionWithTimeArg::getTime
std::vector< CommonTime > getTime() const
Return the times scanned in from the command line.
Definition: CommandOptionWithTimeArg.hpp:95
gnsstk::CommandOptionWithTimeArg::~CommandOptionWithTimeArg
virtual ~CommandOptionWithTimeArg()
Destructor.
Definition: CommandOptionWithTimeArg.hpp:84
gnsstk::CommandOptionWithSimpleTimeArg::~CommandOptionWithSimpleTimeArg
virtual ~CommandOptionWithSimpleTimeArg()
Destructor.
Definition: CommandOptionWithTimeArg.hpp:139
CommonTime.hpp
gnsstk::CommandOptionWithTimeArg
Definition: CommandOptionWithTimeArg.hpp:61


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:38