MAK Data Logger API Documentation for HLA
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes
MAKLogger::DtLgrFilename Class Reference

Instances of DtLgrFilename are DtStrings which convert filenames to the native format. More...

+ Inheritance diagram for MAKLogger::DtLgrFilename:
+ Collaboration diagram for MAKLogger::DtLgrFilename:

Public Member Functions

 DtLgrFilename ()
 default constructor
 DtLgrFilename (const char *str)
 constructor
virtual ~DtLgrFilename ()
 destructor
 DtLgrFilename (const DtLgrFilename &orig)
 copy constructor
DtLgrFilenameoperator= (const DtLgrFilename &orig)
 assignment operator
DtLgrFilenameoperator= (const DtString &orig)
DtLgrFilenameoperator= (const char *orig)
virtual bool absolute () const
 Returns true if the filename is an absolute filename, or a relative filename, respectively.
virtual bool relative () const
virtual void append (DtLgrFilename const &filename)
 This filename is considered a path and the supplied filename is appended.
virtual void prefix (DtLgrFilename const &pathName)
 This filename is considered a relative path (or filename) and the supplied path is prefixed.
virtual DtString extension () const
 Returns the file extension, which are all the characters following the last '.
virtual void setExtension (const DtString &extension)
 Sets the extension for the filename, if the existing file has an extension it is removed, else this extension is appended.
virtual void stripFilename ()
 Strip the filename from this path.
virtual void stripPath ()
 Strip the path from this filename.
virtual bool isWritable () const
 Returns true if the filename is writable.
virtual bool isReadable () const
 Return true if the filename is readable.
virtual unsigned long fileLength () const
 Returns the size of the file in bytes.
virtual bool exists () const
 Returns true if the filename exists.

Static Public Member Functions

static const DtLgrFilenamenullFilename ()
 Return empty filename.
static DtLgrFilename stripFilename (const DtLgrFilename &orig)
 Strip the filename from a path.
static DtLgrFilename stripPath (const DtLgrFilename &orig)
 Strip the path from a filename.
static DtLgrFilename combine (const DtLgrFilename &path, const DtLgrFilename &filename)
 Constructs a new filename by combining the path with filename, which is an absolute or relative path.
static char separator ()
 Returns the separator used in representing directories.

Protected Member Functions

void replaceSlashes ()
 Replaces slashes.

Static Protected Attributes

static const char theSeparator

Detailed Description

Instances of DtLgrFilename are DtStrings which convert filenames to the native format.

Constructor & Destructor Documentation

MAKLogger::DtLgrFilename::DtLgrFilename ( )

default constructor

MAKLogger::DtLgrFilename::DtLgrFilename ( const char *  str)

constructor

virtual MAKLogger::DtLgrFilename::~DtLgrFilename ( )
virtual

destructor

MAKLogger::DtLgrFilename::DtLgrFilename ( const DtLgrFilename orig)

copy constructor

Member Function Documentation

virtual bool MAKLogger::DtLgrFilename::absolute ( ) const
virtual

Returns true if the filename is an absolute filename, or a relative filename, respectively.

virtual void MAKLogger::DtLgrFilename::append ( DtLgrFilename const &  filename)
virtual

This filename is considered a path and the supplied filename is appended.

The filename may be an absolute or relative path. If the filename is absolute, then it replaces this one. A separator is inserted between this path and the filename if necessary.

static DtLgrFilename MAKLogger::DtLgrFilename::combine ( const DtLgrFilename path,
const DtLgrFilename filename 
)
static

Constructs a new filename by combining the path with filename, which is an absolute or relative path.

If the filename is an absolute filename, then filename is returned. If the filename is a relative filename, then path is prefixed to it.

virtual bool MAKLogger::DtLgrFilename::exists ( ) const
virtual

Returns true if the filename exists.

virtual DtString MAKLogger::DtLgrFilename::extension ( ) const
virtual

Returns the file extension, which are all the characters following the last '.

' period. If there is no extension in the filename, an empty string is returned.

virtual unsigned long MAKLogger::DtLgrFilename::fileLength ( ) const
virtual

Returns the size of the file in bytes.

If file does not exist results are undefined.

virtual bool MAKLogger::DtLgrFilename::isReadable ( ) const
virtual

Return true if the filename is readable.

virtual bool MAKLogger::DtLgrFilename::isWritable ( ) const
virtual

Returns true if the filename is writable.

static const DtLgrFilename& MAKLogger::DtLgrFilename::nullFilename ( )
static

Return empty filename.

DtLgrFilename& MAKLogger::DtLgrFilename::operator= ( const DtLgrFilename orig)

assignment operator

DtLgrFilename& MAKLogger::DtLgrFilename::operator= ( const DtString orig)
DtLgrFilename& MAKLogger::DtLgrFilename::operator= ( const char *  orig)
virtual void MAKLogger::DtLgrFilename::prefix ( DtLgrFilename const &  pathName)
virtual

This filename is considered a relative path (or filename) and the supplied path is prefixed.

The path name may be an absolute or relative path. If this filename is absolute it is left unchanged. A separator is inserted between the path and this filename if necessary.

virtual bool MAKLogger::DtLgrFilename::relative ( ) const
virtual
void MAKLogger::DtLgrFilename::replaceSlashes ( )
protected

Replaces slashes.

On unix, this replaces backslashes with forward slashes. Vice versa on win32. Hail Mr Gates. This is not virtual, because we call this from the constructors and destructor.

static char MAKLogger::DtLgrFilename::separator ( )
static

Returns the separator used in representing directories.

virtual void MAKLogger::DtLgrFilename::setExtension ( const DtString extension)
virtual

Sets the extension for the filename, if the existing file has an extension it is removed, else this extension is appended.

The extension string does NOT need a leading period.

virtual void MAKLogger::DtLgrFilename::stripFilename ( )
virtual

Strip the filename from this path.

static DtLgrFilename MAKLogger::DtLgrFilename::stripFilename ( const DtLgrFilename orig)
static

Strip the filename from a path.

virtual void MAKLogger::DtLgrFilename::stripPath ( )
virtual

Strip the path from this filename.

static DtLgrFilename MAKLogger::DtLgrFilename::stripPath ( const DtLgrFilename orig)
static

Strip the path from a filename.

Member Data Documentation

const char MAKLogger::DtLgrFilename::theSeparator
staticprotected

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

Document ID: Generated on Mon Jan 19 08:20:14 EST 2015 from SVN revision 149581
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)