gloox  1.0.9
dataformitem.cpp
1  /*
2  Copyright (c) 2006-2013 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 
22  {
23  }
24 
26  {
27  if( tag->name() != "item" )
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* i = new Tag ( "item" );
46  DataFormFieldContainer::FieldList::const_iterator it = m_fields.begin();
47  for( ; it != m_fields.end(); ++it )
48  {
49  i->addChild( (*it)->tag() );
50  }
51  return i;
52  }
53 
54 }