Browse Source

Add doxygen docs to plFileName

Michael Hansen 11 years ago
parent
commit
2b1e05fcc7
  1. 2
      Doxyfile
  2. 2
      Sources/Plasma/CoreLib/plString.cpp
  3. 45
      Sources/Plasma/CoreLib/plString.h

2
Doxyfile

@ -353,7 +353,7 @@ TYPEDEF_HIDES_STRUCT = NO
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols.
SYMBOL_CACHE_SIZE = 0
SYMBOL_CACHE_SIZE = 4
# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given

2
Sources/Plasma/CoreLib/plString.cpp

@ -929,7 +929,7 @@ plFileName plFileName::StripFileName() const
if (end < 0)
return *this;
return Left(end + 1);
return Left(end);
}
plFileName plFileName::StripFileExt() const

45
Sources/Plasma/CoreLib/plString.h

@ -665,29 +665,70 @@ size_t ustrlen(const UniChar *ustr, size_t max = plString::kSizeAuto);
# define PATH_SEPARATOR_STR "/"
#endif
/* plFileName - custom extension of plString for manipulating filenames */
/** Subclass of plString with specific methods to help deal with common
* filename manipulation tasks.
*/
class plFileName : public plString
{
public:
/** Construct an empty filename. */
plFileName() { }
/** Construct a filename from the UTF-8 character data in \a cstr. */
plFileName(const char *cstr) : plString(cstr) { }
/** Construct a filename from the plString argument \a copy. */
plFileName(const plString &copy) : plString(copy) { }
/** Copy constructor. */
plFileName(const plFileName &copy) : plString(copy) { }
/** Return the name portion of the path (including extension).
* For example:
* <pre>plFileName("C:\\Path\\Filename.ext") => "Filename.ext"</pre>
*/
plString GetFileName() const;
/** Return the file extension from the filename.
* For example:
* <pre>plFileName("C:\\Path\\Filename.ext") => "ext"</pre>
*/
plString GetFileExt() const;
/** Return the name portion of the path, excluding its extension.
* For example:
* <pre>plFileName("C:\\Path\\Filename.ext") => "Filename"</pre>
*/
plString GetFileNameNoExt() const;
/** Return the path with the filename portion stripped off.
* For example:
* <pre>plFileName("C:\\Path\\Filename.ext") => "C:\\Path"</pre>
*/
plFileName StripFileName() const;
/** Return the filename with the extension stripped off.
* For example:
* <pre>plFileName("C:\\Path\\Filename.ext") => "C:\\Path\\Filename"</pre>
*/
plFileName StripFileExt() const;
/** Join two path components together with the correct path separator.
* For example:
* <pre>plFileName::Join("C:\\Path", "Filename.ext") => "C:\\Path\\Filename.ext"</pre>
*/
static plFileName Join(const plFileName &base, const plFileName &path);
// TODO: Make this more efficient
/** Join three path components together with the correct path separator.
* \todo Make this more efficient.
*/
static plFileName Join(const plFileName &base, const plFileName &path,
const plFileName& path2)
{ return Join(Join(base, path), path2); }
/** Join four path components together with the correct path separator.
* \todo Make this more efficient.
*/
static plFileName Join(const plFileName &base, const plFileName &path,
const plFileName& path2, const plFileName &path3)
{ return Join(Join(Join(base, path), path2), path3); }

Loading…
Cancel
Save