Orcus
Loading...
Searching...
No Matches
css_document_tree.hpp
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 */
7
8#ifndef INCLUDED_ORCUS_CSS_DOCUMENT_TREE_HPP
9#define INCLUDED_ORCUS_CSS_DOCUMENT_TREE_HPP
10
11#include "orcus/css_selector.hpp"
12#include "orcus/exception.hpp"
13
14#include <string>
15#include <memory>
16
17namespace orcus {
18
22class ORCUS_DLLPUBLIC css_document_tree
23{
24 struct impl;
25 std::unique_ptr<impl> mp_impl;
26
27public:
28
29 class insertion_error : public general_error
30 {
31 public:
32 insertion_error(const std::string& msg);
33 };
34
35 css_document_tree(const css_document_tree&) = delete;
36
37 css_document_tree();
38 css_document_tree(css_document_tree&& other);
39 ~css_document_tree();
40
41 css_document_tree& operator=(css_document_tree&& other);
42
49 void load(std::string_view stream);
50
60 const css_selector_t& selector,
61 css::pseudo_element_t pseudo_elem,
62 const css_properties_t& props);
63
75 const css_properties_t* get_properties(
76 const css_selector_t& selector, css::pseudo_element_t pseudo_elem) const;
77
88 const css_pseudo_element_properties_t*
89 get_all_properties(const css_selector_t& selector) const;
90
91 void dump() const;
92
93 void swap(css_document_tree& other) noexcept;
94};
95
96}
97
98#endif
99
100/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const css_pseudo_element_properties_t * get_all_properties(const css_selector_t &selector) const
void load(std::string_view stream)
void insert_properties(const css_selector_t &selector, css::pseudo_element_t pseudo_elem, const css_properties_t &props)
const css_properties_t * get_properties(const css_selector_t &selector, css::pseudo_element_t pseudo_elem) const
Definition css_selector.hpp:61