author | František Kučera <franta-hg@frantovo.cz> |
Wed, 16 Jan 2019 18:16:07 +0100 | |
branch | v_0 |
changeset 7 | 8d73bff730a7 |
parent 6 | 35607c973cf5 |
child 10 | 3e1608320b6c |
permissions | -rw-r--r-- |
4 | 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)); |
|
7
8d73bff730a7
add symlink link target field
František Kučera <franta-hg@frantovo.cz>
parents:
6
diff
changeset
|
44 |
// c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_TYPE,{L"type_a", L"type_b"})); |
6
35607c973cf5
distinguish link type and link target type
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
45 |
c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_SYMLINK_TARGET_TYPE)); |
7
8d73bff730a7
add symlink link target field
František Kučera <franta-hg@frantovo.cz>
parents:
6
diff
changeset
|
46 |
// c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_SYMLINK_TARGET)); |
4 | 47 |
c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_SIZE)); |
48 |
c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_OWNER)); |
|
49 |
c.fields.push_back(RequestedField(RequestedField::GROUP_FILE, FileAttributeFinder::FIELD_GROUP)); |
|
50 |
c.fields.push_back(RequestedField(RequestedField::GROUP_XATTR, L"user.xdg.origin.url")); |
|
51 |
return c; |
|
52 |
} |
|
53 |
||
54 |
virtual ~CLIParser() { |
|
55 |
} |
|
56 |
}; |
|
57 |
||
58 |
} |
|
59 |
} |
|
60 |
} |