hecl
High-Level Extensible Combiner Language and Resource Database
|
Main project interface. More...
#include <HECLDatabase.hpp>
Classes | |
class | ConfigFile |
Configuration file handle. More... | |
class | IndexFile |
Index file handle. More... | |
class | PackageException |
Internal packagePath() exception. More... | |
Public Types | |
enum | Cost { C_NONE, C_LIGHT, C_MEDIUM, C_HEAVY } |
A rough description of how 'expensive' a given cook operation is. More... | |
typedef std::vector< std::pair< const DataSpecEntry &, bool > > | CompiledSpecs |
Public Member Functions | |
Project (const HECL::ProjectRootPath &rootPath) | |
void | registerLogger (HECL::FLogger logger) |
Register an optional callback to report log-messages using. More... | |
const ProjectRootPath & | getProjectRootPath () const |
Get the path of the project's root-directory. More... | |
bool | addPaths (const std::vector< ProjectPath > &paths) |
Add given file(s) to the database. More... | |
bool | removePaths (const std::vector< ProjectPath > &paths, bool recursive=false) |
Remove a given file or file-pattern from the database. More... | |
bool | addGroup (const ProjectPath &path) |
Register a working sub-directory as a Dependency Group. More... | |
bool | removeGroup (const ProjectPath &path) |
Unregister a working sub-directory as a dependency group. More... | |
const CompiledSpecs & | getDataSpecs () |
Return map populated with dataspecs targetable by this project interface. More... | |
bool | enableDataSpecs (const std::vector< SystemString > &specs) |
Enable persistent user preference for particular spec string(s) More... | |
bool | disableDataSpecs (const std::vector< SystemString > &specs) |
Disable persistent user preference for particular spec string(s) More... | |
bool | cookPath (const ProjectPath &path, std::function< void(SystemString &, Cost, unsigned)> feedbackCb, bool recursive=false) |
Begin cook process for specified directory. More... | |
void | interruptCook () |
Interrupts a cook in progress (call from SIGINT handler) More... | |
bool | cleanPath (const ProjectPath &path, bool recursive=false) |
Delete cooked objects for directory. More... | |
PackageDepsgraph | buildPackageDepsgraph (const ProjectPath &path) |
Constructs a full depsgraph of the project-subpath provided. More... | |
Public Attributes | |
ConfigFile | m_specs |
ConfigFile | m_paths |
ConfigFile | m_groups |
IndexFile | m_index |
Main project interface.
Projects are intermediate working directories used for staging resources in their ideal editor-formats. This interface exposes all primary operations to perform on a given project.
A rough description of how 'expensive' a given cook operation is.
This is used to provide pretty colors during the cook operation
bool HECL::Database::Project::addGroup | ( | const ProjectPath & | path | ) |
Register a working sub-directory as a Dependency Group.
path | directory to register as Dependency Group |
Dependency Groups are used at runtime to stage burst load-transactions. They may only be added to directories and will automatically claim subdirectories as well.
Cooked objects in dependency groups will be packaged contiguously and automatically duplicated if shared with other dependency groups. This contiguous storage makes for optimal loading from slow block-devices like optical drives.
bool HECL::Database::Project::addPaths | ( | const std::vector< ProjectPath > & | paths | ) |
Add given file(s) to the database.
path | file or pattern within project |
This method blocks while object hashing takes place
PackageDepsgraph HECL::Database::Project::buildPackageDepsgraph | ( | const ProjectPath & | path | ) |
Constructs a full depsgraph of the project-subpath provided.
path | Subpath of project to root depsgraph at |
bool HECL::Database::Project::cleanPath | ( | const ProjectPath & | path, |
bool | recursive = false |
||
) |
Delete cooked objects for directory.
path | directory of intermediates to clean |
recursive | traverse subdirectories to clean as well |
Developers understand how useful 'clean' is. While ideally not required, it's useful for verifying that a rebuild from ground-up is doable.
bool HECL::Database::Project::cookPath | ( | const ProjectPath & | path, |
std::function< void(SystemString &, Cost, unsigned)> | feedbackCb, | ||
bool | recursive = false |
||
) |
Begin cook process for specified directory.
path | directory of intermediates to cook |
feedbackCb | a callback to run reporting cook-progress |
recursive | traverse subdirectories to cook as well |
Object cooking is generally an expensive process for large projects. This method blocks execution during the procedure, with periodic feedback delivered via feedbackCb.
bool HECL::Database::Project::disableDataSpecs | ( | const std::vector< SystemString > & | specs | ) |
Disable persistent user preference for particular spec string(s)
specs | String(s) representing unique spec(s) from listDataSpecs |
bool HECL::Database::Project::enableDataSpecs | ( | const std::vector< SystemString > & | specs | ) |
Enable persistent user preference for particular spec string(s)
specs | String(s) representing unique spec(s) from listDataSpecs |
|
inline |
Return map populated with dataspecs targetable by this project interface.
|
inline |
Get the path of the project's root-directory.
absolute | return as absolute-path |
Self explanatory
void HECL::Database::Project::interruptCook | ( | ) |
Interrupts a cook in progress (call from SIGINT handler)
Database corruption is bad! sqlite is pretty robust at avoiding data corruption, but HECL spreads its data objects through the filesystem; this ensures that those objects are cleanly finalized or discarded before stopping.
Note that this method returns immediately; the resumed cookPath() call will return as quickly as possible.
void HECL::Database::Project::registerLogger | ( | HECL::FLogger | logger | ) |
Register an optional callback to report log-messages using.
logger | logger-callback |
If this method is never called, all project operations will run silently.
bool HECL::Database::Project::removeGroup | ( | const ProjectPath & | path | ) |
Unregister a working sub-directory as a dependency group.
path | directory to unregister as Dependency Group |
bool HECL::Database::Project::removePaths | ( | const std::vector< ProjectPath > & | paths, |
bool | recursive = false |
||
) |
Remove a given file or file-pattern from the database.
paths | file(s) or pattern(s) within project |
recursive | traverse into matched subdirectories |
This method will not delete actual working files from the project directory. It will delete associated cooked objects though.