|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_OS_RESOURCEFINDER_H
11 #define YARP_OS_RESOURCEFINDER_H
43 #ifndef YARP_NO_DEPRECATED // Since YARP 3.4
55 bool setVerbose(
bool verbose =
true);
67 bool setQuiet(
bool quiet =
true);
68 #endif // YARP_NO_DEPRECATED
81 bool configure(
int argc,
char* argv[],
bool skipFirstArgument =
true);
94 return addContext(contextName);
103 bool setDefault(
const std::string& key,
const std::string& val);
111 bool setDefault(
const std::string& key, std::int32_t val);
136 return setDefault(
"from", fname);
155 std::string findFile(
const std::string& name);
164 std::string findFileByName(
const std::string& name);
181 std::string findPath(
const std::string& name);
204 std::string findPath();
214 std::string getContext();
225 bool check(
const std::string& key)
const override;
226 Value& find(
const std::string& key)
const override;
227 Bottle& findGroup(
const std::string& key)
const override;
228 bool isNull()
const override;
229 std::string
toString()
const override;
240 virtual ResourceFinder findNestedResourceFinder(
const std::string& key);
245 return isConfiguredFlag;
284 return getDataHomeWithPossibleCreation(
true);
296 return getDataHomeWithPossibleCreation(
false);
316 return getConfigHomeWithPossibleCreation(
true);
327 return getConfigHomeWithPossibleCreation(
false);
335 std::string getHomeContextPath();
342 std::string getHomeRobotPath();
359 static Bottle getDataDirs();
376 static Bottle getConfigDirs();
381 std::string findPath(
const std::string& name,
384 std::string findFile(
const std::string& name,
387 std::string findFileByName(
const std::string& name,
391 const std::string& key,
398 bool addContext(
const std::string& appName);
405 bool isConfiguredFlag;
408 static std::string getDataHomeWithPossibleCreation(
bool mayCreate);
409 static std::string getConfigHomeWithPossibleCreation(
bool mayCreate);
410 static std::string createIfAbsent(
bool mayCreate,
const std::string& path);
412 #ifndef DOXYGEN_SHOULD_SKIP_THIS
417 #endif // DOXYGEN_SHOULD_SKIP_THIS
423 #endif // YARP_OS_RESOURCEFINDER_H
A simple collection of objects that can be described and transmitted in a portable way.
A base class for nested structures that can be searched.
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
These options are loosely based on http://wiki.icub.org/wiki/YARP_ResourceFinder.
bool setDefaultContext(const std::string &contextName)
Sets the context for the current ResourceFinder object.
static std::string getConfigHome()
Location where user config files are stored.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
bool isConfigured() const
static std::string getDataHomeNoCreate()
Variant of getDataHome that will never create the directory returned.
std::string toString(const T &value)
convert an arbitrary type to string.
The main, catch-all namespace for YARP.
static std::string getConfigHomeNoCreate()
Variant of getConfigHome that will never create the directory returned.
bool setDefaultConfigFile(const std::string &fname)
Provide a default value for the configuration file (can be overridden from command line with the –fro...
A single value (typically within a Bottle).
static std::string getDataHome()
Location where user data files are stored.
A class for storing options and configuration information.
Helper class for finding config files and other external resources.