dlangui.core.files

This module contains cross-platform file access utilities

More...

Members

Enums

RootEntryType
enum RootEntryType

Filesystem root entry / bookmark types

Functions

appDataPath
string appDataPath(string subdir)

Returns application data directory

appendPath
string appendPath(string[] pathItems)

Appends file path parts with proper delimiters e.g. appendPath("/home/user", ".myapp", "config") => "/home/user/.myapp/config"

appendPath
char[] appendPath(char[] buf, string[] pathItems)

Appends file path parts with proper delimiters (as well converts delimiters inside path to system) to buffer e.g. appendPath("/home/user", ".myapp", "config") => "/home/user/.myapp/config"

convertPathDelimiters
char[] convertPathDelimiters(char[] buf)

Converts path delimiters to standard for platform inplace in buffer(e.g. / to \ on windows, \ to / on posix), returns buf

convertPathDelimiters
string convertPathDelimiters(string src)

Converts path delimiters to standard for platform (e.g. / to \ on windows, \ to / on posix)

filterFilename
bool filterFilename(string filename, string pattern)

check filename with pattern (currently only *.ext pattern is supported)

filterFilename
bool filterFilename(string filename, string[] filters)

Filters file name by pattern list

isPathDelimiter
bool isPathDelimiter(char ch)

Returns true if char ch is / or \ slash

isRoot
bool isRoot(string path)

returns true if directory is root directory (e.g. / or C:\)

listDirectory
bool listDirectory(string dir, bool includeDirs, bool includeFiles, bool showHiddenFiles, string[] filters, DirEntry[] entries)

List directory content

parentDir
string parentDir(string path)

returns parent directory for specified path

splitPath
string[] splitPath(string path)

Split path into elements, e.g. /home/user/dir1 -> ["home", "user", "dir1"], "c:\dir1\dir2" -> ["c:", "dir1", "dir2"]

Properties

currentDir
string currentDir [@property getter]

Returns current directory

exePath
string exePath [@property getter]

Returns current executable path only, including last path delimiter - removes executable name from result of std.file.thisExePath()

getRootPaths
RootEntry[] getRootPaths [@property getter]

returns array of system root entries

homeEntry
RootEntry homeEntry [@property getter]

Returns

homePath
string homePath [@property getter]

Returns user's home directory

Structs

RootEntry
struct RootEntry

Filesystem root entry item

Variables

PATH_DELIMITER
char PATH_DELIMITER;

path delimiter (\ for windows, / for others)

PATH_DELIMITER
char PATH_DELIMITER;

path delimiter (\ for windows, / for others)

Detailed Description

Synopsis:

import exlib.files;

Meta

License

Boost License 1.0

Authors

Vadim Lopatin, coolreader.org@gmail.com