EgtGeneral 1.6l11 :

- aggiunta funzione GetFileTitleEgt.
This commit is contained in:
Dario Sassi
2016-02-05 10:55:11 +00:00
parent 2f051a6321
commit 40ca267dea
2 changed files with 13 additions and 0 deletions
+13
View File
@@ -138,6 +138,19 @@ GetFileName( const string& sPath)
return sPath.substr( iPos+1) ;
}
//----------------------------------------------------------------------------
string
GetFileTitleEgt( const string& sPath)
{
// cerco l'ultimo separatore
size_t iPos = sPath.find_last_of( "/\\") ;
// recupero il nome
string sName = (( iPos == string::npos) ? sPath : sPath.substr( iPos + 1)) ;
// tolgo l'eventuale estensione
size_t iPos2 = sName.find_last_of( ".") ;
return (( iPos2 == string::npos) ? sName : sName.substr( 0, iPos2)) ;
}
//----------------------------------------------------------------------------
string
GetDirectory( const string& sPath)