libtmx  0.4.0
an C++11 library for reading TMX files
Public Member Functions | List of all members
tmx::Component Class Reference

A base class for classes that have properties. More...

#include <tmx/Component.h>

Inheritance diagram for tmx::Component:
Inheritance graph
[legend]

Public Member Functions

bool hasProperty (const std::string &key) const noexcept
 Tell if the object has a given property. More...
 
const std::string & getProperty (const std::string &key, const std::string &def) const noexcept
 Get a property value. More...
 
bool addProperty (const std::string &key, const std::string &value)
 Add a property. More...
 

Detailed Description

A base class for classes that have properties.

Member Function Documentation

bool tmx::Component::addProperty ( const std::string &  key,
const std::string &  value 
)

Add a property.

Parameters
keythe property key
valuethe property value
const std::string& tmx::Component::getProperty ( const std::string &  key,
const std::string &  def 
) const
noexcept

Get a property value.

Parameters
keythe property key
defa default value if the property does not exist
Returns
the value of the given property
bool tmx::Component::hasProperty ( const std::string &  key) const
noexcept

Tell if the object has a given property.

Parameters
keythe property key
Returns
true if the object has the given property