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

Member Function Documentation

◆ expandFilename()

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

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 = "" 
)
static

Definition at line 208 of file NameConfig.cpp.

◆ getIps()

std::string NameConfig::getIps ( )
static

Definition at line 415 of file NameConfig.cpp.

◆ getIpsAsBottle()

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

Definition at line 364 of file NameConfig.cpp.

◆ getMode()

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

Definition at line 55 of file NameConfig.h.

◆ getNamespace()

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

Definition at line 441 of file NameConfig.cpp.

◆ getNamespaces()

Bottle NameConfig::getNamespaces ( bool  refresh = false)

Definition at line 462 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)
static

Definition at line 318 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 430 of file NameConfig.cpp.

◆ setMode()

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

Definition at line 60 of file NameConfig.h.

◆ setNamespace()

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

Definition at line 436 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: