Wrench.VariableSet Class Reference

Detailed Description

Represents a set of used for localization.

Inheritance diagram for Wrench.VariableSet:
Wrench.LanguageSet

Public Member Functions

 VariableSet ()
 Creates a new empty variable set. More...
 
void Clear ()
 Empties this variable set. More...
 
void Add (string code, string value)
 Adds a variable to this set. More...
 
void Remove (string code)
 Removes a variable by name. More...
 
bool Contains (string code)
 Checks if this variable set contains the named variable. More...
 
virtual string GetValue (string code)
 Gets the value of the named variable from this set. More...
 
virtual void SetValue (string code, string value)
 Sets a value of the named variable into this set. Creates it if it doesn't exist. More...
 

Public Attributes

Dictionary< string, string > Map
 The lookup of variable name to its content. More...
 

Properties

string this[string code] [get, set]
 Gets or sets (or creates if not found) the value of a named variable in this set. More...
 

Constructor & Destructor Documentation

Wrench.VariableSet.VariableSet ( )
inline

Creates a new empty variable set.

Member Function Documentation

void Wrench.VariableSet.Add ( string  code,
string  value 
)
inline

Adds a variable to this set.

Parameters
codeThe name of the variable.
valueThe value of this variable.
void Wrench.VariableSet.Clear ( )
inline

Empties this variable set.

bool Wrench.VariableSet.Contains ( string  code)
inline

Checks if this variable set contains the named variable.

Parameters
codeThe name of the variable to look for.
Returns
True if this variable was found in this set; false otherwise.
virtual string Wrench.VariableSet.GetValue ( string  code)
inlinevirtual

Gets the value of the named variable from this set.

Parameters
codeThe name of the variable to get the value of.
Returns
The value of the variable; null if it wasn't found.

Reimplemented in Wrench.LanguageSet.

void Wrench.VariableSet.Remove ( string  code)
inline

Removes a variable by name.

Parameters
codeThe name of the variable to remove.
virtual void Wrench.VariableSet.SetValue ( string  code,
string  value 
)
inlinevirtual

Sets a value of the named variable into this set. Creates it if it doesn't exist.

Parameters
codeThe name of the variable to set or create.
valueThe value of the variable to set.

Member Data Documentation

Dictionary<string,string> Wrench.VariableSet.Map

The lookup of variable name to its content.

Property Documentation

string Wrench.VariableSet.this[string code]
getset

Gets or sets (or creates if not found) the value of a named variable in this set.

Parameters
codeThe name of the variable to get/set/create.