gui
[lbook_fbreader.git] / fbreader / src / formats / docbook / DocBookPlugin.cpp
blob6e2f7471d16a69449d8cddaf89e7624523374688
1 /*
2 * Copyright (C) 2004-2008 Geometer Plus <contact@geometerplus.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
20 #include <ZLFile.h>
21 #include <ZLInputStream.h>
23 #include "DocBookPlugin.h"
24 #include "DocBookDescriptionReader.h"
25 #include "DocBookBookReader.h"
26 #include "../../description/BookDescription.h"
28 bool DocBookPlugin::acceptsFile(const std::string &extension) const {
29 return extension == "xml";
32 bool DocBookPlugin::readDescription(const std::string &path, BookDescription &description) const {
33 return DocBookDescriptionReader(description).readDescription(ZLFile(path).inputStream());
36 bool DocBookPlugin::readModel(const BookDescription &description, BookModel &model) const {
37 return DocBookBookReader(model).readDocument(ZLFile(description.fileName()).inputStream());
40 const std::string &DocBookPlugin::iconName() const {
41 static const std::string ICON_NAME = "unknown";
42 return ICON_NAME;