# Frost::Directory Class Reference

A tool for directory listing. More...

`#include <frost_utils_directory.h>`

List of all members.

## Public Member Functions

| Directory (const s_str &sRelPath)
| Call that constructor to open a directory.
s_wptr< Directory > | GetNextSubDirectory ()
| Iterates through sub-directories.
s_ctnr< s_str > | GetFileList (const s_bool &bWithPath=false, const s_str &sExtensionFilter="") const
| Returns the list of the contained files.
s_ctnr< s_str > | GetRecursiveFileList (const s_bool &bWithPath=false, const s_str &sExtensionFilter="") const
| Returns the list of the contained files (recursive).
const s_str & | GetName () const
| Returns this directory's name.
const s_str & | GetRelPath () const
| Returns this directory's relative path.

## Static Public Member Functions

static s_bool | Exists (const s_str &sPath)
| Checks if a directory exists.
static s_bool | Make (const s_str &sPath)
| Creates a new directory.

## Static Public Attributes

static const s_str | CLASS_NAME = "Directory"

## Static Private Member Functions

static s_bool | Make_ (const s_str &sPath)
| Creates a new directory.

## Private Attributes

s_ctnr< s_refptr< Directory > > | lSubDirectoryList_
| The sub-directory list.
s_ctnr< s_str > | lFileList_
| The contained file list.
s_uint | uiIter_
| The sub-directory iterator.
s_str | sName_
| This directory name.
s_str | sRelPath_
| This directory relative path (with name).

## Detailed Description

A tool for directory listing.

This class iterates through every sub- directories, store them in a vector and list their sub-directories, ...

Definition at line 22 of file frost_utils_directory.h.

## Constructor & Destructor Documentation

Frost::Directory::Directory | ( | const s_str & | sRelPath | ) |

Call that constructor to open a directory.

Parameters:

  | sRelPath | The directory path (relative to the program).

## Member Function Documentation

static s_bool Frost::Directory::Exists | ( | const s_str & | sPath | ) | `[static]`

Checks if a directory exists.

Parameters:

  | sPath | The path to the directory to check

Returns:
  'true' if the directory exists

s_ctnr<s_str> Frost::Directory::GetFileList | ( | const s_bool & | bWithPath = `false`,
|  | const s_str & | sExtensionFilter = `""` |
| ) |  |  | const

Returns the list of the contained files.

Parameters:

  | bWithPath | 'true' to include this Directory's relative path
  | sExtensionFilter | Use it to filter files depending on their extention

Returns:
  The list of the contained files

Note:
  Example : if you use "xml" as the extention filter, then only *.xml files will appear on the list.
  Example : if you use "xml, lua", then you'll only get *.xml and *.lua files.

const s_str & Frost::Directory::GetName | ( |  | ) | const

Returns this directory's name.

Returns:
  This directory's name

Note:
  For example : Interface/Base_UI.
  This function would return "Base_UI".

Definition at line 293 of file frost_utils_directory.cpp.

s_wptr< Directory > Frost::Directory::GetNextSubDirectory | ( |  | ) |

Iterates through sub-directories.

Returns:
  The next sub-directory, 'nullptr' if none

Definition at line 213 of file frost_utils_directory.cpp.

s_ctnr<s_str> Frost::Directory::GetRecursiveFileList | ( | const s_bool & | bWithPath = `false`,
|  | const s_str & | sExtensionFilter = `""` |
| ) |  |  | const

Returns the list of the contained files (recursive).

Parameters:

  | bWithPath | 'true' to include this Directory's relative path
  | sExtensionFilter | Use it to filter files depending on their extention

Returns:
  The list of the contained files (recursive)

Note:
  Example : if you use "xml" as the extention filter, then only *.xml files will appear on the list.
  Example : if you use "xml, lua", then you'll only get *.xml and *.lua files.
  This function searches through subdirectories too.

const s_str & Frost::Directory::GetRelPath | ( |  | ) | const

Returns this directory's relative path.

Returns:
  This directory's relative path

Note:
  For example : Interface/Base_UI.
  This function would return "Interface/Base_UI".

Definition at line 298 of file frost_utils_directory.cpp.

static s_bool Frost::Directory::Make | ( | const s_str & | sPath | ) | `[static]`

Creates a new directory.

Parameters:

  | sPath | The path to the directory to create

Returns:
  'true' if the operation was successful

Note:
  This fuction doesn't check if the directory already exists.

static s_bool Frost::Directory::Make_ | ( | const s_str & | sPath | ) | `[static, private]`

Creates a new directory.

Parameters:

  | sPath | The path to the directory to create

Returns:
  'true' if the operation was successful

Note:
  This version is very low level, it does absolutely no checks, nor does it support nested directories.

## Member Data Documentation

const s_str Frost::Directory::CLASS_NAME = "Directory"`[static]`

Definition at line 87 of file frost_utils_directory.h.

s_ctnr<s_str> Frost::Directory::lFileList_`[private]`

The contained file list.

Definition at line 102 of file frost_utils_directory.h.

s_ctnr< s_refptr<Directory> > Frost::Directory::lSubDirectoryList_`[private]`

The sub-directory list.

Definition at line 100 of file frost_utils_directory.h.

s_str Frost::Directory::sName_`[private]`

This directory name.

Definition at line 106 of file frost_utils_directory.h.

s_str Frost::Directory::sRelPath_`[private]`

This directory relative path (with name).

Definition at line 108 of file frost_utils_directory.h.

s_uint Frost::Directory::uiIter_`[private]`

The sub-directory iterator.

Definition at line 104 of file frost_utils_directory.h.

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

- D:/Programmation/Sources/Tensor2/Utils/include/frost_utils_directory.h
- D:/Programmation/Sources/Tensor2/Utils/src/frost_utils_directory.cpp