OSFI-C++  3.10.0
OpenSF Integration Library
CLP.h
Go to the documentation of this file.
1 /*
2  * openSF Integration Libraries (OSFI)
3  * Deimos Space, S.L.U.
4  *
5  * This file is part of OSFI. OSFI is free software; you can redistribute it
6  * and/or modify it under the terms of the 'ESA Software Community Licence Permissive' as
7  * published by the European Space Agency; either version 2.4 of the License,
8  * or (at your option) any later version. You should have received a
9  * copy of the 'ESA Software Community Licence Permissive - v2.4' along with this program
10  * or one can be found at <http://eop-cfi.esa.int/index.php/docs-and-mission-data/licensing-documents>.
11  */
12 
17 #ifndef OSFI_CLP_H
18 #define OSFI_CLP_H
19 
20 #include <string>
21 #include <list>
22 
23 #if __cplusplus >= 201402L
25 # define OSFI_DEPRECATED(reason) [[deprecated(reason)]]
26 #else
27 # define OSFI_DEPRECATED(reason) /*deprecated*/
28 #endif
29 
78 class CLP {
79  std::string confFile; // Unparsed value of argv[1]
80  std::list<std::string> confFiles; // Tokenized value of argv[1]
81  std::list<std::string> inputFiles; // Tokenized value of argv[2]
82  std::list<std::string> outputFiles; // Tokenized value of argv[3]
83 
87  static constexpr char FILE_DELIM = ',';
88 
94  static std::list<std::string> parseFiles(const char * argv);
95 
102  void parseFlaggedInputs(int argc, char * argv[]);
103 
110  void parsePositionalInputs(int argc, char * argv[]);
111 
112  friend struct CLPTest; // For unit testing purposes
113 
114 public:
121  CLP(int argc, char * argv[]);
122 
126  virtual ~CLP();
127 
133  OSFI_DEPRECATED("Modules with no global configuration file are deprecated")
134  std::string getConfFile();
135 
145  std::list<std::string> getConfFiles() const;
146 
148  std::list<std::string> getInputFiles() const;
149 
151  std::list<std::string> getOutputFiles() const;
152 };
153 
154 #endif /*OSFI_CLP_H*/
#define OSFI_DEPRECATED(reason)
Definition: CLP.h:25
Definition: CLP.h:78
std::list< std::string > getConfFiles() const
std::list< std::string > getOutputFiles() const
std::string getConfFile()
virtual ~CLP()
std::list< std::string > getInputFiles() const
CLP(int argc, char *argv[])