Ceylan::System::LibfatFile Class Reference

Encapsulates libfat-based files, as provided by the libfat DS library. More...

#include <CeylanLibfatFile.h>

Inheritance diagram for Ceylan::System::LibfatFile:

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

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 ~LibfatFile () throw ()
 Destroys the libfat file reference object, does not remove the file itself.
virtual bool isOpen () const
 Returns true iff this file is open.
virtual bool close ()
 Closes the file for read/write actions.
virtual void saveAs (const std::string &newName)
 Saves the file under a new name.
virtual time_t getLastChangeTime () const
 Returns the latest change time of this libfat file.
virtual Size read (Ceylan::Byte *buffer, Size maxLength)
 Reads up to maxLength bytes from this file to specified buffer.
virtual Size write (const std::string &message)
 Writes message to this file.
virtual Size write (const Ceylan::Byte *buffer, Size maxLength)
 Writes up to maxLength bytes from the specified buffer to this file.
virtual Position tell ()
 Determines current position within this file.
virtual void seek (Position targetPosition)
 Seeks to specified position within this file.
virtual void serialize (FileDescriptor fd) const
 Sends the file content to the fd file descriptor stream.
FileDescriptor getFileDescriptor () const
 Returns the stream id, its file descriptor.
virtual StreamID getStreamID () const
 Returns this file's ID.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const
 Returns an user-friendly description of the state of this object.
const std::string & getName () const
 Returns this file's 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 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 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 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.
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 LibfatFileCreate (const std::string &filename, OpeningFlag createFlag=CreateToWriteBinary)
 Returns a LibfatFile reference on a newly created file.
static LibfatFileOpen (const std::string &filename, OpeningFlag openFlag=OpenToReadBinary)
 Returns a LibfatFile reference on specified already-existing file, which will be opened with specified settings.
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 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

 LibfatFile (const std::string &name, OpeningFlag openFlag=CreateToWriteBinary)
 Constructs a libfat file reference object.
 LibfatFile (const std::string &name, Size length, FileDescriptor fd)
 Constructs a libfat file with size length from file descriptor fd.
virtual FileSystemManagergetCorrespondingFileSystemManager () const
 Returns the libfat filesystem manager.
virtual void reopen ()
 Tries to reopen file.
std::string interpretState () const
 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 int ConvertToFileDescriptorOpenFlag (OpeningFlag openFlag)
 Converts specified Ceylan opening flag into a valid opening flag to be used with file descriptor 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

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

Static Private Member Functions

static void FromFDtoFD (FileDescriptor from, FileDescriptor to, Size length)
 Transfers bytes from a file descriptor to another.

Private Attributes

FileDescriptor _fdes
 Internal file descriptor.


Detailed Description

Encapsulates libfat-based files, as provided by the libfat DS library.

Actual files should be created and opened with respectively the File::Create and File::Open factories, that allow the user program to be cross-platform by hiding each filesystem-related per-platform specificity.

Note:
Not all primitives are available, which results in FileException being raised whenever they are 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.

Definition at line 80 of file CeylanLibfatFile.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

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

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

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

See also:
remove

Definition at line 109 of file CeylanLibfatFile.cc.

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

LibfatFile::LibfatFile ( const std::string &  name,
OpeningFlag  openFlag = CreateToWriteBinary 
) [explicit, protected]

Constructs a libfat file reference object.

By default, it creates a new file on card, if the name corresponds to an already-existing file, it will be truncated and overwritten.

Parameters:
name the name of the file.
openFlag the flag describing the opening mode.
Note:
No permission flag, as permissions are not supported. Always deemed OwnerReadWrite.
See also:
OpeningFlag, PermissionFlag
Note:
If not specifically set, the file is open 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.

This constructor should not be called directly, the File factories (File::Create and File::Open) should be used instead, as they allow to write code really independant from the running platform, not having to choose between the per-platform constructors.

Exceptions:
FileException if the operation failed.

Definition at line 608 of file CeylanLibfatFile.cc.

References Ceylan::System::File::DoNotOpen, reopen(), and Ceylan::System::LibfatFileSystemManager::SecureLibfatFileSystemManager().

Referenced by Create(), and Open().

Ceylan::System::LibfatFile::LibfatFile ( const std::string &  name,
Size  length,
FileDescriptor  fd 
) [protected]

Constructs a libfat file with size length from file descriptor fd.

Parameters:
name the name of the file.
length the file size.
fd the file descriptor to use.
Note:
No permission flag, as permissions are not supported. Always deemed OwnerReadWrite.

Very useful to copy files from streams: socket, file, pipe.

Exceptions:
FileException if the operation failed.
Note:
This constructor should not be called directly, the File factories (File::Create and File::Open) should be used instead, as they allow to write code really independant from the running platform, not having to choose between the per-platform constructors.

Ceylan::System::LibfatFile::LibfatFile ( const LibfatFile 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 close().

bool LibfatFile::close (  )  [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::File.

Definition at line 169 of file CeylanLibfatFile.cc.

References _fdes, Ceylan::System::File::_name, Ceylan::System::Stream::Close(), generalUtils::false, and isOpen().

Referenced by ~LibfatFile().

int LibfatFile::ConvertToFileDescriptorOpenFlag ( OpeningFlag  openFlag  )  [static, protected]

Converts specified Ceylan opening flag into a valid opening flag to be used with file descriptor functions.

Parameters:
openFlag the Ceylan opening flag to convert to lower-level flag.
Returns:
the converted opening flag.
Exceptions:
ConversionFailed if the mapping failed.

Definition at line 714 of file CeylanLibfatFile.cc.

References Ceylan::System::File::AppendFile, Ceylan::System::File::CreateFile, Ceylan::System::File::DoNotOpen, Ceylan::System::File::Read, Ceylan::System::File::TruncateFile, and Ceylan::System::File::Write.

Referenced by reopen().

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

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 Ceylan::System::File::GetCorrespondingFileSystemManager().

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

LibfatFile & LibfatFile::Create ( const std::string &  filename,
OpeningFlag  createFlag = CreateToWriteBinary 
) [static]

Returns a LibfatFile reference on a newly created file.

By default, it creates a new file on disk. If the name corresponds to an already-existing file, it will be truncated and overwritten.

Parameters:
filename the name of the file to be created.
createFlag the flag describing the creation mode.
Note:
No permission flag, as permissions are not supported. Always deemed OwnerReadWrite.
See also:
OpeningFlag, PermissionFlag
Note:
This LibfatFile factory is only a helper method. Ceylan users should only use File::Create instead.
Exceptions:
FileException,including FileCreationFailed if the operation failed.

Definition at line 582 of file CeylanLibfatFile.cc.

References Ceylan::System::File::CreateFile, and LibfatFile().

Referenced by Ceylan::System::LibfatFileSystemManager::createFile(), and saveAs().

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

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 Ceylan::System::File::GetCorrespondingFileSystemManager().

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

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 Ceylan::System::File::ExistsAsFileOrSymbolicLink().

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

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 Ceylan::System::File::GetCorrespondingFileSystemManager().

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

void LibfatFile::FromFDtoFD ( FileDescriptor  from,
FileDescriptor  to,
Size  length 
) [static, private]

Transfers bytes from a file descriptor to another.

Parameters:
from the source file descriptor.
to the target file descriptor.
length the length of the transfer, in bytes.
Exceptions:
LibfatFileException if the operation failed.

Definition at line 786 of file CeylanLibfatFile.cc.

References Ceylan::System::File::BigBufferSize, dataUtils::e, Ceylan::System::FDRead(), Ceylan::System::FDWrite(), Ceylan::System::LibfatFileSystemManager::SecureLibfatFileSystemManager(), and Ceylan::Exception::toString().

Referenced by serialize().

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

FileSystemManager & LibfatFile::getCorrespondingFileSystemManager (  )  const [protected, virtual]

Returns the libfat filesystem manager.

Exceptions:
FileDelegatingException if the operation failed.

Implements Ceylan::System::File.

Definition at line 646 of file CeylanLibfatFile.cc.

References dataUtils::e, Ceylan::System::LibfatFileSystemManager::GetLibfatFileSystemManager(), and Ceylan::Exception::toString().

FileDescriptor LibfatFile::getFileDescriptor (  )  const

Returns the stream id, its file descriptor.

Exceptions:
LibfatFileException if the operation failed.

Definition at line 507 of file CeylanLibfatFile.cc.

References _fdes.

Referenced by getStreamID(), and toString().

StreamID File::getInputStreamID (  )  const [virtual, inherited]

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 Ceylan::System::File::getStreamID().

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

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 Ceylan::System::File::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::getLastChangeTimeFile().

time_t LibfatFile::getLastChangeTime (  )  const [virtual]

Returns the latest change time of this libfat file.

On Nintendo DS, usual locking primitives are not available, hence we do not override the implementations inherited from File.

Exceptions:
FileLastChangeTimeRequestFailed if the operation failed.

Implements Ceylan::System::File.

Definition at line 266 of file CeylanLibfatFile.cc.

References Ceylan::System::File::_name, and Ceylan::System::explainError().

const std::string & File::getName (  )  const [inherited]

Returns this file's name.

Definition at line 333 of file CeylanFile.cc.

References Ceylan::System::File::_name.

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

StreamID File::getOutputStreamID (  )  const [virtual, inherited]

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 Ceylan::System::File::getStreamID().

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

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 Ceylan::System::File::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::getSize().

StreamID LibfatFile::getStreamID (  )  const [virtual]

Returns this file's ID.

Returns:
the StreamID.

Implements Ceylan::System::File.

Definition at line 534 of file CeylanLibfatFile.cc.

References getFileDescriptor().

bool File::hasAvailableData (  )  const [virtual, inherited]

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.

string LibfatFile::interpretState (  )  const [protected, virtual]

Interprets the current state of this file.

Implements Ceylan::System::File.

Definition at line 701 of file CeylanLibfatFile.cc.

References _fdes, and toString().

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, inherited]

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.

bool LibfatFile::isOpen (  )  const [virtual]

Returns true iff this file is open.

Implements Ceylan::System::File.

Definition at line 144 of file CeylanLibfatFile.cc.

References _fdes, and generalUtils::false.

Referenced by close(), and ~LibfatFile().

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, inherited]

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, inherited]

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, inherited]

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 Ceylan::System::File::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::moveFile().

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

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 Ceylan::System::File::_name, Ceylan::System::File::_openFlag, Ceylan::System::File::_permissions, Ceylan::System::File::DoNotOpen, and Ceylan::System::File::reopen().

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

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

Returns a LibfatFile reference on specified already-existing file, which will be opened with specified settings.

Parameters:
filename the name of the file to open.
openFlag the flag describing the opening mode.
See also:
OpeningFlag
Note:
This LibfatFile factory is only a helper method. Ceylan users should only use File::Open instead.
Exceptions:
FileException,including FileOpeningFailed if the operation failed.

Reimplemented from Ceylan::System::File.

Definition at line 593 of file CeylanLibfatFile.cc.

References Ceylan::System::File::CreateFile, and LibfatFile().

Referenced by Ceylan::System::LibfatFileSystemManager::copyFile(), and Ceylan::System::LibfatFileSystemManager::openFile().

LibfatFile& Ceylan::System::LibfatFile::operator= ( const LibfatFile 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.

Size LibfatFile::read ( Ceylan::Byte buffer,
Size  maxLength 
) [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).

Implements Ceylan::System::File.

Definition at line 301 of file CeylanLibfatFile.cc.

References _fdes, Ceylan::System::File::_name, dataUtils::e, Ceylan::System::FDRead(), Ceylan::System::InputStream::setSelected(), and Ceylan::Exception::toString().

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

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, Ceylan::System::File::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, inherited]

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 Ceylan::System::File::_name, Ceylan::System::File::close(), dataUtils::e, Ceylan::System::File::getCorrespondingFileSystemManager(), Ceylan::System::FileSystemManager::removeFile(), and Ceylan::Exception::toString().

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

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 Ceylan::System::File::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::removeFile().

void LibfatFile::reopen (  )  [protected, virtual]

void LibfatFile::saveAs ( const std::string &  newName  )  [virtual]

Saves the file under a new name.

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

Implements Ceylan::System::File.

Definition at line 221 of file CeylanLibfatFile.cc.

References _fdes, Create(), dataUtils::f, and serialize().

void LibfatFile::seek ( Position  targetPosition  )  [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.

Implements Ceylan::System::File.

Definition at line 445 of file CeylanLibfatFile.cc.

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 LibfatFile::serialize ( FileDescriptor  fd  )  const [virtual]

Sends the file content to the fd file descriptor stream.

Exceptions:
LibfatFileException if the operation failed.

Definition at line 479 of file CeylanLibfatFile.cc.

References _fdes, FromFDtoFD(), and Ceylan::System::File::size().

Referenced by saveAs().

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, inherited]

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 Ceylan::System::File::_name, Ceylan::System::File::getCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::getSize().

Referenced by Ceylan::System::StandardFile::serialize(), and 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().

Position LibfatFile::tell (  )  [virtual]

Determines current position within this file.

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

Implements Ceylan::System::File.

Definition at line 417 of file CeylanLibfatFile.cc.

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 LibfatFile::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::File.

Definition at line 561 of file CeylanLibfatFile.cc.

References Ceylan::System::File::_name, Ceylan::System::File::_openFlag, Ceylan::System::File::_permissions, and getFileDescriptor().

Referenced by interpretState().

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

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 Ceylan::System::File::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::touch().

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

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 Ceylan::System::File::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::transformIntoValidFilename().

void File::unlockForReading (  )  const [virtual, inherited]

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, inherited]

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.

Size LibfatFile::write ( const Ceylan::Byte buffer,
Size  maxLength 
) [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.

Implements Ceylan::System::File.

Definition at line 379 of file CeylanLibfatFile.cc.

References _fdes, Ceylan::System::File::_name, dataUtils::e, Ceylan::System::FDWrite(), and Ceylan::Exception::toString().

Size LibfatFile::write ( const std::string &  message  )  [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.

Implements Ceylan::System::File.

Definition at line 341 of file CeylanLibfatFile.cc.

References _fdes, Ceylan::System::File::_name, dataUtils::e, Ceylan::System::FDWrite(), and Ceylan::Exception::toString().

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

Internal file descriptor.

Definition at line 566 of file CeylanLibfatFile.h.

Referenced by close(), getFileDescriptor(), interpretState(), isOpen(), read(), reopen(), saveAs(), serialize(), and write().

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

bool Ceylan::System::File::_lockedForReading [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().

bool Ceylan::System::File::_lockedForWriting [protected, inherited]

Definition at line 1221 of file CeylanFile.h.

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

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

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, inherited]

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

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 FromFDtoFD().

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

Definition at line 234 of file CeylanFile.h.

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

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

Creates the file, if it does not exist.

Could not be named 'Create' (static method of the same name exists already), thus CreateFile is used.

Definition at line 221 of file CeylanFile.h.

Referenced by Ceylan::System::StandardFile::ConvertToFileDescriptorOpenFlag(), ConvertToFileDescriptorOpenFlag(), Ceylan::System::StandardFile::ConvertToStreamOpenFlag(), Ceylan::System::StandardFile::Create(), Create(), Ceylan::System::StandardFile::Open(), and Open().

const OpeningFlag File::CreateToWriteBinary [static, inherited]

Initial value:

Definition at line 248 of file CeylanFile.h.

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

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

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

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, inherited]

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().

const PermissionFlag File::GroupReadWrite [static, inherited]

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.

const PermissionFlag File::GroupReadWriteExec [static, inherited]

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, inherited]

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, inherited]

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().

const OpeningFlag File::OpenToReadBinary = Read | Binary [static, inherited]

Definition at line 257 of file CeylanFile.h.

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

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, inherited]

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().

const PermissionFlag File::OthersReadWrite [static, inherited]

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.

const PermissionFlag File::OthersReadWriteExec [static, inherited]

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, inherited]

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, inherited]

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, inherited]

Allows its owner to read the created file.

Definition at line 299 of file CeylanFile.h.

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

const PermissionFlag File::OwnerReadWrite [static, inherited]

Initial value:

Provided for convenience: OwnerReadWrite = OwnerRead | OwnerWrite.

Definition at line 318 of file CeylanFile.h.

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

const PermissionFlag File::OwnerReadWriteExec [static, inherited]

Initial value:

Provided for convenience: OwnerReadWriteExec = OwnerReadWrite | OwnerExec.

Definition at line 327 of file CeylanFile.h.

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

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, inherited]

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

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, inherited]

const Size File::UsualBufferSize = 10240 [static, inherited]

Describes buffer size for usual I/O operations.

Definition at line 1130 of file CeylanFile.h.

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


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

Generated on Thu Jun 4 20:41:00 2009 for Ceylan by  doxygen 1.5.8