FictionBook2Token.h Source File documentation

FictionBook2Token.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 FICTIONBOOK2TOKEN_H_INCLUDED
11 #define FICTIONBOOK2TOKEN_H_INCLUDED
12
13 #include "EBOOKToken.h"
14
15 namespace libebook
16 {
17
18 #define FictionBook2_NO_NAMESPACE(ns) (0 == ns)
19
20 namespace FictionBook2Token
21 {
22
23 enum
24 {
25 INVALID_TOKEN = 0,
26 FIRST_TOKEN = EBOOKToken<FictionBook2Parser>::FIRST_TOKEN,
27
28 // namespaces
29 NS_FICTIONBOOK,
30 NS_XLINK,
31 NS_XML,
32 NS_XMLNS,
33
34 // elements
35 a,
36 annotation,
37 author,
38 binary,
39 body,
40 book_name,
41 book_title,
42 cite,
43 city,
44 code,
45 coverpage,
46 custom_info,
47 date,
48 description,
49 document_info,
50 email,
51 emphasis,
52 empty_line,
53 epigraph,
54 FictionBook,
55 first_name,
56 genre,
57 history,
58 home_page,
59 id,
60 image,
61 isbn,
62 keywords,
63 lang,
64 last_name,
65 middle_name,
66 nickname,
67 output,
68 output_document,
69 p,
70 part,
71 poem,
72 program_used,
73 publisher,
74 publish_info,
75 section,
76 sequence,
77 src_lang,
78 src_ocr,
79 src_title_info,
80 src_url,
81 stanza,
82 strikethrough,
83 strong,
84 style,
85 stylesheet,
86 sub,
87 subtitle,
88 sup,
89 table,
90 td,
91 text_author,
92 th,
93 title,
94 title_info,
95 tr,
96 translator,
97 v,
98 version,
99 year,
100
101 // attributes
102 align,
103 alt,
104 colspan,
105 content_type,
106 create,
107 currency,
108 href,
109 include,
110 include_all,
111 info_type,
112 match,
113 mode,
114 name,
115 number,
116 price,
117 rowspan,
118 type,
119 value,
120
121 // attribute values
122 image_jpg,
123 note,
124 simple,
125
126 LAST_TOKEN
127 };
128
129 static_assert(EBOOKToken<FictionBook2Parser>::LAST_TOKEN >= LAST_TOKEN, "token number overflow");
130
131 }
132
133 struct FictionBook2TokenData
134 {
135 const char *name;
136 int id;
137 };
138
139 const FictionBook2TokenData *getFictionBook2Token(const char *str, const unsigned length);
140 const FictionBook2TokenData *getFictionBook2Token(const char *str);
141 const FictionBook2TokenData *getFictionBook2Token(const unsigned char *str);
142
143 int getFictionBook2TokenID(const FictionBook2TokenData &token);
144 int getFictionBook2TokenID(const FictionBook2TokenData *token);
145 int getFictionBook2TokenID(const char *str, const unsigned length);
146 int getFictionBook2TokenID(const char *str);
147 int getFictionBook2TokenID(const unsigned char *str);
148
149 const char *getFictionBook2TokenName(const FictionBook2TokenData &token);
150 const char *getFictionBook2TokenName(const FictionBook2TokenData *token);
151 const char *getFictionBook2TokenName(const char *str, const unsigned length);
152 const char *getFictionBook2TokenName(const char *str);
153 const char *getFictionBook2TokenName(const unsigned char *str);
154
155 }
156
157 #endif // FICTIONBOOK2TOKEN_H_INCLUDED
158
159 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::FictionBook2Token::a
Definition: FictionBook2Token.h:35
libebook::FictionBook2Token::LAST_TOKEN
Definition: FictionBook2Token.h:126
libebook::FictionBook2Token::name
Definition: FictionBook2Token.h:114
libebook::FictionBook2Token::genre
Definition: FictionBook2Token.h:56
libebook::FictionBook2Token::alt
Definition: FictionBook2Token.h:103
libebook::FictionBook2Token::subtitle
Definition: FictionBook2Token.h:87
libebook::FictionBook2Token::currency
Definition: FictionBook2Token.h:107
libebook::FictionBook2Token::rowspan
Definition: FictionBook2Token.h:117
libebook::FictionBook2Token::simple
Definition: FictionBook2Token.h:124
libebook::FictionBook2Token::book_name
Definition: FictionBook2Token.h:40
libebook::FictionBook2Token::content_type
Definition: FictionBook2Token.h:105
libebook::FictionBook2Token::keywords
Definition: FictionBook2Token.h:62
libebook::FictionBook2Token::section
Definition: FictionBook2Token.h:75
libebook::FictionBook2Token::strong
Definition: FictionBook2Token.h:83
libebook::FictionBook2Token::number
Definition: FictionBook2Token.h:115
libebook::FictionBook2Token::match
Definition: FictionBook2Token.h:112
libebook::FictionBook2Token::value
Definition: FictionBook2Token.h:119
libebook::FictionBook2Token::href
Definition: FictionBook2Token.h:108
libebook::FictionBook2Token::program_used
Definition: FictionBook2Token.h:72
str
const char * str
Definition: EBOOKHTMLParser.cpp:46
libebook::FictionBook2Token::tr
Definition: FictionBook2Token.h:95
libebook::FictionBook2Token::emphasis
Definition: FictionBook2Token.h:51
libebook::FictionBook2TokenData::name
const char * name
Definition: FictionBook2Token.h:135
libebook::FictionBook2Token::cite
Definition: FictionBook2Token.h:42
libebook::FictionBook2Token::table
Definition: FictionBook2Token.h:89
libebook::FictionBook2Token::city
Definition: FictionBook2Token.h:43
libebook::FictionBook2Token::mode
Definition: FictionBook2Token.h:113
libebook::FictionBook2Token::NS_XML
Definition: FictionBook2Token.h:31
libebook::FictionBook2Token::lang
Definition: FictionBook2Token.h:63
libebook::FictionBook2Token::v
Definition: FictionBook2Token.h:97
libebook::FictionBook2Token::home_page
Definition: FictionBook2Token.h:58
libebook::FictionBook2Token::src_ocr
Definition: FictionBook2Token.h:78
libebook::FictionBook2Token::NS_FICTIONBOOK
Definition: FictionBook2Token.h:29
libebook::FictionBook2Token::publisher
Definition: FictionBook2Token.h:73
libebook::FictionBook2Token::create
Definition: FictionBook2Token.h:106
libebook::FictionBook2Token::book_title
Definition: FictionBook2Token.h:41
length
unsigned length
Definition: SoftBookParser.cpp:73
libebook::FictionBook2Token::type
Definition: FictionBook2Token.h:118
libebook::FictionBook2Token::FictionBook
Definition: FictionBook2Token.h:54
libebook::FictionBook2Token::price
Definition: FictionBook2Token.h:116
libebook::FictionBook2Token::src_url
Definition: FictionBook2Token.h:80
libebook::FictionBook2Token::include_all
Definition: FictionBook2Token.h:110
libebook::FictionBook2Token::body
Definition: FictionBook2Token.h:39
libebook::FictionBook2Token::translator
Definition: FictionBook2Token.h:96
libebook::FictionBook2Token::sup
Definition: FictionBook2Token.h:88
libebook::FictionBook2Token::FIRST_TOKEN
Definition: FictionBook2Token.h:26
libebook::FictionBook2Token::title_info
Definition: FictionBook2Token.h:94
libebook::FictionBook2Token::output_document
Definition: FictionBook2Token.h:68
libebook::EBOOKToken
Definition: EBOOKToken.h:17
libebook::FictionBook2Token::td
Definition: FictionBook2Token.h:90
libebook::FictionBook2TokenData
Definition: FictionBook2Token.h:133
libebook::FictionBook2Token::output
Definition: FictionBook2Token.h:67
libebook::FictionBook2Token::epigraph
Definition: FictionBook2Token.h:53
libebook::FictionBook2Token::first_name
Definition: FictionBook2Token.h:55
libebook::FictionBook2Token::NS_XLINK
Definition: FictionBook2Token.h:30
libebook::FictionBook2Token::binary
Definition: FictionBook2Token.h:38
libebook::FictionBook2Token::INVALID_TOKEN
Definition: FictionBook2Token.h:25
libebook::FictionBook2Token::p
Definition: FictionBook2Token.h:69
libebook::FictionBook2Token::middle_name
Definition: FictionBook2Token.h:65
libebook::FictionBook2Token::include
Definition: FictionBook2Token.h:109
libebook::FictionBook2Token::history
Definition: FictionBook2Token.h:57
libebook::FictionBook2Token::stylesheet
Definition: FictionBook2Token.h:85
libebook::FictionBook2Token::style
Definition: FictionBook2Token.h:84
libebook::FictionBook2Token::annotation
Definition: FictionBook2Token.h:36
libebook::FictionBook2Token::colspan
Definition: FictionBook2Token.h:104
libebook::getFictionBook2TokenID
int getFictionBook2TokenID(const FictionBook2TokenData &token)
Definition: FictionBook2Token.cpp:50
libebook::FictionBook2Token::author
Definition: FictionBook2Token.h:37
libebook::FictionBook2Token::src_title_info
Definition: FictionBook2Token.h:79
libebook::FictionBook2Token::email
Definition: FictionBook2Token.h:50
EBOOKToken.h
libebook::FictionBook2Token::part
Definition: FictionBook2Token.h:70
libebook::FictionBook2Token::NS_XMLNS
Definition: FictionBook2Token.h:32
libebook::FictionBook2Token::document_info
Definition: FictionBook2Token.h:49
libebook::FictionBook2Token::sequence
Definition: FictionBook2Token.h:76
libebook::FictionBook2Token::title
Definition: FictionBook2Token.h:93
libebook::getFictionBook2TokenName
const char * getFictionBook2TokenName(const FictionBook2TokenData &token)
Definition: FictionBook2Token.cpp:77
libebook::FictionBook2Token::sub
Definition: FictionBook2Token.h:86
libebook::FictionBook2Token::custom_info
Definition: FictionBook2Token.h:46
libebook::FictionBook2Token::code
Definition: FictionBook2Token.h:44
libebook::FictionBook2Token::th
Definition: FictionBook2Token.h:92
libebook::FictionBook2Token::stanza
Definition: FictionBook2Token.h:81
libebook::FictionBook2Token::text_author
Definition: FictionBook2Token.h:91
libebook::FictionBook2Token::poem
Definition: FictionBook2Token.h:71
libebook
Definition: BBeBCollector.cpp:18
libebook::FictionBook2Token::publish_info
Definition: FictionBook2Token.h:74
libebook::FictionBook2Token::note
Definition: FictionBook2Token.h:123
libebook::FictionBook2Token::image
Definition: FictionBook2Token.h:60
libebook::FictionBook2Token::version
Definition: FictionBook2Token.h:98
libebook::FictionBook2Token::empty_line
Definition: FictionBook2Token.h:52
libebook::FictionBook2Token::coverpage
Definition: FictionBook2Token.h:45
libebook::FictionBook2Token::isbn
Definition: FictionBook2Token.h:61
libebook::FictionBook2Token::info_type
Definition: FictionBook2Token.h:111
libebook::FictionBook2Token::align
Definition: FictionBook2Token.h:102
libebook::FictionBook2Token::description
Definition: FictionBook2Token.h:48
libebook::getFictionBook2Token
const FictionBook2TokenData * getFictionBook2Token(const char *const str, const unsigned length)
Definition: FictionBook2Token.cpp:29
libebook::FictionBook2Token::id
Definition: FictionBook2Token.h:59
libebook::FictionBook2Token::nickname
Definition: FictionBook2Token.h:66
libebook::FictionBook2Token::strikethrough
Definition: FictionBook2Token.h:82
libebook::FictionBook2Token::date
Definition: FictionBook2Token.h:47
libebook::FictionBook2Token::year
Definition: FictionBook2Token.h:99
libebook::FictionBook2TokenData::id
int id
Definition: FictionBook2Token.h:136
libebook::FictionBook2Token::src_lang
Definition: FictionBook2Token.h:77
libebook::FictionBook2Token::last_name
Definition: FictionBook2Token.h:64
libebook::FictionBook2Token::image_jpg
Definition: FictionBook2Token.h:122