Skip to content

Commit

Permalink
FS|libcore: Improved API convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Nov 4, 2018
1 parent dc4482e commit 92a831e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 12 additions & 1 deletion doomsday/sdk/libcore/include/de/filesys/filesystem.h
Expand Up @@ -151,9 +151,20 @@ class DENG2_PUBLIC FileSystem : public System

void printIndex();

/**
* Returns the root folder of the file system.
*/
Folder &root();

Folder const &root() const;
/**
* Returns the root folder of the file system.
*/
const Folder &root() const;

/**
* Returns the root folder of the file system.
*/
static Folder &rootFolder();

/**
* Refresh the file system asynchronously. Populates all folders with files from
Expand Down
5 changes: 5 additions & 0 deletions doomsday/sdk/libcore/src/filesys/filesystem.cpp
Expand Up @@ -455,6 +455,11 @@ Folder const &FileSystem::root() const
return *d->root;
}

Folder &FileSystem::rootFolder() // static
{
return get().root();
}

FileSystem &FileSystem::get() // static
{
return App::fileSystem();
Expand Down

0 comments on commit 92a831e

Please sign in to comment.