XLE  v0.02.0
Public Types | Public Member Functions | List of all members
Utility::FileNameSplitter< CharType > Class Template Reference

Split a filename into its component parts More...

#include <PathUtils.h>

Public Types

using Section = StringSection< CharType >
 

Public Member Functions

Section Drive () const
 
Section Path () const
 
Section File () const
 
Section Extension () const
 
Section ExtensionWithPeriod () const
 
Section Parameters () const
 
Section ParametersWithDivider () const
 
Section DriveAndPath () const
 
Section FileAndExtension () const
 
Section AllExceptParameters () const
 
Section FullFilename () const
 
 FileNameSplitter (const CharType rawString[])
 
 FileNameSplitter (const std::basic_string< CharType > &rawString)
 
 FileNameSplitter (Section rawString)
 

Detailed Description

template<typename CharType>
class Utility::FileNameSplitter< CharType >

Split a filename into its component parts

Separates a filename into drive, path, file, extension and parameters. Handy for separating out an individual part of a filename (such as just getting the extension)

Note that this class does not keep a copy of the value passed in. If the input string is freed (or changes or becomes invalid), that the FileNameSplitter will be invalidated. Be careful when using with volatile or temporary objects!

It's done this way to minimize overhead when doing simple operations (like finding the extension).

Note that network paths and path with protocols (eg, "file://.../") are not supported.

See also
Utility::XlExtension, Utility::XlDirname

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