wxStringTokenizer usage cleanup.

1) Always be explicit about what the delimiters are
2) If space is a delimiter, we probably want to skip
empty fields (wxTOKEN_STRTOK)
3) If space is not a delimiter, we often need to
trim the resultant tokens
4) Be more lenient about \t\r\n (and when they are
included, include them in the same order)
This commit is contained in:
Jeff Young
2025-09-16 13:03:02 +01:00
parent bad00cdceb
commit 87739c8ac7
41 changed files with 94 additions and 93 deletions
+2 -2
View File
@@ -143,10 +143,10 @@ int CLI::SCH_EXPORT_PLOT_COMMAND::doPerform( KIWAY& aKiway )
std::vector<wxString> pages;
wxString pagesStr = From_UTF8( m_argParser.get<std::string>( ARG_PAGES ).c_str() );
wxStringTokenizer tokenizer( pagesStr, "," );
wxStringTokenizer tokenizer( pagesStr, ",", wxTOKEN_STRTOK );
while( tokenizer.HasMoreTokens() )
pages.push_back( tokenizer.GetNextToken().Trim() );
pages.push_back( tokenizer.GetNextToken().Trim( wxString::both) );
std::unique_ptr<JOB_EXPORT_SCH_PLOT> plotJob;