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 22 of file NameConfig.h.

Member Function Documentation

◆ expandFilename()

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

Definition at line 95 of file NameConfig.cpp.

◆ fromFile()

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

Definition at line 158 of file NameConfig.cpp.

◆ getAddress()

Contact NameConfig::getAddress ( )

Definition at line 186 of file NameConfig.cpp.

◆ getConfigFileName()

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

Definition at line 121 of file NameConfig.cpp.

◆ getHostName()

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

Definition at line 210 of file NameConfig.cpp.

◆ getIps()

std::string NameConfig::getIps ( )

Definition at line 417 of file NameConfig.cpp.

◆ getIpsAsBottle()

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

Definition at line 366 of file NameConfig.cpp.

◆ getMode()

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

Definition at line 53 of file NameConfig.h.

◆ getNamespace()

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

Definition at line 443 of file NameConfig.cpp.

◆ getNamespaces()

Bottle NameConfig::getNamespaces ( bool  refresh = false)

Definition at line 464 of file NameConfig.cpp.

◆ getSafeString()

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

Definition at line 109 of file NameConfig.cpp.

◆ isLocalName()

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

Definition at line 320 of file NameConfig.cpp.

◆ readConfig()

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

Definition at line 141 of file NameConfig.cpp.

◆ setAddress()

void NameConfig::setAddress ( const Contact address)

Definition at line 432 of file NameConfig.cpp.

◆ setMode()

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

Definition at line 58 of file NameConfig.h.

◆ setNamespace()

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

Definition at line 438 of file NameConfig.cpp.

◆ toFile()

bool NameConfig::toFile ( bool  clean = false)

Definition at line 171 of file NameConfig.cpp.

◆ writeConfig()

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

Definition at line 192 of file NameConfig.cpp.

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