Debian Codegraph @

src/lib/EPUBCSSContent.cpp

raw
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 #include "EPUBCSSContent.h"
11
12 #include <libepubgen/EPUBPackage.h>
13
14 namespace libepubgen
15 {
16
17 EPUBCSSContent::EPUBCSSContent()
18 : m_rules()
19 {
20 }
21
22 void EPUBCSSContent::insertRule(const librevenge::RVNGString &selector, const librevenge::RVNGPropertyList &properties)
23 {
24 m_rules.push_back(std::make_pair(selector, properties));
25 }
26
27 void EPUBCSSContent::writeTo(EPUBPackage &package, const char *const name)
28 {
29 package.openCSSFile(name);
30
31 for (Rules_t::const_iterator it = m_rules.begin(); m_rules.end() != it; ++it)
32 package.insertRule(it->first, it->second);
33
34 package.closeCSSFile();
35 }
36
37 } // namespace libepubgen
38
39 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */