Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
rs2::config_file Class Reference

#include <rs-config.h>

Public Member Functions

 config_file ()
 
 config_file (std::string filename)
 
bool contains (const char *key) const
 
std::string get (const char *key, const char *def) const
 
config_value get (const char *key) const
 
template<class T >
get_or_default (const char *key, T def) const
 
config_fileoperator= (const config_file &other)
 
bool operator== (const config_file &other) const
 
void reset ()
 
void save (const char *filename)
 
void set (const char *key, const char *value)
 
template<class T >
void set (const char *key, T val)
 
void set_default (const char *key, const char *calculate)
 
template<class T >
void set_default (const char *key, T val)
 

Static Public Member Functions

static config_fileinstance ()
 

Private Member Functions

std::string get_default (const char *key, const char *def) const
 
void save ()
 

Private Attributes

std::map< std::string, std::string_defaults
 
std::string _filename
 
std::map< std::string, std::string_values
 

Detailed Description

Definition at line 39 of file rs-config.h.

Constructor & Destructor Documentation

config_file::config_file ( )

Definition at line 114 of file rs-config.cpp.

config_file::config_file ( std::string  filename)

Definition at line 87 of file rs-config.cpp.

Member Function Documentation

bool config_file::contains ( const char *  key) const

Definition at line 42 of file rs-config.cpp.

std::string config_file::get ( const char *  key,
const char *  def 
) const

Definition at line 32 of file rs-config.cpp.

config_value config_file::get ( const char *  key) const

Definition at line 55 of file rs-config.cpp.

std::string config_file::get_default ( const char *  key,
const char *  def 
) const
private

Definition at line 48 of file rs-config.cpp.

template<class T >
T rs2::config_file::get_or_default ( const char *  key,
def 
) const
inline

Definition at line 65 of file rs-config.h.

config_file & config_file::instance ( )
static

Definition at line 80 of file rs-config.cpp.

config_file & config_file::operator= ( const config_file other)

Definition at line 119 of file rs-config.cpp.

bool config_file::operator== ( const config_file other) const

Definition at line 130 of file rs-config.cpp.

void config_file::reset ( void  )

Definition at line 26 of file rs-config.cpp.

void config_file::save ( const char *  filename)

Definition at line 61 of file rs-config.cpp.

void config_file::save ( )
private

Definition at line 109 of file rs-config.cpp.

void config_file::set ( const char *  key,
const char *  value 
)

Definition at line 15 of file rs-config.cpp.

template<class T >
void rs2::config_file::set ( const char *  key,
val 
)
inline

Definition at line 72 of file rs-config.h.

void config_file::set_default ( const char *  key,
const char *  calculate 
)

Definition at line 21 of file rs-config.cpp.

template<class T >
void rs2::config_file::set_default ( const char *  key,
val 
)
inline

Definition at line 48 of file rs-config.h.

Member Data Documentation

std::map<std::string, std::string> rs2::config_file::_defaults
private

Definition at line 93 of file rs-config.h.

std::string rs2::config_file::_filename
private

Definition at line 94 of file rs-config.h.

std::map<std::string, std::string> rs2::config_file::_values
private

Definition at line 92 of file rs-config.h.


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


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:40