Current Version: 1.0.10
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_t
variable_table_t
 

Private Attributes

bool f_boolean = false
 
list_t f_children
 
decimal_number_t f_decimal_number = 0.0
 
flag_table_t f_flags
 
integer_t f_integer = 0
 
std::string f_lowercase_string
 
position f_position
 
std::string f_string
 
node_type_t f_type = node_type_t::UNKNOWN
 
variable_table_t f_variables
 

Detailed Description

Definition at line 119 of file node.h.

Member Typedef Documentation

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

Definition at line 189 of file node.h.

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

Definition at line 187 of file node.h.

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

Definition at line 122 of file node.h.

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

Definition at line 188 of file node.h.

Constructor & Destructor Documentation

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

Definition at line 232 of file node.cpp.

References csspp::anonymous_namespace{node.cpp}::g_node_count.

Member Function Documentation

void csspp::node::add_child ( pointer_t  child)
size_t csspp::node::child_position ( pointer_t  child)
void csspp::node::clear ( )
void csspp::node::clear_flags ( )

Definition at line 725 of file node.cpp.

References f_flags.

void csspp::node::clear_variables ( )

Definition at line 694 of file node.cpp.

References f_variables.

node::pointer_t csspp::node::clone ( ) const

Definition at line 237 of file node.cpp.

References f_boolean, f_children, f_decimal_number, f_flags, f_integer, f_position, f_string, f_type, and node().

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

Definition at line 704 of file node.cpp.

References f_variables.

void csspp::node::display ( std::ostream &  out,
uint32_t  indent 
) const
bool csspp::node::empty ( ) const
bool csspp::node::get_boolean ( ) const
node::pointer_t csspp::node::get_child ( size_t  idx) const
color csspp::node::get_color ( ) const
decimal_number_t csspp::node::get_decimal_number ( ) const
std::string csspp::node::get_dim1 ( ) const

Definition at line 461 of file node.cpp.

References f_string, f_type, and csspp::anonymous_namespace{node.cpp}::type_supports_font_metrics().

Referenced by display(), and to_string().

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

Definition at line 498 of file node.cpp.

References f_string, f_type, and csspp::anonymous_namespace{node.cpp}::type_supports_font_metrics().

Referenced by display(), and to_string().

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

Definition at line 746 of file node.cpp.

References f_flags.

decimal_number_t csspp::node::get_font_size ( ) const
integer_t csspp::node::get_integer ( ) const
node::pointer_t csspp::node::get_last_child ( ) const

Definition at line 659 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
position const & csspp::node::get_position ( ) const

Definition at line 325 of file node.cpp.

References f_position.

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

Definition at line 259 of file node.cpp.

References f_type.

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

Definition at line 715 of file node.cpp.

References f_variables.

void csspp::node::insert_child ( size_t  idx,
pointer_t  child 
)
bool csspp::node::is ( node_type_t const  type) const

Definition at line 264 of file node.cpp.

References f_type.

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

Definition at line 1416 of file node.cpp.

References csspp::anonymous_namespace{node.cpp}::g_node_max_count.

void csspp::node::remove_child ( pointer_t  child)
void csspp::node::remove_child ( size_t  idx)
void csspp::node::replace_child ( pointer_t  o,
pointer_t  n 
)

Definition at line 677 of file node.cpp.

References f_children.

void csspp::node::set_boolean ( bool  integer)
void csspp::node::set_color ( color  c)
void csspp::node::set_decimal_number ( decimal_number_t  decimal_number)
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 
)

Definition at line 730 of file node.cpp.

References f_flags.

void csspp::node::set_font_size ( decimal_number_t  font_size)
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)
void csspp::node::set_string ( std::string const &  str)
void csspp::node::set_variable ( std::string const &  name,
pointer_t  value 
)

Definition at line 699 of file node.cpp.

References f_variables.

size_t csspp::node::size ( ) const
void csspp::node::take_over_children_of ( pointer_t  n)
boolean_t csspp::node::to_boolean ( ) const
std::string csspp::node::to_string ( int  flags) const

Definition at line 752 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::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::unicode_range_t::to_string(), csspp::nth_child::to_string(), csspp::color::to_string(), csspp::UNICODE_RANGE, csspp::UNKNOWN, csspp::URL, csspp::VARIABLE, csspp::VARIABLE_FUNCTION, and csspp::WHITESPACE.

Member Data Documentation

bool csspp::node::f_boolean = false
private

Definition at line 193 of file node.h.

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

list_t csspp::node::f_children
private
decimal_number_t csspp::node::f_decimal_number = 0.0
private
flag_table_t csspp::node::f_flags
private

Definition at line 200 of file node.h.

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

integer_t csspp::node::f_integer = 0
private
std::string csspp::node::f_lowercase_string
private

Definition at line 197 of file node.h.

Referenced by get_lowercase_string(), and set_lowercase_string().

position csspp::node::f_position
private

Definition at line 192 of file node.h.

Referenced by clone(), and get_position().

std::string csspp::node::f_string
private
node_type_t csspp::node::f_type = node_type_t::UNKNOWN
private
variable_table_t csspp::node::f_variables
private

Definition at line 199 of file node.h.

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

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

Definition at line 126 of file node.h.

Referenced by to_string().

int const csspp::node::g_to_string_flag_show_quotes = 0x01
static
size_t const csspp::node::npos = static_cast<size_t>(-1)
static

Definition at line 123 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.