X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvirtualfilesystem.h;h=a3327de2490001c1f3e3c349ac284e66fb9c7611;hb=HEAD;hp=b19d10e8b45382ae9d18f89d77a7eb55546fe885;hpb=243d7c7355c1c5d9a0134440f340936325caaf88;p=builder.git diff --git a/source/virtualfilesystem.h b/source/virtualfilesystem.h deleted file mode 100644 index b19d10e..0000000 --- a/source/virtualfilesystem.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef VIRTUALFILESYSTEM_H_ -#define VIRTUALFILESYSTEM_H_ - -#include -#include -#include - -class Builder; -class FileTarget; -class Pattern; - -/** -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: - typedef std::list SearchPath; - -private: - typedef std::map TargetMap; - - Builder &builder; - TargetMap targets; - TargetMap include_cache; - TargetMap library_cache; - -public: - VirtualFileSystem(Builder &); - - 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. */ - FileTarget *find_header(const std::string &, const SearchPath &); - - /** 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. */ - FileTarget *find_library(const std::string &, const SearchPath &, LibMode); - -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 &); -}; - -#endif