NT4/private/utils/ulib/inc/file.hxx
2020-09-30 17:12:29 +02:00

128 lines
2.1 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
Copyright (c) 1991 Microsoft Corporation
Module Name:
file.hxx
Abstract:
This module contains the declaration for the FSN_FILE class. FSN_FILE
is derived from the abstract FSNODE class. It offers an interface which
supports manipulation of the external (i.e. non data) portion of files.
Author:
David J. Gilman (davegi) 09-Jan-1991
Environment:
ULIB, User Mode
--*/
#if ! defined( _FSN_FILE_ )
#define _FSN_FILE_
#include "fsnode.hxx"
#include "filestrm.hxx"
//
// Error Codes from a copy
//
typedef enum _COPY_ERROR {
COPY_ERROR_ACCESS_DENIED = ERROR_ACCESS_DENIED,
COPY_ERROR_SHARE_VIOLATION = ERROR_SHARING_VIOLATION,
COPY_ERROR_NO_MEMORY = ERROR_NOT_ENOUGH_MEMORY,
COPY_ERROR_DISK_FULL = ERROR_DISK_FULL,
COPY_ERROR_INVALID_NAME = ERROR_INVALID_NAME
} COPY_ERROR, *PCOPY_ERROR;
//
// Forward references
//
DECLARE_CLASS( FSN_FILE );
DECLARE_CLASS( FSN_FILTER );
class FSN_FILE : public FSNODE {
friend FSN_FILTER;
friend SYSTEM;
public:
DECLARE_CAST_MEMBER_FUNCTION( FSN_FILE );
NONVIRTUAL
ULIB_EXPORT
BOOLEAN
Copy (
IN OUT PPATH NewFile,
OUT PCOPY_ERROR ErrorCode DEFAULT NULL,
IN BOOLEAN OverwriteReadOnly DEFAULT FALSE,
IN BOOLEAN ResetReadOnly DEFAULT FALSE,
IN BOOLEAN Restartable DEFAULT FALSE,
IN LPPROGRESS_ROUTINE CallBack DEFAULT NULL,
IN VOID * Data DEFAULT NULL,
IN PBOOL Cancel DEFAULT NULL
) CONST;
VIRTUAL
BOOLEAN
DeleteFromDisk(
IN BOOLEAN Force DEFAULT FALSE
);
NONVIRTUAL
ULONG
QuerySize (
) CONST;
ULIB_EXPORT
PFILE_STREAM
QueryStream (
IN STREAMACCESS Access
);
protected:
DECLARE_CONSTRUCTOR( FSN_FILE );
private:
};
INLINE
ULONG
FSN_FILE::QuerySize (
) CONST
/*++
Routine Description:
Return the size of the file in bytes.
Arguments:
None.
Return Value:
ULONG - returns the file size
--*/
{
return( _FileData.nFileSizeLow );
}
#endif // _FSN_FILE_