rviz::Config Class Reference

#include <config.h>

List of all members.

Classes

class  DirectoryCompare

Public Types

typedef Map::iterator Iterator
typedef std::map< std::string,
std::string, DirectoryCompare
Map

Public Member Functions

Iterator begin ()
void clear ()
Iterator end ()
bool get (const std::string &key, int *output, int default_value=0)
bool get (const std::string &key, float *output, float default_value=0)
bool get (const std::string &key, std::string *output, const std::string &default_value="")
void read (std::istream &input)
bool readFromFile (const std::string &filename)
void set (const std::string &key, int value)
void set (const std::string &key, float value)
void set (const std::string &key, const std::string &value)
void unset (const std::string &key)
void write (std::ostream &output)
bool writeToFile (const std::string &filename)

Private Member Functions

std::string escapeKey (const std::string &raw_key)
const std::string stripFirstSlash (const std::string &str)
std::string unescapeKey (const std::string &cooked_key)
void writeDirectory (std::ostream &output, const std::string &new_dir, const std::string &prev_dir)

Private Attributes

Map map_

Detailed Description

Configuration data structure. Inspired by rviz's use of wxConfigBase. Current implementation uses a flat ordered map, but in the long run it may more sense to use a recursive data structure.

Definition at line 44 of file config.h.


Member Typedef Documentation

typedef Map::iterator rviz::Config::Iterator

Definition at line 78 of file config.h.

typedef std::map<std::string, std::string, DirectoryCompare> rviz::Config::Map

Definition at line 77 of file config.h.


Member Function Documentation

Iterator rviz::Config::begin (  )  [inline]

Definition at line 80 of file config.h.

void rviz::Config::clear (  )  [inline]

Definition at line 83 of file config.h.

Iterator rviz::Config::end (  )  [inline]

Definition at line 81 of file config.h.

std::string rviz::Config::escapeKey ( const std::string &  raw_key  )  [private]

Escape ' ' and ':' characters with '\'.

Definition at line 200 of file config.cpp.

bool rviz::Config::get ( const std::string &  key,
int *  output,
int  default_value = 0 
)

Definition at line 298 of file config.cpp.

bool rviz::Config::get ( const std::string &  key,
float *  output,
float  default_value = 0 
)

Definition at line 281 of file config.cpp.

bool rviz::Config::get ( const std::string &  key,
std::string *  output,
const std::string &  default_value = "" 
)

Definition at line 269 of file config.cpp.

void rviz::Config::read ( std::istream &  input  ) 

Read settings from a stream. Invalid lines are ignored.

Definition at line 67 of file config.cpp.

bool rviz::Config::readFromFile ( const std::string &  filename  ) 
Returns:
success or failure of the initial file-open.

Definition at line 37 of file config.cpp.

void rviz::Config::set ( const std::string &  key,
int  value 
)

Definition at line 262 of file config.cpp.

void rviz::Config::set ( const std::string &  key,
float  value 
)

Definition at line 255 of file config.cpp.

void rviz::Config::set ( const std::string &  key,
const std::string &  value 
)

Definition at line 250 of file config.cpp.

const std::string rviz::Config::stripFirstSlash ( const std::string &  str  )  [private]

If the first char of str is a '/', return everything but the first char in a new string. If it is not, return str.

Definition at line 315 of file config.cpp.

std::string rviz::Config::unescapeKey ( const std::string &  cooked_key  )  [private]

Un-escape ' ' and ':' characters with '\'.

Definition at line 223 of file config.cpp.

void rviz::Config::unset ( const std::string &  key  )  [inline]

Remove a key/value pair. This will invalidate iterators pointing at the given element.

Definition at line 65 of file config.h.

void rviz::Config::write ( std::ostream &  output  ) 

Write settings to a stream.

Definition at line 109 of file config.cpp.

void rviz::Config::writeDirectory ( std::ostream &  output,
const std::string &  new_dir,
const std::string &  prev_dir 
) [private]

Write a directory description of new_dir to output, given that we were previously "in" prev_dir.

Definition at line 164 of file config.cpp.

bool rviz::Config::writeToFile ( const std::string &  filename  ) 
Returns:
success or failure of the initial file-open.

Definition at line 52 of file config.cpp.


Member Data Documentation

Definition at line 100 of file config.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


rviz
Author(s): Dave Hershberger, Josh Faust
autogenerated on Wed Jun 6 11:25:47 2012