class VirtualFileSystem
{
public:
- typedef std::list<std::string> SearchPath;
+ typedef std::list<Msp::FS::Path> SearchPath;
private:
- typedef std::map<std::string, FileTarget *> TargetMap;
+ typedef std::map<Msp::FS::Path, FileTarget *> TargetMap;
Builder &builder;
TargetMap targets;
public:
VirtualFileSystem(Builder &);
+ /** Gets an existing target associated with a path. If no target has claimed
+ that path, 0 is returned. */
FileTarget *get_target(const Msp::FS::Path &) const;
/** Registers a target with the VFS. A target may be registered at multiple
created. */
FileTarget *find_library(const std::string &, const SearchPath &, LibMode);
+ /** Locates a binary. The normal search path for binaries is used (usually
+ this means the PATH environment variable). If a file is found but no target
+ is associated with it, a new package-less Executable target is created. */
+ FileTarget *find_binary(const std::string &);
+
private:
bool file_exists(const Msp::FS::Path &);
};