author | František Kučera <franta-hg@frantovo.cz> |
Sun, 31 Oct 2021 17:30:40 +0100 | |
branch | v_0 |
changeset 33 | c9a158da6c32 |
parent 28 | 0e7c57d48d1e |
permissions | -rw-r--r-- |
26 | 1 |
/** |
2 |
* Relational pipes |
|
3 |
* Copyright © 2020 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, version 3 of the License. |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 |
*/ |
|
17 |
#pragma once |
|
18 |
||
19 |
#include <sstream> |
|
20 |
||
21 |
#include "INIReader.h" |
|
22 |
||
23 |
namespace relpipe { |
|
24 |
namespace in { |
|
25 |
namespace ini { |
|
26 |
namespace lib { |
|
27 |
||
28
0e7c57d48d1e
configurable unescaping processors
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
28 |
class UnescapingProcessor { |
26 | 29 |
private: |
30 |
protected: |
|
31 |
const char ESC = '\\'; |
|
32 |
||
33 |
std::stringstream& put(std::stringstream& result, const char& ch, int& i) { |
|
34 |
result.put(ch); |
|
35 |
i++; |
|
36 |
return result; |
|
37 |
} |
|
38 |
||
39 |
public: |
|
40 |
||
28
0e7c57d48d1e
configurable unescaping processors
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
41 |
enum class TextType { |
0e7c57d48d1e
configurable unescaping processors
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
42 |
SectionName, |
0e7c57d48d1e
configurable unescaping processors
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
43 |
SectionComment, |
0e7c57d48d1e
configurable unescaping processors
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
44 |
SectionTag, |
0e7c57d48d1e
configurable unescaping processors
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
45 |
EntryKey, |
0e7c57d48d1e
configurable unescaping processors
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
46 |
EntryValue, |
0e7c57d48d1e
configurable unescaping processors
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
47 |
EntryComment, |
0e7c57d48d1e
configurable unescaping processors
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
48 |
Comment, |
0e7c57d48d1e
configurable unescaping processors
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
49 |
}; |
26 | 50 |
|
28
0e7c57d48d1e
configurable unescaping processors
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
51 |
virtual std::string unescape(const std::string& s, const TextType type) = 0; |
26 | 52 |
|
33
c9a158da6c32
java-manifest-mf dialect for parsing MANIFEST.MF files (import shared code from relpipe-in-ini)
František Kučera <franta-hg@frantovo.cz>
parents:
28
diff
changeset
|
53 |
virtual ~UnescapingProcessor() { |
c9a158da6c32
java-manifest-mf dialect for parsing MANIFEST.MF files (import shared code from relpipe-in-ini)
František Kučera <franta-hg@frantovo.cz>
parents:
28
diff
changeset
|
54 |
} |
26 | 55 |
}; |
56 |
||
57 |
} |
|
58 |
} |
|
59 |
} |
|
60 |
} |