KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::EVALUE Struct Reference

Represents a floating value in E notation. More...

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::EVALUE:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 
double GetDouble ()
 

Public Attributes

long Base = 0
 
long Exponent = 0
 

Detailed Description

Represents a floating value in E notation.

Definition at line 373 of file cadstar_archive_parser.h.

Member Function Documentation

◆ GetDouble()

double CADSTAR_ARCHIVE_PARSER::EVALUE::GetDouble ( )

◆ Parse()

void CADSTAR_ARCHIVE_PARSER::EVALUE::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 384 of file cadstar_archive_parser.cpp.

385 {
386  wxASSERT( aNode->GetName() == wxT( "E" ) );
387 
388  if( ( !GetXmlAttributeIDString( aNode, 0 ).ToLong( &Base ) )
389  || ( !GetXmlAttributeIDString( aNode, 1 ).ToLong( &Exponent ) ) )
390  {
391  THROW_PARSING_IO_ERROR( wxT( "Base and Exponent" ),
393  "%s->%s", aNode->GetParent()->GetName(), aNode->GetParent()->GetName() ) );
394  }
395 }
XNODE * GetParent() const
Definition: xnode.h:72
#define THROW_PARSING_IO_ERROR(param, location)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

References Format(), XNODE::GetParent(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), and THROW_PARSING_IO_ERROR.

Referenced by CADSTAR_ARCHIVE_PARSER::ParseChildEValue().

Member Data Documentation

◆ Base

long CADSTAR_ARCHIVE_PARSER::EVALUE::Base = 0

Definition at line 375 of file cadstar_archive_parser.h.

◆ Exponent

long CADSTAR_ARCHIVE_PARSER::EVALUE::Exponent = 0

Definition at line 376 of file cadstar_archive_parser.h.


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