EPUBImageManager.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

EPUBImageManager.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 libepubgen 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 INCLUDED_EPUBIMAGEMANAGER_H
11 #define INCLUDED_EPUBIMAGEMANAGER_H
12
13 #include <boost/unordered_map.hpp>
14
15 #include <librevenge/librevenge.h>
16
17 #include "EPUBCounter.h"
18 #include "EPUBPath.h"
19
20 namespace libepubgen
21 {
22
23 class EPUBManifest;
24 class EPUBPackage;
25
26 class EPUBImageManager
27 {
28 // disable copying
29 EPUBImageManager(const EPUBImageManager &);
30 EPUBImageManager &operator=(const EPUBImageManager &);
31
32 struct BinaryDataHash // : public std::unary_function<librevenge::RVNGBinaryData, std::size_t>
33 {
34 std::size_t operator()(const librevenge::RVNGBinaryData &data) const;
35 };
36
37 struct BinaryDataEqual // : public std::binary_function<librevenge::RVNGBinaryData, librevenge::RVNGBinaryData, bool>
38 {
39 bool operator()(const librevenge::RVNGBinaryData &left, const librevenge::RVNGBinaryData right) const;
40 };
41
42 typedef boost::unordered_map<librevenge::RVNGBinaryData, EPUBPath, BinaryDataHash, BinaryDataEqual> MapType_t;
43
44 public:
45 explicit EPUBImageManager(EPUBManifest &manifest);
46
47 const EPUBPath &insert(const librevenge::RVNGBinaryData &data, const librevenge::RVNGString &mimetype);
48
49 void writeTo(EPUBPackage &package);
50
51 private:
52 EPUBManifest &m_manifest;
53 MapType_t m_map;
54 EPUBCounter m_number;
55 };
56
57 }
58
59 #endif // INCLUDED_EPUBIMAGEMANAGER
60
61 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
EPUBCounter.h
libepubgen::EPUBImageManager::m_map
MapType_t m_map
Definition: EPUBImageManager.h:53
libepubgen
Definition: EPUBBinarySink.cpp:12
libepubgen::EPUBImageManager::writeTo
void writeTo(EPUBPackage &package)
Definition: EPUBImageManager.cpp:99
libepubgen::EPUBImageManager::MapType_t
boost::unordered_map< librevenge::RVNGBinaryData, EPUBPath, BinaryDataHash, BinaryDataEqual > MapType_t
Definition: EPUBImageManager.h:42
libepubgen::EPUBImageManager::BinaryDataEqual
Definition: EPUBImageManager.h:37
libepubgen::EPUBImageManager::BinaryDataEqual::operator()
bool operator()(const librevenge::RVNGBinaryData &left, const librevenge::RVNGBinaryData right) const
Definition: EPUBImageManager.cpp:58
libepubgen::EPUBManifest
Definition: EPUBManifest.h:24
libepubgen::EPUBImageManager::BinaryDataHash::operator()
std::size_t operator()(const librevenge::RVNGBinaryData &data) const
Definition: EPUBImageManager.cpp:47
libepubgen::EPUBImageManager::EPUBImageManager
EPUBImageManager(const EPUBImageManager &)
EPUBPath.h
libepubgen::EPUBPath
Representation of a path in the package.
Definition: EPUBPath.h:21
libepubgen::EPUBImageManager::m_manifest
EPUBManifest & m_manifest
Definition: EPUBImageManager.h:52
libepubgen::EPUBImageManager::insert
const EPUBPath & insert(const librevenge::RVNGBinaryData &data, const librevenge::RVNGString &mimetype)
Definition: EPUBImageManager.cpp:75
libepubgen::EPUBImageManager::m_number
EPUBCounter m_number
Definition: EPUBImageManager.h:54
libepubgen::EPUBCounter
Definition: EPUBCounter.h:16
libepubgen::EPUBImageManager::operator=
EPUBImageManager & operator=(const EPUBImageManager &)
libepubgen::EPUBImageManager::BinaryDataHash
Definition: EPUBImageManager.h:32
libepubgen::EPUBImageManager
Definition: EPUBImageManager.h:26