![]() |
KiCad PCB EDA Suite
|
#include "config.h"
#include <string>
#include <vector>
#include <wx/string.h>
#include <wx/filename.h>
Go to the source code of this file.
Classes | |
struct | rsort_wxString |
A helper for sorting strings from the rear. More... | |
Enumerations | |
enum | ESCAPE_CONTEXT { CTX_NETNAME, CTX_LIBID, CTX_QUOTED_STR, CTX_LINE, CTX_FILENAME, CTX_NO_SPACE } |
Escape/Unescape routines to safely encode reserved-characters in various contexts. More... | |
Functions | |
void | ConvertMarkdown2Html (const wxString &aMarkdownInput, wxString &aHtmlOutput) |
wxString | ConvertToNewOverbarNotation (const wxString &aOldStr) |
Convert the old ~...~ overbar notation to the new ~{...} one. More... | |
bool | ConvertSmartQuotesAndDashes (wxString *aString) |
Convert curly quotes and em/en dashes to straight quotes and dashes. More... | |
wxString | EscapeString (const wxString &aSource, ESCAPE_CONTEXT aContext) |
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are: (a) not legal in filenames (b) used as control characters in LIB_IDs (c) used to delineate hierarchical paths. More... | |
wxString | UnescapeString (const wxString &aSource) |
wxString | PrettyPrintForMenu (const wxString &aString) |
Remove markup (such as overbar or subscript) that we can't render to menu items. More... | |
wxString | TitleCaps (const wxString &aString) |
Capitalize the first letter in each word. More... | |
int | ReadDelimitedText (char *aDest, const char *aSource, int aDestSize) |
Copy bytes from aSource delimited string segment to aDest buffer. More... | |
int | ReadDelimitedText (wxString *aDest, const char *aSource) |
Copy bytes from aSource delimited string segment to aDest wxString. More... | |
std::string | EscapedUTF8 (const wxString &aString) |
Return an 8 bit UTF8 string given aString in Unicode form. More... | |
wxString | EscapeHTML (const wxString &aString) |
Return a new wxString escaped for embedding in HTML. More... | |
char * | GetLine (FILE *aFile, char *Line, int *LineNum=nullptr, int SizeLine=255) |
Read one line line from aFile. More... | |
bool | NoPrintableChars (const wxString &aString) |
Return true if the string is empty or contains only whitespace. More... | |
int | PrintableCharCount (const wxString &aString) |
Return the number of printable (ie: non-formatting) chars. More... | |
char * | StrPurge (char *text) |
Remove leading and training spaces, tabs and end of line chars in text. More... | |
wxString | DateAndTime () |
int | StrNumCmp (const wxString &aString1, const wxString &aString2, bool aIgnoreCase=false) |
Compare two strings with alphanumerical content. More... | |
bool | WildCompareString (const wxString &pattern, const wxString &string_to_tst, bool case_sensitive=true) |
Compare a string against wild card (* and ?) pattern using the usual rules. More... | |
int | ValueStringCompare (const wxString &strFWord, const wxString &strSWord) |
Compare strings like the strcmp function but handle numbers and modifiers within the string text correctly for sorting. More... | |
int | SplitString (const wxString &strToSplit, wxString *strBeginning, wxString *strDigits, wxString *strEnd) |
Break a string into three parts: he alphabetic preamble, the numeric part, and any alphabetic ending. More... | |
int | GetTrailingInt (const wxString &aStr) |
Gets the trailing int, if any, from a string. More... | |
wxString | GetIllegalFileNameWxChars () |
bool | ReplaceIllegalFileNameChars (std::string *aName, int aReplaceChar=0) |
Checks aName for illegal file name characters. More... | |
bool | ReplaceIllegalFileNameChars (wxString &aName, int aReplaceChar=0) |
char * | strtok_r (char *str, const char *delim, char **nextp) |
static std::vector< std::string > | split (const std::string &aStr, const std::string &aDelim) |
Split the input string into a vector of output strings. More... | |
void | AccumulateDescription (wxString &aDesc, const wxString &aItem) |
Utility to build comma separated lists in messages. More... | |
void | wxStringSplit (const wxString &aText, wxArrayString &aStrings, wxChar aSplitter) |
Split aString to a string list separated at aSplitter. More... | |
void | StripTrailingZeros (wxString &aStringValue, unsigned aTrailingZeroAllowed=1) |
Remove trailing zeros from a string containing a converted float number. More... | |
std::string | Double2Str (double aValue) |
Print a float number without using scientific notation and no trailing 0 We want to avoid scientific notation in S-expr files (not easy to read) for floating numbers. More... | |
wxString | AngleToStringDegrees (double aAngle) |
A helper to convert the double aAngle (in internal unit) to a string in degrees. More... | |
enum ESCAPE_CONTEXT |
Escape/Unescape routines to safely encode reserved-characters in various contexts.
Enumerator | |
---|---|
CTX_NETNAME | |
CTX_LIBID | |
CTX_QUOTED_STR | |
CTX_LINE | |
CTX_FILENAME | |
CTX_NO_SPACE |
Definition at line 52 of file string_utils.h.
|
inline |
Utility to build comma separated lists in messages.
Definition at line 319 of file string_utils.h.
Referenced by ZONE::GetMsgPanelInfo().
wxString AngleToStringDegrees | ( | double | aAngle | ) |
A helper to convert the double aAngle (in internal unit) to a string in degrees.
Definition at line 1108 of file string_utils.cpp.
References StripTrailingZeros(), and text.
Referenced by PANEL_EDIT_OPTIONS::TransferDataToWindow().
void ConvertMarkdown2Html | ( | const wxString & | aMarkdownInput, |
wxString & | aHtmlOutput | ||
) |
bool ConvertSmartQuotesAndDashes | ( | wxString * | aString | ) |
Convert curly quotes and em/en dashes to straight quotes and dashes.
Definition at line 116 of file string_utils.cpp.
Referenced by WX_HTML_REPORT_PANEL::onBtnSaveToFile(), SCINTILLA_TRICKS::onCharHook(), and PANEL_SETUP_RULES::TransferDataToWindow().
wxString ConvertToNewOverbarNotation | ( | const wxString & | aOldStr | ) |
Convert the old ~...~
overbar notation to the new ~{...}
one.
Definition at line 44 of file string_utils.cpp.
Referenced by escapeName(), CADSTAR_ARCHIVE_PARSER::HandleTextOverbar(), SCH_LEGACY_PLUGIN_CACHE::loadField(), LEGACY_PLUGIN::loadMODULE_TEXT(), LEGACY_PLUGIN::loadNETCLASS(), LEGACY_PLUGIN::loadNETINFO_ITEM(), LEGACY_PLUGIN::loadPAD(), LEGACY_PLUGIN::loadPCB_TEXT(), SCH_LEGACY_PLUGIN_CACHE::loadPin(), SCH_LEGACY_PLUGIN::loadSheet(), SCH_LEGACY_PLUGIN::loadText(), SCH_LEGACY_PLUGIN_CACHE::loadText(), NET_SETTINGS::migrateSchema0to1(), SCH_SEXPR_PARSER::parseBusAlias(), SCH_SEXPR_PARSER::parseEDA_TEXT(), PCB_PARSER::parseEDA_TEXT(), PCB_PARSER::parseNETCLASS(), PCB_PARSER::parseNETINFO_ITEM(), PCB_PARSER::parsePAD(), SCH_SEXPR_PARSER::parsePin(), and DRAWING_SHEET_PARSER::parseText().
wxString DateAndTime | ( | ) |
Definition at line 632 of file string_utils.cpp.
Referenced by GENDRILL_WRITER_BASE::GenDrillReportFile(), PLACE_FILE_EXPORTER::GenPositionData(), PLACE_FILE_EXPORTER::GenReportData(), NETLIST_EXPORTER_XML::makeDesignHeader(), RecreateCmpFile(), EXCELLON_WRITER::writeEXCELLONHeader(), PCB_CALCULATOR_DATAFILE::WriteHeader(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), NETLIST_EXPORTER_CADSTAR::WriteNetlist(), and DIALOG_ERC::writeReport().
std::string Double2Str | ( | double | aValue | ) |
Print a float number without using scientific notation and no trailing 0 We want to avoid scientific notation in S-expr files (not easy to read) for floating numbers.
We cannot always just use the g or the f format to print a fp number this helper function uses the f format when needed, or g when f is not well working and then removes trailing 0
Definition at line 1078 of file string_utils.cpp.
Referenced by PANEL_SETUP_BOARD_STACKUP::createRowData(), GBR_TO_PCB_EXPORTER::export_non_copper_item(), GBR_TO_PCB_EXPORTER::export_via(), PCB_PLUGIN::format(), BOARD_STACKUP::FormatBoardStackup(), DIELECTRIC_SUBSTRATE::FormatEpsilonR(), BOARD_STACKUP_ITEM::FormatEpsilonR(), DIELECTRIC_SUBSTRATE::FormatLossTangent(), BOARD_STACKUP_ITEM::FormatLossTangent(), PCB_PLUGIN::formatSetup(), formatStroke(), NUMERIC_EVALUATOR::parseSetResult(), SCH_SEXPR_PLUGIN::saveJunction(), PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard(), GBR_TO_PCB_EXPORTER::writeCopperLineItem(), GBR_TO_PCB_EXPORTER::writePcbFilledCircle(), GBR_TO_PCB_EXPORTER::writePcbPolygon(), and GBR_TO_PCB_EXPORTER::writePcbZoneItem().
std::string EscapedUTF8 | ( | const wxString & | aString | ) |
Return an 8 bit UTF8 string given aString in Unicode form.
Any double quoted or back slashes are prefixed with a '\' byte and the form of this UTF8 byte string is compatible with function ReadDelimitedText().
aString | is the input string to convert. |
Definition at line 438 of file string_utils.cpp.
References TO_UTF8.
Referenced by SCH_LEGACY_PLUGIN::Format(), PLACE_FILE_EXPORTER::GenReportData(), SCH_LEGACY_PLUGIN::saveField(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_SEXPR_PLUGIN::saveSheet(), and SCH_LEGACY_PLUGIN::saveSheet().
wxString EscapeHTML | ( | const wxString & | aString | ) |
Return a new wxString escaped for embedding in HTML.
Definition at line 479 of file string_utils.cpp.
Referenced by DRC_ENGINE::EvalRules(), FOOTPRINT_INFO_GENERATOR::GenerateHtml(), FOOTPRINT_INFO_GENERATOR::GetHtmlFieldRow(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), BOARD_INSPECTION_TOOL::InspectDRCError(), FOOTPRINT_INFO_GENERATOR::SetHtmlAliasOf(), FOOTPRINT_INFO_GENERATOR::SetHtmlDesc(), FOOTPRINT_INFO_GENERATOR::SetHtmlKeywords(), FOOTPRINT_INFO_GENERATOR::SetHtmlName(), and PANEL_PACKAGES_VIEW::setPackageDetails().
wxString EscapeString | ( | const wxString & | aSource, |
ESCAPE_CONTEXT | aContext | ||
) |
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are: (a) not legal in filenames (b) used as control characters in LIB_IDs (c) used to delineate hierarchical paths.
Definition at line 143 of file string_utils.cpp.
References CTX_FILENAME, CTX_LIBID, CTX_LINE, CTX_NETNAME, CTX_NO_SPACE, and CTX_QUOTED_STR.
Referenced by AltiumToKiCadLibID(), SCH_EDIT_TOOL::ChangeTextType(), SYMBOL_VIEWER_FRAME::ClickOnCmpList(), SYMBOL_VIEWER_FRAME::ClickOnLibList(), PANEL_SYM_LIB_TABLE::convertLibrary(), CONNECTION_SUBGRAPH::driverName(), SYMBOL_EDITOR_EDIT_TOOL::editFieldProperties(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckLabels(), TEXT_BUTTON_SYMBOL_CHOOSER::escapeLibId(), RESCUE_CASE_CANDIDATE::FindRescues(), RESCUE_CACHE_CANDIDATE::FindRescues(), RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues(), SYMBOL_VIEWER_FRAME::FinishModal(), getLibIdValue(), DIALOG_LIB_NEW_SYMBOL::GetName(), DIALOG_LIB_NEW_SYMBOL::GetParentSymbolName(), SYMBOL_EDIT_FRAME::ImportSymbol(), SCH_LEGACY_PLUGIN_CACHE::loadField(), SCH_EAGLE_PLUGIN::loadInstance(), SCH_EAGLE_PLUGIN::loadLibrary(), SCH_LEGACY_PLUGIN_CACHE::LoadPart(), CADSTAR_SCH_ARCHIVE_LOADER::loadPartsLibrary(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), SCH_EAGLE_PLUGIN::loadSegments(), DIALOG_NET_INSPECTOR::onRenameNet(), NET_SETTINGS::ParseBusGroup(), SCH_SEXPR_PLUGIN_CACHE::saveDcmInfoAsFields(), SIM_PLOT_FRAME::saveWorkbook(), LIB_TABLE_GRID::SetValue(), FIELDS_GRID_TABLE< SCH_FIELD >::SetValue(), DIALOG_SHEET_PIN_PROPERTIES::TransferDataFromWindow(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_LIB_FIELD_PROPERTIES::UpdateField(), and FOOTPRINT_LIST_IMPL::WriteCacheToFile().
wxString GetIllegalFileNameWxChars | ( | ) |
Definition at line 966 of file string_utils.cpp.
References FROM_UTF8(), and illegalFileNameChars.
Referenced by ReplaceIllegalFileNameChars().
char* GetLine | ( | FILE * | aFile, |
char * | Line, | ||
int * | LineNum = nullptr , |
||
int | SizeLine = 255 |
||
) |
Read one line line from aFile.
Definition at line 616 of file string_utils.cpp.
Referenced by CVPCB_MAINFRAME::buildEquivalenceList().
int GetTrailingInt | ( | const wxString & | aStr | ) |
Gets the trailing int, if any, from a string.
aStr | the string to check. |
Definition at line 942 of file string_utils.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), FOOTPRINT::GetNextPadNumber(), and FOOTPRINT::IncrementReference().
bool NoPrintableChars | ( | const wxString & | aString | ) |
Return true if the string is empty or contains only whitespace.
Definition at line 505 of file string_utils.cpp.
Referenced by SCH_DRAWING_TOOLS::createNewText(), SCH_DRAWING_TOOLS::createSheetPin(), DRAWING_TOOL::PlaceText(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().
wxString PrettyPrintForMenu | ( | const wxString & | aString | ) |
Remove markup (such as overbar or subscript) that we can't render to menu items.
int PrintableCharCount | ( | const wxString & | aString | ) |
Return the number of printable (ie: non-formatting) chars.
Used to approximate rendered text size when speed is more important than accuracy.
Definition at line 517 of file string_utils.cpp.
Referenced by KIGFX::PCB_PAINTER::draw().
int ReadDelimitedText | ( | char * | aDest, |
const char * | aSource, | ||
int | aDestSize | ||
) |
Copy bytes from aSource delimited string segment to aDest buffer.
The extracted string will be null terminated even if truncation is necessary because aDestSize was not large enough.
aDest | is the destination byte buffer. |
aSource | is the source bytes as a C string. |
aDestSize | is the size of the destination byte buffer. |
Definition at line 389 of file string_utils.cpp.
int ReadDelimitedText | ( | wxString * | aDest, |
const char * | aSource | ||
) |
Copy bytes from aSource delimited string segment to aDest wxString.
aDest | is the destination wxString. |
aSource | is the source C string holding utf8 encoded bytes. |
Definition at line 344 of file string_utils.cpp.
References FROM_UTF8().
Referenced by LEGACY_PLUGIN::load3D(), LEGACY_PLUGIN::loadDIMENSION(), LEGACY_PLUGIN::loadMODULE_TEXT(), LEGACY_PLUGIN::loadNETCLASS(), LEGACY_PLUGIN::loadNETINFO_ITEM(), LEGACY_PLUGIN::loadPAD(), LEGACY_PLUGIN::loadPCB_TEXT(), LEGACY_PLUGIN::loadSHEET(), and LEGACY_PLUGIN::loadZONE_CONTAINER().
bool ReplaceIllegalFileNameChars | ( | std::string * | aName, |
int | aReplaceChar = 0 |
||
) |
Checks aName for illegal file name characters.
The Windows (DOS) file system forbidden characters already include the forbidden file name characters for both Posix and OSX systems. The characters \/?*|"<> are illegal and are replaced with xx where xx the hexadecimal equivalent of the replaced character. This replacement may not be as elegant as using an underscore ('_') or hyphen ('-') but it guarantees that there will be no naming conflicts when fixing footprint library names. however, if aReplaceChar is given, it will replace the illegal chars
aName | is a point to a std::string object containing the footprint name to verify. |
aReplaceChar | (if not 0) is the replacement char. |
Definition at line 972 of file string_utils.cpp.
References illegalFileNameChars, and StrPrintf().
Referenced by EDEVICE::EDEVICE(), EELEMENT::EELEMENT(), LEGACY_PLUGIN::loadAllSections(), FABMASTER::loadFootprints(), EAGLE_PLUGIN::loadLibrary(), LP_CACHE::LoadModules(), SCH_EAGLE_PLUGIN::loadSheet(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), and CADSTAR_SCH_ARCHIVE_LOADER::loadSheets().
bool ReplaceIllegalFileNameChars | ( | wxString & | aName, |
int | aReplaceChar = 0 |
||
) |
Definition at line 1002 of file string_utils.cpp.
References Format(), and GetIllegalFileNameWxChars().
|
inlinestatic |
Split the input string into a vector of output strings.
aStr | Input string with 0 or more delimiters. |
aDelim | The string of delimiter. Multiple characters here denote alternate delimiters. |
Definition at line 293 of file string_utils.h.
Referenced by CompareToBucket::CompareToBucket(), HLBVH_SAH_Evaluator::HLBVH_SAH_Evaluator(), PCB_EDIT_FRAME::KiwayMailIn(), SCH_EDIT_FRAME::KiwayMailIn(), FABMASTER::processText(), and PNS::NODE::rebuildJoint().
int SplitString | ( | const wxString & | strToSplit, |
wxString * | strBeginning, | ||
wxString * | strDigits, | ||
wxString * | strEnd | ||
) |
Break a string into three parts: he alphabetic preamble, the numeric part, and any alphabetic ending.
For example C10A is split to C 10 A
Definition at line 881 of file string_utils.cpp.
Referenced by ValueStringCompare().
void StripTrailingZeros | ( | wxString & | aStringValue, |
unsigned | aTrailingZeroAllowed = 1 |
||
) |
Remove trailing zeros from a string containing a converted float number.
The trailing zeros are removed if the mantissa has more than aTrailingZeroAllowed digits and some trailing zeros.
Definition at line 1056 of file string_utils.cpp.
Referenced by AngleToStringDegrees().
int StrNumCmp | ( | const wxString & | aString1, |
const wxString & | aString2, | ||
bool | aIgnoreCase = false |
||
) |
Compare two strings with alphanumerical content.
This function is equivalent to strncmp() or strncasecmp() if aIgnoreCase is true except that strings containing numbers are compared by their integer value not by their ASCII code. In other words U10 would be greater than U2.
aString1 | A wxString reference to the reference string. |
aString2 | A wxString reference to the comparison string. |
aIgnoreCase | Use true to make the comparison case insensitive. |
Definition at line 641 of file string_utils.cpp.
Referenced by REGULATOR_LIST::Add(), LIB_TREE_NODE::AssignIntrinsicRanks(), BOOST_AUTO_TEST_CASE(), ChangeArrayCompare(), FIELDS_EDITOR_GRID_DATA_MODEL::cmp(), SCH_PIN_TABLE_DATA_MODEL::compare(), PIN_TABLE_DATA_MODEL::compare(), SCH_SHEET::ComparePageNum(), SCH_FIELD::DoHypertextMenu(), PLACE_FILE_EXPORTER::GenReportData(), FP_TREE_MODEL_ADAPTER::getFootprints(), LIB_TABLE::GetLogicalLibs(), FIELDS_EDITOR_GRID_DATA_MODEL::GetValue(), NETLIST_EXPORTER_XML::makeListOfNets(), NETLIST_EXPORTER_XML::makeSymbols(), myCompareFunction(), FOOTPRINT::cmp_pads::operator()(), operator<(), BOARD_REANNOTATE_TOOL::ReannotateDuplicates(), NET_SELECTOR_COMBOPOPUP::rebuildList(), SCH_GLOBALLABEL::ResolveTextVar(), SCH_REFERENCE_LIST::sortByReferenceOnly(), sortFPlist(), sortPinsByNum(), sortPinsByNumber(), and FP_TREE_SYNCHRONIZING_ADAPTER::updateLibrary().
char* StrPurge | ( | char * | text | ) |
Remove leading and training spaces, tabs and end of line chars in text.
Definition at line 597 of file string_utils.cpp.
References text.
Referenced by detect_file_type(), LEGACY_PLUGIN::loadAllSections(), EXCELLON_IMAGE::LoadFile(), LEGACY_PLUGIN::loadFOOTPRINT(), GERBER_FILE_IMAGE::LoadGerberFile(), LP_CACHE::LoadModules(), LEGACY_NETLIST_READER::LoadNetlist(), and LEGACY_PLUGIN::loadPAD().
char* strtok_r | ( | char * | str, |
const char * | delim, | ||
char ** | nextp | ||
) |
Referenced by LEGACY_PLUGIN::loadDIMENSION(), LEGACY_PLUGIN::loadFOOTPRINT(), LEGACY_PLUGIN::loadGENERAL(), LEGACY_PLUGIN::loadMODULE_TEXT(), LEGACY_PLUGIN::loadPAD(), LEGACY_PLUGIN::loadPCB_LINE(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), LEGACY_PLUGIN::loadSETUP(), LEGACY_PLUGIN::loadSHEET(), LEGACY_PLUGIN::loadTrackList(), LEGACY_PLUGIN::loadZONE_CONTAINER(), and LP_CACHE::ReadAndVerifyHeader().
wxString TitleCaps | ( | const wxString & | aString | ) |
Capitalize the first letter in each word.
Definition at line 323 of file string_utils.cpp.
References wxStringSplit().
Referenced by SYMBOL_EDITOR_EDIT_TOOL::editFieldProperties(), and SCH_EDIT_TOOL::editFieldText().
wxString UnescapeString | ( | const wxString & | aSource | ) |
Definition at line 247 of file string_utils.cpp.
References UnescapeString().
Referenced by NET_SELECTOR_COMBOPOPUP::Accept(), DIALOG_EDIT_SYMBOLS_LIBID::AddRowToGrid(), NETLIST_EXPORTER_XML::addSymbolFields(), SCH_CONNECTION::AppendInfoToMsgPanel(), EDA_TEXT::cacheShownText(), SCH_EDIT_TOOL::ChangeTextType(), NETLIST_EXPORTER_PSPICE_SIM::ComponentToVector(), SCH_CONNECTION::ConfigureFromLabel(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), DIALOG_LIB_FIELD_PROPERTIES::DIALOG_LIB_FIELD_PROPERTIES(), DIALOG_LIB_NEW_SYMBOL::DIALOG_LIB_NEW_SYMBOL(), DIALOG_UPDATE_SYMBOL_FIELDS::DIALOG_UPDATE_SYMBOL_FIELDS(), GRID_CELL_ESCAPED_TEXT_RENDERER::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckHierSheets(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), SYMBOL_EDIT_FRAME::ExportSymbol(), NETLIST_EXPORTER_PSPICE::Format(), DIALOG_NET_INSPECTOR::formatNetName(), GRID_CELL_ESCAPED_TEXT_RENDERER::GetBestSize(), PCB_TEXT::GetMsgPanelInfo(), LIB_TEXT::GetMsgPanelInfo(), ZONE::GetMsgPanelInfo(), LIB_FIELD::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), LIB_PIN::GetMsgPanelInfo(), FP_TEXT::GetMsgPanelInfo(), SCH_FIELD::GetMsgPanelInfo(), GERBER_DRAW_ITEM::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_SYMBOL::GetMsgPanelInfo(), PAD::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::GetRootSymbolNames(), LIB_PIN::GetSelectMenuText(), SCH_SYMBOL::GetSelectMenuText(), DIALOG_COPPER_ZONE::getUnescapedNetName(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), LIB_TABLE_GRID::GetValue(), FIELDS_GRID_TABLE< SCH_FIELD >::GetValue(), LIB_TREE_MODEL_ADAPTER::GetValue(), GERBVIEW_CONTROL::HighlightControl(), SCH_CONNECTION::IsBusLabel(), SYMBOL_EDIT_FRAME::KiwayMailIn(), DIALOG_CHANGE_SYMBOLS::launchMatchIdSymbolBrowser(), DIALOG_CHANGE_SYMBOLS::launchNewIdSymbolBrowser(), DIALOG_NET_INSPECTOR::LIST_ITEM::LIST_ITEM(), SCH_EAGLE_PLUGIN::loadInstance(), SCH_LEGACY_PLUGIN_CACHE::LoadPart(), SIM_PLOT_FRAME::loadWorkbook(), SCH_CONNECTION::MightBeBusLabel(), NET_SETTINGS::NET_SETTINGS(), DIALOG_NET_INSPECTOR::netFilterMatches(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), DIALOG_EDIT_SYMBOLS_LIBID::onClickOrphansButton(), DIALOG_NET_INSPECTOR::onRenameNet(), SCH_SEXPR_PARSER::parseProperty(), DIALOG_CHANGE_SYMBOLS::processSymbol(), FOOTPRINT_LIST_IMPL::ReadCacheFromFile(), NET_SELECTOR_COMBOPOPUP::rebuildList(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), SYMBOL_VIEWER_FRAME::ReCreateSymbolList(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer(), SYMBOL_EDIT_FRAME::SetCurSymbol(), FOOTPRINT_INFO_GENERATOR::SetHtmlAliasOf(), FOOTPRINT_INFO_GENERATOR::SetHtmlName(), DIALOG_EDIT_SYMBOLS_LIBID::setLibIdByBrowser(), DIALOG_LIB_NEW_SYMBOL::SetName(), SYMBOL_VIEWER_FRAME::SetSelectedLibrary(), NET_SELECTOR::SetSelectedNet(), NET_SELECTOR::SetSelectedNetcode(), SYMBOL_VIEWER_FRAME::SetSelectedSymbol(), SYMBOL_VIEWER_FRAME::ShowModal(), ERC_TESTER::TestLibSymbolIssues(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_SYMBOLS_LIBID::TransferDataFromWindow(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), DIALOG_SHEET_PIN_PROPERTIES::TransferDataToWindow(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataToWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow(), UnescapeString(), HIGHLIGHT_MENU::update(), SYMBOL_EDIT_FRAME::UpdateAfterSymbolProperties(), BOARD_NETLIST_UPDATER::updateComponentPadConnections(), BOARD_NETLIST_UPDATER::updateCopperZoneNets(), SCH_SYMBOL::UpdateFields(), SCH_EDIT_FRAME::UpdateNetHighlightStatus(), GERBVIEW_FRAME::updateNetnameListSelectBox(), SYMBOL_VIEWER_FRAME::updatePreviewSymbol(), LIB_TREE_NODE_LIB_ID::UpdateScore(), SCH_SCREEN::UpdateSymbolLinks(), SYMBOL_EDIT_FRAME::UpdateSymbolMsgPanelInfo(), SYMBOL_EDIT_FRAME::updateTitle(), ValueStringCompare(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().
int ValueStringCompare | ( | const wxString & | strFWord, |
const wxString & | strSWord | ||
) |
Compare strings like the strcmp function but handle numbers and modifiers within the string text correctly for sorting.
eg. 1mF > 55uF
Definition at line 829 of file string_utils.cpp.
References ApplyModifier(), SplitString(), and UnescapeString().
Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::cmp().
bool WildCompareString | ( | const wxString & | pattern, |
const wxString & | string_to_tst, | ||
bool | case_sensitive = true |
||
) |
Compare a string against wild card (* and ?) pattern using the usual rules.
Definition at line 720 of file string_utils.cpp.
Referenced by FROM_TO_CACHE::cacheFromToPaths(), LIBEVAL::VALUE::EqualTo(), DIALOG_EXCHANGE_FOOTPRINTS::isMatch(), DIALOG_CHANGE_SYMBOLS::isMatch(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().
void wxStringSplit | ( | const wxString & | aText, |
wxArrayString & | aStrings, | ||
wxChar | aSplitter | ||
) |
Split aString to a string list separated at aSplitter.
aText | is the text to split. |
aStrings | will contain the split lines. |
aSplitter | is the 'split' character. |
Definition at line 1033 of file string_utils.cpp.
Referenced by EDA_TEXT::GetTextBox(), HTML_MESSAGE_BOX::ListSet(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), PANEL_SETUP_RULES::OnErrorLinkClicked(), pcbnewGetWizardsBackTrace(), SCH_TEXT::Plot(), BRDITEMS_PLOTTER::PlotPcbText(), EDA_TEXT::Print(), TitleCaps(), and EDA_TEXT::TransformToSegmentList().