src/lib/uri.h
author František Kučera <franta-hg@frantovo.cz>
Sun, 13 Dec 2020 17:34:26 +0100
branchv_0
changeset 33 3b81fbeb5f3b
parent 32 193c643f4ffe
child 34 7eb3dcacba7b
permissions -rw-r--r--
java-manifest-mf + improve unescaping
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * Relational pipes
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2020 František Kučera (Frantovo.cz, GlobalCode.info;
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
 * the Free Software Foundation, version 3 of the License.
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 *
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * GNU General Public License for more details.
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 *
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 */
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
#pragma once
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
namespace relpipe {
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
namespace in {
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
namespace ini {
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
namespace lib {
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
// TODO: these strings will become globally unique URIs (or IRIs) after moving to alt2xml and relative/unprefixed names should also work
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
32
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    26
/** general options of the INI parser */
28
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
namespace option {
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
static const char* TrimContinuingLines = "trim-continuing-lines";
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
static const char* AllowSections = "allow-sections";
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
static const char* AllowSectionTags = "allow-section-tags";
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
static const char* AllowSubKeys = "allow-sub-keys";
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
static const char* CommentSeparators = "comment-separators";
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
static const char* KeyValueSeparators = "key-value-separators";
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
static const char* Quotes = "quotes";
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
static const char* Dialect = "dialect";
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
}
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
32
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    38
/** names of dynamically registered unescaping processors; they are also options */
28
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
namespace unescaping {
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
static const char* Basic = "unescape-basic";
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
static const char* JavaProperties = "unescape-java-properties";
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
static const char* Backspace = "unescape-backspace";
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
}
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
32
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    45
/** not options but a values of the dialect option */
28
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
namespace dialect {
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
static const char* JavaProperties = "java-properties";
33
3b81fbeb5f3b java-manifest-mf + improve unescaping
František Kučera <franta-hg@frantovo.cz>
parents: 32
diff changeset
    48
static const char* JavaManifestMF = "java-manifest-mf";
28
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
}
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50
32
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    51
/** options for configuring the stage where events from the INI parser are converted to SAX events or DOM building */
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    52
namespace xml {
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    53
static const char* TreeWithNamespaces = "tree-with-namespaces";
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    54
static const char* TreeStyle = "tree-style";
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    55
static const char* RootName = "root-name";
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    56
static const char* EnableComments = "enable-comments";
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    57
static const char* EnableWhitespace = "enable-whitespace";
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    58
static const char* EnableLineNumbers = "enable-line-numbers";
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    59
static const char* EnableEventNumbers = "enable-event-numbers";
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    60
static const char* EnableSubKeys = "enable-sub-keys";
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    61
// static const char* EnableSections = "enable-sections"; // TODO: flat XML without sections?
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    62
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    63
static const char* XMLNS = "tag:globalcode.info,2018:alt2xml:TEMPORARY:ini"; // not an option and might change, just preliminary namespace
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    64
}
193c643f4ffe synchronize uri.h with relpipe-in-initable
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    65
28
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    66
}
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    67
}
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    68
}
596a724fbb83 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    69
}