Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type > Class Template Reference

Stores named attribute to the topmost object on the stack if attribute present, or stores default if present. More...

#include <simple_actions.h>

Inheritance diagram for desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >:
Inheritance graph
[legend]
Collaboration diagram for desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef void(Obj_Type::* FunType )(Data_Type)
typedef Data_Type(* ConvType )(const Xml_string &)

Public Member Functions

 SetAttributeWithConversion_body (FunType set, const Xml_string &name, ConvType conv)
 SetAttributeWithConversion_body (FunType set, const Xml_string &name, ConvType conv, Data_Type deflt)
void begin (const Xml_string &, Xml_attr attr)

Protected Member Functions

virtual void end (const Xml_string &)
virtual void chars (const Xml_string &)

Protected Attributes

Digesterdig

Private Attributes

FunType set_
Xml_string name_
ConvType conv_
Data_Type default_
bool hasDefault_

Detailed Description

template<class Obj_Type, class Data_Type>
class desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >

Stores named attribute to the topmost object on the stack if attribute present, or stores default if present.

Definition at line 447 of file simple_actions.h.


Member Typedef Documentation

template<class Obj_Type , class Data_Type >
typedef Data_Type(* desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >::ConvType)(const Xml_string &)

Definition at line 451 of file simple_actions.h.

template<class Obj_Type , class Data_Type >
typedef void(Obj_Type::* desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >::FunType)(Data_Type)

Definition at line 450 of file simple_actions.h.


Constructor & Destructor Documentation

template<class Obj_Type , class Data_Type >
desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >::SetAttributeWithConversion_body ( FunType  set,
const Xml_string name,
ConvType  conv 
) [inline]

Definition at line 453 of file simple_actions.h.

              : set_(set), name_(name), conv_(conv), default_(), hasDefault_(false)
       {}
template<class Obj_Type , class Data_Type >
desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >::SetAttributeWithConversion_body ( FunType  set,
const Xml_string name,
ConvType  conv,
Data_Type  deflt 
) [inline]

Definition at line 457 of file simple_actions.h.

              : set_(set), name_(name), conv_(conv), default_(deflt), hasDefault_(true)
       {}

Member Function Documentation

template<class Obj_Type , class Data_Type >
void desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >::begin ( const Xml_string ,
Xml_attr  attr 
) [inline, virtual]

Reimplemented from desaxe::Action_body.

Definition at line 461 of file simple_actions.h.

       {
              Obj_Type* obj = this->dig->template top<Obj_Type>();
              Xml_attr::iterator it = attr.find(name_);
              if (it != attr.end() && conv_)
                     (obj->*set_)( conv_(Xml_data(it)) );
              else if (hasDefault_)
                     (obj->*set_)( default_ );                 
       }      

Here is the call graph for this function:

virtual void desaxe::Action_body::chars ( const Xml_string ) [inline, protected, virtual, inherited]

Reimplemented in AppendText_body, desaxe::SetText_body< Obj_Type >, and desaxe::AddText_body< Obj_Type >.

Definition at line 36 of file actions.h.

{}

Here is the caller graph for this function:

virtual void desaxe::Action_body::end ( const Xml_string ) [inline, protected, virtual, inherited]

Member Data Documentation

template<class Obj_Type , class Data_Type >
ConvType desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >::conv_ [private]

Definition at line 473 of file simple_actions.h.

template<class Obj_Type , class Data_Type >
Data_Type desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >::default_ [private]

Definition at line 474 of file simple_actions.h.

Digester* desaxe::Action_body::dig [protected, inherited]

Definition at line 38 of file actions.h.

template<class Obj_Type , class Data_Type >
bool desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >::hasDefault_ [private]

Definition at line 475 of file simple_actions.h.

template<class Obj_Type , class Data_Type >
Xml_string desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >::name_ [private]

Definition at line 472 of file simple_actions.h.

template<class Obj_Type , class Data_Type >
FunType desaxe::SetAttributeWithConversion_body< Obj_Type, Data_Type >::set_ [private]

Definition at line 471 of file simple_actions.h.


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