All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
QGpCoreTools::XMLSaveAttributes Class Reference

Brief description of class still missing. More...

#include <XMLSaveAttributes.h>

List of all members.

Public Member Functions

QString & add (QString key, QString value=QString::null)
void clear ()
bool isEmpty () const
bool isSimilar (const XMLSaveAttributes &o) const
const QString & key (int index) const
QString & key (int index)
bool operator== (const XMLSaveAttributes &o) const
QString toEncodedString () const
QString toString () const
const QString & value (int index) const
QString & value (int index)
QString value (const QString &key)
 XMLSaveAttributes ()
 XMLSaveAttributes (const XMLSaveAttributes &o)

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

{}
: QList<XMLSaveAttribute>(o) {}

Member Function Documentation

QString & QGpCoreTools::XMLSaveAttributes::add ( QString  key,
QString  value = QString::null 
) [inline]

Returns true if it has all attributes of o. If o has no values for keys only the existence of the keys is checked (the values are not considered).

References TRACE.

Referenced by QGpCoreTools::XMLGenericItem::find().

  {
    TRACE;
    // Cache available keys in a map
    QMap<QString, QString> map;
    for(const_iterator it=begin(); it!=end();it++) {
      map.insert(it->key(), it->value());
    }
    QMap<QString, QString>::iterator itmap;
    for(const_iterator it=o.begin(); it!=o.end();it++) {
      itmap=map.find(it->key());
      if(itmap==map.end() || ( !it->value().isEmpty() && itmap.value()!=it->value())) {
        return false;
      }
    }
    return true;
  }
const QString& QGpCoreTools::XMLSaveAttributes::key ( int  index) const [inline]

Referenced by value().

{return (*this)[index].key();}
QString& QGpCoreTools::XMLSaveAttributes::key ( int  index) [inline]
{return (*this)[index].key();}
bool QGpCoreTools::XMLSaveAttributes::operator== ( const XMLSaveAttributes o) const [inline]

References QGpCoreTools::XMLClass::saveSpecChar().

Referenced by QGpCoreTools::XMLClass::writeChildren(), and QGpCoreTools::XMLClass::xml_save().

{
  QString tmp;
  for(const_iterator it=begin();it!=end();it++) {
    tmp += " ";
    tmp += it->key();
    tmp += "=\"";
    tmp += XMLClass::saveSpecChar(it->value());
    tmp += "\"";
  }
  return tmp;
}

References TRACE.

Referenced by QGpGuiTools::XMLItem::data().

  {
    TRACE;
    QString tmp;
    for(const_iterator it=begin();it!=end();it++) {
      tmp += " ";
      tmp += it->key();
      tmp += "=\"";
      tmp += it->value();
      tmp += "\"";
    }
    return tmp;
  }
const QString& QGpCoreTools::XMLSaveAttributes::value ( int  index) const [inline]
QString& QGpCoreTools::XMLSaveAttributes::value ( int  index) [inline]
{return (*this)[index].value();}
QString QGpCoreTools::XMLSaveAttributes::value ( const QString &  key)

Returns the value corresponding to key. If key does not exist, a null string. Slow lookup, the complete list of attributes may be traversed.

References key().

  {
    for(const_iterator it=begin(); it!=end();it++) {
      if(it->key()==key) return it->value();
    }
    return QString::null;
  }

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines