static void writeVectors(T& vectors, const QString& element, QXmlStreamWriter& stream, QString (V::* name)() const) {
  for (QStringList::iterator it = vectors.ordered.begin(); it != vectors.ordered.end(); ++it) {
    typename T::iterator i = vectors.find(*it);
    stream.writeStartElement(element);
    stream.writeAttribute("type", i.key());
    stream.writeAttribute("tag", (i.value()->*name)());
    stream.writeEndElement();
  }
}
Ejemplo n.º 2
0
static Object meta_data_each(T self) {
  for(typename T::iterator i = self.begin(); i != self.end(); i++) {
    VALUE key   = to_ruby_string(i->key());
    VALUE value = to_ruby_string(i->value().toString());
    rb_yield(rb_ary_new3(2, key, value));
  }

  return Qnil;
}