dataformreported.cpp
/*
Copyright (c) 2006-2023 by Jakob Schröter <js@camaya.net>
This file is part of the gloox library. http://camaya.net/gloox
This software is distributed under a license. The full license
agreement can be found in the file LICENSE in this distribution.
This software may not be copied, modified, sold or distributed
other than expressed in the named license agreement.
This software is distributed without any warranty.
*/
#include "dataformreported.h"
#include "tag.h"
namespace gloox
{
DataFormReported::DataFormReported()
{
}
DataFormReported::DataFormReported( Tag* tag )
{
if( tag->name() != "reported" )
return;
const TagList &l = tag->children();
TagList::const_iterator it = l.begin();
for( ; it != l.end(); ++it )
{
DataFormField* f = new DataFormField( (*it) );
m_fields.push_back( f );
}
}
DataFormReported::~DataFormReported()
{
}
Tag* DataFormReported::tag() const
{
Tag* r = new Tag ( "reported" );
DataFormFieldContainer::FieldList::const_iterator it = m_fields.begin();
for( ; it != m_fields.end(); ++it )
{
r->addChild( (*it)->tag() );
}
return r;
}
}
gloox::DataFormField
An abstraction of a single field in a XEP-0004 Data Form.
Definition dataformfield.h:34
gloox::DataFormReported::DataFormReported
DataFormReported()
Definition dataformreported.cpp:21
gloox::DataFormReported::~DataFormReported
virtual ~DataFormReported()
Definition dataformreported.cpp:39
gloox::DataFormReported::tag
virtual Tag * tag() const
Definition dataformreported.cpp:43
gloox::Tag
This is an abstraction of an XML element.
Definition tag.h:47
gloox::Tag::addChild
void addChild(Tag *child)
Definition tag.cpp:424
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28
gloox::TagList
std::list< Tag * > TagList
Definition tag.h:31