Workspace 6.21.5
Public Types | Public Member Functions | Static Public Member Functions | List of all members
SettingsVariables Class Reference

Singleton class for storing settings variables.

#include <Workspace/Application/settingsvariables.h>

Public Types

enum  Type { FilePath , Path , String }
 

Public Member Functions

 ~SettingsVariables ()
 
void clear ()
 
bool contains (const QString &name) const
 
QStringList getNameList () const
 
Type getSystemVariableType (const QString &name) const
 
bool getType (const QString &name, Type &type) const
 
bool getValue (const QString &name, QString &value) const
 
void initializeSystemDefaults ()
 
bool isSystemSettingsVar (const QString &name) const
 
bool setType (const QString &name, Type type)
 
bool setValue (const QString &name, const QString &value)
 

Static Public Member Functions

static QStringList getAllTypes ()
 
static SettingsVariablesgetInstance ()
 
static Type toEnum (const QString &type)
 
static QString toString (Type type)
 

Member Enumeration Documentation

◆ Type

enum Type
Enumerator
FilePath 
Path 
String 

Constructor & Destructor Documentation

◆ ~SettingsVariables()

~SettingsVariables ( )
default

Member Function Documentation

◆ clear()

void clear ( )

Clears all of the settings variables.

◆ contains()

bool contains ( const QString &  name) const
Returns
Returns false if the supplied variable name does not exist

◆ getAllTypes()

QStringList getAllTypes ( )
static
Returns
Returns a list of all variable types.

◆ getInstance()

SettingsVariables & getInstance ( )
static

◆ getNameList()

QStringList getNameList ( ) const
Returns
A list of names for all settings variables.

◆ getSystemVariableType()

SettingsVariables::Type getSystemVariableType ( const QString &  name) const
Parameters
nameName of the settings variable which will have its type checked.
Returns
Returns system variable type. String value is returned if the supplied name is not a system variable.

◆ getType()

bool getType ( const QString &  name,
Type type 
) const
Parameters
nameName of the settings variable whose value is requested.
typeOutput parameter for settings variable type.
Returns
Returns false if the requested settings variable does not exist.

◆ getValue()

bool getValue ( const QString &  name,
QString &  value 
) const
Parameters
nameName of the settings variable whose value is requested.
valueOutput parameter for settings variable value.
Returns
Returns false if the requested settings variable does not exist.

◆ initializeSystemDefaults()

void initializeSystemDefaults ( )

Initializes System default settings variables.

◆ isSystemSettingsVar()

bool isSystemSettingsVar ( const QString &  name) const
Parameters
nameName of the settings variable which will be checked.
Returns
Returns true if the supplied name is reserved as a system settings variable.

◆ setType()

bool setType ( const QString &  name,
Type  type 
)
Parameters
nameName of the settings variable.
typeType of the settings variable.
Returns
Returns false if the settings variable name is empty.

◆ setValue()

bool setValue ( const QString &  name,
const QString &  value 
)
Parameters
nameName of the settings variable.
valueValue of the settings variable.
Returns
Returns false if the settings variable name is empty.

◆ toEnum()

SettingsVariables::Type toEnum ( const QString &  type)
static

QString to Enum converter.

◆ toString()

QString toString ( Type  type)
static

Enum to QString converter.