OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TStreamFile Class Reference

#include <owl/file.h>

Inheritance diagram for owl::TStreamFile:
owl::TFile

Public Member Functions

 TStreamFile ()
 
 TStreamFile (TStreamFile &file)
 
 TStreamFile (TStreamHandle *handle, bool shouldClose)
 
 TStreamFile (const tstring &filename, const uint32 mode=ReadOnly|PermRead|OpenExisting)
 
virtual ~TStreamFile ()
 
virtual bool Open (const tstring &fileName, const uint32 mode=ReadOnly|PermRead|OpenExisting)
 
- Public Member Functions inherited from owl::TFile
 TFile ()
 Creates a TFile object with a file handle of FileNull.
 
 TFile (const tstring &fileName, const uint32 mode=ReadOnly|PermRead|OpenExisting)
 Creates a TFile object and opens file name with the given attributes.
 
 TFile (TFileHandle *handle, bool shouldClose)
 Creates a TFile object with a file handle of handle.
 
 TFile (const TFile &file)
 
virtual ~TFile ()
 If ShouldClose is true the file is closed.
 
virtual TFileHandleGetHandle () const
 Returns Handle.
 
const tstring GetName () const
 Returns Name.
 
virtual bool Close ()
 Closes the file. Returns true if successful, false otherwise.
 
virtual bool Length (uint64 newLen)
 Resizes file to newLen.
 
virtual uint64 Position64 () const
 32 Bit Only: Returns the current position of the file pointer.
 
virtual uint64 Length64 () const
 Returns the file length.
 
virtual bool Length (uint32 newLen)
 Resizes file to newLen.
 
virtual uint32 Position () const
 Returns the current position of the file pointer.
 
virtual uint32 Length () const
 Returns the file length.
 
virtual uint64 Seek (int64 offset, TSeekDir origin=beg)
 Repositions the file pointer to offset bytes from the specified origin.
 
virtual uint32 Seek (long offset, TSeekDir origin=beg)
 Repositions the file pointer to offset bytes from the specified origin.
 
uint64 SeekToBegin64 ()
 Repositions the file pointer to the beginning of the file.
 
uint64 SeekToEnd64 ()
 Repositions the file pointer to the end of the file.
 
uint32 SeekToBegin ()
 Repositions the file pointer to the beginning of the file.
 
uint32 SeekToEnd ()
 Repositions the file pointer to the end of the file.
 
bool IsOpen () const
 Returns true if the file is open, false otherwise.
 
uint32 GetOpenMode () const
 Returns OpenMode.
 
uint32 LastError ()
 Returns the last error.
 
virtual uint32 Read (void *buffer, uint32 numBytes)
 Reads numBytes from the file into buffer. The number of bytes read is returned.
 
virtual bool Write (const void *buffer, uint32 numBytes)
 Writes numbytes of buffer to the file.
 
virtual bool Flush ()
 Performs any pending I/O functions. Returns true if successful; false otherwise.
 
uint ReadStruct (void *buffer, TBinType btype, TByteOrderType type)
 Read binary predefined structure from file.
 
uint ReadStruct (void *buffer, TBinField *fields, TByteOrderType type)
 Read binary structure from file.
 
uint WriteStruct (void *buffer, TBinType btype, TByteOrderType type)
 Writes predefined structures to binary file.
 
uint WriteStruct (void *buffer, TBinField *fields, TByteOrderType type)
 Writes structures to binary file based on fields description.
 
virtual bool LockRange (uint32 position, uint32 count)
 Locks count bytes, beginning at position of the file.
 
virtual bool UnlockRange (uint32 position, uint32 count)
 Unlocks the range at the given Position.
 
virtual bool LockRange (uint64 position, uint64 count)
 Locks count bytes, beginning at position of the file.
 
virtual bool UnlockRange (uint64 position, uint64 count)
 32 Bit Only: Unlocks the range at the given Position.
 
bool GetStatus (TFileStatus &status) const
 Fills status with the current file status.
 
virtual uint8 readUint8 ()
 
virtual uint16 readUint16 ()
 
virtual uint32 readUint32 ()
 
virtual uint64 readUint64 ()
 
virtual float readFloat ()
 
virtual double readDouble ()
 
virtual TCHARreadString (tchar *)
 
virtual void writeUint8 (const uint8)
 
virtual void writeUint16 (const uint16)
 
virtual void writeUint32 (const uint32)
 
virtual void writeUint64 (const uint64)
 
virtual void writeFloat (const float)
 
virtual void writeDouble (const double)
 
virtual void writeString (const tchar *)
 

Additional Inherited Members

- Public Types inherited from owl::TFile
enum  TSeekDir { beg = 0 , cur = 1 , end = 2 }
 
enum  TOpenMode {
  ReadOnly = 0x0001 , WriteOnly = 0x0002 , ReadWrite = WriteOnly|ReadOnly , PermWrite = 0x0010 , PermRead = 0x0020 , PermReadWrite = PermWrite|PermRead , PermExclusive = 0x0040 , PermNone = 0x0080 , CreateNew = 0x0100 , CreateAlways = 0x0200 ,
  OpenExisting = 0x0400 , TruncateExist = 0x0800 , Text = 0x1000
}
 Open mode -> remapped into OS specific value internally. More...
 
enum  TAttribute { Normal = 0x00 , RdOnly = 0x01 , Hidden = 0x02 , System = 0x04 , Volume = 0x08 , Directory = 0x10 , Archive = 0x20 , Temporary = 0x40 }
 file attributes -> internally remapped into OS values More...
 
enum  TBinType { TypeChar , TypeShort , TypeLong , TypeFloat , TypeDouble , TypeLong64 , TypePoint , TypeRect }
 Binary data type enumerations. More...
 
- Static Public Member Functions inherited from owl::TFile
static uint ReadStruct (uint8 *readBuf, void *buffer, TBinField *fields, TByteOrderType type)
 Read binary structure from buffer.
 
static uint WriteStruct (uint8 *writeBuf, void *buffer, TBinField *fields, TByteOrderType type)
 Writes structures to buffer based on fields description.
 
static uint StructSize (TBinField *fields)
 Returns the number of bytes in a binary data structure.
 
- Protected Attributes inherited from owl::TFile
TFileHandleHandle
 Low-level C file handle.
 
bool ShouldClose
 Should C++ object close file on dtor.
 
uint8Buffer
 Buffer used with structure read/write.
 
uint BufSize
 Size of Buffer used with structure read/write.
 

Detailed Description

Definition at line 692 of file file.h.

Constructor & Destructor Documentation

◆ TStreamFile() [1/4]

owl::TStreamFile::TStreamFile ( )
inline

Definition at line 1279 of file file.h.

◆ TStreamFile() [2/4]

owl::TStreamFile::TStreamFile ( TStreamFile & file)

◆ TStreamFile() [3/4]

owl::TStreamFile::TStreamFile ( TStreamHandle * handle,
bool shouldClose )
inline

Definition at line 1282 of file file.h.

◆ TStreamFile() [4/4]

owl::TStreamFile::TStreamFile ( const tstring & filename,
const uint32 mode = ReadOnly|PermRead|OpenExisting )
inline

Definition at line 1286 of file file.h.

References Open().

◆ ~TStreamFile()

virtual owl::TStreamFile::~TStreamFile ( )
inlinevirtual

Definition at line 698 of file file.h.

Member Function Documentation

◆ Open()

bool owl::TStreamFile::Open ( const tstring & fileName,
const uint32 mode = ReadOnly|PermRead|OpenExisting )
virtual

Reimplemented from owl::TFile.

Definition at line 2118 of file file.cpp.

References FileNull, owl::TFile::Handle, owl::TFile::IsOpen(), and owl::TFileHandle::IsOpen().


The documentation for this class was generated from the following files: