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: */
EBOOKToken.h
name
string name
Definition: HTMLHelpStream.cpp:80
libebook::EBOOKOPFToken::type
@ type
Definition: EBOOKOPFToken.h:75
libebook::EBOOKOPFToken::title
@ title
Definition: EBOOKOPFToken.h:72
libebook::EBOOKOPFToken::tour
@ tour
Definition: EBOOKOPFToken.h:73
libebook::EBOOKOPFToken::language
@ language
Definition: EBOOKOPFToken.h:59
libebook::EBOOKOPFToken::Relation
@ Relation
Definition: EBOOKOPFToken.h:42
libebook::EBOOKOPFToken::fallback
@ fallback
Definition: EBOOKOPFToken.h:81
libebook::EBOOKOPFToken::Rights
@ Rights
Definition: EBOOKOPFToken.h:43
libebook::EBOOKOPFToken::version
@ version
Definition: EBOOKOPFToken.h:97
libebook::EBOOKOPFToken::_3_0
@ _3_0
Definition: EBOOKOPFToken.h:104
libebook::EBOOKOPFToken::Coverage
@ Coverage
Definition: EBOOKOPFToken.h:34
libebook::EBOOKOPFToken::event
@ event
Definition: EBOOKOPFToken.h:80
libebook::EBOOKOPFToken::reference
@ reference
Definition: EBOOKOPFToken.h:65
libebook::EBOOKOPFToken::format
@ format
Definition: EBOOKOPFToken.h:54
libebook::EBOOKOPFToken::publisher
@ publisher
Definition: EBOOKOPFToken.h:64
libebook::EBOOKOPFToken::opf
@ opf
Definition: EBOOKOPFToken.h:28
libebook::EBOOKOPFToken::Date
@ Date
Definition: EBOOKOPFToken.h:36
libebook::EBOOKOPFToken::MIME_image
@ MIME_image
Definition: EBOOKOPFToken.h:100
libebook::EBOOKOPFToken::required_modules
@ required_modules
Definition: EBOOKOPFToken.h:91
libebook::EBOOKOPFToken::unique_identifier
@ unique_identifier
Definition: EBOOKOPFToken.h:96
libebook::EBOOKOPFToken::scheme
@ scheme
Definition: EBOOKOPFToken.h:94
libebook::EBOOKOPFToken::xmlns
@ xmlns
Definition: EBOOKOPFToken.h:30
libebook::EBOOKOPFToken::creation
@ creation
Definition: EBOOKOPFToken.h:106
libebook::EBOOKOPFToken::dc
@ dc
Definition: EBOOKOPFToken.h:27
libebook::EBOOKOPFToken::spine
@ spine
Definition: EBOOKOPFToken.h:70
libebook::EBOOKOPFToken::_2_0
@ _2_0
Definition: EBOOKOPFToken.h:103
libebook::EBOOKOPFToken::fallback_style
@ fallback_style
Definition: EBOOKOPFToken.h:82
libebook::EBOOKOPFToken::publication
@ publication
Definition: EBOOKOPFToken.h:110
libebook::EBOOKOPFToken::creator
@ creator
Definition: EBOOKOPFToken.h:50
libebook::EBOOKOPFToken::Contributor
@ Contributor
Definition: EBOOKOPFToken.h:33
libebook::EBOOKOPFToken::id
@ id
Definition: EBOOKOPFToken.h:85
libebook::EBOOKOPFToken::name
@ name
Definition: EBOOKOPFToken.h:90
libebook::EBOOKOPFToken::site
@ site
Definition: EBOOKOPFToken.h:68
libebook::EBOOKOPFToken::lang
@ lang
Definition: EBOOKOPFToken.h:87
libebook::EBOOKOPFToken::Subject
@ Subject
Definition: EBOOKOPFToken.h:45
libebook::EBOOKOPFToken::Format
@ Format
Definition: EBOOKOPFToken.h:38
libebook::EBOOKOPFToken::item
@ item
Definition: EBOOKOPFToken.h:57
libebook::EBOOKOPFToken::contributor
@ contributor
Definition: EBOOKOPFToken.h:48
libebook::EBOOKOPFToken::INVALID_TOKEN
@ INVALID_TOKEN
Definition: EBOOKOPFToken.h:23
libebook::EBOOKOPFToken::subject
@ subject
Definition: EBOOKOPFToken.h:71
libebook::EBOOKOPFToken::toc
@ toc
Definition: EBOOKOPFToken.h:95
libebook::EBOOKOPFToken::no
@ no
Definition: EBOOKOPFToken.h:109
libebook::EBOOKOPFToken::Language
@ Language
Definition: EBOOKOPFToken.h:40
libebook::EBOOKOPFToken::required_namespace
@ required_namespace
Definition: EBOOKOPFToken.h:92
libebook::EBOOKOPFToken::content
@ content
Definition: EBOOKOPFToken.h:79
libebook::EBOOKOPFToken::Source
@ Source
Definition: EBOOKOPFToken.h:44
libebook::EBOOKOPFToken::Type
@ Type
Definition: EBOOKOPFToken.h:47
libebook::EBOOKOPFToken::LAST_TOKEN
@ LAST_TOKEN
Definition: EBOOKOPFToken.h:113
libebook::EBOOKOPFToken::source
@ source
Definition: EBOOKOPFToken.h:69
libebook::EBOOKOPFToken::identifier
@ identifier
Definition: EBOOKOPFToken.h:56
libebook::EBOOKOPFToken::Creator
@ Creator
Definition: EBOOKOPFToken.h:35
libebook::EBOOKOPFToken::file_as
@ file_as
Definition: EBOOKOPFToken.h:83
libebook::EBOOKOPFToken::package
@ package
Definition: EBOOKOPFToken.h:63
libebook::EBOOKOPFToken::itemref
@ itemref
Definition: EBOOKOPFToken.h:58
libebook::EBOOKOPFToken::aut
@ aut
Definition: EBOOKOPFToken.h:105
libebook::EBOOKOPFToken::relation
@ relation
Definition: EBOOKOPFToken.h:66
libebook::EBOOKOPFToken::date
@ date
Definition: EBOOKOPFToken.h:51
libebook::EBOOKOPFToken::coverage
@ coverage
Definition: EBOOKOPFToken.h:49
libebook::EBOOKOPFToken::edt
@ edt
Definition: EBOOKOPFToken.h:107
libebook::EBOOKOPFToken::manifest
@ manifest
Definition: EBOOKOPFToken.h:60
libebook::EBOOKOPFToken::href
@ href
Definition: EBOOKOPFToken.h:84
libebook::EBOOKOPFToken::Identifier
@ Identifier
Definition: EBOOKOPFToken.h:39
libebook::EBOOKOPFToken::dc_metadata
@ dc_metadata
Definition: EBOOKOPFToken.h:52
libebook::EBOOKOPFToken::linear
@ linear
Definition: EBOOKOPFToken.h:88
libebook::EBOOKOPFToken::metadata
@ metadata
Definition: EBOOKOPFToken.h:62
libebook::EBOOKOPFToken::role
@ role
Definition: EBOOKOPFToken.h:93
libebook::EBOOKOPFToken::Publisher
@ Publisher
Definition: EBOOKOPFToken.h:41
libebook::EBOOKOPFToken::Description
@ Description
Definition: EBOOKOPFToken.h:37
libebook::EBOOKOPFToken::guide
@ guide
Definition: EBOOKOPFToken.h:55
libebook::EBOOKOPFToken::xml
@ xml
Definition: EBOOKOPFToken.h:29
libebook::EBOOKOPFToken::media_type
@ media_type
Definition: EBOOKOPFToken.h:89
libebook::EBOOKOPFToken::idref
@ idref
Definition: EBOOKOPFToken.h:86
libebook::EBOOKOPFToken::Title
@ Title
Definition: EBOOKOPFToken.h:46
libebook::EBOOKOPFToken::modification
@ modification
Definition: EBOOKOPFToken.h:108
libebook::EBOOKOPFToken::yes
@ yes
Definition: EBOOKOPFToken.h:111
libebook::EBOOKOPFToken::MIME_oeb
@ MIME_oeb
Definition: EBOOKOPFToken.h:101
libebook::EBOOKOPFToken::MIME_xhtml
@ MIME_xhtml
Definition: EBOOKOPFToken.h:102
libebook::EBOOKOPFToken::FIRST_TOKEN
@ FIRST_TOKEN
Definition: EBOOKOPFToken.h:24
libebook::EBOOKOPFToken::meta
@ meta
Definition: EBOOKOPFToken.h:61
libebook::EBOOKOPFToken::tours
@ tours
Definition: EBOOKOPFToken.h:74
libebook::EBOOKOPFToken::x_metadata
@ x_metadata
Definition: EBOOKOPFToken.h:76
libebook::EBOOKOPFToken::description
@ description
Definition: EBOOKOPFToken.h:53
libebook::EBOOKOPFToken::rights
@ rights
Definition: EBOOKOPFToken.h:67
libebook::EBOOKOPFToken::Namespace
Namespace
Definition: EBOOKOPFToken.h:119
libebook::EBOOKOPFToken::NS_xmlns
@ NS_xmlns
Definition: EBOOKOPFToken.h:123
libebook::EBOOKOPFToken::NS_xml
@ NS_xml
Definition: EBOOKOPFToken.h:122
libebook::EBOOKOPFToken::NS_opf
@ NS_opf
Definition: EBOOKOPFToken.h:121
libebook::EBOOKOPFToken::NS_dc
@ NS_dc
Definition: EBOOKOPFToken.h:120
libebook
Definition: BBeBCollector.cpp:19
libebook::getOPFTokenId
int getOPFTokenId(const char *const name, const char *const ns)
Definition: EBOOKOPFToken.cpp:27
libebook::EBOOKToken
Definition: EBOOKToken.h:18