View source code
Display the source code in dmd/root/filename.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Struct dmd.root.filename.FileName

Encapsulate path and file names.

struct FileName ;

Constructors

NameDescription
this

Methods

NameDescription
absolute Determine if path is absolute.
addExt Add the extension ext to name, regardless of the content of name
canonicalName Return canonical version of name in a malloc'd buffer. This code is high risk.
combine Combine a path and a file name
defaultExt Free returned value with FileName::free()
ensurePathExists Ensure that the provided path exists
equals Compare two name according to the platform's rules (case sensitive or not)
equalsExt
equalsExt Return !=0 if extensions match.
exists Check if the file the path points to exists
ext Determine file name extension as slice of input.
forceExt Free returned value with FileName::free()
free Free memory allocated by FileName routines
name Return filename name excluding path (read-only).
path Return path portion of str. returned string is newly allocated Path does not include trailing path separator.
removeExt Return file name without extension.
replaceName Replace filename portion of path.
safeSearchPath Search Path for file in a safe manner.
searchPath Search paths for file.
splitPath Split path (such as that returned by getenv("PATH")) into pieces, each piece is mem.xmalloc'd Handle double quotes and ~. Pass the pieces to sink()
toAbsolute Return the given name as an absolute path

Authors

Walter Bright, http://www.digitalmars.com

License

Boost License 1.0