SoftBookParser.h Source File documentation

SoftBookParser.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 SOFTBOOKPARSER_H_INCLUDED
11 #define SOFTBOOKPARSER_H_INCLUDED
12
13 #include "SoftBookCollector.h"
14 #include "SoftBookHeader.h"
15
16 namespace libebook
17 {
18
19 class SoftBookParser
20 {
21 // disable copying
22 SoftBookParser(const SoftBookParser &);
23 SoftBookParser &operator=(const SoftBookParser &);
24
25 public:
26 SoftBookParser(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document);
27
28 bool parse();
29
30 private:
31 void createTextStream();
32
33 std::shared_ptr<librevenge::RVNGInputStream> getFileStream(const char *name) const;
34
35 private:
36 const SoftBookHeader m_header;
37 librevenge::RVNGInputStream *const m_input;
38 SoftBookCollector m_collector;
39 std::shared_ptr<librevenge::RVNGInputStream> m_resources;
40 std::shared_ptr<librevenge::RVNGInputStream> m_text;
41 };
42
43 }
44
45 #endif // SOFTBOOKPARSER_H_INCLUDED
46
47 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::SoftBookText
Definition: SoftBookText.h:22
SoftBookResourceDir.h
m_collector
FictionBook2ExtrasCollector m_collector
Definition: FictionBook2Parser.cpp:101
libebook::SoftBookResourceDir::getTypeStream
std::shared_ptr< librevenge::RVNGInputStream > getTypeStream() const
Get OLE stream for this resource directory.
Definition: SoftBookResourceDir.cpp:216
libebook::SoftBookParser::m_text
std::shared_ptr< librevenge::RVNGInputStream > m_text
Definition: SoftBookParser.h:40
libebook::getRemainingLength
unsigned long getRemainingLength(librevenge::RVNGInputStream *const input)
Definition: libebook_utils.cpp:170
m_stream
const shared_ptr< librevenge::RVNGInputStream > m_stream
Definition: SoftBookParser.cpp:99
libebook::SoftBookParser::getFileStream
std::shared_ptr< librevenge::RVNGInputStream > getFileStream(const char *name) const
Definition: SoftBookParser.cpp:247
libebook::SoftBookParser::operator=
SoftBookParser & operator=(const SoftBookParser &)
id
unsigned id
Definition: SoftBookParser.cpp:72
libebook::SoftBookLZSSStream
Definition: SoftBookLZSSStream.h:21
libebook
Definition: BBeBCollector.cpp:19
libebook::SoftBookHeader
Definition: SoftBookHeader.h:19
libebook::SoftBookHeader::getCompressed
bool getCompressed() const
Definition: SoftBookHeader.cpp:88
SoftBookCollector.h
libebook_utils.h
SoftBookLZSSStream.h
text
qi::rule< Iterator, AttrValue_t, qi::space_type > text
Definition: TealDocParser.cpp:232
m_resourceIndex
ResourceIndex_t m_resourceIndex
Definition: SoftBookParser.cpp:101
m_input
librevenge::RVNGInputStream * m_input
Definition: PeanutPressParser.cpp:262
libebook::readNBytes
const unsigned char * readNBytes(librevenge::RVNGInputStream *const input, const unsigned long numBytes)
Definition: libebook_utils.cpp:105
offset
unsigned offset
Definition: SoftBookParser.cpp:74
libebook::EBOOKHTMLToken::i
@ i
Definition: EBOOKHTMLToken.h:86
libebook::SoftBookCollector
Definition: SoftBookCollector.h:23
libebook::SoftBookParser::createTextStream
void createTextStream()
Definition: SoftBookParser.cpp:204
libebook::seek
void seek(librevenge::RVNGInputStream *const input, const unsigned long pos)
Definition: libebook_utils.cpp:152
stream
RVNGInputStreamPtr_t stream
Definition: HTMLHelpStream.cpp:79
SoftBookParser.h
SoftBookText.h
document
XMLTreeNodePtr_t document
Definition: EBOOKHTMLParser.cpp:163
m_text
librevenge::RVNGString m_text
Definition: EBOOKOutputElements.cpp:322
m_start
long m_start
Definition: SoftBookParser.cpp:100
libebook::SoftBookParser::SoftBookParser
SoftBookParser(const SoftBookParser &)
libebook::SoftBookParser::parse
bool parse()
Definition: SoftBookParser.cpp:193
libebook::EBOOKHTMLToken::input
@ input
Definition: EBOOKHTMLToken.h:89
mode
hubbub_quirks_mode mode
Definition: EBOOKHTMLParser.cpp:164
libebook::readU16
uint16_t readU16(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libebook_utils.cpp:57
libebook::readU32
uint32_t readU32(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libebook_utils.cpp:73
libebook::EBOOKHTMLToken::header
@ header
Definition: EBOOKHTMLToken.h:82
name
string name
Definition: HTMLHelpStream.cpp:80
libebook::SoftBookParser::m_collector
SoftBookCollector m_collector
Definition: SoftBookParser.h:38
libebook::SoftBookResourceDir
Read the resource tree and provide access to it as an OLE stream.
Definition: SoftBookResourceDir.h:22
EBOOK_DEBUG_MSG
#define EBOOK_DEBUG_MSG(M)
Definition: libebook_utils.h:44
libebook::SoftBookParser
Definition: SoftBookParser.h:20
libebook::SoftBookParser::m_resources
std::shared_ptr< librevenge::RVNGInputStream > m_resources
Definition: SoftBookParser.h:39
type
EBOOKDocument::Type type
Definition: EBOOKDocument.cpp:325
SoftBookHeader.h
libebook::SoftBookParser::m_header
const SoftBookHeader m_header
Definition: SoftBookParser.h:36
libebook::skip
void skip(librevenge::RVNGInputStream *input, unsigned long numBytes)
Definition: libebook_utils.cpp:145
libebook::SoftBookParser::m_input
librevenge::RVNGInputStream *const m_input
Definition: SoftBookParser.h:37
EBOOKStreamView.h
m_header
int m_header
Definition: EBOOKOutputElements.cpp:476
libebook::EBOOKOPFToken::version
@ version
Definition: EBOOKOPFToken.h:97
libebook::SOFTBOOK_COLOR_MODE_GRAYSCALE
@ SOFTBOOK_COLOR_MODE_GRAYSCALE
Definition: SoftBookTypes.h:22
length
unsigned length
Definition: SoftBookParser.cpp:73
libebook::EBOOKHTMLToken::start
@ start
Definition: EBOOKHTMLToken.h:253