|
1 /** |
|
2 * Relational pipes |
|
3 * Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info) |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU General Public License as published by |
|
7 * the Free Software Foundation, either version 3 of the License, or |
|
8 * (at your option) any later version. |
|
9 * |
|
10 * This program is distributed in the hope that it will be useful, |
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 * GNU General Public License for more details. |
|
14 * |
|
15 * You should have received a copy of the GNU General Public License |
|
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 */ |
|
18 #pragma once |
|
19 |
|
20 #include <vector> |
|
21 |
|
22 #include <relpipe/writer/typedefs.h> |
|
23 |
|
24 #include "Configuration.h" |
|
25 #include "FileAttributeFinder.h" |
|
26 |
|
27 namespace relpipe { |
|
28 namespace in { |
|
29 namespace filesystem { |
|
30 |
|
31 using namespace relpipe::writer; |
|
32 |
|
33 class CLIParser { |
|
34 public: |
|
35 |
|
36 Configuration parse(const std::vector<string_t>& arguments) { |
|
37 Configuration c; |
|
38 // TODO: parse arguments |
|
39 c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_PATH_ORIGINAL)); |
|
40 // c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_PATH_ABSOLUTE)); |
|
41 // c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_PATH_CANONICAL)); |
|
42 // c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_NAME)); |
|
43 c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_TYPE)); |
|
44 c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_SIZE)); |
|
45 c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_OWNER)); |
|
46 c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_GROUP)); |
|
47 c.fields.push_back(RequestedField(RequestedField::GROUP_XATTR, L"user.xdg.origin.url")); |
|
48 return c; |
|
49 } |
|
50 |
|
51 virtual ~CLIParser() { |
|
52 } |
|
53 }; |
|
54 |
|
55 } |
|
56 } |
|
57 } |