MCPcopy Create free account
hub / github.com/SpartanJ/eepp / splitCommandParams

Function splitCommandParams

src/eepp/ui/uiconsole.cpp:1568–1598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1566}
1567
1568static std::vector<String> splitCommandParams( String str ) {
1569 std::vector<String> params = String::split( str, ' ' );
1570 std::vector<String> rparams;
1571 String tstr;
1572
1573 for ( size_t i = 0; i < params.size(); i++ ) {
1574 String tparam = params[i];
1575
1576 if ( !tparam.empty() ) {
1577 if ( '"' == tparam[0] ) {
1578 tstr += tparam;
1579 } else if ( '"' == tparam[tparam.size() - 1] ) {
1580 tstr += " " + tparam;
1581
1582 rparams.push_back( String::trim( tstr, '"' ) );
1583
1584 tstr = "";
1585 } else if ( !tstr.empty() ) {
1586 tstr += " " + tparam;
1587 } else {
1588 rparams.push_back( tparam );
1589 }
1590 }
1591 }
1592
1593 if ( !tstr.empty() ) {
1594 rparams.push_back( String::trim( tstr, '"' ) );
1595 }
1596
1597 return rparams;
1598}
1599
1600void UIConsole::processLine() {
1601 String str( mDoc.getCurrentLine().getTextWithoutNewLine() );

Callers 1

processLineMethod · 0.85

Calls 3

push_backMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected