FileName Class Reference

[std::string] extension for filenames More...

#include <filename.h>

List of all members.

Public Member Functions

 FileName (const string &filename)
bool operator< (const FileName &fn)
bool operator== (const FileName &fn)
string qualified () const
string base (bool ext=true) const
string path () const
string relpath () const
string ext (bool dot=true) const
void set (const string &filename)
void setBase (const string &basename, bool ext=true)
void setExt (const string &extension)
void setPath (const string &path)
bool isValid ()
bool isRelative ()

Static Public Member Functions

static void setCaseSensitiveCompare (bool csc)


Detailed Description

[std::string] extension for filenames

This class is derived from std::string and is nothing more or less than that, with additional functions to extract parts of a filename in a cross-safe manner under consideration of the different delimiters and the Drive/Root thing of Linux and Win32. It is also possible to sort FileNames caseinsensitive (the default) in STL containers. Also, no slicing can occure by passing pointers of FileNames, because no additional variables are added at all. Just use it as an ordinary std::string.

Todo:
Drive/Root not yet considered.

Example:
Author:
Fred Klaus


Member Function Documentation

bool FileName::operator< ( const FileName fn  ) 

for case sensitive or insensitive sorting

bool FileName::operator== ( const FileName fn  ) 

for case sensitive or insensitive equalization

string FileName::qualified (  )  const

Todo:
not yet implemented

string FileName::base ( bool  ext = true  )  const

Bug:
with ext=false may couse bad name

void FileName::set ( const string &  filename  )  [inline]

Todo:
used function -localtime- not threadsafe but -localtime_r- not included in MinGW !!

implement errorhandling

void FileName::setBase ( const string &  basename,
bool  ext = true 
)

Todo:
ext=false not yet implemented
See also:
base

bool FileName::isValid (  ) 

Todo:
implement me

bool FileName::isRelative (  ) 

Todo:
implement me

static void FileName::setCaseSensitiveCompare ( bool  csc  )  [inline, static]

Sets wether the operator< should work case sensitive. Switches a static private variable and is therefore NOT THREADSAFE but in most cases riskless. Asynchronus setting this vally may cause mixed sorted Filenames.


The documentation for this class was generated from the following files:
Generated on Fri Mar 16 21:30:29 2007 for roland.kdevelop by  doxygen 1.5.0