Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# oscl_file_manager.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00003
    00004 //                     O S C L _ F I L E _ M A N A G E R
    00005
    00006 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00007
    00019 #ifndef OSCL_FILE_MANAGER_H_INCLUDED
    00020 #define OSCL_FILE_MANAGER_H_INCLUDED
    00021
    00022 #include "oscl_base.h"
    00023
    00024 class OsclFileManager
    00025 {
    00026     public:
    00027         typedef enum
    00028         {
    00029             OSCL_FILE_ATTRIBUTE_READONLY        =       0x00000001,
    00030             /*
    00031             The file or directory is read-only. Applications can read the file but cannot write to it or delete it.
    00032             For a directory, applications cannot delete it.
    00033             */
    00034             OSCL_FILE_ATTRIBUTE_HIDDEN          =       0x00000002,
    00035             /*
    00036             The file or directory is hidden. It is not included in an ordinary directory listing.
    00037             */
    00038             OSCL_FILE_ATTRIBUTE_SYSTEM          =       0x00000004,
    00039             /*
    00040             The file or directory is part of the operating system, or is used exclusively by the operating system.
    00041             */
    00042             OSCL_FILE_ATTRIBUTE_DIRECTORY       =       0x00000010,
    00043             /*
    00044             The handle identifies a directory.
    00045             */
    00046             OSCL_FILE_ATTRIBUTE_ARCHIVE         =       0x00000020,
    00047             /*
    00048             The file or directory is an archive file. Applications use this attribute to mark files for backup or removal.
    00049             */
    00050             OSCL_FILE_ATTRIBUTE_NORMAL            =       0x00000080,
    00051             /*
    00052             The file or directory does not have another attributes set. This attribute is valid only if used alone.
    00053             */
    00054             //OSCL_FILE_ATTRIBUTE_TEMPORARY     =       0x00000100,
    00055             /*
    00056             The file is being used for temporary storage. File systems avoid writing data back to mass storage
    00057             if sufficient cache memory is available, because often the application deletes the temporary file
    00058             shortly after the handle is closed. In that case, the system can entirely avoid writing the data.
    00059             Otherwise, the data is written after the handle is closed.
    00060             */
    00061             //OSCL_FILE_ATTRIBUTE_SPARSE_FILE       =       0x00000200,
    00062             /*
    00063             The file is a sparse file.
    00064             */
    00065             //OSCL_FILE_ATTRIBUTE_REPARSE_POINT =       0x00000400,
    00066             /*
    00067             The file or directory has an associated reparse point.
    00068             */
    00069             //OSCL_FILE_ATTRIBUTE_COMPRESSED        =       0x00000800,
    00070             /*
    00071             The file or directory is compressed.
    00072             For a file, this means that all of the data in the file is compressed.
    00073             For a directory, this means that compression is the default for newly created files and subdirectories.
    00074             */
    00075
    00076             //OSCL_FILE_ATTRIBUTE_OFFLINE           =       0x00001000,
    00077             /*
    00078             The data of the file is not immediately available. This attribute indicates that the file data has been
    00079             physically moved to offline storage.This attribute is used by Remote Storage, the hierarchical storage
    00080             management software. Applications should not arbitrarily change this attribute.
    00081             */
    00082             //OSCL_FILE_ATTRIBUTE_ENCRYPTED     =       0x00004000,
    00083             /*
    00084             The file or directory is encrypted. For a file, this means that all data in the file is encrypted.
    00085             For a directory, this means that encryption is the default for newly created files and subdirectories.
    00086             */
    00087             //OSCL_FILE_ATTRIBUTE_VIRTUAL           =       0x00010000
    00088             /*
    00089             A file is a virtual file.
    00090             */
    00091
    00092         } OSCL_FILE_ATTRIBUTE_TYPE;
    00093
    00103         OSCL_IMPORT_REF static bool OsclGetFileSize(const oscl_wchar* aFileName, uint64& aFileSize);
    00104
    00113         OSCL_IMPORT_REF static bool OsclGetFileSize(const char* aFileName, uint64& aFileSize);
    00114
    00124         OSCL_IMPORT_REF static bool OsclGetFileCreationTime(const oscl_wchar* aFileName, uint64& aFileCreationTime);
    00125
    00135         OSCL_IMPORT_REF static bool OsclGetFileCreationTime(const char* aFileName, uint64& aFileCreationTime);
    00136
    00147         OSCL_IMPORT_REF static bool OsclGetFileLastAccessTime(const oscl_wchar* aFileName, uint64& aFileLastAccessTime);
    00157         OSCL_IMPORT_REF static bool OsclGetFileLastAccessTime(const char* aFileName, uint64& aFileLastAccessTime);
    00158
    00167         OSCL_IMPORT_REF static bool OsclGetFileLastWriteTime(const oscl_wchar* aFileName, uint64& aFileLastWriteTime);
    00168
    00177         OSCL_IMPORT_REF static bool OsclGetFileLastWriteTime(const char* aFileName, uint64& aFileLastWriteTime);
    00178
    00188         OSCL_IMPORT_REF static bool OsclGetFileAttributes(const oscl_wchar* aFileName, uint32& aFileAttributes);
    00189
    00199         OSCL_IMPORT_REF static bool OsclGetFileAttributes(const char* aFileName, uint32& aFileAttributes);
    00207         OSCL_IMPORT_REF static void OsclExtractFilenameFromFullpath(const char* aPath, char* &aFileName);
    00208         OSCL_IMPORT_REF static void OsclExtractFilenameFromFullpath(const oscl_wchar* aPath, oscl_wchar* &aFileName);
    00209
    00210 #endif // OSCL_FILE_MANAGER_H_INCLUDED
    00211
    00213 };