X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvirtualfilesystem.h;h=a3327de2490001c1f3e3c349ac284e66fb9c7611;hb=HEAD;hp=9a25930aa8a8cf693980cf80720a23bb3508623b;hpb=799d256e952913524c5e51a59c836e7a4cb52ea5;p=builder.git diff --git a/source/virtualfilesystem.h b/source/virtualfilesystem.h deleted file mode 100644 index 9a25930..0000000 --- a/source/virtualfilesystem.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef VIRTUALFILESYSTEM_H_ -#define VIRTUALFILESYSTEM_H_ - -#include -#include -#include -#include -#include "buildinfo.h" - -class Builder; -class FileTarget; -class Pattern; -class Tool; - -/** -Provides access to the filesystem in a way that takes known targets into -account. Thus, targets may be returned for files that do not exist yet if it's -possible to build them. -*/ -class VirtualFileSystem -{ -public: - using SearchPath = std::list; - -private: - Builder &builder; - std::map targets; - std::set nonexistent; - SearchPath sys_bin_path; - -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 - paths if building it results in multiple files. */ - void register_path(const Msp::FS::Path &, FileTarget *); - - /** Locates a source file. If a file is found but no target is associated - with it, a new package-less target is created with the appropriate tool. If - use_syspath is true, the system path reported by the tool is also searched. */ - FileTarget *find_header(const std::string &, Tool *, const SearchPath &, bool use_syspath = true); - - /** Locates a library. The library name should be the same as what would be - 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. If use_syspath is true, the system path reported by the LINK tool - is also searched. */ - FileTarget *find_library(const std::string &, const SearchPath &, BuildInfo::LibraryMode, bool use_syspath = true); - - /** 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 &); -}; - -#endif