FB2Token.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* libe-book
00003  * Version: MPL 2.0 / LGPLv2.1+
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  * Alternatively, the contents of this file may be used under the terms
00010  * of the GNU Lesser General Public License Version 2.1 or later
00011  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
00012  * applicable instead of those above.
00013  *
00014  * For further information visit http://libebook.sourceforge.net
00015  */
00016 
00017 #ifndef FB2TOKEN_H_INCLUDED
00018 #define FB2TOKEN_H_INCLUDED
00019 
00020 #include "EBOOKToken.h"
00021 
00022 namespace libebook
00023 {
00024 
00025 #define FB2_NO_NAMESPACE(ns) (0 == ns)
00026 
00027 namespace FB2Token
00028 {
00029 
00030 enum
00031 {
00032   INVALID_TOKEN = 0,
00033 
00034   // namespaces
00035   NS_FICTIONBOOK,
00036   NS_XLINK,
00037   NS_XML,
00038   NS_XMLNS,
00039 
00040   // elements
00041   a,
00042   annotation,
00043   author,
00044   binary,
00045   body,
00046   book_name,
00047   book_title,
00048   cite,
00049   city,
00050   code,
00051   coverpage,
00052   custom_info,
00053   date,
00054   description,
00055   document_info,
00056   email,
00057   emphasis,
00058   empty_line,
00059   epigraph,
00060   FictionBook,
00061   first_name,
00062   genre,
00063   history,
00064   home_page,
00065   id,
00066   image,
00067   isbn,
00068   keywords,
00069   lang,
00070   last_name,
00071   middle_name,
00072   nickname,
00073   output,
00074   output_document,
00075   p,
00076   part,
00077   poem,
00078   program_used,
00079   publisher,
00080   publish_info,
00081   section,
00082   sequence,
00083   src_lang,
00084   src_ocr,
00085   src_title_info,
00086   src_url,
00087   stanza,
00088   strikethrough,
00089   strong,
00090   style,
00091   stylesheet,
00092   sub,
00093   subtitle,
00094   sup,
00095   table,
00096   td,
00097   text_author,
00098   th,
00099   title,
00100   title_info,
00101   tr,
00102   translator,
00103   v,
00104   version,
00105   year,
00106 
00107   // attributes
00108   align,
00109   alt,
00110   colspan,
00111   content_type,
00112   create,
00113   currency,
00114   href,
00115   include,
00116   include_all,
00117   info_type,
00118   match,
00119   mode,
00120   name,
00121   number,
00122   price,
00123   rowspan,
00124   type,
00125   value,
00126 
00127   // attribute values
00128   note,
00129   simple,
00130 
00131   LAST_TOKEN
00132 };
00133 
00134 }
00135 
00136 const EBOOKToken *getFB2Token(const char *str, const unsigned length);
00137 const EBOOKToken *getFB2Token(const char *str);
00138 const EBOOKToken *getFB2Token(const unsigned char *str);
00139 
00140 int getFB2TokenID(const EBOOKToken &token);
00141 int getFB2TokenID(const EBOOKToken *token);
00142 int getFB2TokenID(const char *str, const unsigned length);
00143 int getFB2TokenID(const char *str);
00144 int getFB2TokenID(const unsigned char *str);
00145 
00146 const char *getFB2TokenName(const EBOOKToken &token);
00147 const char *getFB2TokenName(const EBOOKToken *token);
00148 const char *getFB2TokenName(const char *str, const unsigned length);
00149 const char *getFB2TokenName(const char *str);
00150 const char *getFB2TokenName(const unsigned char *str);
00151 
00152 }
00153 
00154 #endif // FB2TOKEN_H_INCLUDED
00155 
00156 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */