![]() |
KiCad PCB EDA Suite
|
Model an optional XML attribute. More...
#include <eagle_parser.h>
Public Member Functions | |
OPTIONAL_XML_ATTRIBUTE () | |
Construct a default OPTIONAL_XML_ATTRIBUTE, whose data is not available. More... | |
OPTIONAL_XML_ATTRIBUTE (const wxString &aData) | |
template<typename V = T> | |
OPTIONAL_XML_ATTRIBUTE (T aData) | |
operator bool () const | |
OPTIONAL_XML_ATTRIBUTE< T > & | operator= (const wxString &aData) |
Assign to a string (optionally) containing the data. More... | |
OPTIONAL_XML_ATTRIBUTE< T > & | operator= (T aData) |
Assign to an object of the base type containing the data. More... | |
bool | operator== (const T &aOther) const |
void | Set (const wxString &aString) |
Attempt to convert a string to the base type. More... | |
T & | Get () |
Return a reference to the value of the attribute assuming it is available. More... | |
const T & | CGet () const |
Return a constant reference to the value of the attribute assuming it is available. More... | |
T & | operator * () |
Return a reference to the value of the attribute assuming it is available. More... | |
const T & | operator * () const |
Return a constant reference to the value of the attribute assuming it is available. More... | |
T * | operator-> () |
Return a pointer to the value of the attribute assuming it is available. More... | |
const T * | operator-> () const |
Return a constant pointer to the value of the attribute assuming it is available. More... | |
Private Attributes | |
bool | m_isAvailable |
A boolean indicating if the data is present or not. More... | |
T | m_data |
The actual data if m_isAvailable is true; otherwise, garbage. More... | |
Model an optional XML attribute.
This was implemented as an alternative to OPT. This class should be replaced with a simple typedef per type using std::optional when C++17 is published.
Definition at line 188 of file eagle_parser.h.
|
inline |
Construct a default OPTIONAL_XML_ATTRIBUTE, whose data is not available.
Definition at line 201 of file eagle_parser.h.
|
inline |
aData | is a wxString containing the value that should be converted to type T. If aData is empty, the attribute is understood as unavailable; otherwise, the conversion to T is tried. |
Definition at line 211 of file eagle_parser.h.
|
inline |
aData | is the value of the XML attribute. If this constructor is called, the attribute is available. |
Definition at line 225 of file eagle_parser.h.
|
inline |
Return a constant reference to the value of the attribute assuming it is available.
Definition at line 303 of file eagle_parser.h.
Referenced by ETEXT::ConvertSize(), SCH_EAGLE_PLUGIN::loadTextAttributes(), OPTIONAL_XML_ATTRIBUTE< bool >::operator *(), and OPTIONAL_XML_ATTRIBUTE< bool >::operator->().
|
inline |
Return a reference to the value of the attribute assuming it is available.
Definition at line 292 of file eagle_parser.h.
Referenced by SCH_EAGLE_PLUGIN::loadInstance(), SCH_EAGLE_PLUGIN::loadLibrary(), SCH_EAGLE_PLUGIN::loadPin(), OPTIONAL_XML_ATTRIBUTE< bool >::operator *(), and OPTIONAL_XML_ATTRIBUTE< bool >::operator->().
|
inline |
Return a reference to the value of the attribute assuming it is available.
Definition at line 314 of file eagle_parser.h.
|
inline |
Return a constant reference to the value of the attribute assuming it is available.
Definition at line 324 of file eagle_parser.h.
|
inline |
Definition at line 233 of file eagle_parser.h.
|
inline |
Return a pointer to the value of the attribute assuming it is available.
Definition at line 334 of file eagle_parser.h.
|
inline |
Return a constant pointer to the value of the attribute assuming it is available.
Definition at line 344 of file eagle_parser.h.
|
inline |
Assign to a string (optionally) containing the data.
aData | is a wxString that should be converted to T. If the string is empty, the attribute is set to unavailable. |
Definition at line 244 of file eagle_parser.h.
|
inline |
Assign to an object of the base type containing the data.
aData | is the actual value of the attribute. Calling this assignment, the attribute is automatically made available. |
Definition at line 260 of file eagle_parser.h.
|
inline |
aOther | is the object of the base type that should be compared with this one. |
Definition at line 271 of file eagle_parser.h.
|
inline |
Attempt to convert a string to the base type.
aString | is the string that will be converted to the base type. |
Definition at line 281 of file eagle_parser.h.
Referenced by OPTIONAL_XML_ATTRIBUTE< bool >::operator=(), and OPTIONAL_XML_ATTRIBUTE< bool >::OPTIONAL_XML_ATTRIBUTE().
|
private |
The actual data if m_isAvailable is true; otherwise, garbage.
Definition at line 195 of file eagle_parser.h.
Referenced by OPTIONAL_XML_ATTRIBUTE< bool >::CGet(), OPTIONAL_XML_ATTRIBUTE< bool >::Get(), OPTIONAL_XML_ATTRIBUTE< bool >::operator=(), OPTIONAL_XML_ATTRIBUTE< bool >::operator==(), OPTIONAL_XML_ATTRIBUTE< bool >::OPTIONAL_XML_ATTRIBUTE(), and OPTIONAL_XML_ATTRIBUTE< bool >::Set().
|
private |
A boolean indicating if the data is present or not.
Definition at line 192 of file eagle_parser.h.
Referenced by OPTIONAL_XML_ATTRIBUTE< bool >::CGet(), OPTIONAL_XML_ATTRIBUTE< bool >::Get(), OPTIONAL_XML_ATTRIBUTE< bool >::operator bool(), OPTIONAL_XML_ATTRIBUTE< bool >::operator=(), OPTIONAL_XML_ATTRIBUTE< bool >::operator==(), OPTIONAL_XML_ATTRIBUTE< bool >::OPTIONAL_XML_ATTRIBUTE(), and OPTIONAL_XML_ATTRIBUTE< bool >::Set().