gloox
1.0.24
src
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
18
namespace
gloox
19
{
20
21
DataFormReported::DataFormReported
()
22
{
23
}
24
25
DataFormReported::DataFormReported
(
Tag
* tag )
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
39
DataFormReported::~DataFormReported
()
40
{
41
}
42
43
Tag
*
DataFormReported::tag
()
const
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
}
gloox::DataFormField
An abstraction of a single field in a XEP-0004 Data Form.
Definition:
dataformfield.h:34
gloox::TagList
std::list< Tag * > TagList
Definition:
tag.h:26
gloox::DataFormReported::tag
virtual Tag * tag() const
Definition:
dataformreported.cpp:43
gloox::Tag::children
const TagList & children() const
Definition:
tag.cpp:510
gloox::Tag::addChild
void addChild(Tag *child)
Definition:
tag.cpp:424
gloox::DataFormReported::DataFormReported
DataFormReported()
Definition:
dataformreported.cpp:21
gloox
The namespace for the gloox library.
Definition:
adhoc.cpp:28
gloox::Tag
This is an abstraction of an XML element.
Definition:
tag.h:47
gloox::Tag::name
const std::string & name() const
Definition:
tag.h:394
gloox::DataFormReported::~DataFormReported
virtual ~DataFormReported()
Definition:
dataformreported.cpp:39
Generated on Mon Aug 17 2020 01:21:43 for gloox by
1.8.18