Drake
Drake C++ Documentation
find_resource.h File Reference
#include <filesystem>
#include <optional>
#include <string>
#include <vector>
#include "drake/common/drake_assert.h"
#include "drake/common/drake_copyable.h"
Include dependency graph for find_resource.h:
This graph shows which files directly or indirectly include this file:

Classes

class  FindResourceResult
 Models the outcome of drake::FindResource. More...
 

Namespaces

 drake
 

Functions

FindResourceResult FindResource (const std::string &resource_path)
 (Advanced) Attempts to locate a Drake resource named by the given resource_path. More...
 
std::string FindResourceOrThrow (const std::string &resource_path)
 (Advanced) Convenient wrapper for querying FindResource(resource_path) followed by FindResourceResult::get_absolute_path_or_throw(). More...
 
std::optional< std::string > ReadFile (const std::filesystem::path &path)
 Returns the content of the file at the given path, or nullopt if it cannot be read. More...
 
std::string ReadFileOrThrow (const std::filesystem::path &path)
 Returns the content of the file at the given path, or throws if it cannot be read. More...
 

Variables

const char *const kDrakeResourceRootEnvironmentVariableName
 The name of the environment variable that provides the first place where FindResource attempts to look. More...