forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
find_runfiles.h
29 lines (23 loc) · 913 Bytes
/
find_runfiles.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once
#include <string>
namespace drake {
namespace internal {
/** Returns true iff this process has Bazel runfiles available. For both C++
and Python programs, and no matter what workspace a program resides in (`@drake`
or otherwise), this will be true when running `bazel-bin/pkg/program` or `bazel
test //pkg:program` or `bazel run //pkg:program`. */
bool HasRunfiles();
/** The return type of FindRunfile(). Exactly one of the two strings is
non-empty. */
struct RlocationOrError {
/** The absolute path to the resource_path runfile. */
std::string abspath;
/** The error message. */
std::string error;
};
/** Returns the absolute path to the given resource_path from Bazel runfiles,
or else an error message when not found. When HasRunfiles() is false, returns
an error. */
RlocationOrError FindRunfile(const std::string& resource_path);
} // namespace internal
} // namespace drake