Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

dataformfieldcontainer.cpp

00001 /*
00002   Copyright (c) 2005-2008 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
00011 */
00012 
00013 
00014 #include "dataformfieldcontainer.h"
00015 #include "util.h"
00016 
00017 
00018 namespace gloox
00019 {
00020 
00021   DataFormFieldContainer::DataFormFieldContainer()
00022   {
00023   }
00024 
00025   DataFormFieldContainer::DataFormFieldContainer( const DataFormFieldContainer& dffc )
00026   {
00027     FieldList::const_iterator it = dffc.m_fields.begin();
00028     for( ; it != dffc.m_fields.end(); ++it )
00029     {
00030       m_fields.push_back( new DataFormField( *(*it) ) );
00031     }
00032   }
00033 
00034   DataFormFieldContainer::~DataFormFieldContainer()
00035   {
00036 //     util::clearList( m_fields );
00037     // FIXME
00038     FieldList::iterator it = m_fields.begin();
00039     FieldList::iterator it2;
00040     while( it != m_fields.end() )
00041     {
00042       it2 = it++;
00043       delete (*it2);
00044       m_fields.erase( it2 );
00045     }
00046     // ~
00047   }
00048 
00049   DataFormField* DataFormFieldContainer::field( const std::string& field ) const
00050   {
00051     FieldList::const_iterator it = m_fields.begin();
00052     for( ; it != m_fields.end() && (*it)->name() != field; ++it )
00053       ;
00054     return it != m_fields.end() ? (*it) : 0;
00055   }
00056 
00057 }

Generated on Mon Jun 23 10:50:18 2008 for gloox by  doxygen 1.4.1