EBOOKOPFToken.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libe-book project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #ifndef EBOOKOPFTOKEN_H_INCLUDED
11 #define EBOOKOPFTOKEN_H_INCLUDED
12
13 #include "EBOOKToken.h"
14
15 namespace libebook
16 {
17
18 namespace EBOOKOPFToken
19 {
20
21 enum
22 {
23 INVALID_TOKEN = 0,
24 FIRST_TOKEN = EBOOKToken<EBOOKOPFParser>::FIRST_TOKEN,
25
26 // namespace prefixes
27 dc,
28 opf,
29 xml,
30 xmlns,
31
32 // elements
33 Contributor,
34 Coverage,
35 Creator,
36 Date,
37 Description,
38 Format,
39 Identifier,
40 Language,
41 Publisher,
42 Relation,
43 Rights,
44 Source,
45 Subject,
46 Title,
47 Type,
48 contributor,
49 coverage,
50 creator,
51 date,
52 dc_metadata,
53 description,
54 format,
55 guide,
56 identifier,
57 item,
58 itemref,
59 language,
60 manifest,
61 meta,
62 metadata,
63 package,
64 publisher,
65 reference,
66 relation,
67 rights,
68 site,
69 source,
70 spine,
71 subject,
72 title,
73 tour,
74 tours,
75 type,
76 x_metadata,
77
78 // attributes
79 content,
80 event,
81 fallback,
82 fallback_style,
83 file_as,
84 href,
85 id,
86 idref,
87 lang,
88 linear,
89 media_type,
90 name,
91 required_modules,
92 required_namespace,
93 role,
94 scheme,
95 toc,
96 unique_identifier,
97 version,
98
99 // attribute values
100 MIME_image,
101 MIME_oeb,
102 MIME_xhtml,
103 _2_0,
104 _3_0,
105 aut,
106 creation,
107 edt,
108 modification,
109 no,
110 publication,
111 yes,
112
113 LAST_TOKEN
114 };
115
116 static_assert(EBOOKToken<EBOOKOPFParser>::LAST_TOKEN >= LAST_TOKEN, "token number overflow");
117
118 enum Namespace
119 {
120 NS_dc = dc << 16,
121 NS_opf = opf << 16,
122 NS_xml = xml << 16,
123 NS_xmlns = xmlns << 16
124 };
125
126 }
127
128 int getOPFTokenId(const char *name, const char *ns = nullptr);
129 int getOPFTokenId(const char *name, std::size_t nameLen, const char *ns, std::size_t nsLen);
130 int getOPFTokenId(const char *name, std::size_t nameLen);
131
132 }
133
134 #endif // EBOOKOPFTOKEN_H_INCLUDED
135
136 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::EBOOKOPFToken::fallback_style
Definition: EBOOKOPFToken.h:82
libebook::EBOOKOPFToken::creation
Definition: EBOOKOPFToken.h:106
libebook::EBOOKOPFToken::Publisher
Definition: EBOOKOPFToken.h:41
libebook::EBOOKOPFToken::NS_xmlns
Definition: EBOOKOPFToken.h:123
libebook::EBOOKOPFToken::_3_0
Definition: EBOOKOPFToken.h:104
libebook::EBOOKOPFToken::name
Definition: EBOOKOPFToken.h:90
libebook::EBOOKOPFToken::metadata
Definition: EBOOKOPFToken.h:62
libebook::EBOOKOPFToken::manifest
Definition: EBOOKOPFToken.h:60
libebook::EBOOKOPFToken::itemref
Definition: EBOOKOPFToken.h:58
libebook::EBOOKOPFToken::unique_identifier
Definition: EBOOKOPFToken.h:96
libebook::EBOOKOPFToken::xml
Definition: EBOOKOPFToken.h:29
libebook::EBOOKOPFToken::description
Definition: EBOOKOPFToken.h:53
libebook::EBOOKOPFToken::required_modules
Definition: EBOOKOPFToken.h:91
libebook::EBOOKOPFToken::Relation
Definition: EBOOKOPFToken.h:42
libebook::EBOOKOPFToken::MIME_oeb
Definition: EBOOKOPFToken.h:101
libebook::EBOOKOPFToken::required_namespace
Definition: EBOOKOPFToken.h:92
libebook::EBOOKOPFToken::no
Definition: EBOOKOPFToken.h:109
libebook::EBOOKOPFToken::linear
Definition: EBOOKOPFToken.h:88
libebook::EBOOKOPFToken::reference
Definition: EBOOKOPFToken.h:65
libebook::EBOOKOPFToken::creator
Definition: EBOOKOPFToken.h:50
libebook::EBOOKOPFToken::LAST_TOKEN
Definition: EBOOKOPFToken.h:113
libebook::EBOOKOPFToken::Rights
Definition: EBOOKOPFToken.h:43
libebook::EBOOKOPFToken::subject
Definition: EBOOKOPFToken.h:71
libebook::EBOOKOPFToken::contributor
Definition: EBOOKOPFToken.h:48
libebook::EBOOKOPFToken::event
Definition: EBOOKOPFToken.h:80
libebook::EBOOKOPFToken::dc_metadata
Definition: EBOOKOPFToken.h:52
libebook::EBOOKOPFToken::Language
Definition: EBOOKOPFToken.h:40
libebook::EBOOKOPFToken::NS_opf
Definition: EBOOKOPFToken.h:121
libebook::EBOOKOPFToken::role
Definition: EBOOKOPFToken.h:93
libebook::EBOOKOPFToken::Source
Definition: EBOOKOPFToken.h:44
libebook::EBOOKOPFToken::tour
Definition: EBOOKOPFToken.h:73
libebook::EBOOKOPFToken::yes
Definition: EBOOKOPFToken.h:111
libebook::EBOOKOPFToken::Date
Definition: EBOOKOPFToken.h:36
libebook::EBOOKOPFToken::INVALID_TOKEN
Definition: EBOOKOPFToken.h:23
libebook::EBOOKOPFToken::Identifier
Definition: EBOOKOPFToken.h:39
libebook::EBOOKOPFToken::idref
Definition: EBOOKOPFToken.h:86
libebook::EBOOKOPFToken::dc
Definition: EBOOKOPFToken.h:27
libebook::EBOOKOPFToken::scheme
Definition: EBOOKOPFToken.h:94
libebook::EBOOKToken
Definition: EBOOKToken.h:17
libebook::EBOOKOPFToken::rights
Definition: EBOOKOPFToken.h:67
libebook::EBOOKOPFToken::MIME_xhtml
Definition: EBOOKOPFToken.h:102
libebook::EBOOKOPFToken::site
Definition: EBOOKOPFToken.h:68
libebook::getOPFTokenId
int getOPFTokenId(const char *const name, const char *const ns)
Definition: EBOOKOPFToken.cpp:27
libebook::EBOOKOPFToken::title
Definition: EBOOKOPFToken.h:72
libebook::EBOOKOPFToken::xmlns
Definition: EBOOKOPFToken.h:30
libebook::EBOOKOPFToken::date
Definition: EBOOKOPFToken.h:51
libebook::EBOOKOPFToken::package
Definition: EBOOKOPFToken.h:63
libebook::EBOOKOPFToken::coverage
Definition: EBOOKOPFToken.h:49
libebook::EBOOKOPFToken::Contributor
Definition: EBOOKOPFToken.h:33
libebook::EBOOKOPFToken::content
Definition: EBOOKOPFToken.h:79
libebook::EBOOKOPFToken::Creator
Definition: EBOOKOPFToken.h:35
libebook::EBOOKOPFToken::lang
Definition: EBOOKOPFToken.h:87
EBOOKToken.h
libebook::EBOOKOPFToken::_2_0
Definition: EBOOKOPFToken.h:103
libebook::EBOOKOPFToken::language
Definition: EBOOKOPFToken.h:59
libebook::EBOOKOPFToken::toc
Definition: EBOOKOPFToken.h:95
libebook::EBOOKOPFToken::opf
Definition: EBOOKOPFToken.h:28
libebook::EBOOKOPFToken::MIME_image
Definition: EBOOKOPFToken.h:100
libebook::EBOOKOPFToken::href
Definition: EBOOKOPFToken.h:84
libebook::EBOOKOPFToken::format
Definition: EBOOKOPFToken.h:54
libebook::EBOOKOPFToken::Subject
Definition: EBOOKOPFToken.h:45
libebook::EBOOKOPFToken::identifier
Definition: EBOOKOPFToken.h:56
libebook::EBOOKOPFToken::NS_xml
Definition: EBOOKOPFToken.h:122
libebook::EBOOKOPFToken::edt
Definition: EBOOKOPFToken.h:107
libebook::EBOOKOPFToken::source
Definition: EBOOKOPFToken.h:69
libebook::EBOOKOPFToken::type
Definition: EBOOKOPFToken.h:75
libebook
Definition: BBeBCollector.cpp:18
libebook::EBOOKOPFToken::spine
Definition: EBOOKOPFToken.h:70
libebook::EBOOKOPFToken::aut
Definition: EBOOKOPFToken.h:105
libebook::EBOOKOPFToken::publication
Definition: EBOOKOPFToken.h:110
libebook::EBOOKOPFToken::publisher
Definition: EBOOKOPFToken.h:64
libebook::EBOOKOPFToken::x_metadata
Definition: EBOOKOPFToken.h:76
libebook::EBOOKOPFToken::item
Definition: EBOOKOPFToken.h:57
libebook::EBOOKOPFToken::modification
Definition: EBOOKOPFToken.h:108
libebook::EBOOKOPFToken::Title
Definition: EBOOKOPFToken.h:46
libebook::EBOOKOPFToken::fallback
Definition: EBOOKOPFToken.h:81
libebook::EBOOKOPFToken::meta
Definition: EBOOKOPFToken.h:61
libebook::EBOOKOPFToken::Description
Definition: EBOOKOPFToken.h:37
libebook::EBOOKOPFToken::Coverage
Definition: EBOOKOPFToken.h:34
libebook::EBOOKOPFToken::tours
Definition: EBOOKOPFToken.h:74
libebook::EBOOKOPFToken::guide
Definition: EBOOKOPFToken.h:55
libebook::EBOOKOPFToken::NS_dc
Definition: EBOOKOPFToken.h:120
libebook::EBOOKOPFToken::media_type
Definition: EBOOKOPFToken.h:89
libebook::EBOOKOPFToken::id
Definition: EBOOKOPFToken.h:85
libebook::EBOOKOPFToken::Type
Definition: EBOOKOPFToken.h:47
libebook::EBOOKOPFToken::FIRST_TOKEN
Definition: EBOOKOPFToken.h:24
libebook::EBOOKOPFToken::file_as
Definition: EBOOKOPFToken.h:83
libebook::EBOOKOPFToken::Namespace
Namespace
Definition: EBOOKOPFToken.h:118
libebook::EBOOKOPFToken::relation
Definition: EBOOKOPFToken.h:66
libebook::EBOOKOPFToken::Format
Definition: EBOOKOPFToken.h:38
libebook::EBOOKOPFToken::version
Definition: EBOOKOPFToken.h:97