OSFI-C++  3.9.2
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  */
18 #ifndef OSFI_CLP_H
19 #define OSFI_CLP_H
20 
21 #include <string>
22 #include <list>
23 
24 #if __cplusplus >= 201402L
25 
26 # define OSFI_DEPRECATED(reason) [[deprecated(reason)]]
27 #else
28 # define OSFI_DEPRECATED(reason) /*deprecated*/
29 #endif
30 
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*/
CLP::getOutputFiles
std::list< std::string > getOutputFiles() const
CLP::getConfFile
std::string getConfFile()
CLP::CLP
CLP(int argc, char *argv[])
CLP::getConfFiles
std::list< std::string > getConfFiles() const
CLP::getInputFiles
std::list< std::string > getInputFiles() const
CLP::~CLP
virtual ~CLP()
CLP
Definition: CLP.h:78
OSFI_DEPRECATED
#define OSFI_DEPRECATED(reason)
Definition: CLP.h:26