00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_LIBFAT_FILESYSTEM_MANAGER_H_
00028 #define CEYLAN_LIBFAT_FILESYSTEM_MANAGER_H_
00029
00030
00031
00032 #include "CeylanFileSystemManager.h"
00033 #include "CeylanFileSystemCommon.h"
00034
00035
00036 #include <string>
00037
00038
00039
00040
00041 namespace Ceylan
00042 {
00043
00044
00045
00046 namespace System
00047 {
00048
00049
00050
00051 class CEYLAN_DLL LibfatFileSystemManagerException:
00052 public FileSystemManagerException
00053 {
00054
00055 public:
00056
00057 explicit LibfatFileSystemManagerException(
00058 const std::string & reason ) :
00059 FileSystemManagerException( reason )
00060 {
00061
00062 }
00063
00064 } ;
00065
00066
00067
00068
00103 class CEYLAN_DLL LibfatFileSystemManager: public FileSystemManager
00104 {
00105
00106
00107 public:
00108
00109
00110
00112 enum SlotType
00113 {
00114
00115
00117 DefaultSlot,
00118
00120 Slot1,
00121
00122
00123 Slot2,
00124
00125
00126 CustomSlot
00127
00128 } ;
00129
00130
00131
00141 typedef Ceylan::Uint8 PartitionNumber ;
00142
00143
00144
00146 enum FATType
00147 {
00148
00149 FAT12,
00150 FAT16,
00151 FAT32,
00152 UnknownFAT
00153
00154 } ;
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00186 virtual bool existsAsEntry( const std::string & entryPath )
00187 const ;
00188
00189
00190
00203 virtual void createSymbolicLink( const std::string & linkTarget,
00204 const std::string & linkName ) ;
00205
00206
00207
00218 virtual time_t getEntryChangeTime(
00219 const std::string & entryPath ) ;
00220
00221
00222
00223
00224
00225
00226
00227
00228
00235 virtual const std::string & getRootDirectoryPrefix() const ;
00236
00237
00238
00245 virtual Ceylan::Latin1Char getSeparator() const ;
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00290 virtual File & createFile( const std::string & filename,
00291 OpeningFlag createFlag = File::CreateToWriteBinary,
00292 PermissionFlag permissionFlag = File::OwnerReadWrite ) ;
00293
00294
00295
00315 virtual File & openFile( const std::string & filename,
00316 OpeningFlag openFlag = File::OpenToReadBinary ) ;
00317
00318
00319
00334 virtual bool existsAsFileOrSymbolicLink(
00335 const std::string & filename ) const ;
00336
00337
00338
00348 virtual void removeFile( const std::string & filename ) ;
00349
00350
00351
00365 virtual void moveFile( const std::string & sourceFilename,
00366 const std::string & targetFilename ) ;
00367
00368
00369
00381 virtual void copyFile( const std::string & sourceFilename,
00382 const std::string & targetFilename ) ;
00383
00384
00385
00395 virtual Size getSize( const std::string & filename ) ;
00396
00397
00398
00409 virtual time_t getLastChangeTimeFile(
00410 const std::string & filename ) ;
00411
00412
00413
00414
00415
00416
00417
00437 virtual void touch( const std::string & filename ) ;
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00467 virtual Directory & createDirectory(
00468 const std::string & newDirectoryName ) ;
00469
00470
00471
00489 virtual Directory & openDirectory(
00490 const std::string & directoryName = "" ) ;
00491
00492
00493
00509 virtual bool existsAsDirectory(
00510 const std::string & directoryPath ) const ;
00511
00512
00513
00529 virtual void removeDirectory( const std::string & directoryPath,
00530 bool recursive = false ) ;
00531
00532
00533
00548 virtual void moveDirectory(
00549 const std::string & sourceDirectoryPath,
00550 const std::string & targetDirectoryPath ) ;
00551
00552
00553
00566 virtual void copyDirectory(
00567 const std::string & sourceDirectoryPath,
00568 const std::string & targetDirectoryPath ) ;
00569
00570
00571
00582 virtual time_t getLastChangeTimeDirectory(
00583 const std::string & directoryPath ) ;
00584
00585
00586
00598 virtual bool isAValidDirectoryPath(
00599 const std::string & directoryString ) ;
00600
00601
00602
00603
00604
00605
00606
00613 virtual bool isAbsolutePath( const std::string & path ) ;
00614
00615
00616
00624 virtual std::string getCurrentWorkingDirectoryPath() ;
00625
00626
00627
00638 virtual void changeWorkingDirectory(
00639 const std::string & newWorkingDirectory ) ;
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00668 virtual const std::string toString(
00669 Ceylan::VerbosityLevels level = Ceylan::high ) const ;
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00695 static LibfatFileSystemManager &
00696 GetLibfatFileSystemManager() ;
00697
00698
00699
00716 static void SecureLibfatFileSystemManager() ;
00717
00718
00719
00729 static void RemoveLibfatFileSystemManager() ;
00730
00731
00732
00749 LibfatFileSystemManager() ;
00750
00751
00752
00760 virtual ~LibfatFileSystemManager() throw() ;
00761
00762
00763
00773 static FileDescriptor Duplicate( FileDescriptor fd ) ;
00774
00775
00776
00777
00778 protected:
00779
00780
00782 std::string _currentWorkingDirectory ;
00783
00784
00785
00786 private:
00787
00788
00789
00790
00791
00792
00798 static const std::string RootDirectoryPrefix ;
00799
00800
00807 static const Ceylan::Latin1Char Separator ;
00808
00809
00810
00819 LibfatFileSystemManager(
00820 const LibfatFileSystemManager & source ) ;
00821
00822
00831 LibfatFileSystemManager & operator = (
00832 const LibfatFileSystemManager & source ) ;
00833
00834
00835
00836
00838 static LibfatFileSystemManager * _LibfatFileSystemManager ;
00839
00840
00841
00842 } ;
00843
00844
00845 }
00846
00847 }
00848
00849
00850
00851 #endif // CEYLAN_LIBFAT_FILESYSTEM_MANAGER_H_
00852