Current Version: 1.0.33
Project Name: csspp
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Attributes | List of all members
csspp::node Class Reference

#include <node.h>

Inheritance diagram for csspp::node:
Inheritance graph
[legend]
Collaboration diagram for csspp::node:
Collaboration graph
[legend]

Public Types

typedef std::shared_ptr< nodepointer_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_tlist_t
 
typedef std::map< std::string, node::pointer_tvariable_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()
 

Detailed Description

Definition at line 128 of file node.h.

Member Typedef Documentation

◆ flag_table_t

typedef std::map<std::string, bool> csspp::node::flag_table_t
private

Definition at line 199 of file node.h.

◆ list_t

typedef std::vector<pointer_t> csspp::node::list_t
private

Definition at line 197 of file node.h.

◆ pointer_t

typedef std::shared_ptr<node> csspp::node::pointer_t

Definition at line 132 of file node.h.

◆ variable_table_t

typedef std::map<std::string, node::pointer_t> csspp::node::variable_table_t
private

Definition at line 198 of file node.h.

Constructor & Destructor Documentation

◆ node()

csspp::node::node ( node_type_t const  type,
position const &  pos 
)

Definition at line 227 of file node.cpp.

◆ ~node()

csspp::node::~node ( )

Definition at line 245 of file node.cpp.

Member Function Documentation

◆ add_child()

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().

◆ child_position()

size_t csspp::node::child_position ( pointer_t  child)

Definition at line 580 of file node.cpp.

References f_children, f_type, and npos.

◆ clear()

void csspp::node::clear ( )

Definition at line 566 of file node.cpp.

References f_children, and f_type.

◆ clear_flags()

void csspp::node::clear_flags ( )

Definition at line 738 of file node.cpp.

References f_flags.

◆ clear_variables()

void csspp::node::clear_variables ( )

Definition at line 707 of file node.cpp.

References f_variables.

◆ clone()

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.

◆ copy_variable()

void csspp::node::copy_variable ( node::pointer_t  source)

Definition at line 717 of file node.cpp.

References f_variables.

◆ display()

void csspp::node::display ( std::ostream &  out,
uint32_t  indent 
) const

◆ empty()

bool csspp::node::empty ( ) const

Definition at line 559 of file node.cpp.

References f_children, and f_type.

◆ get_boolean()

bool csspp::node::get_boolean ( ) const

Definition at line 379 of file node.cpp.

References f_boolean, and f_type.

◆ get_child()

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().

◆ get_color()

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().

◆ get_decimal_number()

decimal_number_t csspp::node::get_decimal_number ( ) const

Definition at line 391 of file node.cpp.

References f_decimal_number, and f_type.

◆ get_dim1()

std::string csspp::node::get_dim1 ( ) const

Definition at line 474 of file node.cpp.

References f_string, and f_type.

Referenced by display(), and to_string().

◆ get_dim2()

std::string csspp::node::get_dim2 ( ) const

Definition at line 511 of file node.cpp.

References f_string, and f_type.

Referenced by display(), and to_string().

◆ get_flag()

bool csspp::node::get_flag ( std::string const &  name)

Definition at line 759 of file node.cpp.

References f_flags.

◆ get_font_size()

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().

◆ get_integer()

integer_t csspp::node::get_integer ( ) const

Definition at line 367 of file node.cpp.

References f_integer, and f_type.

◆ get_last_child()

node::pointer_t csspp::node::get_last_child ( ) const

Definition at line 672 of file node.cpp.

References f_children, and get_child().

◆ get_line_height()

decimal_number_t csspp::node::get_line_height ( ) const

Definition at line 456 of file node.cpp.

References f_integer, and f_type.

Referenced by display(), and to_string().

◆ get_lowercase_string()

std::string const & csspp::node::get_lowercase_string ( ) const

Definition at line 355 of file node.cpp.

References f_lowercase_string, and f_type.

◆ get_position()

position const & csspp::node::get_position ( ) const

Definition at line 338 of file node.cpp.

References f_position.

◆ get_string()

std::string const & csspp::node::get_string ( ) const

Definition at line 343 of file node.cpp.

References f_string, and f_type.

◆ get_type()

node_type_t csspp::node::get_type ( ) const

Definition at line 272 of file node.cpp.

References f_type.

◆ get_variable()

node::pointer_t csspp::node::get_variable ( std::string const &  name)

Definition at line 728 of file node.cpp.

References f_variables.

◆ insert_child()

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.

◆ is()

bool csspp::node::is ( node_type_t const  type) const

Definition at line 277 of file node.cpp.

References f_type.

◆ limit_nodes_to()

void csspp::node::limit_nodes_to ( uint32_t  count)
static

Definition at line 1458 of file node.cpp.

◆ remove_child() [1/2]

void csspp::node::remove_child ( pointer_t  child)

Definition at line 635 of file node.cpp.

References f_children, and f_type.

◆ remove_child() [2/2]

void csspp::node::remove_child ( size_t  idx)

Definition at line 648 of file node.cpp.

References f_children, and f_type.

◆ replace_child()

void csspp::node::replace_child ( pointer_t  o,
pointer_t  n 
)

Definition at line 690 of file node.cpp.

References f_children.

◆ set_boolean()

void csspp::node::set_boolean ( bool  integer)

Definition at line 385 of file node.cpp.

References f_boolean, and f_type.

◆ set_color()

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().

◆ set_decimal_number()

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.

◆ set_dim1()

void csspp::node::set_dim1 ( std::string const &  font_size)

Definition at line 489 of file node.cpp.

References f_string, and f_type.

◆ set_dim2()

void csspp::node::set_dim2 ( std::string const &  line_height)

Definition at line 526 of file node.cpp.

References f_string, and f_type.

◆ set_flag()

void csspp::node::set_flag ( std::string const &  name,
bool  value 
)

Definition at line 743 of file node.cpp.

References f_flags.

◆ set_font_size()

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.

◆ set_integer()

void csspp::node::set_integer ( integer_t  integer)

Definition at line 373 of file node.cpp.

References f_integer, and f_type.

◆ set_line_height()

void csspp::node::set_line_height ( decimal_number_t  line_height)

Definition at line 465 of file node.cpp.

References f_integer, and f_type.

◆ set_lowercase_string()

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.

◆ set_string()

void csspp::node::set_string ( std::string const &  str)

Definition at line 349 of file node.cpp.

References f_string, and f_type.

◆ set_variable()

void csspp::node::set_variable ( std::string const &  name,
pointer_t  value 
)

Definition at line 712 of file node.cpp.

References f_variables.

◆ size()

size_t csspp::node::size ( ) const

Definition at line 573 of file node.cpp.

References f_children, and f_type.

◆ take_over_children_of()

void csspp::node::take_over_children_of ( pointer_t  n)

Definition at line 678 of file node.cpp.

References f_children, and f_type.

◆ to_boolean()

boolean_t csspp::node::to_boolean ( ) const

◆ to_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.

Member Data Documentation

◆ f_boolean

bool csspp::node::f_boolean = false
private

Definition at line 203 of file node.h.

Referenced by clone(), display(), get_boolean(), set_boolean(), to_boolean(), and to_string().

◆ f_children

list_t csspp::node::f_children = list_t()
private

◆ f_decimal_number

decimal_number_t csspp::node::f_decimal_number = 0.0
private

◆ f_flags

flag_table_t csspp::node::f_flags = flag_table_t()
private

Definition at line 210 of file node.h.

Referenced by clear_flags(), clone(), display(), get_flag(), and set_flag().

◆ f_integer

integer_t csspp::node::f_integer = 0
private

◆ f_lowercase_string

std::string csspp::node::f_lowercase_string = std::string()
private

Definition at line 207 of file node.h.

Referenced by get_lowercase_string(), and set_lowercase_string().

◆ f_position

position csspp::node::f_position
private

Definition at line 202 of file node.h.

Referenced by clone(), and get_position().

◆ f_string

std::string csspp::node::f_string = std::string()
private

◆ f_type

node_type_t csspp::node::f_type = node_type_t::UNKNOWN
private

◆ f_variables

variable_table_t csspp::node::f_variables = variable_table_t()
private

Definition at line 209 of file node.h.

Referenced by clear_variables(), copy_variable(), display(), get_variable(), and set_variable().

◆ g_to_string_flag_add_spaces

int const csspp::node::g_to_string_flag_add_spaces = 0x02
static

Definition at line 136 of file node.h.

Referenced by to_string().

◆ g_to_string_flag_show_quotes

int const csspp::node::g_to_string_flag_show_quotes = 0x01
static

◆ npos

size_t const csspp::node::npos = static_cast<size_t>(-1)
static

Definition at line 133 of file node.h.

Referenced by child_position().


The documentation for this class was generated from the following files:

Documentation of CSS Preprocessor.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.