src/lib/uri.h
author František Kučera <franta-hg@frantovo.cz>
Mon, 30 Nov 2020 00:12:16 +0100
branchv_0
changeset 32 e72546725c77
parent 31 c6527b45fbc2
child 33 c9a158da6c32
permissions -rw-r--r--
add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * Relational pipes
06aaad12c207 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;
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
06aaad12c207 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
06aaad12c207 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
06aaad12c207 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.
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 *
06aaad12c207 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,
06aaad12c207 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
06aaad12c207 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
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * GNU General Public License for more details.
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 *
06aaad12c207 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
06aaad12c207 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/>.
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 */
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
#pragma once
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
namespace relpipe {
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
namespace in {
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
namespace ini {
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
namespace lib {
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
06aaad12c207 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
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
32
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    26
/** general options of the INI parser */
29
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
namespace option {
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
static const char* TrimContinuingLines = "trim-continuing-lines";
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
static const char* AllowSections = "allow-sections";
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
static const char* AllowSectionTags = "allow-section-tags";
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
static const char* AllowSubKeys = "allow-sub-keys";
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
static const char* CommentSeparators = "comment-separators";
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
static const char* KeyValueSeparators = "key-value-separators";
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
static const char* Quotes = "quotes";
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
static const char* Dialect = "dialect";
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
}
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
32
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    38
/** names of dynamically registered unescaping processors; they are also options */
29
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
namespace unescaping {
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
static const char* Basic = "unescape-basic";
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
static const char* JavaProperties = "unescape-java-properties";
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
static const char* Backspace = "unescape-backspace";
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
}
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
32
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    45
/** not options but a values of the dialect option */
29
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
namespace dialect {
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
static const char* JavaProperties = "java-properties";
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
}
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
32
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    50
/** options for configuring the stage where events from the INI parser are converted to SAX events or DOM building */
31
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    51
namespace xml {
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    52
static const char* TreeWithNamespaces = "tree-with-namespaces";
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    53
static const char* TreeStyle = "tree-style";
32
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    54
static const char* RootName = "root-name";
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    55
static const char* EnableComments = "enable-comments";
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    56
static const char* EnableWhitespace = "enable-whitespace";
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    57
static const char* EnableLineNumbers = "enable-line-numbers";
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    58
static const char* EnableEventNumbers = "enable-event-numbers";
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    59
static const char* EnableSubKeys = "enable-sub-keys";
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    60
// static const char* EnableSections = "enable-sections"; // TODO: flat XML without sections?
31
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    61
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    62
static const char* XMLNS = "tag:globalcode.info,2018:alt2xml:TEMPORARY:ini"; // not an option and might change, just preliminary namespace
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    63
}
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    64
29
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    65
}
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    66
}
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    67
}
06aaad12c207 configurable dialects: in separate classes
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    68
}