18 #include "stanzaextension.h"
19 #include "stanzaextensionfactory.h"
27 : m_xmllang(
"default" ), m_to( to )
32 : m_xmllang(
"default" )
49 return findExtension<Error>(
ExtError );
54 m_extensionList.push_back( se );
59 StanzaExtensionList::const_iterator it = m_extensionList.begin();
60 for( ; it != m_extensionList.end() && (*it)->extensionType() != type; ++it ) ;
61 return it != m_extensionList.end() ? (*it) : 0;
70 std::string& defaultLang,
78 std::string& defaultLang,
79 const std::string& data,
80 const std::string& xmllang )
91 (**map)[xmllang] = data;
95 const std::string& Stanza::findLang(
const StringMap* map,
96 const std::string& defaultData,
97 const std::string& lang )
99 if( map && lang !=
"default" )
101 StringMap::const_iterator it = map->find( lang );
102 if( it != map->end() )
108 void Stanza::getLangs(
const StringMap* map,
109 const std::string& defaultData,
110 const std::string& name,
113 if( !defaultData.empty() )
114 new Tag( tag, name, defaultData );
119 StringMap::const_iterator it = map->begin();
120 for( ; it != map->end(); ++it )
122 Tag* t =
new Tag( tag, name,
"xml:lang", (*it).first );
123 t->setCData( (*it).second );