KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DSN::PARSER Class Reference

A configuration record per the SPECCTRA DSN file spec. More...

#include <specctra.h>

Inheritance diagram for DSN::PARSER:
DSN::ELEM

Public Member Functions

 PARSER (ELEM *aParent)
 
void FormatContents (OUTPUTFORMATTER *out, int nestLevel) override
 Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
DSN_T Type () const
 
const char * Name () const
 
virtual UNIT_RESGetUnits () const
 Return the units for this section.
 
virtual void Format (OUTPUTFORMATTER *out, int nestLevel)
 Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void SetParent (ELEM *aParent)
 

Protected Member Functions

std::string makeHash ()
 Return a string which uniquely represents this ELEM among other ELEMs of the same derived class as "this" one.
 

Protected Attributes

DSN_T type
 
ELEMparent
 

Static Protected Attributes

static STRING_FORMATTER sf
 

Private Attributes

char string_quote
 
bool space_in_quoted_tokens
 
bool case_sensitive
 
bool wires_include_testpoint
 
bool routes_include_testpoint
 
bool routes_include_guides
 
bool routes_include_image_conductor
 
bool via_rotate_first
 
bool generated_by_freeroute
 
STRINGS constants
 This holds pairs of strings, one pair for each constant definition.
 
std::string host_cad
 
std::string host_version
 

Friends

class SPECCTRA_DB
 

Detailed Description

A configuration record per the SPECCTRA DSN file spec.

It is not actually a parser, but rather corresponds to <parser_descriptor>

Definition at line 368 of file specctra.h.

Constructor & Destructor Documentation

◆ PARSER()

Member Function Documentation

◆ Format()

◆ FormatContents()

void DSN::PARSER::FormatContents ( OUTPUTFORMATTER out,
int  nestLevel 
)
overridevirtual

Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.

This is the same as Format() except that the outer wrapper is not included.

Parameters
outThe formatter to write to.
nestLevelA multiple of the number of spaces to precede the output with.
Exceptions
IO_ERRORif a system error writing the output, such as a full disk.

Reimplemented from DSN::ELEM.

Definition at line 3885 of file specctra.cpp.

References case_sensitive, constants, OUTPUTFORMATTER::GetQuoteChar(), host_cad, host_version, OUTPUTFORMATTER::Print(), routes_include_guides, routes_include_image_conductor, routes_include_testpoint, space_in_quoted_tokens, string_quote, via_rotate_first, and wires_include_testpoint.

◆ GetUnits()

UNIT_RES * DSN::ELEM::GetUnits ( ) const
virtualinherited

Return the units for this section.

Derived classes may override this to check for section specific overrides.

Returns
an element from a local or parent scope.

Reimplemented in DSN::STRUCTURE, DSN::PLACEMENT, DSN::IMAGE, DSN::PADSTACK, DSN::LIBRARY, DSN::WIRING, DSN::PCB, and DSN::ROUTE.

Definition at line 3764 of file specctra.cpp.

References DSN::UNIT_RES::Default, DSN::ELEM::GetUnits(), and DSN::ELEM::parent.

Referenced by DSN::SPECCTRA_DB::FromSESSION(), DSN::ELEM::GetUnits(), DSN::STRUCTURE::GetUnits(), DSN::PLACEMENT::GetUnits(), DSN::IMAGE::GetUnits(), DSN::PADSTACK::GetUnits(), DSN::LIBRARY::GetUnits(), DSN::WIRING::GetUnits(), DSN::PCB::GetUnits(), and DSN::ROUTE::GetUnits().

◆ makeHash()

std::string DSN::ELEM::makeHash ( )
inlineprotectedinherited

Return a string which uniquely represents this ELEM among other ELEMs of the same derived class as "this" one.

It is not usable for all derived classes, only those which plan for it by implementing a FormatContents() function that captures all info which will be used in the subsequent string compare. THIS SHOULD NORMALLY EXCLUDE THE TYPENAME, AND INSTANCE NAME OR ID AS WELL.

Definition at line 262 of file specctra.h.

References STRING_FORMATTER::Clear(), DSN::ELEM::FormatContents(), STRING_FORMATTER::GetString(), DSN::ELEM::sf, and STRING_FORMATTER::StripUseless().

Referenced by DSN::IMAGE::Compare(), and DSN::PADSTACK::Compare().

◆ Name()

◆ SetParent()

◆ Type()

Friends And Related Function Documentation

◆ SPECCTRA_DB

friend class SPECCTRA_DB
friend

Definition at line 377 of file specctra.h.

Member Data Documentation

◆ case_sensitive

bool DSN::PARSER::case_sensitive
private

Definition at line 381 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doPARSER(), FormatContents(), and PARSER().

◆ constants

STRINGS DSN::PARSER::constants
private

This holds pairs of strings, one pair for each constant definition.

Definition at line 390 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doPARSER(), and FormatContents().

◆ generated_by_freeroute

bool DSN::PARSER::generated_by_freeroute
private

Definition at line 387 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doPARSER(), and PARSER().

◆ host_cad

std::string DSN::PARSER::host_cad
private

Definition at line 392 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doPARSER(), FormatContents(), and PARSER().

◆ host_version

std::string DSN::PARSER::host_version
private

Definition at line 393 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doPARSER(), FormatContents(), and PARSER().

◆ parent

ELEM* DSN::ELEM::parent
protectedinherited

Definition at line 275 of file specctra.h.

Referenced by DSN::ELEM::GetUnits(), and DSN::ELEM::SetParent().

◆ routes_include_guides

bool DSN::PARSER::routes_include_guides
private

Definition at line 384 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doPARSER(), FormatContents(), and PARSER().

◆ routes_include_image_conductor

bool DSN::PARSER::routes_include_image_conductor
private

Definition at line 385 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doPARSER(), FormatContents(), and PARSER().

◆ routes_include_testpoint

bool DSN::PARSER::routes_include_testpoint
private

Definition at line 383 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doPARSER(), FormatContents(), and PARSER().

◆ sf

STRING_FORMATTER DSN::ELEM::sf
staticprotectedinherited

Definition at line 272 of file specctra.h.

Referenced by DSN::ELEM::makeHash().

◆ space_in_quoted_tokens

bool DSN::PARSER::space_in_quoted_tokens
private

◆ string_quote

char DSN::PARSER::string_quote
private

Definition at line 379 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doPARSER(), FormatContents(), and PARSER().

◆ type

DSN_T DSN::ELEM::type
protectedinherited

◆ via_rotate_first

bool DSN::PARSER::via_rotate_first
private

Definition at line 386 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doPARSER(), FormatContents(), and PARSER().

◆ wires_include_testpoint

bool DSN::PARSER::wires_include_testpoint
private

Definition at line 382 of file specctra.h.

Referenced by FormatContents(), and PARSER().


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