X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvirtualfilesystem.h;h=045f9b5057bcdb2b3514736147f83c015d97afd5;hb=b0b8e35336104f6e17fb128d794ab1655eb6fee0;hp=b19d10e8b45382ae9d18f89d77a7eb55546fe885;hpb=243d7c7355c1c5d9a0134440f340936325caaf88;p=builder.git diff --git a/source/virtualfilesystem.h b/source/virtualfilesystem.h index b19d10e..045f9b5 100644 --- a/source/virtualfilesystem.h +++ b/source/virtualfilesystem.h @@ -4,6 +4,7 @@ #include #include #include +#include "buildinfo.h" class Builder; class FileTarget; @@ -17,19 +18,20 @@ possible to build them. class VirtualFileSystem { public: - typedef std::list SearchPath; + typedef std::list SearchPath; private: - typedef std::map TargetMap; + typedef std::map TargetMap; Builder &builder; TargetMap targets; - TargetMap include_cache; - TargetMap library_cache; + std::set nonexistent; 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 @@ -44,12 +46,15 @@ public: used in linking with the library. If a file is found but no target is associated with it, a new package-less target of appropriate type is created. */ - FileTarget *find_library(const std::string &, const SearchPath &, LibMode); + FileTarget *find_library(const std::string &, const SearchPath &, BuildInfo::LibraryMode); + + /** 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: - FileTarget *get_header(const Msp::FS::Path &, const Tool &); - FileTarget *get_library(const std::string &, const Msp::FS::Path &, LibMode); - Msp::FS::Path try_patterns(const Msp::FS::Path &, const std::list &, const std::string &); + bool file_exists(const Msp::FS::Path &); }; #endif