Scene Lab
An open source project by FPL.
 All Classes Namespaces Files Functions Pages
util.h File Reference

Scan a directory on the file system for all files matching a given file extension. More...

#include <functional>
#include <string>
#include <unordered_map>
#include <vector>

Go to the source code of this file.

Detailed Description

Scan a directory on the file system for all files matching a given file extension.

Return all files found, along with the "last modified" time for each file.

This allows you to check a directory to see if any files have been modified since you last used them, which could be useful if you are hypothetically updating assets used within an editor tool whenever they change on disk, for example.

Classes

struct  scene_lab::AssetLoader
 AssetLoader struct, basically a tuple of directory, file extension, and loader function. More...
 

Namespaces

 scene_lab
 Utility functions that might be useful if you are using Scene Lab.
 

Functions

std::unordered_map
< std::string, time_t > 
scene_lab::ScanDirectory (const std::string &directory, const std::string &file_ext)
 
time_t scene_lab::LoadAssetsIfNewer (time_t threshold, const std::vector< AssetLoader > &asset_loaders)
 Load assets via the designated asset loaders. More...
 
time_t scene_lab::LoadAssetsIfNewer (time_t threshold, const std::string &directory, const std::string &file_extension, const AssetLoader::load_function_t &load_function)
 Scan a directory for assets matching a given file extension. More...