aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/runfiles/runfiles.h
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2018-02-28 06:48:18 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-02-28 06:49:53 -0800
commite7d9e1f8aae459ec71cdb31f988661f4c3975ca8 (patch)
treeb9e4f36d4ad55fe8a45aba0667db010fae9e8e95 /src/tools/runfiles/runfiles.h
parent51275462a5f63d34e176e76ef372e91b25ecee56 (diff)
runfiles,C++: implement manifest-based runfiles
Implement a manifest-based Runfiles object, add tests and test utils (MockFile). Subsequent commits will add more feataures: - creating list of envvars to pass to child processes - automatic Runfiles creation based on argv[0] and the envvars of this process See https://github.com/bazelbuild/bazel/issues/4460 Change-Id: I4376ede3ac00241688ff16a36ed596fb08f13a72 PiperOrigin-RevId: 187318502
Diffstat (limited to 'src/tools/runfiles/runfiles.h')
-rw-r--r--src/tools/runfiles/runfiles.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tools/runfiles/runfiles.h b/src/tools/runfiles/runfiles.h
index c15dec39e0..821cc1aa6f 100644
--- a/src/tools/runfiles/runfiles.h
+++ b/src/tools/runfiles/runfiles.h
@@ -32,8 +32,12 @@ class Runfiles {
// Runfiles* Create(const string& argv0, string* error);
// TODO(laszlocsomor): implement:
// vector<pair<string, string>> EnvVars();
- // TODO(laszlocsomor): implement:
- // Runfiles* CreateManifestBased(const string& path, string* error);
+
+ // Returns a new manifest-based `Runfiles` instance.
+ // Returns nullptr on error. If `error` is provided, the method prints an
+ // error message into it.
+ static Runfiles* CreateManifestBased(const std::string& manifest_path,
+ std::string* error = nullptr);
// Returns a new directory-based `Runfiles` instance.
// Returns nullptr on error. If `error` is provided, the method prints an