UFO: Alien Invasion
Loading...
Searching...
No Matches
KeyValuePair Class Reference

A pair of strings representing a key and a value The value string can be trimmed and rendered in the data type it is expected to be. We might add some validity checking here. More...

#include <keyvaluepair.h>

Collaboration diagram for KeyValuePair:
Collaboration graph

Public Member Functions

 KeyValuePair (const char *keyStr, const char *valStr)
void set (const char *keyStr, const char *valStr)
bool isKey (const char *name) const
float asFloat () const
int asInt () const
bool asBool () const
const char * asString () const
void asVec3 (vec3_t vec) const

Private Attributes

const char * _keyStr
const char * _valStr

Detailed Description

A pair of strings representing a key and a value The value string can be trimmed and rendered in the data type it is expected to be. We might add some validity checking here.

Definition at line 38 of file keyvaluepair.h.

Constructor & Destructor Documentation

◆ KeyValuePair()

KeyValuePair::KeyValuePair ( const char * keyStr,
const char * valStr )
inline

Definition at line 43 of file keyvaluepair.h.

References _keyStr, and _valStr.

Member Function Documentation

◆ asBool()

bool KeyValuePair::asBool ( ) const
inline

Definition at line 60 of file keyvaluepair.h.

References asInt().

Referenced by ED_ParseField().

◆ asFloat()

float KeyValuePair::asFloat ( ) const
inline

Definition at line 54 of file keyvaluepair.h.

References _valStr.

Referenced by Com_ParseTerrainDefinition(), and ED_ParseField().

◆ asInt()

int KeyValuePair::asInt ( ) const
inline

Definition at line 57 of file keyvaluepair.h.

References _valStr.

Referenced by asBool(), Com_ParseTerrainDefinition(), and ED_ParseField().

◆ asString()

const char * KeyValuePair::asString ( ) const
inline

Definition at line 63 of file keyvaluepair.h.

References _valStr.

◆ asVec3()

void KeyValuePair::asVec3 ( vec3_t vec) const
inline

Definition at line 66 of file keyvaluepair.h.

References _valStr, vec3_origin, and VectorCopy.

Referenced by ED_ParseField().

◆ isKey()

bool KeyValuePair::isKey ( const char * name) const
inline

Definition at line 51 of file keyvaluepair.h.

References _keyStr, and name.

Referenced by Com_ParseTerrainDefinition(), and ED_ParseField().

◆ set()

void KeyValuePair::set ( const char * keyStr,
const char * valStr )
inline

Definition at line 47 of file keyvaluepair.h.

References _keyStr, and _valStr.

Field Documentation

◆ _keyStr

const char* KeyValuePair::_keyStr
private

Definition at line 40 of file keyvaluepair.h.

Referenced by isKey(), KeyValuePair(), and set().

◆ _valStr

const char* KeyValuePair::_valStr
private

Definition at line 41 of file keyvaluepair.h.

Referenced by asFloat(), asInt(), asString(), asVec3(), KeyValuePair(), and set().


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