diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-16 18:56:48 +0100 |
---|---|---|
committer | Andreas Stöckel <andreas@somweyr.de> | 2015-02-16 18:56:48 +0100 |
commit | f6069914af0d47bfea343b0babb734c9fd6d432d (patch) | |
tree | c5af9664dddcbe0a18b2edbf9074325b6af4a2af /src/core/Registry.hpp | |
parent | f69518b192ba5015e7ececddbfcf3a3695487d00 (diff) |
Added "autocomplete" function to ResourceLocator and Registry
Diffstat (limited to 'src/core/Registry.hpp')
-rw-r--r-- | src/core/Registry.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/Registry.hpp b/src/core/Registry.hpp index 4b4cb65..b4ce1a9 100644 --- a/src/core/Registry.hpp +++ b/src/core/Registry.hpp @@ -30,6 +30,7 @@ #include <map> #include <set> +#include <string> #include <vector> #include <core/common/Rtti.hpp> @@ -153,6 +154,23 @@ public: bool locateResource(Resource &resource, const std::string &path, ResourceType type = ResourceType::UNKNOWN, const Resource &relativeTo = NullResource) const; + + /** + * Performs autocompletion of resources with missing file extension and + * returns a list of possible files existing within the filesystem. + * + * @param path is the path for which the autocompletion shuold be performed. + * @param type is the ResourceType which is used to select the search paths. + * @param relativeTo is another resource relatie to which the resource may + * be looked up. + * @return a list of possible files to which the given path may be extended. + * If the file pointed to by "path" exists, it will be the only result in + * the list. Otherwise files which have the given path as a prefix but a + * different file extension are returned. + */ + std::vector<std::string> autocompleteResource( + const std::string &path, ResourceType type = ResourceType::UNKNOWN, + const Resource &relativeTo = NullResource) const; }; } |