My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ConfigContext Class Reference

#include <context.h>

Inheritance diagram for ConfigContext:
RefCountedContext TemplateStructIntf

Classes

class  Private
 

Public Member Functions

virtual TemplateVariant get (const char *name) const
 
virtual int addRef ()
 
virtual int release ()
 
- Public Member Functions inherited from RefCountedContext
 RefCountedContext (const char *)
 
virtual ~RefCountedContext ()
 
int addRef ()
 
int release ()
 
- Public Member Functions inherited from TemplateStructIntf
virtual ~TemplateStructIntf ()
 

Static Public Member Functions

static ConfigContextalloc ()
 

Private Member Functions

 ConfigContext ()
 
 ~ConfigContext ()
 

Private Attributes

Privatep
 

Detailed Description

Definition at line 129 of file context.h.

Constructor & Destructor Documentation

ConfigContext::ConfigContext ( )
private

Definition at line 320 of file context.cpp.

References p, and Private.

Referenced by alloc().

: RefCountedContext("ConfigContext")
{
p = new Private;
}
ConfigContext::~ConfigContext ( )
private

Definition at line 325 of file context.cpp.

References p.

{
delete p;
}

Member Function Documentation

virtual int ConfigContext::addRef ( )
inlinevirtual

Increase object's reference count

Implements TemplateStructIntf.

Definition at line 136 of file context.h.

References RefCountedContext::addRef().

static ConfigContext* ConfigContext::alloc ( )
inlinestatic

Definition at line 132 of file context.h.

References ConfigContext().

Referenced by generateOutputViaTemplate().

{ return new ConfigContext; }
TemplateVariant ConfigContext::get ( const char *  name) const
virtual

Gets the value for a field name.

Parameters
[in]nameThe name of the field.

Implements TemplateStructIntf.

Definition at line 330 of file context.cpp.

References ConfigContext::Private::fetchList(), and p.

{
if (name)
{
const ConfigValues::Info *option = ConfigValues::instance().get(name);
if (option)
{
switch (option->type)
{
case ConfigValues::Info::Bool:
{
bool b = ConfigValues::instance().*((ConfigValues::InfoBool*)option)->item;
return TemplateVariant(b);
}
case ConfigValues::Info::Int:
{
int i = ConfigValues::instance().*((ConfigValues::InfoInt*)option)->item;
return TemplateVariant(i);
}
case ConfigValues::Info::String:
{
QCString s = ConfigValues::instance().*((ConfigValues::InfoString*)option)->item;
return TemplateVariant(s);
}
case ConfigValues::Info::List:
{
const QStrList &l = ConfigValues::instance().*((ConfigValues::InfoList*)option)->item;
return p->fetchList(name,&l);
}
default:
break;
}
}
}
return result;
}
virtual int ConfigContext::release ( )
inlinevirtual

Decreases object's referenc count, destroy object if 0

Implements TemplateStructIntf.

Definition at line 137 of file context.h.

References RefCountedContext::release().

Member Data Documentation

Private* ConfigContext::p
private

Definition at line 142 of file context.h.

Referenced by ConfigContext(), get(), and ~ConfigContext().


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