KiCad PCB EDA Suite
Loading...
Searching...
No Matches
XATTR Class Reference

An extension of wxXmlAttribute that stores a variant type rather than just a string. More...

#include <xnode.h>

Inheritance diagram for XATTR:

Public Types

typedef std::variant< wxString, int, double > VALUE_TYPE
 

Public Member Functions

 XATTR ()
 
 XATTR (const wxString &aName, const VALUE_TYPE &aValue)
 
void SetValue (const VALUE_TYPE &aValue)
 
VALUE_TYPE GetValue () const
 

Private Attributes

VALUE_TYPE m_originalValue
 

Detailed Description

An extension of wxXmlAttribute that stores a variant type rather than just a string.

Technically, XML requires that all attribute values be strings, but since XNODE is primarily used for s-expression formatting rather than XML formatting, and KiCad's s-expression format permits integer and floating-point numeric values in lists, this class allows storage of the source value so that it can be properly formatted in the output.

Definition at line 49 of file xnode.h.

Member Typedef Documentation

◆ VALUE_TYPE

typedef std::variant<wxString, int, double> XATTR::VALUE_TYPE

Definition at line 52 of file xnode.h.

Constructor & Destructor Documentation

◆ XATTR() [1/2]

XATTR::XATTR ( )
inline

Definition at line 54 of file xnode.h.

◆ XATTR() [2/2]

XATTR::XATTR ( const wxString & aName,
const VALUE_TYPE & aValue )

Definition at line 34 of file xnode.cpp.

References m_originalValue, and T.

Member Function Documentation

◆ GetValue()

VALUE_TYPE XATTR::GetValue ( ) const
inline

Definition at line 61 of file xnode.h.

References m_originalValue.

◆ SetValue()

void XATTR::SetValue ( const VALUE_TYPE & aValue)
inline

Definition at line 59 of file xnode.h.

References m_originalValue.

Member Data Documentation

◆ m_originalValue

VALUE_TYPE XATTR::m_originalValue
private

Definition at line 64 of file xnode.h.

Referenced by GetValue(), SetValue(), and XATTR().


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