BAOS SDK v2  1.0.1
An SDK providing access to IP-BAOS devices through BAOS binary protocol version 2.x
Helper.h
1 //
2 // Copyright (c) 2002-2023 WEINZIERL ENGINEERING GmbH
3 // All rights reserved.
4 //
5 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
6 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
7 // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
8 // SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY,
9 // WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
10 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
11 //
12 
13 #include <wzcpp/features/logging.h>
14 #include <string>
15 
16 namespace utility
17 {
18 
22 class CommandLineOptions final
23 {
24 public:
25  CommandLineOptions() = default;
26 
27  void parse(int argc, char* argv[]);
28 
29  bool wasHelpdisplayed() const;
30  const std::string& getIpAddress() const;
31 
32  void showUsage();
33 
34 public:
35  std::string applicationName_;
36  bool wasHelpdisplayed_ = false;
37  std::string ipAddress_;
38 };
39 
40 } // end namespace utility
Definition: Helper.h:23
bool wasHelpdisplayed_
Indicate that the help meesage was displayed and we should not continue.
Definition: Helper.h:36
std::string applicationName_
contains the application name as given as first parameter from command line
Definition: Helper.h:35
std::string ipAddress_
The ip v4 address as string in the form xxx.xxx.xxx.xxx.
Definition: Helper.h:37
void showUsage()
Display the how to use message.
Definition: Helper.cpp:62
bool wasHelpdisplayed() const
returns true if the help show be displayed
Definition: Helper.cpp:52
const std::string & getIpAddress() const
Get the ip address parse from command line.
Definition: Helper.cpp:57
void parse(int argc, char *argv[])
Parse the command line options.
Definition: Helper.cpp:23