EPUBToken.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is part of the libe-book project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  */
00009 
00010 #ifndef EPUBTOKEN_H_INCLUDED
00011 #define EPUBTOKEN_H_INCLUDED
00012 
00013 #include <boost/static_assert.hpp>
00014 
00015 #include "EBOOKToken.h"
00016 
00017 namespace libebook
00018 {
00019 
00020 namespace EPUBToken
00021 {
00022 
00023 enum
00024 {
00025   INVALID_TOKEN = 0,
00026   FIRST_TOKEN = EBOOKToken<EPUBParser>::FIRST_TOKEN,
00027 
00028   // namespace prefixes
00029   container,
00030   xml,
00031   xmlns,
00032 
00033   // elements
00034   rootfiles,
00035   rootfile,
00036   signatures,
00037   encryption,
00038 
00039   // attributes
00040   version,
00041   full_path,
00042   media_type,
00043 
00044   // attribute values
00045   _1_0,
00046   MIME_epub,
00047   MIME_opf,
00048 
00049   LAST_TOKEN
00050 };
00051 
00052 BOOST_STATIC_ASSERT(EBOOKToken<EPUBParser>::LAST_TOKEN >= LAST_TOKEN);
00053 
00054 enum Namespace
00055 {
00056   NS_container = container << 16,
00057   NS_xml = xml << 16,
00058   NS_xmlns = xmlns << 16
00059 };
00060 
00061 }
00062 
00063 int getEPUBTokenId(const char *name, const char *ns = 0);
00064 int getEPUBTokenId(const char *name, std::size_t nameLen, const char *ns, std::size_t nsLen);
00065 int getEPUBTokenId(const char *name, std::size_t nameLen);
00066 
00067 }
00068 
00069 #endif // EPUBTOKEN_H_INCLUDED
00070 
00071 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */