d = new ItemPrivate;
}
-APE::Item::Item(const String& key, const String& str)
+APE::Item::Item(const String &key, const String &s)
{
d = new ItemPrivate;
d->key = key;
- d->text.append(str);
+ d->text.append(s);
}
-APE::Item::Item(const Item& item)
+APE::Item::Item(const Item &item)
{
d = new ItemPrivate(*item.d);
}
-Item &APE::Item::operator=(const Item& item)
+Item &APE::Item::operator=(const Item &item)
{
delete d;
d = new ItemPrivate(*item.d);
return *this;
}
-void APE::Item::setReadOnly(bool val)
+void APE::Item::setReadOnly(bool readOnly)
{
- d->readOnly = val;
+ d->readOnly = readOnly;
}
bool APE::Item::isReadOnly() const
setReadOnly(flags & 1);
setType(ItemTypes((flags >> 1) & 3));
- if(int(d->type) < 2) {
- ByteVectorList bl = ByteVectorList::split(d->value, '\0');
- d->text = StringList(bl, String::UTF8);
- }
+ if(int(d->type) < 2)
+ d->text = StringList(ByteVectorList::split(d->value, '\0'), String::UTF8);
}
ByteVector APE::Item::render()
value.append(it->data(String::UTF8));
}
d->value = value;
- } else
+ }
+ else
value.append(d->value);
data.append(ByteVector::fromUInt(value.size(), false));
* Enum of types an Item can have. The value of 3 is reserved.
*/
enum ItemTypes {
- //! item contains text information coded in UTF-8
+ //! Item contains text information coded in UTF-8
Text = 0,
- //! item contains binary information
+ //! Item contains binary information
Binary = 1,
- //! item is a locator of external stored information
+ //! Item is a locator of external stored information
Locator = 2
};
/*!
/*!
* Constructs an item with \a key and \a value.
*/
- Item(const String& key, const String& value);
+ Item(const String &key, const String &value);
/*!
* Constructs an item with \a key and \a values.
*/
- Item(const String& key, const StringList& values);
+ Item(const String &key, const StringList &values);
- Item(const Item&);
- Item& operator=(const Item&);
+ /*!
+ * Construct an item as a copy of \a item.
+ */
+ Item(const Item &item);
+
+ /*!
+ * Copies the contents of \a item into this item.
+ */
+ Item &operator=(const Item &item);
/*!
- * Returns the key
+ * Returns the key.
*/
String key() const;
/*!
- * Returns the binary value
+ * Returns the binary value.
*/
ByteVector value() const;
/*!
- * Returns the size of the full item
+ * Returns the size of the full item.
*/
int size() const;
ByteVector render();
/*!
- * Render the item to a ByteVector
+ * Render the item to a ByteVector.
*/
ByteVector render() const;
/*!
- * Parse the item from the ByteVector \a data
+ * Parse the item from the ByteVector \a data.
*/
void parse(const ByteVector& data);
/*!
- * Set the item to read-only
+ * Set the item to read-only.
*/
- void setReadOnly(bool);
+ void setReadOnly(bool readOnly);
/*!
- * Returns if the item is read-only
+ * Return true if the item is read-only.
*/
bool isReadOnly() const;