Public Member Functions |
| | DtUcFilename () |
| | CTOR.
|
| | DtUcFilename (const char *str) |
| | CTOR.
|
| | DtUcFilename (const DtUcString &str) |
| | CTOR.
|
| | DtUcFilename (const DtUcFilename &orig) |
| | Copy CTOR.
|
| virtual | ~DtUcFilename () |
| | Virtual DTOR.
|
| 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 (const DtUcFilename &filename) |
| | This filename is considered a path and the supplied filename is appended.
|
| virtual void | prepend (const DtUcFilename &pathName) |
| | This filename is considered a relative path (or filename) and the supplied path is prepended.
|
| virtual DtUcString | extension () const |
| | Returns the file extension, which are all the characters following the last '.
|
| virtual void | setExtension (const DtUcString &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 void | stripExtension () |
| | Strip the extension from the 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.
|
|
| DtUcFilename & | operator= (const DtUcFilename &orig) |
| DtUcFilename & | operator= (const DtUcString &orig) |
| | Assignment operator copies the string, this function will NOT allocate memory for the string, and thus it is fast to pass by value, and create many identical copies of a string.
|
| DtUcFilename & | operator= (const char *orig) |
| | DtUcString () |
| | CTOR creates an empty string.
|
| | DtUcString (size_t len, DtUnicodeChar c=DtUnicodeChar('\0')) |
| | CTOR create a string of n length filled with the unicode character c.
|
| | DtUcString (const DtUcString &str) |
| | Copy ctor copies the string, this function will NOT allocate memory for the string, and thus it is fast to pass by value, and create many identical copies of a string.
|
| | ~DtUcString () |
| | DTOR may NOT deallocate memory as this string may share data.
|
| template<typename QStringType , typename QCoreApp > |
| QStringType | translate () const |
| | Utility function for translating a DtUcString variable initialized using the static DtUcString::tr function, and QLinguist.
|
| void | setFromWCharArray (const wchar_t utf16[], int len=-1) |
| | Set from an wchar string, the string MUST be zero terminated if the length is not passed, the encoding of wchar arrays are different on each platform.
|
| void | setFromUtf8 (const unsigned char *utf8, int len=-1) |
| | Set from an UTF-8 encoded string, the string MUST be zero terminated if the length is not passed.
|
| void | setFromUtf8 (const std::string &utf8) |
| void | setFromLatin1 (const char *latin, int len=-1) |
| | Set from an UTF-8 encoded string, the string MUST be zero terminated if the length is not passed.
|
| void | setFromUtf16 (const unsigned short *utf16, int len=-1) |
| | Set from an UTF-16 encoded string, the string MUST be zero terminated if the length is not passed.
|
| void | setFromUtf32 (const unsigned int *utf32, int len=-1) |
| | Set from an UTF-32 encoded string, the string MUST be zero terminated if the length is not passed.
|
| void | setFromAscii (const std::string &ascii) |
| | Set from an ascii string, the string MUST be zero terminated if the length is not passed.
|
| void | setFromAscii (const char *ascii, int len=-1) |
| | Set from an ascii string, the string MUST be zero terminated if the length is not passed.
|
| template<typename QStringType > |
| void | setFromQString (QStringType qstr) |
| | Template function for setting from Qt 4 style string.
|
| void | toAscii (std::string &str) const |
| | Encode to an ascii string.
|
| std::string | toAscii () const |
| void | toLatin1 (std::string &str) const |
| | Encode to an Latin-1 string.
|
| std::string | toLatin1 () const |
| void | toUtf8 (std::string &str) const |
| | Encode to a UTF-8 string.
|
| std::string | toUtf8 () const |
| void | toWideString (std::wstring &str) const |
| | Encode to a wstring.
|
| std::wstring | toWideString () const |
| template<typename QStringType > |
| QStringType | toQString () const |
| | Template function for outputting a Qt 4 style string.
|
| template<typename QStringType > |
| void | toQString (QStringType &qstr) const |
| | Template function for initializing a Qt 4 style string.
|
| DtUcString & | operator+= (const DtUcString &str) |
| | Append a string to the end.
|
| DtUcString & | operator+= (const DtUnicodeChar &x) |
| | Append a character to the end.
|
| DtUcString | operator+ (const DtUcString &str) const |
| | Append two strings together.
|
| bool | operator== (const DtUcString &other) const |
| | Test if two strings are identical.
|
| bool | operator!= (const DtUcString &other) const |
| | Test if two strings are not identical.
|
| bool | operator< (const DtUcString &other) const |
| | Test if a string is less than another based on their first different character or the length.
|
| size_t | length () const |
| | Get the length in Code Units.
|
| size_t | sizeInBytes () const |
| | Get the size in 8bit bytes.
|
| size_t | calculateCodePoints () const |
| | Calculate the number of Code Points.
|
| const CodeUnit * | codeUnits () const |
| | Get an array of code units.
|
| int | indexOf (const DtUnicodeChar &x, size_t pos=0) const |
| | Search for a character starting a pos, returns index, or -1 if not found.
|
| int | indexOf (const DtUcString &x, size_t pos=0) const |
| | Search for a string starting a pos, returns index, or -1 if not found.
|
| int | lastIndexOf (const DtUnicodeChar &x, size_t pos=0) const |
| | Search for a character starting a pos, returns index, or -1 if not found.
|
| int | lastIndexOf (const DtUcString &x, size_t pos=0) const |
| | Search for a string starting a pos, returns index, or -1 if not found.
|
| DtUcString | subString (size_t pos=0, int len=-1) const |
| | Create a substring starting at position, for n characters.
|
| void | push_back (const DtUnicodeChar &x) |
| | Append a unicode character to the string.
|
| void | resize (int size) |
| | Resize a string to a new size, if the size < 0 the string will be empty.
|
| virtual bool | snipFront (const char ch, bool toLastCh=false) |
| | Truncates everything before or after the character, including the character, respectively.
|
| virtual bool | snipBack (const char ch, bool fromFirstCh=false) |
| | Truncates everything before or after the character, including the character, respectively.
|
Static Public Member Functions |
| static const DtUcFilename & | nullFilename () |
| | Return empty filename.
|
| static DtUcFilename | stripFilename (const DtUcFilename &orig) |
| | Strip the filename from a path.
|
| static DtUcFilename | stripPath (const DtUcFilename &orig) |
| | Strip the path from a filename.
|
| static DtUcFilename | stripExtension (const DtUcFilename &orig) |
| | Strip the extension from a filename.
|
| static DtUcFilename | combine (const DtUcFilename &path, const DtUcFilename &filename) |
| | Constructs a new filename by combining the path with filename, which is an absolute or relative path.
|
| static const DtUnicodeChar & | separator () |
| | Returns the separator used in representing directories.
|
| static DtUcString | fromWCharArray (const wchar_t utf16[], int len=-1) |
| | Set from a wchar_t array, compiler encoding specific, the string MUST be zero terminated if the length is not passed.
|
| static DtUcString | fromWideString (const std::wstring &str) |
| | Set from a std::wstring.
|
| static DtUcString | fromUtf8 (const unsigned char *utf8, int len=-1) |
| | Create a unicode string from an UTF-16 encoded string, the string MUST be zero terminated if the length is not passed.
|
| static DtUcString | fromUtf8 (const std::string &utf8) |
| static DtUcString | fromUtf16 (const unsigned short *utf16, int len=-1) |
| | Create a unicode string from an UTF-16 encoded string, the string MUST be zero terminated if the length is not passed.
|
| static DtUcString | fromUtf32 (const unsigned int *utf32, int len=-1) |
| | Create a unicode string from an UTF-32 encoded string, the string MUST be zero terminated if the length is not passed.
|
| static DtUcString | fromAscii (const std::string &ascii) |
| | Create a unicode string from an ascii string, the string MUST be zero terminated if the length is not passed.
|
| static DtUcString | fromAscii (const char *ascii, int len=-1) |
| | Create a unicode string from an ascii string, the string MUST be zero terminated if the length is not passed.
|
| static DtUcString | tr (const char *ascii) |
| | Ascii translation function, used to be compatible with Qt's translation tools.
|
| template<typename QStringType > |
| static DtUcString | fromQString (QStringType qstr) |
| | Template function for setting from Qt 4 style string.
|
Instances of DtUcFilename are DtUcStrings which convert filenames to the native format.