lxgui
|
An attribute in a layout file. More...
#include <gui_layout_node.hpp>
Public Member Functions | |
layout_attribute ()=default | |
layout_attribute (const layout_attribute &)=default | |
layout_attribute (layout_attribute &&)=default | |
layout_attribute & | operator= (const layout_attribute &)=default |
layout_attribute & | operator= (layout_attribute &&)=default |
std::string_view | get_location () const noexcept |
Returns this node's location in the file as {file}:{line}. | |
std::string_view | get_value_location () const noexcept |
Returns this node's value location in the file as {file}:{line}. | |
std::string_view | get_filename () const noexcept |
Returns the file in which this node is located. | |
std::size_t | get_line_number () const noexcept |
Returns the line number on which this node is located. | |
std::size_t | get_value_line_number () const noexcept |
Returns the line number on which this node's value is located. | |
std::string_view | get_name () const noexcept |
Returns this node's name. | |
std::string_view | get_value () const noexcept |
Returns this node's value as string. | |
template<typename T > | |
std::optional< T > | try_get_value () const noexcept |
Returns this node's value converted to a specific type, or nullopt if conversion failed. | |
template<typename T > | |
T | get_value () const |
Returns this node's value converted to a specific type. | |
template<typename T > | |
T | get_value_or (T fallback) const noexcept |
Returns this node's value converted to a specific type, or a default value. | |
void | set_location (std::string location) noexcept |
Set this node's location. | |
void | set_value_location (std::string location) noexcept |
Set this node's value location. | |
void | set_name (std::string name) noexcept |
Set this node's name. | |
void | set_value (std::string value) noexcept |
Set this node's value. | |
void | mark_as_not_accessed () const noexcept |
Flag this node as "not accessed" for later warnings. | |
void | bypass_access_check () const noexcept |
Flag this node as "fully accessed" for later warnings; no check will be done. | |
bool | was_accessed () const noexcept |
Check if this node was accessed by the parser. | |
bool | is_access_check_bypassed () const noexcept |
Check if this node should be bypassed for access checks. | |
Protected Attributes | |
std::string | name_ |
std::string | value_ |
std::string | location_ |
std::string | value_location_ |
bool | accessed_ = false |
bool | access_bypass_ = false |
An attribute in a layout file.
This is a format-agnostic representation of a GUI layout, as read for example from an XML or YAML file. The GUI uses this class to de-couple the layout parsing format (XML, YAML, etc) from the actual parsed layout.
Definition at line 24 of file gui_layout_node.hpp.
|
default |
|
default |
|
default |
|
inlinenoexcept |
Flag this node as "fully accessed" for later warnings; no check will be done.
Definition at line 193 of file gui_layout_node.hpp.
|
inlinenoexcept |
Returns the file in which this node is located.
Definition at line 52 of file gui_layout_node.hpp.
|
inlinenoexcept |
Returns the line number on which this node is located.
Definition at line 61 of file gui_layout_node.hpp.
|
inlinenoexcept |
Returns this node's location in the file as {file}:{line}.
Definition at line 36 of file gui_layout_node.hpp.
|
inlinenoexcept |
Returns this node's name.
Definition at line 87 of file gui_layout_node.hpp.
|
inline |
Returns this node's value converted to a specific type.
Definition at line 124 of file gui_layout_node.hpp.
|
inlinenoexcept |
Returns this node's value as string.
Definition at line 96 of file gui_layout_node.hpp.
|
inlinenoexcept |
Returns the line number on which this node's value is located.
Definition at line 74 of file gui_layout_node.hpp.
|
inlinenoexcept |
Returns this node's value location in the file as {file}:{line}.
Definition at line 44 of file gui_layout_node.hpp.
|
inlinenoexcept |
Returns this node's value converted to a specific type, or a default value.
Definition at line 142 of file gui_layout_node.hpp.
|
inlinenoexcept |
Check if this node should be bypassed for access checks.
Definition at line 209 of file gui_layout_node.hpp.
|
inlinenoexcept |
Flag this node as "not accessed" for later warnings.
Definition at line 188 of file gui_layout_node.hpp.
|
default |
|
default |
|
inlinenoexcept |
Set this node's location.
location | The new location |
Definition at line 159 of file gui_layout_node.hpp.
|
inlinenoexcept |
Set this node's name.
name | The new name |
Definition at line 175 of file gui_layout_node.hpp.
|
inlinenoexcept |
Set this node's value.
value | The new value |
Definition at line 183 of file gui_layout_node.hpp.
|
inlinenoexcept |
Set this node's value location.
location | The new value location |
Definition at line 167 of file gui_layout_node.hpp.
|
inlinenoexcept |
Returns this node's value converted to a specific type, or nullopt if conversion failed.
Definition at line 106 of file gui_layout_node.hpp.
|
inlinenoexcept |
Check if this node was accessed by the parser.
Definition at line 201 of file gui_layout_node.hpp.
|
mutableprotected |
Definition at line 220 of file gui_layout_node.hpp.
|
mutableprotected |
Definition at line 219 of file gui_layout_node.hpp.
|
protected |
Definition at line 216 of file gui_layout_node.hpp.
|
protected |
Definition at line 214 of file gui_layout_node.hpp.
|
protected |
Definition at line 215 of file gui_layout_node.hpp.
|
protected |
Definition at line 217 of file gui_layout_node.hpp.