46#ifdef _QX_ENABLE_BOOST_SERIALIZATION
47#include <boost/serialization/serialization.hpp>
48#include <boost/serialization/nvp.hpp>
51#include <QtCore/qdatastream.h>
73#ifdef _QX_ENABLE_BOOST_SERIALIZATION
106 inline operator bool()
const {
return (
m_bValue !=
false); }
122 if (s.trimmed().isEmpty()) { (* this) =
QxBool();
return; }
123 bool bValue = s.startsWith(
"1");
124 int iPos = s.indexOf(
"|", 2);
125 if (iPos == -1) { (* this) =
QxBool(bValue);
return; }
126 long lCode = s.mid(2, (iPos - 2)).toLong();
127 QString sDesc = s.right(s.size() - (iPos + 1));
128 (* this) =
QxBool(bValue, lCode, sDesc);
133#ifdef _QX_ENABLE_BOOST_SERIALIZATION
134 template <
class Archive>
135 void serialize(Archive & ar,
const unsigned int file_version)
137 Q_UNUSED(file_version);
138 ar & boost::serialization::make_nvp(
"value",
m_bValue);
139 ar & boost::serialization::make_nvp(
"code",
m_lCode);
140 ar & boost::serialization::make_nvp(
"desc",
m_sDesc);
144 inline bool checkInitialized(
const bool b)
const {
return ((
static_cast<int>(b) == 0) || (
static_cast<int>(b) == 1)); }
QX_DLL_EXPORT QDataStream & operator<<(QDataStream &stream, const qx::QxBool &t) QX_USED
QX_DLL_EXPORT QDataStream & operator>>(QDataStream &stream, qx::QxBool &t) QX_USED
qx_bool : boolean type with code and description message when an error occured
QxBool(long lCode, const QString &sDesc)
bool m_bValue
Data boolean value.
void setDesc(const QString &sDesc)
QxBool(const QxBool &other)
bool operator&&(const bool b) const
QString m_sDesc
Error description when value is false.
bool operator!=(const QxBool &other) const
bool operator==(const bool b) const
void fromString(const QString &s)
bool operator||(const bool b) const
void serialize(Archive &ar, const unsigned int file_version)
bool checkInitialized(const bool b) const
QxBool & operator=(const QxBool &other)
long m_lCode
Error code when value is false.
bool operator&&(const QxBool &other) const
QxBool(bool bValue, long lCode, const QString &sDesc)
bool operator||(const QxBool &other) const
friend class boost::serialization::access
bool operator!=(const bool b) const
QxBool & operator=(const bool b)
bool operator==(const QxBool &other) const
void setValue(bool bValue)
qx::trait::get_class_name<T>::get() : return class name of type T under const char * format,...
#define QX_REGISTER_CLASS_NAME(className)
Root namespace for all QxOrm library features.