|
nux-1.14.0
|
Public Member Functions | |
| NFileName (const NFileName &Filename) | |
| NFileName (const NString &str) | |
| NFileName (const ANSICHAR *str) | |
| NFileName (const UNICHAR *str) | |
| void | ConvertSlashToBackslash () |
| Replace all slash with backslash. | |
| void | ConvertBackslashToSlash () |
| Replace all backslash with slash. | |
| void | AddSlashAtEnd () |
| Add slash at the end if there isn't one already. | |
| void | AddBackSlashAtEnd () |
| Add backslash at the end if there isn't one already. | |
| void | AddSlashAtStart () |
| Add slash at the start if there isn't one already. | |
| void | AddBackSlashAtStart () |
| Add backslash at the start if there isn't one already. | |
| void | RemoveSlashAtEnd () |
| Remove slash at the end if there is one. | |
| void | RemoveBackSlashAtEnd () |
| Remove backslash at the end if there is one. | |
| void | RemoveSlashAtStart () |
| Remove slash at the start if there is one. | |
| void | RemoveBackSlashAtStart () |
| Remove backslash at the start if there is one. | |
| void | ConvertToCleanSlash () |
| Replace all backslash with slash. Replace multiple consecutive slash with one slash. | |
| void | ConvertToCleanBackslash () |
| Replace all slash with backslash. Replace multiple consecutive backslash with one backslash. | |
| NString | GetDrive () const |
| NString | GetExtension () const |
| Returns the text following the last period. | |
| NString | GetCleanFilename () const |
| Returns the base filename, minus any path information. | |
| NString | GetFilenameNoExtension () const |
| Returns the base filename, without the extension (keep the path) | |
| NString | GetBaseFilename () const |
| Returns the same thing as GetCleanFilename, but without the extension. | |
| NString | GetDirectoryPath () const |
| Returns the path in front of the filename. | |
| void | ChangeFileExtension (const TCHAR *ext) |
| Change the file extension. | |
Definition at line 31 of file FileName.h.
| void nux::NFileName::ChangeFileExtension | ( | const TCHAR * | ext | ) |
Change the file extension.
Do not start ext with a dot character '.'. ie ext = "com"
Definition at line 117 of file FileName.cpp.
References nux::NString::FindLastOccurence(), and nux::NString::GetSubString().
{
t_size Pos = FindLastOccurence (TEXT (".") );
if (Pos != tstring::npos)
{
(*this) = GetSubString (Pos) + NString (TEXT (".") ) + NString (ext);
}
else
{
(*this) = (*this) + NString (TEXT (".") ) + NString (ext);
}
}