EPubToken.h Source File documentation

EPubToken.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 EPUBTOKEN_H_INCLUDED
11 #define EPUBTOKEN_H_INCLUDED
12
13 #include "EBOOKToken.h"
14
15 namespace libebook
16 {
17
18 namespace EPubToken
19 {
20
21 enum
22 {
23 INVALID_TOKEN = 0,
24 FIRST_TOKEN = EBOOKToken<EPubParser>::FIRST_TOKEN,
25
26 // namespace prefixes
27 container,
28 xml,
29 xmlns,
30
31 // elements
32 rootfiles,
33 rootfile,
34 signatures,
35 encryption,
36
37 // attributes
38 version,
39 full_path,
40 media_type,
41
42 // attribute values
43 _1_0,
44 MIME_epub,
45 MIME_opf,
46
47 LAST_TOKEN
48 };
49
50 static_assert(EBOOKToken<EPubParser>::LAST_TOKEN >= LAST_TOKEN, "token number overflow");
51
52 enum Namespace
53 {
54 NS_container = container << 16,
55 NS_xml = xml << 16,
56 NS_xmlns = xmlns << 16
57 };
58
59 }
60
61 int getEPubTokenId(const char *name, const char *ns = nullptr);
62 int getEPubTokenId(const char *name, std::size_t nameLen, const char *ns, std::size_t nsLen);
63 int getEPubTokenId(const char *name, std::size_t nameLen);
64
65 }
66
67 #endif // EPUBTOKEN_H_INCLUDED
68
69 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::EPubToken::rootfiles
Definition: EPubToken.h:32
libebook::EPubToken::xml
Definition: EPubToken.h:28
libebook::EPubToken::NS_container
Definition: EPubToken.h:54
libebook::EPubToken::INVALID_TOKEN
Definition: EPubToken.h:23
libebook::EPubToken::container
Definition: EPubToken.h:27
libebook::EPubToken::full_path
Definition: EPubToken.h:39
libebook
Definition: BBeBCollector.cpp:18
libebook::EPubToken::xmlns
Definition: EPubToken.h:29
libebook::EBOOKToken
Definition: EBOOKToken.h:17
libebook::EPubToken::NS_xml
Definition: EPubToken.h:55
libebook::EPubToken::NS_xmlns
Definition: EPubToken.h:56
libebook::EPubToken::encryption
Definition: EPubToken.h:35
EPubToken.h
libebook::EPubToken::media_type
Definition: EPubToken.h:40
libebook::getEPubTokenId
int getEPubTokenId(const char *const name, const char *const ns)
Definition: EPubToken.cpp:27
libebook::EPubToken::MIME_epub
Definition: EPubToken.h:44
libebook::EPubToken::signatures
Definition: EPubToken.h:34
name
string name
Definition: HTMLHelpStream.cpp:80
libebook::EPubToken::_1_0
Definition: EPubToken.h:43
libebook::EPubToken::version
Definition: EPubToken.h:38
EBOOKToken.h
libebook::EPubToken::Namespace
Namespace
Definition: EPubToken.h:52
libebook::EPubToken::MIME_opf
Definition: EPubToken.h:45
libebook::EPubToken::LAST_TOKEN
Definition: EPubToken.h:47
libebook::EPubToken::rootfile
Definition: EPubToken.h:33
libebook::EPubToken::FIRST_TOKEN
Definition: EPubToken.h:24