Ceylan::System::File Class Reference

Abstract file mother class, so that programs can always manipulate Ceylan::File instances, whereas per-platform specialized classes are actually used by the system. More...

#include <CeylanFile.h>

Inheritance diagram for Ceylan::System::File:

Inheritance graph
[legend]
Collaboration diagram for Ceylan::System::File:

Collaboration graph
[legend]

List of all members.

Public Types

enum  TextOutputFormat { rawText, html }
 Defines what text output formats for TextDisplayable instances are available. More...

Public Member Functions

virtual ~File () throw ()
 Destroys the file reference object, does not remove the file itself.
const std::string & getName () const
 Returns this file's name.
virtual bool isOpen () const =0
 Returns true iff this file is open.
virtual bool close ()=0
 Closes the file for read/write actions.
virtual void saveAs (const std::string &newName)=0
 Saves the file under a new name.
virtual void lockForReading () const
 Locks the file for reading.
virtual void unlockForReading () const
 Unlocks the file for reading.
virtual void lockForWriting () const
 Locks the file for writing.
virtual void unlockForWriting () const
 Unlocks the file for writing.
virtual bool isLocked () const
 Tells whether the file is locked.
virtual Size size () const
 Returns the file size, in bytes.
virtual time_t getLastChangeTime () const =0
 Returns the latest change time of this standard file.
virtual Size read (Ceylan::Byte *buffer, Size maxLength)=0
 Reads up to maxLength bytes from this file to specified buffer.
virtual void readExactLength (Ceylan::Byte *buffer, Size exactLength)
 Reads exactly exactLength bytes from this file to specified buffer.
virtual bool hasAvailableData () const
 Tells whether there is data available on input.
virtual Size write (const std::string &message)=0
 Writes message to this file.
virtual Size write (const Ceylan::Byte *buffer, Size maxLength)=0
 Writes up to maxLength bytes from the specified buffer to this file.
virtual Position tell ()=0
 Determines current position within this file.
virtual void seek (Position targetPosition)=0
 Seeks to specified position within this file.
virtual void open (OpeningFlag openFlag=CreateToWriteBinary, PermissionFlag permissionFlag=OwnerReadWrite)
 Tries to open file, useful if it was created with the DoNotOpen open flag.
virtual void remove ()
 Removes this file from disk.
virtual StreamID getStreamID () const =0
 Returns this file's ID.
virtual StreamID getInputStreamID () const
 Returns this file descriptor for this file, or -1 if the file descriptor feature is not available.
virtual StreamID getOutputStreamID () const
 Returns this file descriptor for this file, or -1 if the file descriptor feature is not available.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const
 Returns an user-friendly description of the state of this object.
bool isSelected () const
 Tells if the stream has data to read.
bool isFaulty () const
virtual void clearInput ()
 Clears the input stream.
virtual Ceylan::Sint8 readSint8 ()
 Returns a Ceylan::Sint8 read from this input stream.
virtual Ceylan::Uint8 readUint8 ()
 Returns a Ceylan::Uint8 read from this input stream.
virtual Ceylan::Sint16 readSint16 ()
 Returns a Ceylan::Sint16 read from this input stream.
virtual Ceylan::Uint16 readUint16 ()
 Returns a Ceylan::Uint16 read from this input stream.
virtual Ceylan::Sint32 readSint32 ()
 Returns a Ceylan::Sint32 read from this input stream.
virtual Ceylan::Uint32 readUint32 ()
 Returns a Ceylan::Uint32 read from this input stream.
virtual Ceylan::Float32 readFloat32 ()
 Returns a Ceylan::Float32 read from this input stream.
virtual Ceylan::Float64 readFloat64 ()
 Returns a Ceylan::Float64 read from this input stream.
virtual void readString (std::string &result)
 Reads a string from this input stream, and stores it in the specified string.
virtual void skipWhitespaces (Ceylan::Uint8 &firstNonSpace)
 Reads from this input stream as long as there are whitespaces to be read.
bool isBlocking () const
 Tells whether this stream is in blocking mode (if true), or in non-blocking mode (if false).
virtual void writeSint8 (Ceylan::Sint8 toWrite)
 Writes a Ceylan::Sint8 to this output stream.
virtual void writeUint8 (Ceylan::Uint8 toWrite)
 Writes a Ceylan::Uint8 to this output stream.
virtual void writeSint16 (Ceylan::Sint16 toWrite)
 Writes a Ceylan::Sint16 to this output stream.
virtual void writeUint16 (Ceylan::Uint16 toWrite)
 Writes a Ceylan::Uint16 to this output stream.
virtual void writeSint32 (Ceylan::Sint32 toWrite)
 Writes a Ceylan::Sint32 to this output stream.
virtual void writeUint32 (Ceylan::Uint32 toWrite)
 Writes a Ceylan::Uint32 to this output stream.
virtual void writeFloat32 (Ceylan::Float32 toWrite)
 Writes a Ceylan::Uint32 to this output stream.
virtual void writeFloat64 (Ceylan::Float64 toWrite)
 Writes a Ceylan::Uint32 to this output stream.
virtual void writeString (const std::string &toWrite)
 Writes a string to this output stream.

Static Public Member Functions

static bool ExistsAsFileOrSymbolicLink (const std::string &filename)
 Tells whether the regular file or symbolic link filename exists (and is not a directory).
static bool Exists (const std::string &filename)
 Tells whether the regular file or symbolic link filename exists (and is not a directory).
static void Remove (const std::string &filename)
 Removes the file or symbolic link from the filesystem.
static void Move (const std::string &sourceFilename, const std::string &targetFilename)
 Moves specified file on filesystem.
static void Copy (const std::string &sourceFilename, const std::string &targetFilename)
 Copies the file on filesystem.
static Size GetSize (const std::string &filename)
 Returns the size, in bytes, of the specified file.
static time_t GetLastChangeTime (const std::string &filename)
 Returns the last change time of the specified file.
static std::string TransformIntoValidFilename (const std::string &rawFilename)
 Takes specified rawFilename and tries to transform it so that the result should be a valid name, from the filesystem's point of view.
static void Touch (const std::string &filename)
 Updates the last access and modification times of specified file.
static bool Diff (const std::string &firstFilename, const std::string &secondFilename)
 Tells whether the two specified files have exactly the same content (byte-wise).
static FileCreate (const std::string &filename, OpeningFlag createFlag=CreateToWriteBinary, PermissionFlag permissionFlag=OwnerReadWrite)
static FileOpen (const std::string &filename, OpeningFlag openFlag=OpenToReadBinary)
static Ceylan::Uint16 Select (std::list< InputStream * > &is)
 Blocks the calling thread until bytes become available on one or more streams in is.
static Ceylan::Uint16 Test (std::list< InputStream * > &is)
 Checks whether bytes become available on one or more streams in is.
static bool Close (FileDescriptor &fd)
 Closes and zeroes the specified file descriptor.
static const std::string ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high)
 Returns a user-friendly description of this list of pointers to text displayable instances.
static TextOutputFormat GetOutputFormat ()
 Returns the current overall text format to be used by TextDisplayable instances.
static void SetOutputFormat (TextOutputFormat newOutputFormat)
 Sets the current overall text format to be used by TextDisplayable instances.

Static Public Attributes

static const OpeningFlag Read = 0x0001
static const OpeningFlag Write = 0x0002
static const OpeningFlag CreateFile = 0x0004
 Creates the file, if it does not exist.
static const OpeningFlag TruncateFile = 0x0008
static const OpeningFlag AppendFile = 0x0010
static const OpeningFlag Binary = 0x0020
static const OpeningFlag DoNotOpen = 0xffff
static const OpeningFlag CreateToWriteBinary
static const OpeningFlag OpenToReadBinary = Read | Binary
static const OpeningFlag NonBlocking = 0x0040
 Opens the file in non-blocking mode, when possible.
static const OpeningFlag Synchronous = 0x0080
 Opens the file in synchronous mode.
static const PermissionFlag OwnerRead = 0x0001
 Allows its owner to read the created file.
static const PermissionFlag OwnerWrite = 0x0002
 Allows its owner to write to the created file.
static const PermissionFlag OwnerExec = 0x0004
 Allows its owner to execute the created file.
static const PermissionFlag OwnerReadWrite
 Provided for convenience: OwnerReadWrite = OwnerRead | OwnerWrite.
static const PermissionFlag OwnerReadWriteExec
 Provided for convenience: OwnerReadWriteExec = OwnerReadWrite | OwnerExec.
static const PermissionFlag GroupRead = 0x0008
 Allows the group to read the created file.
static const PermissionFlag GroupWrite = 0x0010
 Allows the group to write the created file.
static const PermissionFlag GroupExec = 0x0020
 Allows the group to execute the created file.
static const PermissionFlag GroupReadWrite
 Provided for convenience: GroupReadWrite = GroupRead | GroupWrite.
static const PermissionFlag GroupReadWriteExec
 Provided for convenience: GroupReadWriteExec = GroupReadWrite | GroupExec.
static const PermissionFlag OthersRead = 0x0040
 Allows the others (not owner, not group) to read the created file.
static const PermissionFlag OthersWrite = 0x0080
 Allows the others (not owner, not group) to write to the created file.
static const PermissionFlag OthersExec = 0x0100
 Allows the others (not owner, not group) to execute the created file.
static const PermissionFlag OthersReadWrite
 Provided for convenience: OthersReadWrite = OthersRead | OthersWrite.
static const PermissionFlag OthersReadWriteExec
 Provided for convenience: OthersReadWriteExec = OthersReadWrite | OthersExec.
static const Size UsualBufferSize = 10240
 Describes buffer size for usual I/O operations.
static const Size BigBufferSize = 1<<19
 Describes buffer size for significant I/O operations.

Protected Member Functions

 File (const std::string &name, OpeningFlag openFlag=CreateToWriteBinary, PermissionFlag permissionFlag=OwnerReadWrite)
 Constructs a file reference object.
virtual FileSystemManagergetCorrespondingFileSystemManager () const =0
 Returns the filesystem manager that corresponds to the actual File child class.
virtual void reopen ()=0
 Tries to reopen file.
virtual std::string interpretState () const =0
 Interprets the current state of this file.
virtual void setSelected (bool newStatus)
 Used to set the selection status of this stream.
void setFaulty (bool newFaultyState=true)
 Sets the faulty state of this stream.
virtual void setStreamID (StreamID newInputStreamID)
 Sets this input stream's unique ID.
virtual void setBlocking (bool newStatus)
 Sets the blocking mode of this stream.

Static Protected Member Functions

static FileSystemManagerGetCorrespondingFileSystemManager ()
 Returns the filesystem manager that should be used by File static methods, which is the default manager.

Protected Attributes

std::string _name
 Name of the file.
OpeningFlag _openFlag
 Flags used for opening.
PermissionFlag _permissions
 Permissions used for opening.
bool _lockedForReading: 1
 Bit field for access locks.
bool _lockedForWriting: 1
bool _isBlocking
 Stores whether the stream is in blocking mode.

Static Protected Attributes

static TextOutputFormat _OutputFormat = rawText
 The text format to be used currently by TextDisplayable instances.

Private Member Functions

 File (const File &source)
 Copy constructor made private to ensure that it will be never called.
Fileoperator= (const File &source)
 Assignment operator made private to ensure that it will be never called.


Detailed Description

Abstract file mother class, so that programs can always manipulate Ceylan::File instances, whereas per-platform specialized classes are actually used by the system.

Actual files should be created and opened with respectively the File::Create and File::Open factories. If it allows to fully hide the actual child class being used, an abstract File class hinders from using such File instances as automatic variables: 'File myFile(...)' cannot exist, thus 'File & myFile = File::Create(...)' as to be used instead. The drawback of this approach is that the life-cycle of the instance has to be managed explicitly, with for example a 'delete &myFile' to be placed before each return or throw statement (no automatic variable can be used directly for an abstract file). To restore file handling through automatic variable (which are automatically deallocated in the relevant cases), the Holder class is available. It should be used that way: 'Holder<File> myFileHolder( File::Open(...) ) ;', then 'myFileHolder.get().lockForWriting()' or, preferably, 'myFileHolder->lockForWriting()' can be used.

See also:
Directory, FileSystemManager for other file-related operations.
Note:
Depending on the platform support, some primitives may not be available, which results in FileException being raised whenever called. The reason for that is either the underlying platform is unable to provide these features, or the Ceylan porting effort did not manage them for the moment.
See also:
following feature symbols to spot the actual support beforehand:
Note:
To specify all exceptions that may be thrown by file manipulation, use System::SystemException, the closest mother class of FileException, InputStream::ReadFailedException, OutputStream::WriteFailedException, Stream::CloseException.

Definition at line 197 of file CeylanFile.h.


Member Enumeration Documentation

Defines what text output formats for TextDisplayable instances are available.

Enumerator:
rawText 
html 

Definition at line 124 of file CeylanTextDisplayable.h.


Constructor & Destructor Documentation

File::~File (  )  throw () [virtual]

Destroys the file reference object, does not remove the file itself.

Note:
Will close automatically the file if needed.
To remove the file itself (from disk), use Remove.

See also:
Remove
This destructor has to be public, so that instances created from factories can be deleted by the caller.

Definition at line 309 of file CeylanFile.cc.

File::File ( const std::string &  name,
OpeningFlag  openFlag = CreateToWriteBinary,
PermissionFlag  permissionFlag = OwnerReadWrite 
) [explicit, protected]

Constructs a file reference object.

Note:
Not to be called directly, use factories (File:Create, File::Open instead).
Parameters:
name the name of the file.
openFlag the flag describing the opening mode.
permissionFlag the flag describing the requested permissions, if this file is to be created. Otherwise (if the file already exists), this parameter is ignored.
See also:
OpeningFlag, PermissionFlag
Note:
If not specifically set, the file is opened in text mode: one should not forget to add the Binary flag. The mistake can be detected when basic read() returns less than the requested size, or when readExactLength() never terminates.
Exceptions:
FileException if the operation failed.

Definition at line 549 of file CeylanFile.cc.

Ceylan::System::File::File ( const File source  )  [private]

Copy constructor made private to ensure that it will be never called.

The compiler should complain whenever this undefined constructor is called, implicitly or not.


Member Function Documentation

void InputStream::clearInput (  )  [virtual, inherited]

Clears the input stream.

Exceptions:
InputStream::ReadFailedException if the operation failed.

Reimplemented in Ceylan::System::Pipe.

Definition at line 179 of file CeylanInputStream.cc.

References dataUtils::b, Ceylan::System::InputStream::hasAvailableData(), and Ceylan::System::InputStream::read().

bool Stream::Close ( FileDescriptor fd  )  [static, inherited]

Closes and zeroes the specified file descriptor.

It is passed by address so that this function can set it to zero on successful close.

Returns:
true iff an operation had to be performed.
Exceptions:
CloseException if the close operation failed.

Definition at line 114 of file CeylanStream.cc.

References Ceylan::System::Stream::close(), generalUtils::false, Ceylan::toString(), and generalUtils::true.

Referenced by Ceylan::System::StandardFile::close(), Ceylan::Network::Socket::close(), Ceylan::System::Pipe::close(), and Ceylan::System::LibfatFile::close().

virtual bool Ceylan::System::File::close (  )  [pure virtual]

Closes the file for read/write actions.

Returns:
true iff an operation had to be performed.
Exceptions:
Stream::CloseException if the close operation failed.

Implements Ceylan::System::Stream.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

Referenced by Ceylan::System::getSchedulingGranularity(), remove(), and Ceylan::XML::XMLParser::saveToFile().

void File::Copy ( const std::string &  sourceFilename,
const std::string &  targetFilename 
) [static]

Copies the file on filesystem.

Parameters:
sourceFilename the filename of the file to be copied.
targetFilename the new filename of the copied file.
Exceptions:
CopyFailed if the operation failed or is not supported on this platform, or FileDelegatingException if the relevant filesystem manager could not be retrieved.

Definition at line 213 of file CeylanFile.cc.

References Ceylan::System::FileSystemManager::copyFile(), and GetCorrespondingFileSystemManager().

File & File::Create ( const std::string &  filename,
OpeningFlag  createFlag = CreateToWriteBinary,
PermissionFlag  permissionFlag = OwnerReadWrite 
) [static]

bool File::Diff ( const std::string &  firstFilename,
const std::string &  secondFilename 
) [static]

Tells whether the two specified files have exactly the same content (byte-wise).

Parameters:
firstFilename the filename of the first file to compare.
secondFilename the filename of the second file to compare.
Returns:
true iff these files exists and have exactly the same content.
Exceptions:
DiffFailed if the operation failed or is not supported on this platform, or FileDelegatingException if the relevant filesystem manager could not be retrieved.

Definition at line 270 of file CeylanFile.cc.

References Ceylan::System::FileSystemManager::diff(), and GetCorrespondingFileSystemManager().

bool File::Exists ( const std::string &  filename  )  [static]

Tells whether the regular file or symbolic link filename exists (and is not a directory).

Parameters:
filename the filename to look-up.
This method will work as expected whether the symbolic link feature is enabled or not.

Exceptions:
FileException,including FileLookupFailed if the operation failed (existence test failed with no answer) or is not supported on this platform, or FileDelegatingException if the relevant filesystem manager could not be retrieved.
Note:
This method is an alias for ExistsAsFileOrSymbolicLink.

Definition at line 182 of file CeylanFile.cc.

References ExistsAsFileOrSymbolicLink().

bool File::ExistsAsFileOrSymbolicLink ( const std::string &  filename  )  [static]

Tells whether the regular file or symbolic link filename exists (and is not a directory).

Parameters:
filename the filename to look-up.
This method will work as expected whether the symbolic link feature is enabled or not.

Exceptions:
FileException,including FileLookupFailed if the operation failed (existence test failed with no answer) or is not supported on this platform, or FileDelegatingException if the relevant filesystem manager could not be retrieved.

Definition at line 171 of file CeylanFile.cc.

References Ceylan::System::FileSystemManager::existsAsFileOrSymbolicLink(), and GetCorrespondingFileSystemManager().

Referenced by Exists(), and Ceylan::System::FileLocator::find().

FileSystemManager & File::GetCorrespondingFileSystemManager (  )  [static, protected]

Returns the filesystem manager that should be used by File static methods, which is the default manager.

Returns:
the default filesystem manager.
Exceptions:
FileDelegatingException if the operation failed.

Definition at line 573 of file CeylanFile.cc.

References dataUtils::e, Ceylan::System::FileSystemManager::GetAnyDefaultFileSystemManager(), and Ceylan::Exception::toString().

Referenced by Copy(), Create(), Diff(), ExistsAsFileOrSymbolicLink(), GetLastChangeTime(), GetSize(), Move(), Open(), Remove(), Touch(), and TransformIntoValidFilename().

virtual FileSystemManager& Ceylan::System::File::getCorrespondingFileSystemManager (  )  const [protected, pure virtual]

Returns the filesystem manager that corresponds to the actual File child class.

Exceptions:
FileDelegatingException if the operation failed.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

Referenced by remove(), and size().

StreamID File::getInputStreamID (  )  const [virtual]

Returns this file descriptor for this file, or -1 if the file descriptor feature is not available.

Implements Ceylan::System::InputStream.

Definition at line 515 of file CeylanFile.cc.

References getStreamID().

virtual time_t Ceylan::System::File::getLastChangeTime (  )  const [pure virtual]

Returns the latest change time of this standard file.

Exceptions:
FileLastChangeTimeRequestFailed if the operation failed, or is not supported.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

time_t File::GetLastChangeTime ( const std::string &  filename  )  [static]

Returns the last change time of the specified file.

Parameters:
filename the filename whose last change time is searched.
Exceptions:
FileLastChangeTimeRequestFailed if the operation failed or is not supported on this platform, or FileDelegatingException if the relevant filesystem manager could not be retrieved.

Definition at line 234 of file CeylanFile.cc.

References GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::getLastChangeTimeFile().

const std::string & File::getName (  )  const

Returns this file's name.

Definition at line 333 of file CeylanFile.cc.

References _name.

TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat (  )  [static, inherited]

StreamID File::getOutputStreamID (  )  const [virtual]

Returns this file descriptor for this file, or -1 if the file descriptor feature is not available.

Implements Ceylan::System::OutputStream.

Definition at line 524 of file CeylanFile.cc.

References getStreamID().

Size File::GetSize ( const std::string &  filename  )  [static]

Returns the size, in bytes, of the specified file.

Parameters:
filename the filename whose size is searched.
Exceptions:
FileSizeRequestFailed if the operation failed or is not supported on this platform, or FileDelegatingException if the relevant filesystem manager could not be retrieved.

Definition at line 224 of file CeylanFile.cc.

References GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::getSize().

virtual StreamID Ceylan::System::File::getStreamID (  )  const [pure virtual]

Returns this file's ID.

Returns:
the StreamID or -1 if nothing appropriate can be returned with the available features.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

Referenced by getInputStreamID(), and getOutputStreamID().

bool File::hasAvailableData (  )  const [virtual]

Tells whether there is data available on input.

This methods returns always true for files.

Implements Ceylan::System::InputStream.

Definition at line 467 of file CeylanFile.cc.

References generalUtils::true.

virtual std::string Ceylan::System::File::interpretState (  )  const [protected, pure virtual]

Interprets the current state of this file.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

bool Stream::isBlocking (  )  const [inherited]

Tells whether this stream is in blocking mode (if true), or in non-blocking mode (if false).

Definition at line 93 of file CeylanStream.cc.

References Ceylan::System::Stream::_isBlocking.

Referenced by Ceylan::Network::StreamSocket::createSocket(), and Ceylan::Network::Socket::toString().

bool InputStream::isFaulty (  )  const [inherited]

bool File::isLocked (  )  const [virtual]

Tells whether the file is locked.

Returns:
true if the lock feature is available and the file is locked, otherwise returns false, i.e. if the file is locked or if the lock feature is not available.
This default implementation, meant to be overriden, returns always false.

Reimplemented in Ceylan::System::StandardFile.

Definition at line 395 of file CeylanFile.cc.

References generalUtils::false.

virtual bool Ceylan::System::File::isOpen (  )  const [pure virtual]

Returns true iff this file is open.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

bool InputStream::isSelected (  )  const [inherited]

Tells if the stream has data to read.

Definition at line 122 of file CeylanInputStream.cc.

References Ceylan::System::InputStream::_isSelected.

Referenced by Ceylan::System::InputStream::toString().

void File::lockForReading (  )  const [virtual]

Locks the file for reading.

Exceptions:
FileReadLockingFailed if the operation failed or if the file lock feature is not available.
This default implementation, meant to be overriden, throws this exception if called.

Reimplemented in Ceylan::System::StandardFile.

Definition at line 347 of file CeylanFile.cc.

void File::lockForWriting (  )  const [virtual]

Locks the file for writing.

Exceptions:
FileWriteLockingFailed if the operation failed or if the file lock feature is not available.
This default implementation, meant to be overriden, throws this exception if called.

Reimplemented in Ceylan::System::StandardFile.

Definition at line 371 of file CeylanFile.cc.

void File::Move ( const std::string &  sourceFilename,
const std::string &  targetFilename 
) [static]

Moves specified file on filesystem.

A special case of file moving is file renaming.

Parameters:
sourceFilename the filename of the file to be moved.
targetFilename the target filename of the moved file.
Exceptions:
FileException,including FileMoveFailed if the operation failed or is not supported on this platform, or FileDelegatingException if the relevant filesystem manager could not be retrieved.

Definition at line 202 of file CeylanFile.cc.

References GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::moveFile().

void File::open ( OpeningFlag  openFlag = CreateToWriteBinary,
PermissionFlag  permissionFlag = OwnerReadWrite 
) [virtual]

Tries to open file, useful if it was created with the DoNotOpen open flag.

Exceptions:
FileException,including FileAlreadyOpened if file was already opened, and FileOpeningFailed if an error occurred, if the operation failed or is not supported.

Definition at line 477 of file CeylanFile.cc.

References _name, _openFlag, _permissions, DoNotOpen, and reopen().

Referenced by Ceylan::System::StandardFile::reopen(), and Ceylan::System::LibfatFile::reopen().

File & File::Open ( const std::string &  filename,
OpeningFlag  openFlag = OpenToReadBinary 
) [static]

File& Ceylan::System::File::operator= ( const File source  )  [private]

Assignment operator made private to ensure that it will be never called.

The compiler should complain whenever this undefined operator is called, implicitly or not.

virtual Size Ceylan::System::File::read ( Ceylan::Byte buffer,
Size  maxLength 
) [pure virtual]

Reads up to maxLength bytes from this file to specified buffer.

Parameters:
buffer the buffer where to store read bytes. Its size must be at least maxLength bytes.
maxLength the maximum number of bytes that should be read.
Returns:
The number of bytes actually read, which should be maxLength or lower.
Exceptions:
InputStream::ReadFailedException if a read error occurred. Note that this is not a child class of FileException, as it comes from an inherited interface.
Note:
May be unable to read the full content of a file if the file was open without the 'Binary' flag (hence in text mode) and if in the file content it occurs that accidentally some bytes form an 'end of file' marker (despite some bytes remain to be read past this marker).

Reimplemented from Ceylan::System::InputStream.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

Referenced by readExactLength().

void File::readExactLength ( Ceylan::Byte buffer,
Size  exactLength 
) [virtual]

Reads exactly exactLength bytes from this file to specified buffer.

Parameters:
buffer the buffer where to store read bytes. Its size must be at least maxLength bytes.
maxLength the maximum number of bytes that should be read.
Returns:
The number of bytes actually read, which should be maxLength or lower.
Exceptions:
ReadFailed if a read error occurred.
Note:
May never terminate if the file was open without the 'Binary' flag (hence in text mode) and if in the file content it occurs that accidentally some bytes form an 'end of file' marker (despite some bytes remain to be read past this marker).

Definition at line 416 of file CeylanFile.cc.

References dataUtils::e, read(), Ceylan::Exception::toString(), and Ceylan::toString().

Ceylan::Float32 InputStream::readFloat32 (  )  [virtual, inherited]

Returns a Ceylan::Float32 read from this input stream.

Exceptions:
ReadFailedException in case a system error occured, or EOFException is a protocol error occured, with fewer bytes available than expected.

Definition at line 356 of file CeylanInputStream.cc.

References ceylan_bswap_32, and Ceylan::System::InputStream::read().

Referenced by Ceylan::Middleware::LightWeightMarshaller::decodeFloat32().

Ceylan::Float64 InputStream::readFloat64 (  )  [virtual, inherited]

Returns a Ceylan::Float64 read from this input stream.

Exceptions:
ReadFailedException in case a system error occured, or EOFException is a protocol error occured, with fewer bytes available than expected.

Definition at line 392 of file CeylanInputStream.cc.

References Ceylan::byteswap(), ceylan_bswap_64, and Ceylan::System::InputStream::read().

Referenced by Ceylan::Middleware::LightWeightMarshaller::decodeFloat64().

Ceylan::Sint16 InputStream::readSint16 (  )  [virtual, inherited]

Returns a Ceylan::Sint16 read from this input stream.

Exceptions:
ReadFailedException in case a system error occured, or EOFException is a protocol error occured, with fewer bytes available than expected.

Definition at line 239 of file CeylanInputStream.cc.

References ceylan_bswap_16, and Ceylan::System::InputStream::read().

Referenced by Ceylan::Middleware::LightWeightMarshaller::decodeSint16().

Ceylan::Sint32 InputStream::readSint32 (  )  [virtual, inherited]

Returns a Ceylan::Sint32 read from this input stream.

Exceptions:
ReadFailedException in case a system error occured, or EOFException is a protocol error occured, with fewer bytes available than expected.

Definition at line 298 of file CeylanInputStream.cc.

References ceylan_bswap_32, and Ceylan::System::InputStream::read().

Referenced by Ceylan::Middleware::LightWeightMarshaller::decodeSint32().

Ceylan::Sint8 InputStream::readSint8 (  )  [virtual, inherited]

Returns a Ceylan::Sint8 read from this input stream.

Exceptions:
ReadFailedException in case a system error occured, or EOFException is a protocol error occured, with fewer bytes available than expected.

Definition at line 203 of file CeylanInputStream.cc.

References Ceylan::System::InputStream::read().

Referenced by Ceylan::Middleware::LightWeightMarshaller::decodeSint8().

void InputStream::readString ( std::string &  result  )  [virtual, inherited]

Reads a string from this input stream, and stores it in the specified string.

Note:
Read strings can have no more than 65535 characters.
Parameters:
result the string to fill from this input stream.
Exceptions:
ReadFailedException in case a system error occured, or EOFException is a protocol error occured, with fewer bytes available than expected.

Definition at line 437 of file CeylanInputStream.cc.

References Ceylan::System::InputStream::read(), Ceylan::System::InputStream::readUint16(), and Ceylan::toString().

Referenced by Ceylan::Middleware::LightWeightMarshaller::decodeString().

Ceylan::Uint16 InputStream::readUint16 (  )  [virtual, inherited]

Returns a Ceylan::Uint16 read from this input stream.

Exceptions:
ReadFailedException in case a system error occured, or EOFException is a protocol error occured, with fewer bytes available than expected.

Definition at line 268 of file CeylanInputStream.cc.

References ceylan_bswap_16, and Ceylan::System::InputStream::read().

Referenced by Ceylan::Middleware::LightWeightMarshaller::decodeUint16(), and Ceylan::System::InputStream::readString().

Ceylan::Uint32 InputStream::readUint32 (  )  [virtual, inherited]

Returns a Ceylan::Uint32 read from this input stream.

Exceptions:
ReadFailedException in case a system error occured, or EOFException is a protocol error occured, with fewer bytes available than expected.

Definition at line 327 of file CeylanInputStream.cc.

References ceylan_bswap_32, and Ceylan::System::InputStream::read().

Referenced by Ceylan::Middleware::LightWeightMarshaller::decodeUint32().

Ceylan::Uint8 InputStream::readUint8 (  )  [virtual, inherited]

void File::remove (  )  [virtual]

Removes this file from disk.

Closes it if necessary. No other operation should be performed afterwards on that file.

Exceptions:
FileRemoveFailed if the operation failed or is not supported on this platform, and FileDelegatingException if the corresponding filesystem manager could not be used.

Definition at line 493 of file CeylanFile.cc.

References _name, close(), dataUtils::e, getCorrespondingFileSystemManager(), Ceylan::System::FileSystemManager::removeFile(), and Ceylan::Exception::toString().

void File::Remove ( const std::string &  filename  )  [static]

Removes the file or symbolic link from the filesystem.

Parameters:
filename the filename to remove.
Exceptions:
FileException,including FileRemoveFailed if the operation failed or is not supported on this platform, or FileDelegatingException if the relevant filesystem manager could not be retrieved.

Definition at line 192 of file CeylanFile.cc.

References GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::removeFile().

virtual void Ceylan::System::File::reopen (  )  [protected, pure virtual]

Tries to reopen file.

Exceptions:
FileOpeningFailed if the operation failed.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

Referenced by open().

virtual void Ceylan::System::File::saveAs ( const std::string &  newName  )  [pure virtual]

Saves the file under a new name.

Parameters:
newName the name of the newly copied file.
Exceptions:
FileException if the operation failed.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

virtual void Ceylan::System::File::seek ( Position  targetPosition  )  [pure virtual]

Seeks to specified position within this file.

Parameters:
targetPosition this position corresponds to the number of bytes from start of file to seek to.
Exceptions:
FileException if the operation failed.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

Ceylan::Uint16 InputStream::Select ( std::list< InputStream * > &  is  )  [static, inherited]

Blocks the calling thread until bytes become available on one or more streams in is.

To see which are selected, use the isSelected method.

Returns:
the number of selected streams.
See also:
the non-blocking version, Test.
Exceptions:
SelectFailedException if the operation failed, for example if the file descriptor feature is not available on this platform.

Definition at line 534 of file CeylanInputStream.cc.

References Ceylan::System::explainError(), Ceylan::Network::explainSocketError(), Ceylan::System::getError(), Ceylan::Network::getSocketError(), Ceylan::System::Thread::Sleep(), and Ceylan::toString().

Referenced by Ceylan::Network::MultiplexedServerStreamSocket::run().

void Stream::setBlocking ( bool  newStatus  )  [protected, virtual, inherited]

Sets the blocking mode of this stream.

Parameters:
newStatus if true, sets the stream in blocking mode, if false set to non-blocking mode. If the stream is already in the target state, nothing is done.
Exceptions:
NonBlockingNotSupportedException if the operation failed or is not supported.
Note:
This default implementation always raises its exception, streams that supports non-blocking access have to override it.

Reimplemented in Ceylan::Network::Socket, and Ceylan::Network::StreamSocket.

Definition at line 175 of file CeylanStream.cc.

void InputStream::setFaulty ( bool  newFaultyState = true  )  [protected, inherited]

Sets the faulty state of this stream.

Parameters:
newFaultyState the new faulty state.

Definition at line 1004 of file CeylanInputStream.cc.

References Ceylan::System::InputStream::_isFaulty.

Referenced by Ceylan::Network::MultiplexedServerStreamSocket::run().

void TextDisplayable::SetOutputFormat ( TextOutputFormat  newOutputFormat  )  [static, inherited]

Sets the current overall text format to be used by TextDisplayable instances.

Parameters:
newOutputFormat the new output format.

Definition at line 72 of file CeylanTextDisplayable.cc.

References Ceylan::TextDisplayable::_OutputFormat.

Referenced by Ceylan::Log::LogHolder::LogHolder().

void InputStream::setSelected ( bool  newStatus  )  [protected, virtual, inherited]

void InputStream::setStreamID ( StreamID  newInputStreamID  )  [protected, virtual, inherited]

Sets this input stream's unique ID.

Exceptions:
InputStreamException in all cases as long as not specifically overriden.

Definition at line 1013 of file CeylanInputStream.cc.

Size File::size (  )  const [virtual]

Returns the file size, in bytes.

See also:
GetSize
Exceptions:
FileException,including FileLookupFailed if the file metadata could not be accessed or if the operation is not supported on this platform, and FileDelegatingException if the corresponding filesystem manager could not be used as expected.

Definition at line 406 of file CeylanFile.cc.

References _name, getCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::getSize().

Referenced by Ceylan::System::StandardFile::serialize(), and Ceylan::System::LibfatFile::serialize().

void InputStream::skipWhitespaces ( Ceylan::Uint8 firstNonSpace  )  [virtual, inherited]

Reads from this input stream as long as there are whitespaces to be read.

Parameters:
firstNonSpace the variable which will be set by this method to the value of the first non-whitespace character that is read.

Definition at line 516 of file CeylanInputStream.cc.

References Ceylan::isWhitespace(), and Ceylan::System::InputStream::readUint8().

Referenced by Ceylan::XML::XMLParser::handleNextElement().

virtual Position Ceylan::System::File::tell (  )  [pure virtual]

Determines current position within this file.

Returns:
offset in bytes from start of file.
Exceptions:
FileException if the operation failed.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

Ceylan::Uint16 InputStream::Test ( std::list< InputStream * > &  is  )  [static, inherited]

Checks whether bytes become available on one or more streams in is.

To see which are selected, use the isSelected method.

This method returns always immediatly.

Returns:
the number of selected streams.
See also:
the blocking version, Select.
Exceptions:
SelectFailedException if the operation failed, for example if the file descriptor feature is not available on this platform.

Definition at line 863 of file CeylanInputStream.cc.

References Ceylan::System::explainError(), and Ceylan::System::getError().

const std::string TextDisplayable::ToString ( std::list< TextDisplayable * >  displayables,
Ceylan::VerbosityLevels  level = Ceylan::high 
) [static, inherited]

Returns a user-friendly description of this list of pointers to text displayable instances.

Parameters:
displayables a list of pointers to TextDisplayable instances/
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
toString, Ceylan::VerbosityLevels

Definition at line 45 of file CeylanTextDisplayable.cc.

References Ceylan::formatStringList().

const std::string File::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const [virtual]

Returns an user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
TextDisplayable

Reimplemented from Ceylan::System::InputOutputStream.

Reimplemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

Definition at line 533 of file CeylanFile.cc.

References _name.

void File::Touch ( const std::string &  filename  )  [static]

Updates the last access and modification times of specified file.

This is not expected to work for directories.

Parameters:
filename the filename of the file whose times must be updated.
Note:
On contrary to the UNIX command touch, if the specified file does not exist, it will not be created. A TouchFailed exception would be raised instead.
See also:
File::Create to create empty files.
Exceptions:
TouchFailed if the operation failed or is not supported on this platform, or FileDelegatingException if the relevant filesystem manager could not be retrieved.

Definition at line 260 of file CeylanFile.cc.

References GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::touch().

string File::TransformIntoValidFilename ( const std::string &  rawFilename  )  [static]

Takes specified rawFilename and tries to transform it so that the result should be a valid name, from the filesystem's point of view.

Parameters:
rawFilename the filename to convert
Returns:
the converted filename

Definition at line 249 of file CeylanFile.cc.

References GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::transformIntoValidFilename().

void File::unlockForReading (  )  const [virtual]

Unlocks the file for reading.

Exceptions:
FileReadUnlockingFailed if the operation failed or if the file lock feature is not available.
This default implementation, meant to be overriden, throws this exception if called.

Reimplemented in Ceylan::System::StandardFile.

Definition at line 359 of file CeylanFile.cc.

void File::unlockForWriting (  )  const [virtual]

Unlocks the file for writing.

Exceptions:
FileWriteUnlockingFailed if the operation failed or if the file lock feature is not available.
This default implementation, meant to be overriden, throws this exception if called.

Reimplemented in Ceylan::System::StandardFile.

Definition at line 383 of file CeylanFile.cc.

virtual Size Ceylan::System::File::write ( const Ceylan::Byte buffer,
Size  maxLength 
) [pure virtual]

Writes up to maxLength bytes from the specified buffer to this file.

Parameters:
buffer the buffer where to find bytes that must be written to this file. Its size must be at least maxLength bytes.
Returns:
The number of bytes actually written, which should be equal to maxLength.
Exceptions:
OutputStream::WriteFailedException if a write error occurred. Note that this is not a child class of FileException, as it comes from an inherited interface.

Reimplemented from Ceylan::System::OutputStream.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

virtual Size Ceylan::System::File::write ( const std::string &  message  )  [pure virtual]

Writes message to this file.

Parameters:
message the message to write to this file.
Returns:
The number of bytes actually written, which should be equal to the size of the string or lower.
Exceptions:
OutputStream::WriteFailedException if a write error occurred. Note that this is not a child class of FileException, as it comes from an inherited interface.

Reimplemented from Ceylan::System::OutputStream.

Implemented in Ceylan::System::LibfatFile, and Ceylan::System::StandardFile.

Referenced by Ceylan::Log::LogAggregatorRaw::aggregate(), Ceylan::Log::LogAggregatorHTML::aggregate(), Ceylan::System::getSchedulingGranularity(), Ceylan::XML::XMLParser::saveToFile(), Ceylan::Log::LogAggregatorRaw::write(), Ceylan::Log::LogAggregatorHTML::write(), Ceylan::Log::LogAggregatorHTML::WriteChannelFooter(), and Ceylan::Log::LogAggregatorHTML::WriteChannelHeader().

void OutputStream::writeFloat32 ( Ceylan::Float32  toWrite  )  [virtual, inherited]

Writes a Ceylan::Uint32 to this output stream.

Exceptions:
WriteFailedException in case a system error occured.

Definition at line 219 of file CeylanOutputStream.cc.

References ceylan_bswap_32, and Ceylan::System::OutputStream::write().

Referenced by Ceylan::Middleware::LightWeightMarshaller::encodeFloat32().

void OutputStream::writeFloat64 ( Ceylan::Float64  toWrite  )  [virtual, inherited]

Writes a Ceylan::Uint32 to this output stream.

Exceptions:
WriteFailedException in case a system error occured.

Definition at line 247 of file CeylanOutputStream.cc.

References Ceylan::byteswap(), ceylan_bswap_64, and Ceylan::System::OutputStream::write().

Referenced by Ceylan::Middleware::LightWeightMarshaller::encodeFloat64().

void OutputStream::writeSint16 ( Ceylan::Sint16  toWrite  )  [virtual, inherited]

Writes a Ceylan::Sint16 to this output stream.

Exceptions:
WriteFailedException in case a system error occured.

Definition at line 119 of file CeylanOutputStream.cc.

References ceylan_bswap_16, and Ceylan::System::OutputStream::write().

Referenced by Ceylan::Middleware::LightWeightMarshaller::encodeSint16().

void OutputStream::writeSint32 ( Ceylan::Sint32  toWrite  )  [virtual, inherited]

Writes a Ceylan::Sint32 to this output stream.

Exceptions:
WriteFailedException in case a system error occured.

Definition at line 169 of file CeylanOutputStream.cc.

References ceylan_bswap_32, and Ceylan::System::OutputStream::write().

Referenced by Ceylan::Middleware::LightWeightMarshaller::encodeSint32().

void OutputStream::writeSint8 ( Ceylan::Sint8  toWrite  )  [virtual, inherited]

Writes a Ceylan::Sint8 to this output stream.

Exceptions:
WriteFailedException in case a system error occured.

Definition at line 89 of file CeylanOutputStream.cc.

References Ceylan::System::OutputStream::write().

Referenced by Ceylan::Middleware::LightWeightMarshaller::encodeSint8().

void OutputStream::writeString ( const std::string &  toWrite  )  [virtual, inherited]

Writes a string to this output stream.

Note:
Written strings cannot have more than 65535 characters.
Parameters:
toWrite the string to write to this output stream.
Exceptions:
WriteFailedException in case a system error occured.

Definition at line 286 of file CeylanOutputStream.cc.

References Ceylan::Log::LogPlug::debug(), Ceylan::toString(), Ceylan::Uint16Max, Ceylan::System::OutputStream::write(), and Ceylan::System::OutputStream::writeUint16().

Referenced by Ceylan::Middleware::LightWeightMarshaller::encodeString().

void OutputStream::writeUint16 ( Ceylan::Uint16  toWrite  )  [virtual, inherited]

Writes a Ceylan::Uint16 to this output stream.

Exceptions:
WriteFailedException in case a system error occured.

Definition at line 144 of file CeylanOutputStream.cc.

References ceylan_bswap_16, and Ceylan::System::OutputStream::write().

Referenced by Ceylan::Middleware::LightWeightMarshaller::encodeUint16(), and Ceylan::System::OutputStream::writeString().

void OutputStream::writeUint32 ( Ceylan::Uint32  toWrite  )  [virtual, inherited]

Writes a Ceylan::Uint32 to this output stream.

Exceptions:
WriteFailedException in case a system error occured.

Definition at line 194 of file CeylanOutputStream.cc.

References ceylan_bswap_32, and Ceylan::System::OutputStream::write().

Referenced by Ceylan::Middleware::LightWeightMarshaller::encodeUint32().

void OutputStream::writeUint8 ( Ceylan::Uint8  toWrite  )  [virtual, inherited]

Writes a Ceylan::Uint8 to this output stream.

Exceptions:
WriteFailedException in case a system error occured.

Definition at line 104 of file CeylanOutputStream.cc.

References Ceylan::System::OutputStream::write().

Referenced by Ceylan::Middleware::LightWeightMarshaller::encodeUint8(), and Ceylan::XML::XMLSavingVisitor::visit().


Member Data Documentation

bool Ceylan::System::Stream::_isBlocking [protected, inherited]

Bit field for access locks.

Not used by all implementations.

Definition at line 1221 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::toString().

Definition at line 1221 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::toString().

std::string Ceylan::System::File::_name [protected]

TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited]

The text format to be used currently by TextDisplayable instances.

Note:
Defaults to raw text.

Definition at line 158 of file CeylanTextDisplayable.h.

Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().

const OpeningFlag File::AppendFile = 0x0010 [static]

const Size File::BigBufferSize = 1<<19 [static]

Describes buffer size for significant I/O operations.

Definition at line 1134 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFileSystemManager::copyFile(), Ceylan::System::StandardFile::FromFDtoFD(), and Ceylan::System::LibfatFile::FromFDtoFD().

const OpeningFlag File::Binary = 0x0020 [static]

Definition at line 234 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToStreamOpenFlag().

const OpeningFlag File::CreateFile = 0x0004 [static]

Initial value:

Definition at line 248 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFileSystemManager::copyFile().

const OpeningFlag File::DoNotOpen = 0xffff [static]

const PermissionFlag File::GroupExec = 0x0020 [static]

Allows the group to execute the created file.

Note:
Only taken into account if the advanced file attribute feature is enabled.

Definition at line 369 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToFileDescriptorPermissionFlag().

const PermissionFlag File::GroupRead = 0x0008 [static]

Allows the group to read the created file.

Note:
Only taken into account if the advanced file attribute feature is enabled.

Definition at line 348 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToFileDescriptorPermissionFlag().

Initial value:

Provided for convenience: GroupReadWrite = GroupRead | GroupWrite.

Note:
Only taken into account if the advanced file attribute feature is enabled.

Definition at line 381 of file CeylanFile.h.

Initial value:

Provided for convenience: GroupReadWriteExec = GroupReadWrite | GroupExec.

Note:
Only taken into account if the advanced file attribute feature is enabled.

Definition at line 393 of file CeylanFile.h.

const PermissionFlag File::GroupWrite = 0x0010 [static]

Allows the group to write the created file.

Note:
Only taken into account if the advanced file attribute feature is enabled.

Definition at line 359 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToFileDescriptorPermissionFlag().

const OpeningFlag File::NonBlocking = 0x0040 [static]

Opens the file in non-blocking mode, when possible.

Neither the opening nor any subsequent operations on this file will cause the calling process to wait.

Note:
Only taken into account if the advanced file attribute feature is enabled.

Definition at line 271 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToFileDescriptorOpenFlag().

Definition at line 257 of file CeylanFile.h.

const PermissionFlag File::OthersExec = 0x0100 [static]

Allows the others (not owner, not group) to execute the created file.

Note:
Only taken into account if the advanced file attribute feature is enabled.

Definition at line 439 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToFileDescriptorPermissionFlag().

const PermissionFlag File::OthersRead = 0x0040 [static]

Allows the others (not owner, not group) to read the created file.

Note:
Only taken into account if the advanced file attribute feature is enabled.

Definition at line 415 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToFileDescriptorPermissionFlag().

Initial value:

Provided for convenience: OthersReadWrite = OthersRead | OthersWrite.

Note:
Only taken into account if the advanced file attribute feature is enabled.

Definition at line 451 of file CeylanFile.h.

Initial value:

Provided for convenience: OthersReadWriteExec = OthersReadWrite | OthersExec.

Note:
Only taken into account if the advanced file attribute feature is enabled.

Definition at line 463 of file CeylanFile.h.

const PermissionFlag File::OthersWrite = 0x0080 [static]

Allows the others (not owner, not group) to write to the created file.

Note:
Only taken into account if the advanced file attribute feature is enabled.

Definition at line 427 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToFileDescriptorPermissionFlag().

const PermissionFlag File::OwnerExec = 0x0004 [static]

Allows its owner to execute the created file.

Definition at line 309 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToFileDescriptorPermissionFlag().

const PermissionFlag File::OwnerRead = 0x0001 [static]

Allows its owner to read the created file.

Definition at line 299 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToFileDescriptorPermissionFlag().

Initial value:

Provided for convenience: OwnerReadWrite = OwnerRead | OwnerWrite.

Definition at line 318 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFileSystemManager::copyFile().

Initial value:

Provided for convenience: OwnerReadWriteExec = OwnerReadWrite | OwnerExec.

Definition at line 327 of file CeylanFile.h.

const PermissionFlag File::OwnerWrite = 0x0002 [static]

Allows its owner to write to the created file.

Definition at line 304 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToFileDescriptorPermissionFlag().

const OpeningFlag File::Read = 0x0001 [static]

const OpeningFlag File::Synchronous = 0x0080 [static]

Opens the file in synchronous mode.

Any write operation on this file will block the calling process until the data has been physically written to the underlying hardware.

Note:
Mostly taken into account if the advanced file attribute feature is enabled, even though our default C++ file stream-base implementation tries to manage it as well.

Definition at line 287 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToFileDescriptorOpenFlag(), Ceylan::System::StandardFile::reopen(), and Ceylan::System::StandardFile::write().

const OpeningFlag File::TruncateFile = 0x0008 [static]

const Size File::UsualBufferSize = 10240 [static]

Describes buffer size for usual I/O operations.

Definition at line 1130 of file CeylanFile.h.

const OpeningFlag File::Write = 0x0002 [static]


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

Generated on Thu Jun 4 20:40:49 2009 for Ceylan by  doxygen 1.5.8