Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXIO Class Reference

FXIO manipulates a handle to an abstract i/o device. More...

#include <FXIO.h>

Inheritance diagram for FX::FXIO:

FX::FXFile FX::FXPipe FX::FXSocket List of all members.

Public Types

enum  {
  OtherRead = 0x00004,
  OtherWrite = 0x00002,
  OtherExec = 0x00001,
  OtherReadWrite = 0x00006,
  OtherFull = 0x00007,
  GroupRead = 0x00020,
  GroupWrite = 0x00010,
  GroupExec = 0x00008,
  GroupReadWrite = 0x00030,
  GroupFull = 0x00038,
  OwnerRead = 0x00100,
  OwnerWrite = 0x00080,
  OwnerExec = 0x00040,
  OwnerReadWrite = 0x00180,
  OwnerFull = 0x001C0,
  Hidden = 0x00200,
  Directory = 0x00400,
  File = 0x00800,
  SymLink = 0x01000,
  SetUser = 0x02000,
  SetGroup = 0x04000,
  Sticky = 0x08000,
  Character = 0x10000,
  Block = 0x20000,
  Socket = 0x40000,
  Fifo = 0x80000
}
enum  {
  NoAccess = 0,
  ReadOnly = 1,
  WriteOnly = 2,
  ReadWrite = 3,
  Append = 4,
  Truncate = 8,
  Create = 16,
  Exclusive = 32,
  NonBlocking = 64,
  Reading = ReadOnly,
  Writing = ReadWrite|Create|Truncate
}
enum  {
  Begin = 0,
  Current = 1,
  End = 2
}

Public Member Functions

 FXIO ()
virtual bool open (FXInputHandle handle, FXuint mode)
virtual bool isOpen () const
FXuint mode () const
FXInputHandle handle () const
virtual void attach (FXInputHandle handle, FXuint mode)
virtual void detach ()
virtual FXlong position () const
virtual FXlong position (FXlong offset, FXuint from=FXIO::Begin)
virtual FXival readBlock (void *data, FXival count)
virtual FXival writeBlock (const void *data, FXival count)
virtual FXlong truncate (FXlong size)
virtual bool flush ()
virtual bool eof ()
virtual FXlong size ()
virtual bool close ()
virtual ~FXIO ()

Detailed Description

FXIO manipulates a handle to an abstract i/o device.

The various subclasses of FXIO perform i/o on files, sockets, pipes, and possibly other devices.


Member Enumeration Documentation

anonymous enum
 

File modes.

Enumeration values:
OtherRead  Permissions Others have read permission.
OtherWrite  Others have write permisson.
OtherExec  Others have execute permission.
OtherReadWrite  Others have read and write permission.
OtherFull  Others have full access.
GroupRead  Group has read permission.
GroupWrite  Group has write permission.
GroupExec  Group has execute permission.
GroupReadWrite  Group has read and write permission.
GroupFull  Group has full access.
OwnerRead  Owner has read permission.
OwnerWrite  Owner has write permission.
OwnerExec  Owner has execute permission.
OwnerReadWrite  Owner has read and write permission.
OwnerFull  Owner has full access Other flags.
Hidden  Hidden file.
Directory  Is directory.
File  Is regular file.
SymLink  Is symbolic link Special mode bits.
SetUser  Set user id.
SetGroup  Set group id.
Sticky  Sticky bit Device special files.
Character  Character device.
Block  Block device.
Socket  Socket device.
Fifo  Fifo device.

anonymous enum
 

Access modes.

Enumeration values:
NoAccess  Basic access options No access.
ReadOnly  Open for reading.
WriteOnly  Open for writing.
ReadWrite  Open for read and write.
Append  Open for append.
Truncate  Truncate to zero when writing.
Create  Create if it doesn't exist.
Exclusive  Fail if trying to create a file which already exists.
NonBlocking  Non-blocking i/o Convenience access options.
Reading  Normal options for reading.
Writing  Normal options for writing.

anonymous enum
 

Positioning modes.

Enumeration values:
Begin  Position from the begin (default).
Current  Position relative to current position.
End  Position from the end.


Constructor & Destructor Documentation

FX::FXIO::FXIO  ) 
 

Construct.

virtual FX::FXIO::~FXIO  )  [virtual]
 

Destroy and close.


Member Function Documentation

virtual bool FX::FXIO::open FXInputHandle  handle,
FXuint  mode
[virtual]
 

Open device with access mode and handle.

Reimplemented in FX::FXFile, FX::FXPipe, and FX::FXSocket.

virtual bool FX::FXIO::isOpen  )  const [virtual]
 

Return true if open.

FXuint FX::FXIO::mode  )  const [inline]
 

Return access mode.

FXInputHandle FX::FXIO::handle  )  const [inline]
 

Return handle.

virtual void FX::FXIO::attach FXInputHandle  handle,
FXuint  mode
[virtual]
 

Attach existing device handle.

virtual void FX::FXIO::detach  )  [virtual]
 

Detach device handle.

virtual FXlong FX::FXIO::position  )  const [virtual]
 

Get current file position.

Reimplemented in FX::FXFile.

virtual FXlong FX::FXIO::position FXlong  offset,
FXuint  from = FXIO::Begin
[virtual]
 

Change file position, returning new position from start.

Reimplemented in FX::FXFile.

virtual FXival FX::FXIO::readBlock void *  data,
FXival  count
[virtual]
 

Read block of bytes, returning number of bytes read.

Reimplemented in FX::FXFile, FX::FXPipe, and FX::FXSocket.

virtual FXival FX::FXIO::writeBlock const void *  data,
FXival  count
[virtual]
 

Write block of bytes, returning number of bytes written.

Reimplemented in FX::FXFile, FX::FXPipe, and FX::FXSocket.

virtual FXlong FX::FXIO::truncate FXlong  size  )  [virtual]
 

Truncate file.

Reimplemented in FX::FXFile.

virtual bool FX::FXIO::flush  )  [virtual]
 

Flush to disk.

Reimplemented in FX::FXFile.

virtual bool FX::FXIO::eof  )  [virtual]
 

Test if we're at the end.

Reimplemented in FX::FXFile.

virtual FXlong FX::FXIO::size  )  [virtual]
 

Return size of i/o device.

Reimplemented in FX::FXFile.

virtual bool FX::FXIO::close  )  [virtual]
 

Close handle.

Reimplemented in FX::FXFile, FX::FXPipe, and FX::FXSocket.

Copyright © 1997-2005 Jeroen van der Zijp