Include :
- prima versione interfacce per ISurf e ISurfTriMesh - FromString per vettore di interi.
This commit is contained in:
@@ -84,6 +84,21 @@ FromString( const std::string& sVal, double& dVal)
|
||||
pStart = sVal.c_str() ;
|
||||
dVal = strtod( pStart, &pStop) ;
|
||||
return ( pStop != pStart && *pStop == '\0' && errno == 0) ; }
|
||||
template <size_t size>
|
||||
bool FromString( const std::string& sVal, int (&nVal)[size])
|
||||
{ // divido la stringa in parametri
|
||||
STRVECTOR vsParams ;
|
||||
Tokenize( sVal, ",", vsParams) ;
|
||||
// devono essere size parametri
|
||||
if ( vsParams.size() != size)
|
||||
return false ;
|
||||
// recupero il punto
|
||||
for ( int i = 0 ; i < size ; ++ i) {
|
||||
if ( ! FromString( vsParams[i], nVal[i]))
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
EGN_EXPORT const std::string ToString( int nVal, int nPrec = 1) ;
|
||||
inline const std::string
|
||||
ToString( bool bVal)
|
||||
|
||||
Reference in New Issue
Block a user