25 #include "enclosure.h"
37 class Enclosure::EnclosurePrivate :
public Shared
46 bool operator==(
const EnclosurePrivate &other)
const
48 return ( isNull == other.isNull || (url == other.url &&
49 length == other.length &&
55 Enclosure Enclosure::fromXML(
const TQDomElement& e)
60 if (e.hasAttribute(TQString::fromLatin1(
"url")))
61 url = e.attribute(TQString::fromLatin1(
"url"));
63 if (e.hasAttribute(TQString::fromLatin1(
"length")))
66 int c = e.attribute(TQString::fromLatin1(
"length")).toInt(&ok);
69 if (e.hasAttribute(TQString::fromLatin1(
"type")))
70 type = e.attribute(TQString::fromLatin1(
"type"));
72 return Enclosure(url, length, type);
75 TQDomElement Enclosure::toXML(TQDomDocument document)
const
77 TQDomElement e = document.createElement(TQString::fromLatin1(
"enclosure"));
79 e.setAttribute(TQString::fromLatin1(
"url"), d->url);
81 e.setAttribute(TQString::fromLatin1(
"length"), TQString::number(d->length));
82 if (!d->type.isNull())
83 e.setAttribute(TQString::fromLatin1(
"type"), d->type);
88 Enclosure::Enclosure() : d(new EnclosurePrivate)
94 Enclosure::Enclosure(
const Enclosure& other) : d(0)
99 Enclosure::Enclosure(
const TQString& url,
int length,
const TQString& type) : d(new EnclosurePrivate)
107 Enclosure::~Enclosure()
116 Enclosure& Enclosure::operator=(
const Enclosure& other)
128 bool Enclosure::operator==(
const Enclosure &other)
const
130 return *d == *other.d;
133 bool Enclosure::isNull()
const
138 TQString Enclosure::url()
const
143 int Enclosure::length()
const
148 TQString Enclosure::type()
const