Beispiel #1
0
void
AlbumTagsRequest::success( QByteArray data )
{
    QDomDocument xml;
    xml.setContent( data );

//     qDebug() << data;

    QDomNodeList values = xml.elementsByTagName( "tag" );
    for ( int i = 0; i < values.count(); i++ )
        m_tags += WeightedString( values.item( i ).namedItem( "name" ).toElement().text() );
}
Beispiel #2
0
uint32_t IntegerAttribute::get(DocId doc, WeightedString * s, uint32_t sz) const
{
    WeightedInt * v = new WeightedInt[sz];
    unsigned num(static_cast<const AttributeVector *>(this)->get(doc, v, sz));
    for(unsigned i(0); i < num; i++) {
        char tmp[32];
        snprintf(tmp, sizeof(tmp), "%" PRId64, v[i].getValue());
        s[i] = WeightedString(tmp, v[i].getWeight());
    }
    delete [] v;
    return num;
}