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();
  }
}
Пример #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;
}
Пример #3
0
int32_t do_stat(const int32_t size, T& v_value_range)
{
  int32_t ret = TFS_ERROR;
  typename T::iterator iter = v_value_range.begin();
  for(; iter != v_value_range.end(); iter++)
  {
    if (iter->is_in_range(size))
    {
      iter->incr();
      ret = TFS_SUCCESS;
      break;
    }
  }
  return ret;
}