edbee - Qt Editor Library
Public Member Functions | List of all members
edbee::DynamicVariables Class Reference

This class is used for remembering/managing dynamic variables This are a kind of environment variables that are dependent on the given context. More...

#include <dynamicvariables.h>

+ Collaboration diagram for edbee::DynamicVariables:

Public Member Functions

 DynamicVariables ()
 default constructor More...
 
virtual ~DynamicVariables ()
 Destructs all variables. More...
 
void setAndGiveScopedSelector (const QString &name, const QVariant &value, const QString &selector)
 defines a dynamic variable and gives to the dynamic variables environment More...
 
void set (const QString &name, const QVariant &value)
 Sets the given static variable to the given value. More...
 
int size () const
 Returns the number of variables available. More...
 
int valueCount (const QString &name) const
 returns the number of variable-rules/entries available with the given name More...
 
DynamicVariablefind (const QString &name, TextScopeList *scopelist)
 Finds the variable for the given condition. More...
 
QVariant value (const QString &name, TextScopeList *scopeList=0)
 Returns the value at the given position. More...
 

Detailed Description

This class is used for remembering/managing dynamic variables This are a kind of environment variables that are dependent on the given context.

Constructor & Destructor Documentation

◆ DynamicVariables()

edbee::DynamicVariables::DynamicVariables ( )

default constructor

◆ ~DynamicVariables()

edbee::DynamicVariables::~DynamicVariables ( )
virtual

Destructs all variables.

Member Function Documentation

◆ find()

DynamicVariable * edbee::DynamicVariables::find ( const QString &  name,
TextScopeList scopelist 
)

Finds the variable for the given condition.

Parameters
namethe name of the variable to search
scopeListthe scope list to find the variable for

◆ set()

void edbee::DynamicVariables::set ( const QString &  name,
const QVariant &  value 
)

Sets the given static variable to the given value.

Parameters
namethe name of the

◆ setAndGiveScopedSelector()

void edbee::DynamicVariables::setAndGiveScopedSelector ( const QString &  name,
const QVariant &  value,
const QString &  selector 
)

defines a dynamic variable and gives to the dynamic variables environment

Parameters
namethe name of the variable to set
valuethe value of the variable
scopesthe scope selector

Todo, perhaps we should detect identical scope selectors and replace the original

◆ size()

int edbee::DynamicVariables::size ( ) const

Returns the number of variables available.

Returns
the number of variable names. (there can be more values as variables)

◆ value()

QVariant edbee::DynamicVariables::value ( const QString &  name,
TextScopeList scopelist = 0 
)

Returns the value at the given position.

Parameters
namethe name of the variable
scopeListthe scope list to find the variable for

◆ valueCount()

int edbee::DynamicVariables::valueCount ( const QString &  name) const

returns the number of variable-rules/entries available with the given name

Parameters
namethe name of the variable to retrieve the size for
Returns
the number of variables entires with the given name

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