Filename Class Reference

#include <c4d_filename.h>

Private Member Functions

Bool GetMemoryMode () const
 
UInt16 GetSeparator () const
 

Private Attributes

String t_name
 
MemoryFileStructt_memblock
 
MemoryFileStruct t_readmfs
 

Friends

class BaseFile
 

Constructors/Destructors

 Filename ()
 
 Filename (const Char *string)
 
 Filename (const String &string)
 
 Filename (const Filename &fn)
 
 ~Filename ()
 

String Content

Bool IsPopulated () const
 
const String GetString () const
 
void SetString (const String &str)
 
Bool IsBrowserUrl () const
 

Read/Write Memory

void SetMemoryReadMode (void *adr, Int size)
 
void SetMemoryWriteMode (MemoryFileStruct &mfs)
 

Directory/File Parts

const Filename GetDirectory () const
 
const Filename GetFile () const
 
void SetDirectory (const Filename &str)
 
void SetFile (const Filename &str)
 
const String GetFileString () const
 

Suffix Part

String GetSuffix () const
 
void SetSuffix (const String &str)
 
void ClearSuffix ()
 
void ClearSuffixComplete ()
 
Bool CheckSuffix (const String &str) const
 

Operators

const Filename operator+ (const Filename &fname1, const Filename &fname2)
 
const Filenameoperator= (const Filename &fname)
 
const Filenameoperator+= (const Filename &fname)
 
Bool operator== (const Filename &fname) const
 
Bool operator!= (const Filename &fname) const
 

Detailed Description

Manages file and path names.

Constructor & Destructor Documentation

◆ Filename() [1/4]

Filename ( )

Default constructor.

◆ Filename() [2/4]

Filename ( const Char string)

Creates the filename from a character array.

Parameters
[in]stringThe filename character array.

◆ Filename() [3/4]

Filename ( const String string)

Creates the filename from a string.

Parameters
[in]stringThe filename string.

◆ Filename() [4/4]

Filename ( const Filename fn)

Copy constructor. Creates a filename from another filename.

Parameters
[in]fnThe source filename.

◆ ~Filename()

~Filename ( )

Default destructor.

Member Function Documentation

◆ GetMemoryMode()

Bool GetMemoryMode ( ) const
private

Private. Internal.

◆ GetSeparator()

UInt16 GetSeparator ( ) const
private

Private. Internal.

◆ IsPopulated()

Bool IsPopulated ( ) const

Checks if the filename has been set.

Since
R20 Was Content() before.
Returns
true if filename was set, otherwise false.

◆ GetString()

const String GetString ( ) const

Gets the String of the filename.

Returns
The string with the full filename.

◆ SetString()

void SetString ( const String str)

Sets the filename to the passed string.

Parameters
[in]strThe string to use to set the filename.

◆ IsBrowserUrl()

Bool IsBrowserUrl ( ) const

Checks if the filename is a Content Browser URL.

Returns
true if the file name is a Content Browser URL, otherwise false.

◆ SetMemoryReadMode()

void SetMemoryReadMode ( void *  adr,
Int  size 
)

Sets the filename to read from a memory block instead of from a file.

Parameters
[in]adrThe memory to read from. The caller owns the pointed memory block.
[in]sizeThe size of memory block adr, or -1 if the buffer is "big enough".

◆ SetMemoryWriteMode()

void SetMemoryWriteMode ( MemoryFileStruct mfs)

Sets the filename to write to a memory block instead of to a file.

Parameters
[in]mfsThe memory file to write to. The caller owns the pointed memory file.

◆ GetDirectory()

const Filename GetDirectory ( ) const

Gets the directory that the file is located.

Returns
The directory part for the filename.

◆ GetFile()

const Filename GetFile ( ) const

Gets the file part of the filename only, without the path.

Returns
The file part of the filename.

◆ SetDirectory()

void SetDirectory ( const Filename str)

Sets the directory for the filename. The file part remains unchanged.

Parameters
[in]strThe directory to set for the filename.

◆ SetFile()

void SetFile ( const Filename str)

Sets the file part for the filename. The directory part remains unchanged.

Parameters
[in]strThe file part to set for the filename.

◆ GetFileString()

const String GetFileString ( ) const

Convenience function to directly get the file part string. Identical to GetFile().GetString().

Returns
The file part of the filename as a string.

◆ GetSuffix()

String GetSuffix ( ) const

Gets the suffix of the filename.

Returns
The suffix. Only contain the suffix part and no dot (e.g. "TIF").

◆ SetSuffix()

void SetSuffix ( const String str)

Sets the suffix part of the filename.

Note
Suffix strings do not contain the dot character '.'.
Parameters
[in]strA string with the suffix for the file. Only contain the suffix part and no dot (e.g. "TIF").

◆ ClearSuffix()

void ClearSuffix ( )

Clears the suffix part of the filename.

◆ ClearSuffixComplete()

void ClearSuffixComplete ( )

The same as ClearSuffix() only that it also clears suffixes longer than seven characters.

◆ CheckSuffix()

Bool CheckSuffix ( const String str) const

Checks if the suffix of the filename is the same as its string.

Parameters
[in]strThe suffix to check against.
Returns
true if the suffix is the same, otherwise false.

◆ operator=()

const Filename& operator= ( const Filename fname)

Assignment operator. Assigns the filename right-operand to the left-operand filename.

Parameters
[in]fnameThe right-operand filename.

◆ operator+=()

const Filename& operator+= ( const Filename fname)

Concatenates filenames and set the left-hand operand to the result.

Parameters
[in]fnameThe right-operand filename.

◆ operator==()

Bool operator== ( const Filename fname) const

Checks if filenames are equal.

Parameters
[in]fnameThe right-operand filename.

◆ operator!=()

Bool operator!= ( const Filename fname) const

Checks if filenames are different.

Parameters
[in]fnameThe right-operand filename.

Friends And Related Function Documentation

◆ BaseFile

friend class BaseFile
friend

◆ operator+

const Filename operator+ ( const Filename fname1,
const Filename fname2 
)
friend

Concatenates two filenames. It will join directories and files parts.

Parameters
[in]fname1The left-operand filename.
[in]fname2The right-operand filename.

Member Data Documentation

◆ t_name

String t_name
private

Private. Internal.

◆ t_memblock

MemoryFileStruct* t_memblock
private

Private. Internal.

◆ t_readmfs

MemoryFileStruct t_readmfs
private

Private. Internal.