ZED Open Capture  v0.6.0
Low level camera driver for the ZED stereo camera family
Public Member Functions | List of all members
sl_oc::tools::ConfManager Class Reference

#include <calibration.hpp>

Public Member Functions

 ConfManager (std::string filename)
 
 ~ConfManager ()
 
float getValue (std::string key, float default_value=-1)
 
void setValue (std::string key, float value)
 
bool isOpened ()
 

Detailed Description

Definition at line 4003 of file calibration.hpp.

Constructor & Destructor Documentation

◆ ConfManager()

sl_oc::tools::ConfManager::ConfManager ( std::string  filename)
inline

Definition at line 4006 of file calibration.hpp.

4006  {
4007  filename_ = filename;
4008  ini_.SetUnicode();
4009  SI_Error rc = ini_.LoadFile(filename_.c_str());
4010  is_opened_ = !(rc < 0);
4011  }
SI_Error LoadFile(const char *a_pszFile)
void SetUnicode(bool a_bIsUtf8=true)

References sl_oc::tools::CSimpleIniTempl< SI_CHAR, SI_STRLESS, SI_CONVERTER >::LoadFile(), and sl_oc::tools::CSimpleIniTempl< SI_CHAR, SI_STRLESS, SI_CONVERTER >::SetUnicode().

◆ ~ConfManager()

sl_oc::tools::ConfManager::~ConfManager ( )
inline

Definition at line 4013 of file calibration.hpp.

4013  {
4014  //if (is_opened_) ini_.SaveFile(filename_.c_str());
4015  }

Member Function Documentation

◆ getValue()

float sl_oc::tools::ConfManager::getValue ( std::string  key,
float  default_value = -1 
)
inline

Definition at line 4017 of file calibration.hpp.

4017  {
4018  if (is_opened_) {
4019  std::vector<std::string> elems;
4020  split(key, ':', elems);
4021 
4022  return atof(ini_.GetValue(elems.front().c_str(), elems.back().c_str(), std::to_string(default_value).c_str()));
4023  } else
4024  return -1.f;
4025  }
const SI_CHAR * GetValue(const SI_CHAR *a_pSection, const SI_CHAR *a_pKey, const SI_CHAR *a_pDefault=NULL, bool *a_pHasMultiple=NULL) const
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)

References sl_oc::tools::CSimpleIniTempl< SI_CHAR, SI_STRLESS, SI_CONVERTER >::GetValue(), and sl_oc::tools::split().

Referenced by sl_oc::tools::initCalibration().

◆ isOpened()

bool sl_oc::tools::ConfManager::isOpened ( )
inline

Definition at line 4036 of file calibration.hpp.

4036  {
4037  return is_opened_;
4038  }

Referenced by sl_oc::tools::initCalibration().

◆ setValue()

void sl_oc::tools::ConfManager::setValue ( std::string  key,
float  value 
)
inline

Definition at line 4027 of file calibration.hpp.

4027  {
4028  if (is_opened_) {
4029  std::vector<std::string> elems;
4030  split(key, ':', elems);
4031 
4032  /*SI_Error rc = */ini_.SetValue(elems.front().c_str(), elems.back().c_str(), std::to_string(value).c_str());
4033  }
4034  }
SI_Error SetValue(const SI_CHAR *a_pSection, const SI_CHAR *a_pKey, const SI_CHAR *a_pValue, const SI_CHAR *a_pComment=NULL, bool a_bForceReplace=false)

References sl_oc::tools::CSimpleIniTempl< SI_CHAR, SI_STRLESS, SI_CONVERTER >::SetValue(), and sl_oc::tools::split().


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