YARP
Yet Another Robot Platform
yarp::os::impl::NameConfig Class Reference

Small helper class to help deal with legacy YARP configuration files. More...

#include <yarp/os/impl/NameConfig.h>

Public Member Functions

std::string getSafeString (const std::string &txt)
 
std::string getConfigFileName (const char *stem=nullptr, const char *ns=nullptr)
 
std::string readConfig (const std::string &fileName)
 
bool writeConfig (const std::string &fileName, const std::string &text)
 
bool fromFile (const char *ns=nullptr)
 
bool toFile (bool clean=false)
 
void setAddress (const Contact &address)
 
Contact getAddress ()
 
std::string getMode ()
 
void setMode (const std::string &mode)
 
std::string getNamespace (bool refresh=false)
 
yarp::os::Bottle getNamespaces (bool refresh=false)
 
void setNamespace (const std::string &ns)
 

Static Public Member Functions

static std::string expandFilename (const char *fname)
 
static std::string getHostName (bool prefer_loopback=false, const std::string &seed="")
 
static std::string getIps ()
 
static yarp::os::Bottle getIpsAsBottle ()
 
static bool isLocalName (const std::string &name)
 

Detailed Description

Small helper class to help deal with legacy YARP configuration files.

Definition at line 27 of file NameConfig.h.

Member Function Documentation

◆ expandFilename()

std::string NameConfig::expandFilename ( const char *  fname)
static

Definition at line 94 of file NameConfig.cpp.

◆ fromFile()

bool NameConfig::fromFile ( const char *  ns = nullptr)

Definition at line 157 of file NameConfig.cpp.

◆ getAddress()

Contact NameConfig::getAddress ( )

Definition at line 185 of file NameConfig.cpp.

◆ getConfigFileName()

std::string NameConfig::getConfigFileName ( const char *  stem = nullptr,
const char *  ns = nullptr 
)

Definition at line 120 of file NameConfig.cpp.

◆ getHostName()

std::string NameConfig::getHostName ( bool  prefer_loopback = false,
const std::string &  seed = "" 
)
static

Definition at line 207 of file NameConfig.cpp.

◆ getIps()

std::string NameConfig::getIps ( )
static

Definition at line 414 of file NameConfig.cpp.

◆ getIpsAsBottle()

yarp::os::Bottle NameConfig::getIpsAsBottle ( )
static

Definition at line 363 of file NameConfig.cpp.

◆ getMode()

std::string yarp::os::impl::NameConfig::getMode ( )
inline

Definition at line 58 of file NameConfig.h.

◆ getNamespace()

std::string NameConfig::getNamespace ( bool  refresh = false)

Definition at line 440 of file NameConfig.cpp.

◆ getNamespaces()

Bottle NameConfig::getNamespaces ( bool  refresh = false)

Definition at line 461 of file NameConfig.cpp.

◆ getSafeString()

std::string NameConfig::getSafeString ( const std::string &  txt)

Definition at line 108 of file NameConfig.cpp.

◆ isLocalName()

bool NameConfig::isLocalName ( const std::string &  name)
static

Definition at line 317 of file NameConfig.cpp.

◆ readConfig()

std::string NameConfig::readConfig ( const std::string &  fileName)

Definition at line 140 of file NameConfig.cpp.

◆ setAddress()

void NameConfig::setAddress ( const Contact address)

Definition at line 429 of file NameConfig.cpp.

◆ setMode()

void yarp::os::impl::NameConfig::setMode ( const std::string &  mode)
inline

Definition at line 63 of file NameConfig.h.

◆ setNamespace()

void NameConfig::setNamespace ( const std::string &  ns)

Definition at line 435 of file NameConfig.cpp.

◆ toFile()

bool NameConfig::toFile ( bool  clean = false)

Definition at line 170 of file NameConfig.cpp.

◆ writeConfig()

bool NameConfig::writeConfig ( const std::string &  fileName,
const std::string &  text 
)

Definition at line 191 of file NameConfig.cpp.


The documentation for this class was generated from the following files: