gloox 1.0.24
dataformreported.cpp
1 /*
2 Copyright (c) 2006-2019 by Jakob Schröter <js@camaya.net>
3 This file is part of the gloox library. http://camaya.net/gloox
4
5 This software is distributed under a license. The full license
6 agreement can be found in the file LICENSE in this distribution.
7 This software may not be copied, modified, sold or distributed
8 other than expressed in the named license agreement.
9
10 This software is distributed without any warranty.
11*/
12
13
14#include "dataformreported.h"
15
16#include "tag.h"
17
18namespace gloox
19{
20
22 {
23 }
24
26 {
27 if( tag->name() != "reported" )
28 return;
29
30 const TagList &l = tag->children();
31 TagList::const_iterator it = l.begin();
32 for( ; it != l.end(); ++it )
33 {
34 DataFormField* f = new DataFormField( (*it) );
35 m_fields.push_back( f );
36 }
37 }
38
40 {
41 }
42
44 {
45 Tag* r = new Tag ( "reported" );
46 DataFormFieldContainer::FieldList::const_iterator it = m_fields.begin();
47 for( ; it != m_fields.end(); ++it )
48 {
49 r->addChild( (*it)->tag() );
50 }
51 return r;
52 }
53
54}
An abstraction of a single field in a XEP-0004 Data Form.
Definition: dataformfield.h:34
virtual Tag * tag() const
This is an abstraction of an XML element.
Definition: tag.h:47
const std::string & name() const
Definition: tag.h:394
void addChild(Tag *child)
Definition: tag.cpp:424
const TagList & children() const
Definition: tag.cpp:510
The namespace for the gloox library.
Definition: adhoc.cpp:28
std::list< Tag * > TagList
Definition: tag.h:31