00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "dataformreported.h"
00015
00016 #include "tag.h"
00017
00018 namespace gloox
00019 {
00020
00021 DataFormReported::DataFormReported()
00022 : DataFormField( FieldTypeReported )
00023 {
00024 }
00025
00026 DataFormReported::DataFormReported( Tag* tag )
00027 : DataFormField( FieldTypeReported )
00028 {
00029 if( tag->name() != "reported" )
00030 return;
00031
00032 Tag::TagList &l = tag->children();
00033 Tag::TagList::const_iterator it = l.begin();
00034 for( ; it != l.end(); ++it )
00035 {
00036 DataFormField *f = new DataFormField( (*it) );
00037 m_fields.push_back( f );
00038 }
00039 }
00040
00041 DataFormReported::~DataFormReported()
00042 {
00043 }
00044
00045 Tag* DataFormReported::tag() const
00046 {
00047 Tag *r = new Tag ( "reported" );
00048 DataFormBase::FieldList::const_iterator it = m_fields.begin();
00049 for( ; it != m_fields.end(); ++it )
00050 {
00051 r->addChild( (*it)->tag() );
00052 }
00053 return r;
00054 }
00055
00056 }