CommandOptionWithPositionArg.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 COMMANDOPTIONWITHPOSITIONARG_HPP
45 #define COMMANDOPTIONWITHPOSITIONARG_HPP
46 
47 #include "CommandOption.hpp"
48 #include "Position.hpp"
49 
50 namespace gnsstk
51 {
53 
54 
63  {
64  public:
75  CommandOptionWithPositionArg(const char shOpt,
76  const std::string& loOpt,
77  const std::string& posFormat,
78  const std::string& desc,
79  const bool required = false)
80  : gnsstk::CommandOptionWithAnyArg(shOpt, loOpt, desc, required),
81  posSpec(posFormat)
82  {}
83 
86  {}
87 
91  virtual std::string getArgString() const
92  { return "POSITION"; }
93 
95  virtual std::string checkArguments();
96 
98  std::vector<Position> getPosition() const
99  { return positions; }
100 
101  protected:
103  std::vector<Position> positions;
104 
106  std::string posSpec;
107 
110  {}
111 
113  virtual std::string
114  getPositionSpec(std::vector<std::string>::size_type index) const
115  { return posSpec; }
116 
117  }; // end of class CommandOptionWithPositionArg
118 
120 
121 }
122 
123 #endif // COMMANDOPTIONWITHPOSITIONARG_HPP
gnsstk::CommandOptionWithPositionArg
Definition: CommandOptionWithPositionArg.hpp:62
gnsstk::CommandOption::required
bool required
Whether or not this is a required command line option.
Definition: CommandOption.hpp:252
gnsstk::CommandOptionWithPositionArg::~CommandOptionWithPositionArg
virtual ~CommandOptionWithPositionArg()
Destructor.
Definition: CommandOptionWithPositionArg.hpp:85
gnsstk::CommandOptionWithPositionArg::checkArguments
virtual std::string checkArguments()
Validate arguments passed using this option (and store them).
Definition: CommandOptionWithPositionArg.cpp:51
gnsstk::CommandOptionWithPositionArg::CommandOptionWithPositionArg
CommandOptionWithPositionArg(const char shOpt, const std::string &loOpt, const std::string &posFormat, const std::string &desc, const bool required=false)
Definition: CommandOptionWithPositionArg.hpp:75
gnsstk::CommandOptionWithPositionArg::CommandOptionWithPositionArg
CommandOptionWithPositionArg()
Default Constructor.
Definition: CommandOptionWithPositionArg.hpp:109
Position.hpp
gnsstk::CommandOptionWithPositionArg::positions
std::vector< Position > positions
Collection of positions scanned in from the command line.
Definition: CommandOptionWithPositionArg.hpp:103
gnsstk::CommandOptionWithAnyArg
Definition: CommandOption.hpp:342
gnsstk::CommandOptionWithPositionArg::getArgString
virtual std::string getArgString() const
Definition: CommandOptionWithPositionArg.hpp:91
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
CommandOption.hpp
gnsstk::CommandOptionWithPositionArg::getPositionSpec
virtual std::string getPositionSpec(std::vector< std::string >::size_type index) const
Return the appropriate position scanning format for value[index].
Definition: CommandOptionWithPositionArg.hpp:114
gnsstk::CommandOptionWithPositionArg::posSpec
std::string posSpec
Format used to scan positions in.
Definition: CommandOptionWithPositionArg.hpp:106
gnsstk::CommandOptionWithPositionArg::getPosition
std::vector< Position > getPosition() const
Return the positions scanned in from the command line.
Definition: CommandOptionWithPositionArg.hpp:98


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