-
Notifications
You must be signed in to change notification settings - Fork 0
/
NSxConfig.h
75 lines (55 loc) · 1.78 KB
/
NSxConfig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#pragma once
#ifndef NSXCONFIG_H_INCLUDED
#define NSXCONFIG_H_INCLUDED
#include <exception>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <cstdint>
#include <boost/program_options.hpp>
#include <boost/filesystem.hpp>
namespace opts = boost::program_options;
namespace fs = boost::filesystem;
class NSxConfig;
typedef std::vector<NSxConfig> WorkQueue;
class NSxConfig {
public:
NSxConfig();
void parse(int argc, char* argv[]);
std::string input(void) const;
std::string outputDir(void) const;
std::string outputPrefix(void) const;
unsigned int nThreads(void) const;
unsigned int readSize(void) const;
unsigned int flacCompression(void) const;
bool matlabHeader(void) const;
bool textHeader(void) const;
bool compressData(void) const;
std::string outputFilename(std::uint16_t electrode, bool withPath=true) const;
std::string matlabHeaderFilename() const;
std::string textHeaderFilename() const;
bool valid(void) const { return(_valid); }
bool isSingleFileConfig(void) const { return(_singleFile); }
friend std::ostream& operator<<(std::ostream &out, const NSxConfig &c);
WorkQueue toWorkQueue();
private:
bool _valid;
opts::positional_options_description pos;
opts::options_description desc;
std::string _input;
bool _singleFile;
std::string _outputDir;
std::string _outputPrefix;
fs::path outputPath;
unsigned _nThreads;
unsigned _readSize;
unsigned _flacCompression;
bool _matlabHeader;
bool _textHeader;
bool _compressData;
void setInput(const opts::variables_map& vm);
void setOutputDir(const opts::variables_map& vm);
void setOutputDir(const fs::path &p);
};
#endif /* __CONVERT_CONFIG__*/