You.i Engine
CYIDir Class Reference

Detailed Description

This class provides functionality for working with directories.

#include <utility/YiDir.h>

Static Public Member Functions

static const CYIStringGetSeparator ()
 
static CYIString RemoveTrailingSeparators (CYIStringView path)
 
static std::vector< CYIStringGetListing (const CYIString &directoryName)
 
static bool AreDirectoryOperationsSupportedIn (const CYIString &path)
 
static bool DirectoryExists (const CYIString &path)
 
static bool IsDirectory (const CYIString &path)
 
static bool CreateDirectory (const CYIString &path, bool createParents=false)
 
static bool RemoveDirectory (const CYIString &path)
 

Member Function Documentation

◆ AreDirectoryOperationsSupportedIn()

static bool CYIDir::AreDirectoryOperationsSupportedIn ( const CYIString path)
static

Returns true if directories can be created and destroyed within the specified path.

◆ CreateDirectory()

static bool CYIDir::CreateDirectory ( const CYIString path,
bool  createParents = false 
)
static

Creates the final directory in an absolute or relative path. If createParents is true, also creates all listed directories leading up to the final directory. Returns true if directory exists or has been created.

◆ DirectoryExists()

static bool CYIDir::DirectoryExists ( const CYIString path)
static

Returns true if directory exists at the absolute or relative path specified (and is actually a directory).

Deprecated:
This function is deprecated and may be removed in a future release. IsDirectory should be used instead.

◆ GetListing()

static std::vector<CYIString> CYIDir::GetListing ( const CYIString directoryName)
static

Returns a list of files and folders contained in the directory specified by directoryName.

The list will be empty if the directory is empty, the specified path is not a directory, or the specified path does not exist.

Note
On the Tizen platform this method will only return a listing of files which have been accessed previously in the application's current session. This is a limitation due to the sandboxed file system used by the NaCl environment on Tizen.

◆ GetSeparator()

static const CYIString& CYIDir::GetSeparator ( )
static

Returns the native directory separator character for the current platform. On Windows, it would be '\' and on Unix and Unix-derivative systems it would be '/'.

◆ IsDirectory()

static bool CYIDir::IsDirectory ( const CYIString path)
static

Returns true if the file at path exists and is a directory. Absolute and relative paths are supported.

See also
CYIFile::IsFile

◆ RemoveDirectory()

static bool CYIDir::RemoveDirectory ( const CYIString path)
static

Removes the final directory in an absolute or relative path if it is empty. Returns true if removal is successful.

◆ RemoveTrailingSeparators()

static CYIString CYIDir::RemoveTrailingSeparators ( CYIStringView  path)
static

Returns the path with any trailing directory separators removed. For example, calling this function with the path /foo/bar/ results in /foo/bar being returned.

Note
Both Windows forward-slash separators and Unix backslash separators are removed.
The special path / is left unmodified as it represents the root directory on Unix platforms.

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