DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
OFFilename Class Reference

class for managing filenames consisting either of conventional (8-bit) or wide (e.g. 16-bit) characters. More...

Public Member Functions

 OFFilename ()
 default constructor
 
 OFFilename (const char *filename, const OFBool convert=OFFalse)
 constructor expecting a conventional character string More...
 
 OFFilename (const OFString &filename, const OFBool convert=OFFalse)
 constructor expecting a character string as an OFString instance More...
 
 OFFilename (const OFFilename &arg)
 copy constructor More...
 
 ~OFFilename ()
 destructor. More...
 
OFFilenameoperator= (const OFFilename &arg)
 assignment operator More...
 
void clear ()
 clear currently stored filename
 
void swap (OFFilename &arg)
 fast, non-throwing swap function. More...
 
OFBool isEmpty () const
 checks whether this object stores an empty filename More...
 
OFBool usesWideChars () const
 checks whether this object stores a wide character filename More...
 
const char * getCharPointer () const
 get stored filename consisting of conventional characters More...
 
void set (const char *filename, const OFBool convert=OFFalse)
 replace currently stored filename by given value More...
 
void set (const OFString &filename, const OFBool convert=OFFalse)
 replace currently stored filename by given value More...
 

Private Attributes

char * filename_
 filename consisting of conventional characters (8-bit, e.g. UTF-8)
 

Detailed Description

class for managing filenames consisting either of conventional (8-bit) or wide (e.g. 16-bit) characters.

The wide character support is currently Windows-specific because most other operating systems use UTF-8, which is compatible with conventional 8-bit character strings.

Constructor & Destructor Documentation

OFFilename::OFFilename ( const char *  filename,
const OFBool  convert = OFFalse 
)

constructor expecting a conventional character string

Parameters
filenamefilename to be stored (8-bit characters, e.g. UTF-8)
convertconvert given filename to wide character encoding as an alternative representation
OFFilename::OFFilename ( const OFString filename,
const OFBool  convert = OFFalse 
)

constructor expecting a character string as an OFString instance

Parameters
filenamefilename to be stored (8-bit characters, e.g. UTF-8)
convertconvert given filename to wide character encoding as an alternative representation. Only works on Windows systems.
OFFilename::OFFilename ( const OFFilename arg)

copy constructor

Parameters
argfilename object to be copied
OFFilename::~OFFilename ( )

destructor.

Frees memory.

Member Function Documentation

const char* OFFilename::getCharPointer ( ) const
inline

get stored filename consisting of conventional characters

Returns
filename (might be NULL if none is stored)

Referenced by OFFile::fopen().

OFBool OFFilename::isEmpty ( ) const

checks whether this object stores an empty filename

Returns
OFTrue if the filename is empty, OFFalse otherwise
OFFilename& OFFilename::operator= ( const OFFilename arg)

assignment operator

Parameters
argfilename object to be copied
Returns
reference to this filename object
void OFFilename::set ( const char *  filename,
const OFBool  convert = OFFalse 
)

replace currently stored filename by given value

Parameters
filenamefilename to be stored (8-bit characters, e.g. UTF-8)
convertconvert given filename to wide character encoding as an alternative representation. Only works on Windows systems.
void OFFilename::set ( const OFString filename,
const OFBool  convert = OFFalse 
)

replace currently stored filename by given value

Parameters
filenamefilename to be stored (8-bit characters, e.g. UTF-8)
convertconvert given filename to wide character encoding as an alternative representation). Only works on Windows systems.
void OFFilename::swap ( OFFilename arg)

fast, non-throwing swap function.

The time complexity of this function is constant.

Parameters
argfilename object to swap with
OFBool OFFilename::usesWideChars ( ) const
inline

checks whether this object stores a wide character filename

Returns
OFTrue if the filename uses wide characters, OFFalse otherwise

Referenced by OFFile::fopen().


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


Generated on Tue Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8