gloox
0.9.9.12
Main Page
Related Pages
Namespaces
Classes
Files
File List
src
dataformitem.cpp
1
/*
2
Copyright (c) 2006-2008 by Jakob Schroeter <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 "dataformitem.h"
15
16
#include "tag.h"
17
18
namespace
gloox
19
{
20
21
DataFormItem::DataFormItem
()
22
:
DataFormField
( FieldTypeItem )
23
{
24
}
25
26
DataFormItem::DataFormItem
(
Tag
* tag )
27
:
DataFormField
( FieldTypeItem )
28
{
29
if
( tag->
name
() !=
"item"
)
30
return
;
31
32
Tag::TagList
&l = tag->
children
();
33
Tag::TagList::const_iterator it = l.begin();
34
for
( ; it != l.end(); ++it )
35
{
36
DataFormField
*f =
new
DataFormField
( (*it) );
37
m_fields.push_back( f );
38
}
39
}
40
41
DataFormItem::~DataFormItem
()
42
{
43
}
44
45
Tag
*
DataFormItem::tag
()
const
46
{
47
Tag
*i =
new
Tag
(
"item"
);
48
DataFormBase::FieldList::const_iterator it = m_fields.begin();
49
for
( ; it != m_fields.end(); ++it )
50
{
51
i->
addChild
( (*it)->tag() );
52
}
53
return
i;
54
}
55
56
}
Generated on Thu Jun 27 2013 13:05:48 for gloox by
1.8.1.2