diff --git a/EgtGeneral.rc b/EgtGeneral.rc index 0f87376..8a6bbef 100644 Binary files a/EgtGeneral.rc and b/EgtGeneral.rc differ diff --git a/EgtGeneral.vcxproj b/EgtGeneral.vcxproj index 3b31c03..f5164f1 100644 --- a/EgtGeneral.vcxproj +++ b/EgtGeneral.vcxproj @@ -185,6 +185,7 @@ copy $(TargetPath) \EgtProg\Dll64 + diff --git a/EgtGeneral.vcxproj.filters b/EgtGeneral.vcxproj.filters index a3bc3ae..5d38cef 100644 --- a/EgtGeneral.vcxproj.filters +++ b/EgtGeneral.vcxproj.filters @@ -60,6 +60,9 @@ File di intestazione + + File di intestazione + diff --git a/FileUtils.cpp b/FileUtils.cpp index 712ea33..0cb7b45 100644 --- a/FileUtils.cpp +++ b/FileUtils.cpp @@ -14,11 +14,32 @@ //--------------------------- Include ---------------------------------------- #include "stdafx.h" #include "\EgtDev\Include\EgnFileUtils.h" +#include "\EgtDev\Include\EgnStringUtils.h" #include "\EgtDev\Include\EgnStringConverter.h" #include using namespace std ; + +//---------------------------------------------------------------------------- +bool +ExistsFile( const string& sFile) +{ + // leggo gli attributi del file + DWORD dwAttr = ::GetFileAttributesW( stringtoW( sFile)) ; + + // se non esiste + if ( dwAttr == INVALID_FILE_ATTRIBUTES || + dwAttr == INVALID_FILE_SIZE) + return false ; + + // se è un direttorio + if ( dwAttr & FILE_ATTRIBUTE_DIRECTORY) + return false ; + + return true ; +} + //----------------------------------------------------------------------------- bool EraseFile( const string& sFile) @@ -26,6 +47,19 @@ EraseFile( const string& sFile) return ( ::DeleteFileW( stringtoW( sFile)) != 0) ; } +//----------------------------------------------------------------------------- +bool +FileExtensionMatches( const string& sFile, const string& sExt) +{ + string sFileTitle ; + string sFileExt ; + SplitLast( sFile, ".", sFileTitle, sFileExt) ; + ToUpper( sFileExt) ; + string sExtUp = sExt ; + ToUpper( sExtUp) ; + return ( sFileExt == sExtUp) ; +} + //----------------------------------------------------------------------------- bool EmptyDirectory( const string& sDir)