Skip to content

Commit

Permalink
- FileSorter: Added ability to sort only certain types of files
Browse files Browse the repository at this point in the history
- core: added file handling functions for setting meta-data
- vfs: added file handling functions for setting meta-data and expanded CopyFile to consider meta-data, use CopyFileContent for historical behaviour
  • Loading branch information
LiberatorUSA committed Jul 13, 2024
1 parent fd39f2c commit 0a71220
Show file tree
Hide file tree
Showing 28 changed files with 1,012 additions and 78 deletions.
20 changes: 18 additions & 2 deletions platform/gucefCORE/include/CFileAccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
#define GUCEF_CORE_CIOACCESS_H
#endif /* GUCEF_CORE_CIOACCESS_H ? */

#ifndef GUCEF_CORE_CRESOURCEMETADATA_H
#include "gucefCORE_CResourceMetaData.h"
#define GUCEF_CORE_CRESOURCEMETADATA_H
#endif /* GUCEF_CORE_CRESOURCEMETADATA_H ? */

/*-------------------------------------------------------------------------//
// //
// NAMESPACE //
Expand All @@ -57,16 +62,27 @@ class GUCEF_CORE_PUBLIC_CPP CFileAccess : public CIOAccess
CFileAccess( const CString& file ,
const char* mode = "rb" );

CFileAccess( const CString& file ,
const CResourceMetaData& metaData ,
const char* mode = "wb" );

CFileAccess( void );

virtual ~CFileAccess() GUCEF_VIRTUAL_OVERRIDE;

/**
* open the resource for I/O
*/
* open the resource for I/O
*/
virtual bool Open( const CString& file ,
const char* mode = "rb" );

/**
* open the resource for I/O
*/
virtual bool Open( const CString& file ,
const CResourceMetaData& metaData ,
const char* mode = "wb" );

/**
* open the resource for I/O
*/
Expand Down
11 changes: 11 additions & 0 deletions platform/gucefCORE/include/dvcppfileutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ GetFileCreationTime( const CString& path );

/*-------------------------------------------------------------------------*/

/**
* Attempts to set various file meta-data using the file system
* The implementation will apply the meta-data 'best effort' based on the constraints of the actual underlying storage
* and return true if within the constraints of the file system the meta-data was applied successfully.
*/
GUCEF_CORE_PUBLIC_CPP bool
SetFileMetaData( const CString& filePath ,
const CResourceMetaData& metaData );

/*-------------------------------------------------------------------------*/

/**
* Attempts to obtain various file meta-data from the file system
*/
Expand Down
12 changes: 6 additions & 6 deletions platform/gucefCORE/include/dvcppstringutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,10 @@ inline CString ToString( const CAsciiString::StringSet& el ) { CAsciiString out;
#elif ( GUCEF_DEFAULT_STRING_FORMAT == GUCEF_DATATYPE_UTF8_STRING )
inline CString ToString( const CUtf8String& str ) { return str; }
inline CString ToString( const CAsciiString& str ) { return CUtf8String( str ); }
inline CString ToString( const CUtf8String::StringVector& el ) { CUtf8String out; return out.Combine( el, ',' ); }
inline CString ToString( const CAsciiString::StringVector& el ) { CAsciiString out; return CUtf8String( out.Combine( el, ',' ) ); }
inline CString ToString( const CUtf8String::StringSet& el ) { CUtf8String out; return out.Combine( el, ',' ); }
inline CString ToString( const CAsciiString::StringSet& el ) { CAsciiString out; return CUtf8String( out.Combine( el, ',' ) ); }
inline CString ToString( const CUtf8String::StringVector& el, Int32 sepChar = ',' ) { CUtf8String out; return out.Combine( el, sepChar ); }
inline CString ToString( const CAsciiString::StringVector& el, char sepChar = ',' ) { CAsciiString out; return CUtf8String( out.Combine( el, sepChar ) ); }
inline CString ToString( const CUtf8String::StringSet& el, Int32 sepChar = ',' ) { CUtf8String out; return out.Combine( el, sepChar ); }
inline CString ToString( const CAsciiString::StringSet& el, char sepChar = ',' ) { CAsciiString out; return CUtf8String( out.Combine( el, sepChar ) ); }
inline CString ToString( const CUtf8String::StringMap& el ) { CUtf8String out; return out.Combine( el, '=', ',' ); }
#endif

Expand Down Expand Up @@ -526,8 +526,8 @@ inline CString ToString( void ) { return typeid( typeNameParam ).name(); }

/*-------------------------------------------------------------------------*/

inline CString::StringSet ToStringSet( const CUtf8String& str ) { CString::StringSet set; set.insert( str ); return set; }
inline CString::StringSet ToStringSet( const CAsciiString& str ) { CString::StringSet set; set.insert( str ); return set; }
inline CString::StringSet ToStringSet( const CUtf8String& str ) { return StringToStringSet( str ); }
inline CString::StringSet ToStringSet( const CAsciiString& str ) { return StringToStringSet( str ); }
inline CString::StringSet ToStringSet( const CUtf8String::StringVector& vec ) { CString::StringSet set; CUtf8String::StringVector::const_iterator i=vec.begin(); while ( i != vec.end() ) { set.insert( (*i) ); ++i; } return set; }
inline CString::StringSet ToStringSet( const CAsciiString::StringVector& vec ) { CString::StringSet set; CAsciiString::StringVector::const_iterator i=vec.begin(); while ( i != vec.end() ) { set.insert( (*i) ); ++i; } return set; }
#if ( GUCEF_DEFAULT_STRING_FORMAT == GUCEF_DATATYPE_ASCII_STRING )
Expand Down
2 changes: 2 additions & 0 deletions platform/gucefCORE/include/gucefCORE_CDateTime.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ class GUCEF_CORE_PUBLIC_CPP CDateTime : public CDate ,

explicit CDateTime( const struct _FILETIME& src );

struct _FILETIME ToWindowsFiletime( void ) const;

#endif

virtual ~CDateTime();
Expand Down
Loading

0 comments on commit 0a71220

Please sign in to comment.