#include <node.h>
Public Types | |
typedef std::shared_ptr< node > | pointer_t |
Public Member Functions | |
node (node_type_t const type, position const &pos) | |
~node () | |
void | add_child (pointer_t child) |
size_t | child_position (pointer_t child) |
void | clear () |
void | clear_flags () |
void | clear_variables () |
pointer_t | clone () const |
void | copy_variable (node::pointer_t source) |
void | display (std::ostream &out, uint32_t indent) const |
bool | empty () const |
bool | get_boolean () const |
pointer_t | get_child (size_t idx) const |
color | get_color () const |
decimal_number_t | get_decimal_number () const |
std::string | get_dim1 () const |
std::string | get_dim2 () const |
bool | get_flag (std::string const &name) |
decimal_number_t | get_font_size () const |
integer_t | get_integer () const |
pointer_t | get_last_child () const |
decimal_number_t | get_line_height () const |
std::string const & | get_lowercase_string () const |
position const & | get_position () const |
std::string const & | get_string () const |
node_type_t | get_type () const |
pointer_t | get_variable (std::string const &name) |
void | insert_child (size_t idx, pointer_t child) |
bool | is (node_type_t const type) const |
void | remove_child (pointer_t child) |
void | remove_child (size_t idx) |
void | replace_child (pointer_t o, pointer_t n) |
void | set_boolean (bool integer) |
void | set_color (color c) |
void | set_decimal_number (decimal_number_t decimal_number) |
void | set_dim1 (std::string const &font_size) |
void | set_dim2 (std::string const &line_height) |
void | set_flag (std::string const &name, bool value) |
void | set_font_size (decimal_number_t font_size) |
void | set_integer (integer_t integer) |
void | set_line_height (decimal_number_t line_height) |
void | set_lowercase_string (std::string const &str) |
void | set_string (std::string const &str) |
void | set_variable (std::string const &name, pointer_t value) |
size_t | size () const |
void | take_over_children_of (pointer_t n) |
boolean_t | to_boolean () const |
std::string | to_string (int flags) const |
Static Public Member Functions | |
static void | limit_nodes_to (uint32_t count) |
Static Public Attributes | |
static int const | g_to_string_flag_add_spaces = 0x02 |
static int const | g_to_string_flag_show_quotes = 0x01 |
static size_t const | npos = static_cast<size_t>(-1) |
Private Types | |
typedef std::map< std::string, bool > | flag_table_t |
typedef std::vector< pointer_t > | list_t |
typedef std::map< std::string, node::pointer_t > | variable_table_t |
Private Attributes | |
bool | f_boolean = false |
list_t | f_children = list_t() |
decimal_number_t | f_decimal_number = 0.0 |
flag_table_t | f_flags = flag_table_t() |
integer_t | f_integer = 0 |
std::string | f_lowercase_string = std::string() |
position | f_position |
std::string | f_string = std::string() |
node_type_t | f_type = node_type_t::UNKNOWN |
variable_table_t | f_variables = variable_table_t() |
|
private |
|
private |
typedef std::shared_ptr<node> csspp::node::pointer_t |
|
private |
csspp::node::node | ( | node_type_t const | type, |
position const & | pos | ||
) |
void csspp::node::add_child | ( | pointer_t | child | ) |
Definition at line 593 of file node.cpp.
References csspp::EOF_TOKEN, f_children, f_type, and csspp::WHITESPACE.
Referenced by insert_child().
size_t csspp::node::child_position | ( | pointer_t | child | ) |
Definition at line 580 of file node.cpp.
References f_children, f_type, and npos.
void csspp::node::clear | ( | ) |
Definition at line 566 of file node.cpp.
References f_children, and f_type.
void csspp::node::clear_variables | ( | ) |
Definition at line 707 of file node.cpp.
References f_variables.
node::pointer_t csspp::node::clone | ( | ) | const |
Definition at line 250 of file node.cpp.
References f_boolean, f_children, f_decimal_number, f_flags, f_integer, f_position, f_string, and f_type.
void csspp::node::copy_variable | ( | node::pointer_t | source | ) |
Definition at line 717 of file node.cpp.
References f_variables.
void csspp::node::display | ( | std::ostream & | out, |
uint32_t | indent | ||
) | const |
Definition at line 1303 of file node.cpp.
References csspp::AN_PLUS_B, csspp::ARG, csspp::ARRAY, csspp::AT_KEYWORD, csspp::BOOLEAN, csspp::COLOR, csspp::COMMENT, csspp::COMPONENT_VALUE, csspp::DECIMAL_NUMBER, csspp::decimal_number_to_string(), csspp::DECLARATION, csspp::EXCLAMATION, f_boolean, f_children, f_decimal_number, f_flags, f_integer, f_string, f_type, f_variables, csspp::FONT_METRICS, csspp::FRAME, csspp::FUNCTION, csspp::color::get_color(), get_color(), get_dim1(), get_dim2(), get_font_size(), get_line_height(), csspp::HASH, csspp::IDENTIFIER, csspp::INTEGER, csspp::LIST, csspp::MAP, csspp::OPEN_CURLYBRACKET, csspp::OPEN_PARENTHESIS, csspp::OPEN_SQUAREBRACKET, csspp::PERCENT, csspp::PLACEHOLDER, csspp::STRING, csspp::nth_child::to_string(), csspp::UNICODE_RANGE, csspp::URL, csspp::VARIABLE, and csspp::VARIABLE_FUNCTION.
Referenced by operator<<().
bool csspp::node::empty | ( | ) | const |
Definition at line 559 of file node.cpp.
References f_children, and f_type.
bool csspp::node::get_boolean | ( | ) | const |
node::pointer_t csspp::node::get_child | ( | size_t | idx | ) | const |
Definition at line 660 of file node.cpp.
References f_children, and f_type.
Referenced by get_last_child().
color csspp::node::get_color | ( | ) | const |
Definition at line 403 of file node.cpp.
References f_decimal_number, f_integer, f_type, and csspp::color::set_color().
Referenced by display(), to_boolean(), and to_string().
decimal_number_t csspp::node::get_decimal_number | ( | ) | const |
Definition at line 391 of file node.cpp.
References f_decimal_number, and f_type.
std::string csspp::node::get_dim1 | ( | ) | const |
std::string csspp::node::get_dim2 | ( | ) | const |
bool csspp::node::get_flag | ( | std::string const & | name | ) |
decimal_number_t csspp::node::get_font_size | ( | ) | const |
Definition at line 442 of file node.cpp.
References f_decimal_number, and f_type.
Referenced by display(), and to_string().
integer_t csspp::node::get_integer | ( | ) | const |
node::pointer_t csspp::node::get_last_child | ( | ) | const |
Definition at line 672 of file node.cpp.
References f_children, and get_child().
decimal_number_t csspp::node::get_line_height | ( | ) | const |
std::string const & csspp::node::get_lowercase_string | ( | ) | const |
Definition at line 355 of file node.cpp.
References f_lowercase_string, and f_type.
position const & csspp::node::get_position | ( | ) | const |
Definition at line 338 of file node.cpp.
References f_position.
std::string const & csspp::node::get_string | ( | ) | const |
node_type_t csspp::node::get_type | ( | ) | const |
node::pointer_t csspp::node::get_variable | ( | std::string const & | name | ) |
Definition at line 728 of file node.cpp.
References f_variables.
void csspp::node::insert_child | ( | size_t | idx, |
pointer_t | child | ||
) |
Definition at line 612 of file node.cpp.
References add_child(), csspp::EOF_TOKEN, f_children, and f_type.
bool csspp::node::is | ( | node_type_t const | type | ) | const |
void csspp::node::remove_child | ( | pointer_t | child | ) |
Definition at line 635 of file node.cpp.
References f_children, and f_type.
void csspp::node::remove_child | ( | size_t | idx | ) |
Definition at line 648 of file node.cpp.
References f_children, and f_type.
Definition at line 690 of file node.cpp.
References f_children.
void csspp::node::set_boolean | ( | bool | integer | ) |
void csspp::node::set_color | ( | color | c | ) |
Definition at line 424 of file node.cpp.
References f_decimal_number, f_integer, f_type, and csspp::color::get_color().
void csspp::node::set_decimal_number | ( | decimal_number_t | decimal_number | ) |
Definition at line 397 of file node.cpp.
References f_decimal_number, and f_type.
void csspp::node::set_dim1 | ( | std::string const & | font_size | ) |
void csspp::node::set_dim2 | ( | std::string const & | line_height | ) |
void csspp::node::set_flag | ( | std::string const & | name, |
bool | value | ||
) |
void csspp::node::set_font_size | ( | decimal_number_t | font_size | ) |
Definition at line 449 of file node.cpp.
References f_decimal_number, and f_type.
void csspp::node::set_integer | ( | integer_t | integer | ) |
void csspp::node::set_line_height | ( | decimal_number_t | line_height | ) |
void csspp::node::set_lowercase_string | ( | std::string const & | str | ) |
Definition at line 361 of file node.cpp.
References f_lowercase_string, and f_type.
void csspp::node::set_string | ( | std::string const & | str | ) |
void csspp::node::set_variable | ( | std::string const & | name, |
pointer_t | value | ||
) |
Definition at line 712 of file node.cpp.
References f_variables.
size_t csspp::node::size | ( | ) | const |
Definition at line 573 of file node.cpp.
References f_children, and f_type.
void csspp::node::take_over_children_of | ( | pointer_t | n | ) |
Definition at line 678 of file node.cpp.
References f_children, and f_type.
boolean_t csspp::node::to_boolean | ( | ) | const |
Definition at line 282 of file node.cpp.
References csspp::ARRAY, csspp::BOOLEAN, csspp::BOOLEAN_FALSE, csspp::BOOLEAN_INVALID, csspp::BOOLEAN_TRUE, csspp::COLOR, csspp::DECIMAL_NUMBER, f_boolean, f_children, f_decimal_number, f_integer, f_string, f_type, csspp::color::get_color(), get_color(), csspp::IDENTIFIER, csspp::INTEGER, csspp::LIST, csspp::MAP, csspp::NULL_TOKEN, csspp::PERCENT, and csspp::STRING.
std::string csspp::node::to_string | ( | int | flags | ) | const |
Definition at line 765 of file node.cpp.
References csspp::ADD, csspp::AN_PLUS_B, csspp::AND, csspp::ARG, csspp::ARRAY, csspp::ASSIGNMENT, csspp::AT_KEYWORD, csspp::BOOLEAN, csspp::CDC, csspp::CDO, csspp::CLOSE_CURLYBRACKET, csspp::CLOSE_PARENTHESIS, csspp::CLOSE_SQUAREBRACKET, csspp::COLON, csspp::COLOR, csspp::COLUMN, csspp::COMMA, csspp::COMMENT, csspp::COMPONENT_VALUE, csspp::CONDITIONAL, csspp::DASH_MATCH, csspp::DECIMAL_NUMBER, csspp::decimal_number_to_string(), csspp::DECLARATION, csspp::DIVIDE, csspp::DOLLAR, csspp::EOF_TOKEN, csspp::EQUAL, csspp::EXCLAMATION, f_boolean, f_children, f_decimal_number, f_integer, f_string, f_type, csspp::FONT_METRICS, csspp::FRAME, csspp::FUNCTION, g_to_string_flag_add_spaces, g_to_string_flag_show_quotes, get_color(), get_dim1(), get_dim2(), get_font_size(), get_line_height(), csspp::GREATER_EQUAL, csspp::GREATER_THAN, csspp::HASH, csspp::IDENTIFIER, csspp::INCLUDE_MATCH, csspp::INTEGER, csspp::LESS_EQUAL, csspp::LESS_THAN, csspp::LIST, csspp::MAP, csspp::max_type, csspp::MODULO, csspp::MULTIPLY, csspp::NOT_EQUAL, csspp::NULL_TOKEN, csspp::OPEN_CURLYBRACKET, csspp::OPEN_PARENTHESIS, csspp::OPEN_SQUAREBRACKET, csspp::PERCENT, csspp::PERIOD, csspp::PLACEHOLDER, csspp::POWER, csspp::PRECEDED, csspp::PREFIX_MATCH, csspp::REFERENCE, csspp::SCOPE, csspp::SEMICOLON, csspp::STRING, csspp::SUBSTRING_MATCH, csspp::SUBTRACT, csspp::SUFFIX_MATCH, csspp::color::to_string(), csspp::nth_child::to_string(), csspp::unicode_range_t::to_string(), csspp::UNICODE_RANGE, csspp::UNKNOWN, csspp::URL, csspp::VARIABLE, csspp::VARIABLE_FUNCTION, and csspp::WHITESPACE.
|
private |
Definition at line 203 of file node.h.
Referenced by clone(), display(), get_boolean(), set_boolean(), to_boolean(), and to_string().
Definition at line 208 of file node.h.
Referenced by add_child(), child_position(), clear(), clone(), display(), empty(), get_child(), get_last_child(), insert_child(), remove_child(), remove_child(), replace_child(), size(), take_over_children_of(), to_boolean(), and to_string().
|
private |
Definition at line 205 of file node.h.
Referenced by clone(), display(), get_color(), get_decimal_number(), get_font_size(), set_color(), set_decimal_number(), set_font_size(), to_boolean(), and to_string().
|
private |
Definition at line 210 of file node.h.
Referenced by clear_flags(), clone(), display(), get_flag(), and set_flag().
|
private |
Definition at line 204 of file node.h.
Referenced by clone(), display(), get_color(), get_integer(), get_line_height(), set_color(), set_integer(), set_line_height(), to_boolean(), and to_string().
|
private |
Definition at line 207 of file node.h.
Referenced by get_lowercase_string(), and set_lowercase_string().
|
private |
Definition at line 202 of file node.h.
Referenced by clone(), and get_position().
|
private |
Definition at line 206 of file node.h.
Referenced by clone(), display(), get_dim1(), get_dim2(), get_string(), set_dim1(), set_dim2(), set_string(), to_boolean(), and to_string().
|
private |
Definition at line 201 of file node.h.
Referenced by add_child(), child_position(), clear(), clone(), display(), empty(), get_boolean(), get_child(), get_color(), get_decimal_number(), get_dim1(), get_dim2(), get_font_size(), get_integer(), get_line_height(), get_lowercase_string(), get_string(), get_type(), insert_child(), is(), remove_child(), remove_child(), set_boolean(), set_color(), set_decimal_number(), set_dim1(), set_dim2(), set_font_size(), set_integer(), set_line_height(), set_lowercase_string(), set_string(), size(), take_over_children_of(), to_boolean(), and to_string().
|
private |
Definition at line 209 of file node.h.
Referenced by clear_variables(), copy_variable(), display(), get_variable(), and set_variable().
|
static |
Definition at line 136 of file node.h.
Referenced by to_string().
|
static |
Definition at line 135 of file node.h.
Referenced by csspp::expression::internal_function__inspect(), csspp::compiler::selector_simple_term(), and to_string().
|
static |
Definition at line 133 of file node.h.
Referenced by child_position().
Documentation of CSS Preprocessor.
This document is part of the Snap! Websites Project.
Copyright by Made to Order Software Corp.