7 #ifndef YARP_OS_RESOURCEFINDER_H
8 #define YARP_OS_RESOURCEFINDER_H
51 bool configure(
int argc,
char* argv[],
bool skipFirstArgument =
true);
64 return addContext(contextName);
73 bool setDefault(
const std::string& key,
const std::string& val);
81 bool setDefault(
const std::string& key, std::int32_t val);
106 return setDefault(
"from", fname);
125 std::string findFile(
const std::string& name);
134 std::string findFileByName(
const std::string& name);
151 std::string findPath(
const std::string& name);
174 std::string findPath();
184 std::string getContext();
195 bool check(
const std::string& key)
const override;
196 Value& find(
const std::string& key)
const override;
198 bool isNull()
const override;
199 std::string
toString()
const override;
210 virtual ResourceFinder findNestedResourceFinder(
const std::string& key);
215 return m_isConfiguredFlag;
234 std::string getHomeContextPath();
239 std::string getHomeRobotPath();
244 std::string findPath(
const std::string& name,
247 std::string findFile(
const std::string& name,
250 std::string findFileByName(
const std::string& name,
254 const std::string& key,
257 #ifndef YARP_NO_DEPRECATED
269 bool setVerbose(bool verbose = true);
281 bool setQuiet(
bool quiet =
true);
284 #ifndef YARP_NO_DEPRECATED
303 YARP_DEPRECATED_MSG("Use yarp::conf::dirs::data_home() + yarp::os::mkdir_p() instead")
306 return getDataHomeWithPossibleCreation(
true);
317 static std::
string getDataHomeNoCreate()
319 return getDataHomeWithPossibleCreation(
false);
338 static std::
string getConfigHome()
340 return getConfigHomeWithPossibleCreation(
true);
350 static std::
string getConfigHomeNoCreate()
352 return getConfigHomeWithPossibleCreation(
false);
371 static
Bottle getDataDirs();
389 static
Bottle getConfigDirs();
395 bool addContext(
const std::string& appName);
402 bool m_isConfiguredFlag;
405 static std::string createIfAbsent(
bool mayCreate,
const std::string& path);
407 #ifndef YARP_NO_DEPRECATED
408 static std::string getDataHomeWithPossibleCreation(
bool mayCreate);
409 static std::string getConfigHomeWithPossibleCreation(
bool mayCreate);
412 #ifndef DOXYGEN_SHOULD_SKIP_THIS
A simple collection of objects that can be described and transmitted in a portable way.
A class for storing options and configuration information.
These options are loosely based on http://wiki.icub.org/wiki/YARP_ResourceFinder.
Helper class for finding config files and other external resources.
bool setDefaultContext(const std::string &contextName)
Sets the context for the current ResourceFinder object.
static std::string getDataHome()
Location where user data files are stored.
bool isConfigured() const
bool setDefaultConfigFile(const std::string &fname)
Provide a default value for the configuration file (can be overridden from command line with the –fro...
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
A single value (typically within a Bottle).
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
std::string toString(const T &value)
convert an arbitrary type to string.
std::string findGroup(const robotinterface::ParamList &list, const std::string &name)
The main, catch-all namespace for YARP.