Hi Georg,
This bug is already fixed in PCL 2.0. Thank you for reporting it anyway. You have two workarounds:
- Use:
sArgs.Break( argvList, ' ', true/*trim*/ );
That is, specify the token separator as a single character.
- Or patch the pcl/String.h file with the fixed code from PCL 2.0:
/*!
* Gets a sequence of \e tokens (substrings) extracted from this string.
*
* \param[out] list The list of extracted tokens. Must be a reference to a
* container, such as Array or List, or a derived class.
* Typically, this parameter is a reference to a
* StringList.
*
* \param s The token separator null-terminated string.
*
* \param trim True to \e trim the extracted tokens. If this parameter
* is true, existing leading and trailing whitespace
* characters will be removed from each extracted token.
*
* \param i Starting character index.
*/
template <class C>
void Break( C& list, const T* s, bool trim = false, size_type i = 0 ) const
{
size_type len = Length();
if ( i < len )
{
size_type n = R::Length( s );
if ( n > 0 )
{
for ( ;; )
{
size_type j = Find( s, i );
if ( j == notFound )
break;
GenericString<T,R,A> t;
if ( j > i )
{
size_type m = j - i;
t.data->Allocate( m );
R::Copy( t.data->string, data->string+i, m );
t.data->string[m] = R::Null();
if ( trim )
t.Trim();
}
list.Add( t );
if ( (i = j+n) == len )
return;
}
GenericString<T,R,A> t;
t.data->Allocate( n = len-i );
R::Copy( t.data->string, data->string+i, n );
t.data->string[n] = R::Null();
if ( trim )
t.Trim();
list.Add( t );
}
}
}
This function should be around line 1615 of String.h.
Let me know if this helps.