1 | /* |
---|
2 | Copyright (c) 2006-2018 Elmar Pruesse <elmar.pruesse@ucdenver.edu> |
---|
3 | |
---|
4 | This file is part of SINA. |
---|
5 | SINA is free software: you can redistribute it and/or modify it under |
---|
6 | the terms of the GNU General Public License as published by the Free |
---|
7 | Software Foundation, either version 3 of the License, or (at your |
---|
8 | option) any later version. |
---|
9 | |
---|
10 | SINA is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
11 | WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
12 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
---|
13 | for more details. |
---|
14 | |
---|
15 | You should have received a copy of the GNU General Public License |
---|
16 | along with SINA. If not, see <http://www.gnu.org/licenses/>. |
---|
17 | |
---|
18 | Additional permission under GNU GPL version 3 section 7 |
---|
19 | |
---|
20 | If you modify SINA, or any covered work, by linking or combining it |
---|
21 | with components of ARB (or a modified version of that software), |
---|
22 | containing parts covered by the terms of the |
---|
23 | ARB-public-library-license, the licensors of SINA grant you additional |
---|
24 | permission to convey the resulting work. Corresponding Source for a |
---|
25 | non-source form of such a combination shall include the source code |
---|
26 | for the parts of ARB used as well as that of the covered work. |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef _RW_ARB_H_ |
---|
30 | #define _RW_ARB_H_ |
---|
31 | |
---|
32 | #include "tray.h" |
---|
33 | |
---|
34 | #include <memory> |
---|
35 | #include <string> |
---|
36 | #include <boost/program_options.hpp> |
---|
37 | #include <boost/filesystem.hpp> |
---|
38 | |
---|
39 | namespace sina { |
---|
40 | |
---|
41 | class logger_progress; |
---|
42 | |
---|
43 | class rw_arb { |
---|
44 | private: |
---|
45 | struct options; |
---|
46 | static struct options *opts; |
---|
47 | |
---|
48 | public: |
---|
49 | class reader { |
---|
50 | struct priv_data; |
---|
51 | std::shared_ptr<priv_data> data; |
---|
52 | public: |
---|
53 | reader(); |
---|
54 | reader(boost::filesystem::path infile, |
---|
55 | std::vector<std::string>& fields); |
---|
56 | reader(const reader& o); |
---|
57 | reader& operator=(const reader& o); |
---|
58 | ~reader(); |
---|
59 | |
---|
60 | bool operator()(tray& t); |
---|
61 | |
---|
62 | void set_progress(logger_progress& p); |
---|
63 | }; |
---|
64 | |
---|
65 | class writer { |
---|
66 | struct priv_data; |
---|
67 | std::shared_ptr<priv_data> data; |
---|
68 | public: |
---|
69 | writer(); |
---|
70 | writer(boost::filesystem::path outfile, |
---|
71 | unsigned int copy_relatives, |
---|
72 | std::vector<std::string>& fields); |
---|
73 | writer(const writer& o); |
---|
74 | writer& operator=(const writer& o); |
---|
75 | ~writer(); |
---|
76 | |
---|
77 | tray operator()(tray t); |
---|
78 | }; |
---|
79 | |
---|
80 | static void get_options_description(boost::program_options::options_description& all, |
---|
81 | boost::program_options::options_description& adv); |
---|
82 | static void validate_vm(boost::program_options::variables_map& /*unused*/, |
---|
83 | boost::program_options::options_description& /*unused*/); |
---|
84 | |
---|
85 | static std::string get_cli_alignment(); |
---|
86 | }; |
---|
87 | |
---|
88 | } // namespace sina |
---|
89 | |
---|
90 | |
---|
91 | |
---|
92 | #endif // _RW_ARB_H_ |
---|
93 | /* |
---|
94 | Local Variables: |
---|
95 | mode:c++ |
---|
96 | c-file-style:"stroustrup" |
---|
97 | c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . 0)) |
---|
98 | indent-tabs-mode:nil |
---|
99 | fill-column:99 |
---|
100 | End: |
---|
101 | */ |
---|
102 | // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : |
---|