Drake C++ Documentation
find_runfiles.h File Reference

Detailed Description

This file contains helpers to work with Bazel-declared runfiles – declared data dependencies used by C++ code.

The functions in this file only succeed when used within a Bazel build.

All source code within Drake should use FindResource() or FindResourceOrThrow() instead of these Runfiles routines, because FindResource will operate correctly in pre-compiled / installed builds of Drake whereas FindRunfile will not.

These runfiles-related helpers are intended for use by downstream Bazel projects that use Drake as a library, so that those projects can reuse the relatively complicated logic within these routines during source builds.

#include <string>
Include dependency graph for find_runfiles.h:


struct  RlocationOrError
 (Advanced.) The return type of FindRunfile(). More...




bool HasRunfiles ()
 (Advanced.) Returns true iff this process has Bazel runfiles available. More...
RlocationOrError FindRunfile (const std::string &resource_path)
 (Advanced.) Returns the absolute path to the given resource_path from Bazel runfiles, or else an error message when not found. More...