OpenStructure
Public Member Functions | Friends
InfoItem Class Reference

#include <info_item.hh>

Public Member Functions

InfoGroup GetParent () const
 
String GetName () const
 
void SetName (const String &n)
 
String GetValue () const
 
void SetValue (const String &val)
 
Type GetType () const
 
void SetType (Type t)
 
void SetType (int t)
 
Real AsFloat () const
 
int AsInt () const
 
bool AsBool () const
 
geom::Vec3 AsVector () const
 
void SetFloat (Real d)
 
void SetInt (int i)
 
void SetBool (bool b)
 
void SetVector (const geom::Vec3 &v)
 
String GetAttribute (const String &name) const
 
void SetAttribute (const String &name, const String &value)
 
bool HasAttribute (const String &name) const
 
void RemoveAttribute (const String &name)
 
String GetComment () const
 
std::vector< StringGetAttributeList () const
 
bool operator== (const InfoItem &rhs) const
 
bool operator!= (const InfoItem &rhs) const
 

Friends

class InfoGroup
 

Detailed Description

Definition at line 44 of file info_item.hh.

Member Function Documentation

◆ AsBool()

bool AsBool ( ) const

return item value as boolean

◆ AsFloat()

Real AsFloat ( ) const

return item value as floating point

◆ AsInt()

int AsInt ( ) const

return item value as integer

◆ AsVector()

geom::Vec3 AsVector ( ) const

return item value as 3d vector

◆ GetAttribute()

String GetAttribute ( const String name) const

return attribute of given name

◆ GetAttributeList()

std::vector<String> GetAttributeList ( ) const

returns a list with all attribute names

◆ GetComment()

String GetComment ( ) const

get comment just above item

◆ GetName()

String GetName ( ) const

retrieve item name

◆ GetParent()

InfoGroup GetParent ( ) const

retrieve parent info group

◆ GetType()

Type GetType ( ) const

retrieve type

type refers to the encoding of the item, which is one of STRING (default), INT, FLOAT, BOOL or VECTOR (see InfoItem::Type)

◆ GetValue()

String GetValue ( ) const

retrieve value of item

returns the String representation of the value

◆ HasAttribute()

bool HasAttribute ( const String name) const

returns true if attribute of this names exists

◆ operator!=()

bool operator!= ( const InfoItem rhs) const

◆ operator==()

bool operator== ( const InfoItem rhs) const

◆ RemoveAttribute()

void RemoveAttribute ( const String name)

remove attribute of given name

◆ SetAttribute()

void SetAttribute ( const String name,
const String value 
)

set attribute of given name, will be created if it does not yet exist

◆ SetBool()

void SetBool ( bool  b)

set item value as bool

◆ SetFloat()

void SetFloat ( Real  d)

set item value as floating point

◆ SetInt()

void SetInt ( int  i)

set item value as integer

◆ SetName()

void SetName ( const String n)

rename item

◆ SetType() [1/2]

void SetType ( int  t)

◆ SetType() [2/2]

void SetType ( Type  t)

force type

◆ SetValue()

void SetValue ( const String val)

set value of item

this sets the value as a String

◆ SetVector()

void SetVector ( const geom::Vec3 v)

set item value as 3d vector

Friends And Related Function Documentation

◆ InfoGroup

friend class InfoGroup
friend

Definition at line 45 of file info_item.hh.


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