mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
CValueMap generic representation of a value object as a map of QVariants
refs #81
This commit is contained in:
committed by
Mathew Sutcliffe
parent
a280d239e6
commit
bf1837b414
@@ -109,6 +109,38 @@ namespace BlackMisc
|
||||
*/
|
||||
friend QDBusArgument &operator<<(QDBusArgument &argument, const CValueObject &uc);
|
||||
|
||||
/*!
|
||||
* \brief Operator == with value map
|
||||
* \param valueMap
|
||||
* \param uc
|
||||
* \return
|
||||
*/
|
||||
friend bool operator==(const CValueMap &valueMap, const CValueObject &uc);
|
||||
|
||||
/*!
|
||||
* \brief Operator != with value map
|
||||
* \param valueMap
|
||||
* \param uc
|
||||
* \return
|
||||
*/
|
||||
friend bool operator!=(const CValueMap &valueMap, const CValueObject &uc);
|
||||
|
||||
/*!
|
||||
* \brief Operator == with value map
|
||||
* \param uc
|
||||
* \param valueMap
|
||||
* \return
|
||||
*/
|
||||
friend bool operator==(const CValueObject &uc, const CValueMap &valueMap);
|
||||
|
||||
/*!
|
||||
* \brief Operator != with value map
|
||||
* \param uc
|
||||
* \param valueMap
|
||||
* \return
|
||||
*/
|
||||
friend bool operator!=(const CValueObject &uc, const CValueMap &valueMap);
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Virtual destructor
|
||||
@@ -134,6 +166,13 @@ namespace BlackMisc
|
||||
*/
|
||||
std::string toStdString(bool i18n = false) const;
|
||||
|
||||
/*!
|
||||
* \brief Update by variant map
|
||||
* \param valueMap
|
||||
* \return
|
||||
*/
|
||||
int apply(const BlackMisc::CValueMap &valueMap);
|
||||
|
||||
/*!
|
||||
* \brief Value hash, allows comparisons between QVariants
|
||||
* \return
|
||||
@@ -155,6 +194,32 @@ namespace BlackMisc
|
||||
*/
|
||||
virtual QVariant toQVariant() const = 0;
|
||||
|
||||
/*!
|
||||
* \brief Set property by index
|
||||
* \remarks Intentionally not abstract, avoiding all classes need to implement this method
|
||||
* \param index
|
||||
* \return
|
||||
*/
|
||||
virtual void setPropertyByIndex(const QVariant &variant, int index);
|
||||
|
||||
/*!
|
||||
* \brief Property by index
|
||||
* \remarks Intentionally not abstract, avoiding all classes need to implement this method
|
||||
* \param index
|
||||
* \return
|
||||
*/
|
||||
virtual QVariant propertyByIndex(int index) const;
|
||||
|
||||
/*!
|
||||
* \brief Property by index as String
|
||||
* \remarks Intentionally not abstract, avoiding all classes need to implement this method
|
||||
|
||||
* \param index
|
||||
* \param i18n
|
||||
* \return
|
||||
*/
|
||||
virtual QString propertyByIndexAsString(int index, bool i18n = false) const;
|
||||
|
||||
/*!
|
||||
* \brief The stored object as CValueObject
|
||||
* \param qv
|
||||
|
||||
Reference in New Issue
Block a user