7#ifndef YARP_OS_RESOURCEFINDER_H
8#define YARP_OS_RESOURCEFINDER_H
50 bool configure(
int argc,
char* argv[],
bool skipFirstArgument =
true);
63 return addContext(contextName);
72 bool setDefault(
const std::string& key,
const std::string& val);
80 bool setDefault(
const std::string& key, std::int32_t val);
105 return setDefault(
"from", fname);
124 std::string findFile(
const std::string& name);
133 std::string findFileByName(
const std::string& name);
150 std::string findPath(
const std::string& name);
173 std::string findPath();
183 std::string getContext();
194 bool check(
const std::string& key)
const override;
195 Value& find(
const std::string& key)
const override;
197 bool isNull()
const override;
198 std::string
toString()
const override;
209 virtual ResourceFinder findNestedResourceFinder(
const std::string& key);
214 return m_isConfiguredFlag;
233 std::string getHomeContextPath();
238 std::string getHomeRobotPath();
243 std::string findPath(
const std::string& name,
246 std::string findFile(
const std::string& name,
249 std::string findFileByName(
const std::string& name,
253 const std::string& key,
256#ifndef YARP_NO_DEPRECATED
268 bool setVerbose(bool verbose = true);
280 bool setQuiet(
bool quiet =
true);
283#ifndef YARP_NO_DEPRECATED
302 YARP_DEPRECATED_MSG("Use yarp::conf::dirs::data_home() + yarp::os::mkdir_p() instead")
305 return getDataHomeWithPossibleCreation(
true);
316 static
std::
string getDataHomeNoCreate()
318 return getDataHomeWithPossibleCreation(
false);
337 static
std::
string getConfigHome()
339 return getConfigHomeWithPossibleCreation(
true);
349 static
std::
string getConfigHomeNoCreate()
351 return getConfigHomeWithPossibleCreation(
false);
370 static
Bottle getDataDirs();
388 static
Bottle getConfigDirs();
394 bool addContext(
const std::string& appName);
401 bool m_isConfiguredFlag;
404 static std::string createIfAbsent(
bool mayCreate,
const std::string& path);
406#ifndef YARP_NO_DEPRECATED
407 static std::string getDataHomeWithPossibleCreation(
bool mayCreate);
408 static std::string getConfigHomeWithPossibleCreation(
bool mayCreate);
411#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.
An interface to the operating system, including Port based communication.
std::string findGroup(const robotinterface::ParamList &list, const std::string &name)
The main, catch-all namespace for YARP.