KiCad PCB EDA Suite
|
#include <cstdint>
Go to the source code of this file.
Macros | |
#define | SCH_PARSE_ERROR(text, reader, pos) |
Functions | |
bool | is_eol (char c) |
bool | strCompare (const char *aString, const char *aLine, const char **aOutput=nullptr) |
Compare aString to the string starting at aLine and advances the character point to the end of String and returns the new pointer position in aOutput if it is not NULL. | |
int | parseInt (LINE_READER &aReader, const char *aLine, const char **aOutput=nullptr) |
Parse an ASCII integer string with possible leading whitespace into an integer and updates the pointer at aOutput if it is not NULL, just like "man strtol()". | |
uint32_t | parseHex (LINE_READER &aReader, const char *aLine, const char **aOutput=nullptr) |
Parse an ASCII hex integer string with possible leading whitespace into a long integer and updates the pointer at aOutput if it is not NULL, just like "man strtoll". | |
double | parseDouble (LINE_READER &aReader, const char *aLine, const char **aOutput=nullptr) |
Parses an ASCII point string with possible leading whitespace into a double precision floating point number and updates the pointer at aOutput if it is not NULL, just like "man strtod". | |
char | parseChar (LINE_READER &aReader, const char *aCurrentToken, const char **aNextToken=nullptr) |
Parse a single ASCII character and updates the pointer at aOutput if it is not NULL. | |
void | parseUnquotedString (wxString &aString, LINE_READER &aReader, const char *aCurrentToken, const char **aNextToken=nullptr, bool aCanBeEmpty=false) |
Parse an unquoted utf8 string and updates the pointer at aOutput if it is not NULL. | |
void | parseQuotedString (wxString &aString, LINE_READER &aReader, const char *aCurrentToken, const char **aNextToken=nullptr, bool aCanBeEmpty=false) |
Parse an quoted ASCII utf8 and updates the pointer at aOutput if it is not NULL. | |
#define SCH_PARSE_ERROR | ( | text, | |
reader, | |||
pos | |||
) |
Definition at line 26 of file sch_io_kicad_legacy_helpers.h.
bool is_eol | ( | char | c | ) |
Definition at line 36 of file sch_io_kicad_legacy_helpers.cpp.
Referenced by SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText(), and SCH_IO_KICAD_LEGACY::loadWire().
char parseChar | ( | LINE_READER & | aReader, |
const char * | aCurrentToken, | ||
const char ** | aNextToken = nullptr |
||
) |
Parse a single ASCII character and updates the pointer at aOutput if it is not NULL.
aReader | - The line reader used to generate exception throw information. |
aCurrentToken | - A pointer the current position in a string. |
aNextToken | - The pointer to a string pointer to copy the string pointer position when the parsing is complete. |
IO_ERROR | on an unexpected end of line. |
PARSE_ERROR | if the parsed token is not a single character token. |
Definition at line 165 of file sch_io_kicad_legacy_helpers.cpp.
References _, next(), and SCH_PARSE_ERROR.
Referenced by SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField(), SCH_IO_KICAD_LEGACY::loadSheet(), SCH_IO_KICAD_LEGACY::loadSymbol(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText(), and SCH_IO_KICAD_LEGACY_LIB_CACHE::parseFillMode().
double parseDouble | ( | LINE_READER & | aReader, |
const char * | aLine, | ||
const char ** | aOutput = nullptr |
||
) |
Parses an ASCII point string with possible leading whitespace into a double precision floating point number and updates the pointer at aOutput if it is not NULL, just like "man strtod".
aReader | - The line reader used to generate exception throw information. |
aLine | - A pointer the current position in a string. |
aOutput | - The pointer to a string pointer to copy the string pointer position when the parsing is complete. |
IO_ERROR | on an unexpected end of line. |
PARSE_ERROR | if the parsed token is not a valid integer. |
Definition at line 136 of file sch_io_kicad_legacy_helpers.cpp.
References _, next(), and SCH_PARSE_ERROR.
Referenced by SCH_IO_KICAD_LEGACY::loadBitmap(), PCB_IO_KICAD_SEXPR_PARSER::parse3DModel(), PCB_IO_KICAD_SEXPR_PARSER::parseBoardStackup(), PCB_IO_KICAD_SEXPR_PARSER::parseBoardUnits(), DSNLEXER::parseDouble(), PCB_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(), SCH_IO_KICAD_SEXPR_PARSER::parseFill(), PCB_IO_KICAD_SEXPR_PARSER::parseFOOTPRINT_unchecked(), PCB_IO_KICAD_SEXPR_PARSER::parseGENERATOR(), SCH_IO_KICAD_SEXPR_PARSER::parseImage(), SCH_IO_KICAD_SEXPR_PARSER::parseInternalUnits(), SCH_IO_KICAD_SEXPR_PARSER::parseJunction(), PCB_IO_KICAD_SEXPR_PARSER::parsePAD(), PCB_IO_KICAD_SEXPR_PARSER::parsePadstack(), PCB_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO(), SCH_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO(), PCB_IO_KICAD_SEXPR_PARSER::parsePCB_REFERENCE_IMAGE(), PCB_IO_KICAD_SEXPR_PARSER::parsePCB_SHAPE(), PCB_IO_KICAD_SEXPR_PARSER::parsePCB_TEXT_effects(), SCH_IO_KICAD_SEXPR_PARSER::parseProperty(), PCB_IO_KICAD_SEXPR_PARSER::parseRenderCache(), SCH_IO_KICAD_SEXPR_PARSER::parseSchematicSymbol(), SCH_IO_KICAD_SEXPR_PARSER::parseSchField(), SCH_IO_KICAD_SEXPR_PARSER::parseSchSheetPin(), SCH_IO_KICAD_SEXPR_PARSER::parseSchText(), SCH_IO_KICAD_SEXPR_PARSER::parseSchTextBoxContent(), PCB_IO_KICAD_SEXPR_PARSER::parseSetup(), SCH_IO_KICAD_SEXPR_PARSER::parseSymbolArc(), SCH_IO_KICAD_SEXPR_PARSER::parseSymbolText(), SCH_IO_KICAD_SEXPR_PARSER::parseSymbolTextBox(), PCB_IO_KICAD_SEXPR_PARSER::parseTEARDROP_PARAMETERS(), PCB_IO_KICAD_SEXPR_PARSER::parseTextBoxContent(), and PCB_IO_KICAD_SEXPR_PARSER::parseZONE().
uint32_t parseHex | ( | LINE_READER & | aReader, |
const char * | aLine, | ||
const char ** | aOutput = nullptr |
||
) |
Parse an ASCII hex integer string with possible leading whitespace into a long integer and updates the pointer at aOutput if it is not NULL, just like "man strtoll".
aReader | - The line reader used to generate exception throw information. |
aLine | - A pointer the current position in a string. |
aOutput | - The pointer to a string pointer to copy the string pointer position when the parsing is complete. |
IO_ERROR | on an unexpected end of line. |
PARSE_ERROR | if the parsed token is not a valid integer. |
Definition at line 104 of file sch_io_kicad_legacy_helpers.cpp.
References _, next(), and SCH_PARSE_ERROR.
Referenced by SCH_IO_KICAD_LEGACY::loadSymbol().
int parseInt | ( | LINE_READER & | aReader, |
const char * | aLine, | ||
const char ** | aOutput = nullptr |
||
) |
Parse an ASCII integer string with possible leading whitespace into an integer and updates the pointer at aOutput if it is not NULL, just like "man strtol()".
aReader | - The line reader used to generate exception throw information. |
aLine | - A pointer the current position in a string. |
aOutput | - The pointer to a string pointer to copy the string pointer position when the parsing is complete. |
An | IO_ERROR on an unexpected end of line. |
A | PARSE_ERROR if the parsed token is not a valid integer. |
Definition at line 75 of file sch_io_kicad_legacy_helpers.cpp.
References _, next(), and SCH_PARSE_ERROR.
Referenced by SCH_IO_KICAD_LEGACY_LIB_CACHE::Load(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadArc(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadBezier(), SCH_IO_KICAD_LEGACY::loadBitmap(), SCH_IO_KICAD_LEGACY::loadBusEntry(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadCircle(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField(), SCH_IO_KICAD_LEGACY::loadHeader(), SCH_IO_KICAD_LEGACY::loadJunction(), SCH_IO_KICAD_LEGACY::loadNoConnect(), SCH_IO_KICAD_LEGACY::loadPageSettings(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadPolyLine(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadRect(), SCH_IO_KICAD_LEGACY::loadSheet(), SCH_IO_KICAD_LEGACY::loadSymbol(), SCH_IO_KICAD_LEGACY::loadText(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText(), and SCH_IO_KICAD_LEGACY::loadWire().
void parseQuotedString | ( | wxString & | aString, |
LINE_READER & | aReader, | ||
const char * | aCurrentToken, | ||
const char ** | aNextToken = nullptr , |
||
bool | aCanBeEmpty = false |
||
) |
Parse an quoted ASCII utf8 and updates the pointer at aOutput if it is not NULL.
The parsed string must be contained within a single line. There are no multi-line quoted strings in the legacy schematic file format.
aString | - A reference to the parsed string. |
aReader | - The line reader used to generate exception throw information. |
aCurrentToken | - A pointer the current position in a string. |
aNextToken | - The pointer to a string pointer to copy the string pointer position when the parsing is complete. |
aCanBeEmpty | - True if the parsed string is optional. False if it is mandatory. |
IO_ERROR | on an unexpected end of line. |
PARSE_ERROR | if the aCanBeEmpty is false and no string was parsed. |
Definition at line 236 of file sch_io_kicad_legacy_helpers.cpp.
References _, From_UTF8(), next(), and SCH_PARSE_ERROR.
Referenced by SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField(), SCH_IO_KICAD_LEGACY::loadPageSettings(), SCH_IO_KICAD_LEGACY::loadSheet(), SCH_IO_KICAD_LEGACY::loadSymbol(), and SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText().
void parseUnquotedString | ( | wxString & | aString, |
LINE_READER & | aReader, | ||
const char * | aCurrentToken, | ||
const char ** | aNextToken = nullptr , |
||
bool | aCanBeEmpty = false |
||
) |
Parse an unquoted utf8 string and updates the pointer at aOutput if it is not NULL.
The parsed string must be a continuous string with no white space.
aString | - A reference to the parsed string. |
aReader | - The line reader used to generate exception throw information. |
aCurrentToken | - A pointer the current position in a string. |
aNextToken | - The pointer to a string pointer to copy the string pointer position when the parsing is complete. |
aCanBeEmpty | - True if the parsed string is optional. False if it is mandatory. |
IO_ERROR | on an unexpected end of line. |
PARSE_ERROR | if the aCanBeEmpty is false and no string was parsed. |
Definition at line 190 of file sch_io_kicad_legacy_helpers.cpp.
References _, From_UTF8(), next(), and SCH_PARSE_ERROR.
Referenced by SCH_IO_KICAD_LEGACY::loadBusAlias(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadFootprintFilters(), SCH_IO_KICAD_LEGACY::loadJunction(), SCH_IO_KICAD_LEGACY::loadNoConnect(), SCH_IO_KICAD_LEGACY::loadPageSettings(), SCH_IO_KICAD_LEGACY::loadSheet(), SCH_IO_KICAD_LEGACY::loadSymbol(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText(), and SCH_IO_KICAD_LEGACY::loadWire().
bool strCompare | ( | const char * | aString, |
const char * | aLine, | ||
const char ** | aOutput = nullptr |
||
) |
Compare aString to the string starting at aLine and advances the character point to the end of String and returns the new pointer position in aOutput if it is not NULL.
aString | - A pointer to the string to compare. |
aLine | - A pointer to string to begin the comparison. |
aOutput | - A pointer to a string pointer to the end of the comparison if not NULL. |
Definition at line 51 of file sch_io_kicad_legacy_helpers.cpp.
Referenced by SCH_IO_KICAD_LEGACY_LIB_CACHE::Load(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadAliases(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadArc(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadBezier(), SCH_IO_KICAD_LEGACY::loadBitmap(), SCH_IO_KICAD_LEGACY::loadBusAlias(), SCH_IO_KICAD_LEGACY::loadBusEntry(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadCircle(), SCH_IO_KICAD_LEGACY::LoadContent(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadDocs(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadDrawEntries(), SCH_IO_KICAD_LEGACY::loadFile(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadFootprintFilters(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadHeader(), SCH_IO_KICAD_LEGACY::loadHeader(), SCH_IO_KICAD_LEGACY::loadJunction(), SCH_IO_KICAD_LEGACY::loadNoConnect(), SCH_IO_KICAD_LEGACY::loadPageSettings(), SCH_IO_KICAD_LEGACY_LIB_CACHE::LoadPart(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadPin(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadPolyLine(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadRect(), SCH_IO_KICAD_LEGACY::loadSheet(), SCH_IO_KICAD_LEGACY::loadSymbol(), SCH_IO_KICAD_LEGACY::loadText(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText(), and SCH_IO_KICAD_LEGACY::loadWire().