]> git.tdb.fi Git - builder.git/blobdiff - source/virtualfilesystem.h
Move library mode into BuildInfo
[builder.git] / source / virtualfilesystem.h
index f0cb7383fc9e26ea093d558cbb5bc2885d574f89..045f9b5057bcdb2b3514736147f83c015d97afd5 100644 (file)
@@ -4,6 +4,7 @@
 #include <list>
 #include <map>
 #include <msp/fs/path.h>
+#include "buildinfo.h"
 
 class Builder;
 class FileTarget;
@@ -17,10 +18,10 @@ possible to build them.
 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;
@@ -29,6 +30,8 @@ private:
 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
@@ -43,7 +46,12 @@ 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:
        bool file_exists(const Msp::FS::Path &);