Include :

- prima versione interfacce per ISurf e ISurfTriMesh
- FromString per vettore di interi.
This commit is contained in:
Dario Sassi
2014-03-27 22:17:36 +00:00
parent 247ada06a3
commit 12e8ce8c6b
3 changed files with 93 additions and 0 deletions
+15
View File
@@ -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)