Current Version: 1.0.33
Project Name: csspp
assembler.h
Go to the documentation of this file.
1// Copyright (c) 2015-2025 Made to Order Software Corp. All Rights Reserved
2//
3// This program is free software; you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation; either version 2 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License along
14// with this program; if not, write to the Free Software Foundation, Inc.,
15// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16#pragma once
17
18// self
19//
20#include "csspp/node.h"
21
22
23namespace csspp
24{
25
26enum class output_mode_t
27{
28 COMPACT, // one rule per line, spaces around all objects
29 COMPRESSED, // as compressed as possible
30 EXPANDED, // beautified for human consumption
31 TIDY // one rule per line, no spaces
32};
33
34class assembler_impl;
35
37{
38public:
39 assembler(std::ostream & out);
40
42
43private:
44 std::string escape_id(std::string const & id);
45
46 void output(node::pointer_t n);
48 void output_parenthesis(node::pointer_t n, int flags);
51 void output_string(std::string const & str);
52 void output_url(std::string const & str);
53
54 std::shared_ptr<assembler_impl> f_impl = std::shared_ptr<assembler_impl>();
55 std::ostream & f_out;
57};
58
59} // namespace csspp
60
61std::ostream & operator << (std::ostream & out, csspp::output_mode_t const type);
62
63// vim: ts=4 sw=4 et
std::ostream & operator<<(std::ostream &out, csspp::output_mode_t const type)
std::shared_ptr< assembler_impl > f_impl
Definition assembler.h:54
void output_at_keyword(node::pointer_t n)
std::string escape_id(std::string const &id)
node::pointer_t f_root
Definition assembler.h:56
void output_component_value(node::pointer_t n)
void output_string(std::string const &str)
void output_comment(node::pointer_t n)
std::ostream & f_out
Definition assembler.h:55
void output_url(std::string const &str)
void output_parenthesis(node::pointer_t n, int flags)
void output(node::pointer_t n, output_mode_t mode)
std::shared_ptr< node > pointer_t
Definition node.h:132
The namespace of all the classes in the CSS Preprocessor.
Definition csspp.h:48
output_mode_t
Definition assembler.h:27

Documentation of CSS Preprocessor.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.