Choreonoid  1.5
Public Types | Public Member Functions | Friends | List of all members
cnoid::Mapping Class Reference

#include <ValueTree.h>

Inheritance diagram for cnoid::Mapping:
cnoid::ValueNode cnoid::Referenced cnoid::Archive

Public Types

enum  AssignMode { READ_MODE, WRITE_MODE }
 
typedef Container::iterator iterator
 
typedef Container::const_iterator const_iterator
 
- Public Types inherited from cnoid::ValueNode
enum  TypeBit {
  INVALID_NODE = 0, SCALAR = 1, MAPPING = 2, LISTING = 4,
  INSERT_LF = 8, APPEND_LF = 16
}
 

Public Member Functions

 Mapping ()
 
 Mapping (int line, int column)
 
virtual ~Mapping ()
 
virtual ValueNodeclone () const
 
bool empty () const
 
int size () const
 
void clear ()
 
void setFlowStyle (bool isFlowStyle=true)
 
bool isFlowStyle () const
 
void setDoubleFormat (const char *format)
 
const char * doubleFormat ()
 
void setKeyQuoteStyle (StringStyle style)
 
ValueNodefind (const std::string &key) const
 
MappingfindMapping (const std::string &key) const
 
ListingfindListing (const std::string &key) const
 
ValueNodePtr extract (const std::string &key)
 
ValueNodeget (const std::string &key) const
 
ValueNodeoperator[] (const std::string &key) const
 
void insert (const std::string &key, ValueNode *node)
 
void insert (const Mapping *other)
 
MappingopenMapping (const std::string &key)
 
MappingopenFlowStyleMapping (const std::string &key)
 
MappingcreateMapping (const std::string &key)
 
MappingcreateFlowStyleMapping (const std::string &key)
 
ListingopenListing (const std::string &key)
 
ListingopenFlowStyleListing (const std::string &key)
 
ListingcreateListing (const std::string &key)
 
ListingcreateFlowStyleListing (const std::string &key)
 
bool remove (const std::string &key)
 
bool read (const std::string &key, std::string &out_value) const
 
bool readUTF8 (const std::string &key, std::string &out_value) const
 
bool read (const std::string &key, bool &out_value) const
 
bool read (const std::string &key, int &out_value) const
 
bool read (const std::string &key, double &out_value) const
 
template<class T >
read (const std::string &key) const
 
template<class T >
get (const std::string &key, const T &defaultValue) const
 
std::string get (const std::string &key, const char *defaultValue) const
 
void writeUTF8 (const std::string &key, const std::string &value, StringStyle stringStyle=PLAIN_STRING)
 
void write (const std::string &key, const std::string &value, StringStyle stringStyle=PLAIN_STRING)
 
void writeUTF8 (const std::string &key, const char *value, StringStyle stringStyle=PLAIN_STRING)
 
void write (const std::string &key, const char *value, StringStyle stringStyle=PLAIN_STRING)
 
void write (const std::string &key, bool value)
 
void write (const std::string &key, int value)
 
void write (const std::string &key, double value)
 
void writePath (const std::string &key, const std::string &value)
 
void setAssignMode (AssignMode mode)
 
template<class T >
void assign (const std::string &key, T &io_value, const T &defaultValue)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
void throwKeyNotFoundException (const std::string &key) const
 
- Public Member Functions inherited from cnoid::ValueNode
bool isValid () const
 
TypeBit LFType () const
 
TypeBit nodeType () const
 
int toInt () const
 
double toDouble () const
 
bool toBool () const
 
bool isScalar () const
 
bool isString () const
 
const std::string & toString () const
 
const std::string & toUTF8String () const
 
 operator const std::string & () const
 
template<typename T >
to () const
 
bool isMapping () const
 
const MappingtoMapping () const
 
MappingtoMapping ()
 
bool isListing () const
 
const ListingtoListing () const
 
ListingtoListing ()
 
bool read (int &out_value) const
 
bool read (double &out_value) const
 
bool read (bool &out_value) const
 
bool read (std::string &out_value) const
 
bool readUTF8String (std::string &out_value) const
 
bool hasLineInfo () const
 
int line () const
 
int column () const
 
void throwException (const std::string &message) const
 
template<>
double to () const
 
template<>
int to () const
 
- Public Member Functions inherited from cnoid::Referenced
virtual ~Referenced ()
 
void addRef ()
 
void releaseRef ()
 

Friends

class Listing
 
class YAMLReaderImpl
 
class YAMLWriter
 

Additional Inherited Members

- Protected Member Functions inherited from cnoid::ValueNode
 ValueNode ()
 
 ValueNode (TypeBit type)
 
virtual ~ValueNode ()
 
void throwNotScalrException () const
 
void throwNotMappingException () const
 
void throwNotListingException () const
 
- Protected Member Functions inherited from cnoid::Referenced
 Referenced ()
 
 Referenced (const Referenced &org)
 
int refCount () const
 
- Protected Attributes inherited from cnoid::ValueNode
int typeBits
 

Member Typedef Documentation

typedef Container::const_iterator cnoid::Mapping::const_iterator
typedef Container::iterator cnoid::Mapping::iterator

Member Enumeration Documentation

Enumerator
READ_MODE 
WRITE_MODE 

Constructor & Destructor Documentation

Mapping::Mapping ( )
Mapping::Mapping ( int  line,
int  column 
)
Mapping::~Mapping ( )
virtual

Member Function Documentation

template<class T >
void cnoid::Mapping::assign ( const std::string &  key,
T &  io_value,
const T &  defaultValue 
)
inline
iterator cnoid::Mapping::begin ( )
inline
const_iterator cnoid::Mapping::begin ( ) const
inline
void Mapping::clear ( )
ValueNode * Mapping::clone ( ) const
virtual

Reimplemented from cnoid::ValueNode.

Listing* cnoid::Mapping::createFlowStyleListing ( const std::string &  key)
inline
Mapping* cnoid::Mapping::createFlowStyleMapping ( const std::string &  key)
inline
Listing* cnoid::Mapping::createListing ( const std::string &  key)
inline
Mapping* cnoid::Mapping::createMapping ( const std::string &  key)
inline
const char* cnoid::Mapping::doubleFormat ( )
inline
bool cnoid::Mapping::empty ( ) const
inline
iterator cnoid::Mapping::end ( )
inline
const_iterator cnoid::Mapping::end ( ) const
inline
ValueNodePtr Mapping::extract ( const std::string &  key)
ValueNode * Mapping::find ( const std::string &  key) const
Listing * Mapping::findListing ( const std::string &  key) const
Mapping * Mapping::findMapping ( const std::string &  key) const
ValueNode & Mapping::get ( const std::string &  key) const
template<class T >
T cnoid::Mapping::get ( const std::string &  key,
const T &  defaultValue 
) const
inline
std::string cnoid::Mapping::get ( const std::string &  key,
const char *  defaultValue 
) const
inline
void Mapping::insert ( const std::string &  key,
ValueNode node 
)
void Mapping::insert ( const Mapping other)
bool cnoid::Mapping::isFlowStyle ( ) const
inline
Listing* cnoid::Mapping::openFlowStyleListing ( const std::string &  key)
inline
Mapping* cnoid::Mapping::openFlowStyleMapping ( const std::string &  key)
inline
Listing* cnoid::Mapping::openListing ( const std::string &  key)
inline
Mapping* cnoid::Mapping::openMapping ( const std::string &  key)
inline
ValueNode& cnoid::Mapping::operator[] ( const std::string &  key) const
inline
bool Mapping::read ( const std::string &  key,
std::string &  out_value 
) const
bool Mapping::read ( const std::string &  key,
bool &  out_value 
) const
bool Mapping::read ( const std::string &  key,
int &  out_value 
) const
bool Mapping::read ( const std::string &  key,
double &  out_value 
) const
template<class T >
T cnoid::Mapping::read ( const std::string &  key) const
inline
bool Mapping::readUTF8 ( const std::string &  key,
std::string &  out_value 
) const
bool Mapping::remove ( const std::string &  key)
void cnoid::Mapping::setAssignMode ( AssignMode  mode)
inline
void Mapping::setDoubleFormat ( const char *  format)
void cnoid::Mapping::setFlowStyle ( bool  isFlowStyle = true)
inline
void Mapping::setKeyQuoteStyle ( StringStyle  style)
int cnoid::Mapping::size ( ) const
inline
void Mapping::throwKeyNotFoundException ( const std::string &  key) const
void cnoid::Mapping::write ( const std::string &  key,
const std::string &  value,
StringStyle  stringStyle = PLAIN_STRING 
)
inline
void cnoid::Mapping::write ( const std::string &  key,
const char *  value,
StringStyle  stringStyle = PLAIN_STRING 
)
inline
void Mapping::write ( const std::string &  key,
bool  value 
)
void Mapping::write ( const std::string &  key,
int  value 
)
void Mapping::write ( const std::string &  key,
double  value 
)
void Mapping::writePath ( const std::string &  key,
const std::string &  value 
)
void Mapping::writeUTF8 ( const std::string &  key,
const std::string &  value,
StringStyle  stringStyle = PLAIN_STRING 
)
void cnoid::Mapping::writeUTF8 ( const std::string &  key,
const char *  value,
StringStyle  stringStyle = PLAIN_STRING 
)
inline

Friends And Related Function Documentation

friend class Listing
friend
friend class YAMLReaderImpl
friend
friend class YAMLWriter
friend

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