--- /dev/null
+typedef long int ptrdiff_t;
+typedef long unsigned int size_t;
+typedef signed char qint8;
+typedef unsigned char quint8;
+typedef short qint16;
+typedef unsigned short quint16;
+typedef int qint32;
+typedef unsigned int quint32;
+typedef long long qint64;
+typedef unsigned long long quint64;
+typedef qint64 qlonglong;
+typedef quint64 qulonglong;
+template <int> class QUintForSize { private: typedef void Type; };
+template <> class QUintForSize<4> { public: typedef quint32 Type; };
+template <> class QUintForSize<8> { public: typedef quint64 Type; };
+template <typename T> class QUintForType : public QUintForSize<sizeof(T)> { };
+typedef QUintForType<void *>::Type quintptr;
+template <int> class QIntForSize { private: typedef void Type; };
+template <> class QIntForSize<4> { public: typedef qint32 Type; };
+template <> class QIntForSize<8> { public: typedef qint64 Type; };
+template <typename T> class QIntForType : public QIntForSize<sizeof(T)> { };
+typedef QIntForType<void *>::Type qptrdiff;
+typedef unsigned char uchar;
+typedef unsigned short ushort;
+typedef unsigned int uint;
+typedef unsigned long ulong;
+typedef int QNoImplicitBoolCast;
+typedef double qreal;
+template <typename T>
+inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
+inline int qRound(qreal d)
+{ return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); }
+inline qint64 qRound64(qreal d)
+{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); }
+template <typename T>
+inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; }
+template <typename T>
+inline const T &qMax(const T &a, const T &b) { if (a < b) return b; return a; }
+template <typename T>
+inline const T &qBound(const T &min, const T &val, const T &max)
+{ return qMax(min, qMin(max, val)); }
+class QDataStream;
+class QString;
+class __attribute__((visibility("default"))) QSysInfo {
+public:
+ enum Sizes {
+ WordSize = (sizeof(void *)<<3)
+ };
+ enum Endian {
+ BigEndian,
+ LittleEndian
+ , ByteOrder = LittleEndian
+ };
+};
+__attribute__((visibility("default"))) const char *qVersion();
+__attribute__((visibility("default"))) bool qSharedBuild();
+__attribute__((visibility("default"))) void qDebug(const char *, ...)
+ __attribute__ ((format (printf, 1, 2)))
+;
+__attribute__((visibility("default"))) void qWarning(const char *, ...)
+ __attribute__ ((format (printf, 1, 2)))
+;
+class QString;
+__attribute__((visibility("default"))) QString qt_error_string(int errorCode = -1);
+__attribute__((visibility("default"))) void qCritical(const char *, ...)
+ __attribute__ ((format (printf, 1, 2)))
+;
+__attribute__((visibility("default"))) void qFatal(const char *, ...)
+ __attribute__ ((format (printf, 1, 2)))
+;
+__attribute__((visibility("default"))) void qErrnoWarning(int code, const char *msg, ...);
+__attribute__((visibility("default"))) void qErrnoWarning(const char *msg, ...);
+class QDebug;
+class QNoDebug;
+__attribute__((visibility("default"))) inline QDebug qDebug();
+__attribute__((visibility("default"))) inline QDebug qWarning();
+__attribute__((visibility("default"))) inline QDebug qCritical();
+inline void qt_noop() {}
+__attribute__((visibility("default"))) void qt_assert(const char *assertion, const char *file, int line);
+__attribute__((visibility("default"))) void qt_assert_x(const char *where, const char *what, const char *file, int line);
+__attribute__((visibility("default"))) void qt_check_pointer(const char *, int);
+enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg = QtCriticalMsg };
+__attribute__((visibility("default"))) void qt_message_output(QtMsgType, const char *buf);
+typedef void (*QtMsgHandler)(QtMsgType, const char *);
+__attribute__((visibility("default"))) QtMsgHandler qInstallMsgHandler(QtMsgHandler);
+template <typename T> class QBasicAtomicPointer;
+template <typename T>
+class QGlobalStatic
+{
+public:
+ QBasicAtomicPointer<T> pointer;
+ bool destroyed;
+};
+template <typename T>
+class QGlobalStaticDeleter
+{
+public:
+ QGlobalStatic<T> &globalStatic;
+ QGlobalStaticDeleter(QGlobalStatic<T> &_globalStatic)
+ : globalStatic(_globalStatic)
+ { }
+ inline ~QGlobalStaticDeleter()
+ {
+ delete globalStatic.pointer;
+ globalStatic.pointer = 0;
+ globalStatic.destroyed = true;
+ }
+};
+class QBool
+{
+ bool b;
+public:
+ inline explicit QBool(bool B) : b(B) {}
+ inline operator const void *() const
+ { return b ? static_cast<const void *>(this) : static_cast<const void *>(0); }
+};
+inline bool operator==(QBool b1, bool b2) { return !b1 == !b2; }
+inline bool operator==(bool b1, QBool b2) { return !b1 == !b2; }
+inline bool operator==(QBool b1, QBool b2) { return !b1 == !b2; }
+inline bool operator!=(QBool b1, bool b2) { return !b1 != !b2; }
+inline bool operator!=(bool b1, QBool b2) { return !b1 != !b2; }
+inline bool operator!=(QBool b1, QBool b2) { return !b1 != !b2; }
+static inline bool qFuzzyCompare(double p1, double p2)
+{
+ return (qAbs(p1 - p2) <= 0.000000000001 * qMin(qAbs(p1), qAbs(p2)));
+}
+static inline bool qFuzzyCompare(float p1, float p2)
+{
+ return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2)));
+}
+static inline bool qIsNull(double d)
+{
+ union U {
+ double d;
+ quint64 u;
+ };
+ U val;
+ val.d = d;
+ return val.u == quint64(0);
+}
+static inline bool qIsNull(float f)
+{
+ union U {
+ float f;
+ quint32 u;
+ };
+ U val;
+ val.f = f;
+ return val.u == 0u;
+}
+template <typename T> inline bool qIsDetached(T &) { return true; }
+template <typename T>
+class QTypeInfo
+{
+public:
+ enum {
+ isPointer = false,
+ isComplex = true,
+ isStatic = true,
+ isLarge = (sizeof(T)>sizeof(void*)),
+ isDummy = false
+ };
+};
+template <typename T>
+class QTypeInfo<T*>
+{
+public:
+ enum {
+ isPointer = true,
+ isComplex = false,
+ isStatic = false,
+ isLarge = false,
+ isDummy = false
+ };
+};
+enum {
+ Q_COMPLEX_TYPE = 0,
+ Q_PRIMITIVE_TYPE = 0x1,
+ Q_STATIC_TYPE = 0,
+ Q_MOVABLE_TYPE = 0x2,
+ Q_DUMMY_TYPE = 0x4
+};
+template <> class QTypeInfo<bool> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(bool)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "bool"; } };
+template <> class QTypeInfo<char> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(char)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "char"; } };
+template <> class QTypeInfo<signed char> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(signed char)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "signed char"; } };
+template <> class QTypeInfo<uchar> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(uchar)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "uchar"; } };
+template <> class QTypeInfo<short> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(short)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "short"; } };
+template <> class QTypeInfo<ushort> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(ushort)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "ushort"; } };
+template <> class QTypeInfo<int> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(int)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "int"; } };
+template <> class QTypeInfo<uint> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(uint)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "uint"; } };
+template <> class QTypeInfo<long> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(long)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "long"; } };
+template <> class QTypeInfo<ulong> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(ulong)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "ulong"; } };
+template <> class QTypeInfo<qint64> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(qint64)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "qint64"; } };
+template <> class QTypeInfo<quint64> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(quint64)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "quint64"; } };
+template <> class QTypeInfo<float> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(float)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "float"; } };
+template <> class QTypeInfo<double> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(double)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "double"; } };
+template <> class QTypeInfo<long double> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(long double)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "long double"; } };
+__attribute__((visibility("default"))) void *qMalloc(size_t size);
+__attribute__((visibility("default"))) void qFree(void *ptr);
+__attribute__((visibility("default"))) void *qRealloc(void *ptr, size_t size);
+__attribute__((visibility("default"))) void *qMemCopy(void *dest, const void *src, size_t n);
+__attribute__((visibility("default"))) void *qMemSet(void *dest, int c, size_t n);
+class __attribute__((visibility("default"))) QFlag
+{
+ int i;
+public:
+ inline QFlag(int i);
+ inline operator int() const { return i; }
+};
+inline QFlag::QFlag(int ai) : i(ai) {}
+class __attribute__((visibility("default"))) QIncompatibleFlag
+{
+ int i;
+public:
+ inline explicit QIncompatibleFlag(int i);
+ inline operator int() const { return i; }
+};
+inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {}
+template<typename Enum>
+class QFlags
+{
+ typedef void **Zero;
+ int i;
+public:
+ typedef Enum enum_type;
+ inline QFlags(const QFlags &f) : i(f.i) {}
+ inline QFlags(Enum f) : i(f) {}
+ inline QFlags(Zero = 0) : i(0) {}
+ inline QFlags(QFlag f) : i(f) {}
+ inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; }
+ inline QFlags &operator&=(int mask) { i &= mask; return *this; }
+ inline QFlags &operator&=(uint mask) { i &= mask; return *this; }
+ inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; }
+ inline QFlags &operator|=(Enum f) { i |= f; return *this; }
+ inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; }
+ inline QFlags &operator^=(Enum f) { i ^= f; return *this; }
+ inline operator int() const { return i; }
+ inline QFlags operator|(QFlags f) const { QFlags g; g.i = i | f.i; return g; }
+ inline QFlags operator|(Enum f) const { QFlags g; g.i = i | f; return g; }
+ inline QFlags operator^(QFlags f) const { QFlags g; g.i = i ^ f.i; return g; }
+ inline QFlags operator^(Enum f) const { QFlags g; g.i = i ^ f; return g; }
+ inline QFlags operator&(int mask) const { QFlags g; g.i = i & mask; return g; }
+ inline QFlags operator&(uint mask) const { QFlags g; g.i = i & mask; return g; }
+ inline QFlags operator&(Enum f) const { QFlags g; g.i = i & f; return g; }
+ inline QFlags operator~() const { QFlags g; g.i = ~i; return g; }
+ inline bool operator!() const { return !i; }
+ inline bool testFlag(Enum f) const { return (i & f) == f; }
+};
+template <typename T>
+class QForeachContainer {
+public:
+ inline QForeachContainer(const T& t) : c(t), brk(0), i(c.begin()), e(c.end()) { }
+ const T c;
+ int brk;
+ typename T::const_iterator i, e;
+};
+class QByteArray;
+__attribute__((visibility("default"))) QByteArray qgetenv(const char *varName);
+__attribute__((visibility("default"))) bool qputenv(const char *varName, const QByteArray& value);
+inline int qIntCast(double f) { return int(f); }
+inline int qIntCast(float f) { return int(f); }
+__attribute__((visibility("default"))) void qsrand(uint seed);
+__attribute__((visibility("default"))) int qrand();
+enum QtValidLicenseForCoreModule { LicensedCore = true };
+enum QtValidLicenseForGuiModule { LicensedGui = true };
+enum QtValidLicenseForNetworkModule { LicensedNetwork = true };
+enum QtValidLicenseForOpenGLModule { LicensedOpenGL = true };
+enum QtValidLicenseForSqlModule { LicensedSql = true };
+enum QtValidLicenseForXmlModule { LicensedXml = true };
+enum QtValidLicenseForXmlPatternsModule { LicensedXmlPatterns = true };
+enum QtValidLicenseForHelpModule { LicensedHelp = true };
+enum QtValidLicenseForScriptModule { LicensedScript = true };
+enum QtValidLicenseForScriptToolsModule { LicensedScriptTools = true };
+enum QtValidLicenseForQt3SupportLightModule { LicensedQt3SupportLight = true };
+enum QtValidLicenseForQt3SupportModule { LicensedQt3Support = true };
+enum QtValidLicenseForSvgModule { LicensedSvg = true };
+enum QtValidLicenseForTestModule { LicensedTest = true };
+enum QtValidLicenseForDBusModule { LicensedDBus = true };
+typedef QtValidLicenseForCoreModule QtCoreModule;
+namespace QAlgorithmsPrivate {
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan);
+template <typename RandomAccessIterator, typename T>
+inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy);
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ void qStableSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan);
+template <typename RandomAccessIterator, typename T>
+inline void qStableSortHelper(RandomAccessIterator, RandomAccessIterator, const T &);
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan);
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan);
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan);
+}
+template <typename InputIterator, typename OutputIterator>
+inline OutputIterator qCopy(InputIterator begin, InputIterator end, OutputIterator dest)
+{
+ while (begin != end)
+ *dest++ = *begin++;
+ return dest;
+}
+template <typename BiIterator1, typename BiIterator2>
+inline BiIterator2 qCopyBackward(BiIterator1 begin, BiIterator1 end, BiIterator2 dest)
+{
+ while (begin != end)
+ *--dest = *--end;
+ return dest;
+}
+template <typename InputIterator1, typename InputIterator2>
+inline bool qEqual(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2)
+{
+ for (; first1 != last1; ++first1, ++first2)
+ if (!(*first1 == *first2))
+ return false;
+ return true;
+}
+template <typename ForwardIterator, typename T>
+inline void qFill(ForwardIterator first, ForwardIterator last, const T &val)
+{
+ for (; first != last; ++first)
+ *first = val;
+}
+template <typename Container, typename T>
+inline void qFill(Container &container, const T &val)
+{
+ qFill(container.begin(), container.end(), val);
+}
+template <typename InputIterator, typename T>
+inline InputIterator qFind(InputIterator first, InputIterator last, const T &val)
+{
+ while (first != last && !(*first == val))
+ ++first;
+ return first;
+}
+template <typename Container, typename T>
+inline typename Container::const_iterator qFind(const Container &container, const T &val)
+{
+ return qFind(container.constBegin(), container.constEnd(), val);
+}
+template <typename InputIterator, typename T, typename Size>
+inline void qCount(InputIterator first, InputIterator last, const T &value, Size &n)
+{
+ for (; first != last; ++first)
+ if (*first == value)
+ ++n;
+}
+template <typename Container, typename T, typename Size>
+inline void qCount(const Container &container, const T &value, Size &n)
+{
+ qCount(container.constBegin(), container.constEnd(), value, n);
+}
+template <typename T>
+inline void qSwap(T &value1, T &value2)
+{
+ T t = value1;
+ value1 = value2;
+ value2 = t;
+}
+template <typename T>
+class qLess
+{
+public:
+ inline bool operator()(const T &t1, const T &t2) const
+ {
+ return (t1 < t2);
+ }
+};
+template <typename T>
+class qGreater
+{
+public:
+ inline bool operator()(const T &t1, const T &t2) const
+ {
+ return (t2 < t1);
+ }
+};
+template <typename RandomAccessIterator>
+inline void qSort(RandomAccessIterator start, RandomAccessIterator end)
+{
+ if (start != end)
+ QAlgorithmsPrivate::qSortHelper(start, end, *start);
+}
+template <typename RandomAccessIterator, typename LessThan>
+inline void qSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan)
+{
+ if (start != end)
+ QAlgorithmsPrivate::qSortHelper(start, end, *start, lessThan);
+}
+template<typename Container>
+inline void qSort(Container &c)
+{
+ if (!c.empty())
+ QAlgorithmsPrivate::qSortHelper(c.begin(), c.end(), *c.begin());
+}
+template <typename RandomAccessIterator>
+inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end)
+{
+ if (start != end)
+ QAlgorithmsPrivate::qStableSortHelper(start, end, *start);
+}
+template <typename RandomAccessIterator, typename LessThan>
+inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan)
+{
+ if (start != end)
+ QAlgorithmsPrivate::qStableSortHelper(start, end, *start, lessThan);
+}
+template<typename Container>
+inline void qStableSort(Container &c)
+{
+ if (!c.empty())
+ QAlgorithmsPrivate::qStableSortHelper(c.begin(), c.end(), *c.begin());
+}
+template <typename RandomAccessIterator, typename T>
+ RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
+{
+ RandomAccessIterator middle;
+ int n = end - begin;
+ int half;
+ while (n > 0) {
+ half = n >> 1;
+ middle = begin + half;
+ if (*middle < value) {
+ begin = middle + 1;
+ n -= half + 1;
+ } else {
+ n = half;
+ }
+ }
+ return begin;
+}
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
+{
+ return QAlgorithmsPrivate::qLowerBoundHelper(begin, end, value, lessThan);
+}
+template <typename Container, typename T>
+ typename Container::const_iterator qLowerBound(const Container &container, const T &value)
+{
+ return QAlgorithmsPrivate::qLowerBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
+}
+template <typename RandomAccessIterator, typename T>
+ RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
+{
+ RandomAccessIterator middle;
+ int n = end - begin;
+ int half;
+ while (n > 0) {
+ half = n >> 1;
+ middle = begin + half;
+ if (value < *middle) {
+ n = half;
+ } else {
+ begin = middle + 1;
+ n -= half + 1;
+ }
+ }
+ return begin;
+}
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
+{
+ return QAlgorithmsPrivate::qUpperBoundHelper(begin, end, value, lessThan);
+}
+template <typename Container, typename T>
+ typename Container::const_iterator qUpperBound(const Container &container, const T &value)
+{
+ return QAlgorithmsPrivate::qUpperBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
+}
+template <typename RandomAccessIterator, typename T>
+ RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
+{
+ qint64 l = 0;
+ qint64 r = end - begin - 1;
+ if (r < 0)
+ return end;
+ qint64 i = (l + r + 1) / 2;
+ while (r != l) {
+ if (value < begin[i])
+ r = i - 1;
+ else
+ l = i;
+ i = (l + r + 1) / 2;
+ }
+ if (begin[i] < value || value < begin[i])
+ return end;
+ else
+ return begin + i;
+}
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
+{
+ return QAlgorithmsPrivate::qBinaryFindHelper(begin, end, value, lessThan);
+}
+template <typename Container, typename T>
+ typename Container::const_iterator qBinaryFind(const Container &container, const T &value)
+{
+ return QAlgorithmsPrivate::qBinaryFindHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
+}
+template <typename ForwardIterator>
+ void qDeleteAll(ForwardIterator begin, ForwardIterator end)
+{
+ while (begin != end) {
+ delete *begin;
+ ++begin;
+ }
+}
+template <typename Container>
+inline void qDeleteAll(const Container &c)
+{
+ qDeleteAll(c.begin(), c.end());
+}
+namespace QAlgorithmsPrivate {
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan)
+{
+top:
+ int span = end - start;
+ if (span < 2)
+ return;
+ --end;
+ RandomAccessIterator low = start, high = end - 1;
+ RandomAccessIterator pivot = start + span / 2;
+ if (lessThan(*end, *start))
+ qSwap(*end, *start);
+ if (span == 2)
+ return;
+ if (lessThan(*pivot, *start))
+ qSwap(*pivot, *start);
+ if (lessThan(*end, *pivot))
+ qSwap(*end, *pivot);
+ if (span == 3)
+ return;
+ qSwap(*pivot, *end);
+ while (low < high) {
+ while (low < high && lessThan(*low, *end))
+ ++low;
+ while (high > low && lessThan(*end, *high))
+ --high;
+ if (low < high) {
+ qSwap(*low, *high);
+ ++low;
+ --high;
+ } else {
+ break;
+ }
+ }
+ if (lessThan(*low, *end))
+ ++low;
+ qSwap(*end, *low);
+ qSortHelper(start, low, t, lessThan);
+ start = low + 1;
+ ++end;
+ goto top;
+}
+template <typename RandomAccessIterator, typename T>
+inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy)
+{
+ qSortHelper(begin, end, dummy, qLess<T>());
+}
+template <typename RandomAccessIterator>
+ void qReverse(RandomAccessIterator begin, RandomAccessIterator end)
+{
+ --end;
+ while (begin < end)
+ qSwap(*begin++, *end--);
+}
+template <typename RandomAccessIterator>
+ void qRotate(RandomAccessIterator begin, RandomAccessIterator middle, RandomAccessIterator end)
+{
+ qReverse(begin, middle);
+ qReverse(middle, end);
+ qReverse(begin, end);
+}
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ void qMerge(RandomAccessIterator begin, RandomAccessIterator pivot, RandomAccessIterator end, T &t, LessThan lessThan)
+{
+ const int len1 = pivot - begin;
+ const int len2 = end - pivot;
+ if (len1 == 0 || len2 == 0)
+ return;
+ if (len1 + len2 == 2) {
+ if (lessThan(*(begin + 1), *(begin)))
+ qSwap(*begin, *(begin + 1));
+ return;
+ }
+ RandomAccessIterator firstCut;
+ RandomAccessIterator secondCut;
+ int len2Half;
+ if (len1 > len2) {
+ const int len1Half = len1 / 2;
+ firstCut = begin + len1Half;
+ secondCut = qLowerBound(pivot, end, *firstCut, lessThan);
+ len2Half = secondCut - pivot;
+ } else {
+ len2Half = len2 / 2;
+ secondCut = pivot + len2Half;
+ firstCut = qUpperBound(begin, pivot, *secondCut, lessThan);
+ }
+ qRotate(firstCut, pivot, secondCut);
+ const RandomAccessIterator newPivot = firstCut + len2Half;
+ qMerge(begin, firstCut, newPivot, t, lessThan);
+ qMerge(newPivot, secondCut, end, t, lessThan);
+}
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &t, LessThan lessThan)
+{
+ const int span = end - begin;
+ if (span < 2)
+ return;
+ const RandomAccessIterator middle = begin + span / 2;
+ qStableSortHelper(begin, middle, t, lessThan);
+ qStableSortHelper(middle, end, t, lessThan);
+ qMerge(begin, middle, end, t, lessThan);
+}
+template <typename RandomAccessIterator, typename T>
+inline void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy)
+{
+ qStableSortHelper(begin, end, dummy, qLess<T>());
+}
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
+{
+ RandomAccessIterator middle;
+ int n = end - begin;
+ int half;
+ while (n > 0) {
+ half = n >> 1;
+ middle = begin + half;
+ if (lessThan(*middle, value)) {
+ begin = middle + 1;
+ n -= half + 1;
+ } else {
+ n = half;
+ }
+ }
+ return begin;
+}
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
+{
+ RandomAccessIterator middle;
+ int n = end - begin;
+ int half;
+ while (n > 0) {
+ half = n >> 1;
+ middle = begin + half;
+ if (lessThan(value, *middle)) {
+ n = half;
+ } else {
+ begin = middle + 1;
+ n -= half + 1;
+ }
+ }
+ return begin;
+}
+template <typename RandomAccessIterator, typename T, typename LessThan>
+ RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
+{
+ qint64 l = 0;
+ qint64 r = end - begin - 1;
+ if (r < 0)
+ return end;
+ qint64 i = (l + r + 1) / 2;
+ while (r != l) {
+ if (lessThan(value, begin[i]))
+ r = i - 1;
+ else
+ l = i;
+ i = (l + r + 1) / 2;
+ }
+ if (lessThan(begin[i], value) || lessThan(value, begin[i]))
+ return end;
+ else
+ return begin + i;
+}
+}
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class __attribute__((visibility("default"))) QBasicAtomicInt
+{
+public:
+ volatile int _q_value;
+ inline bool operator==(int value) const
+ {
+ return _q_value == value;
+ }
+ inline bool operator!=(int value) const
+ {
+ return _q_value != value;
+ }
+ inline bool operator!() const
+ {
+ return _q_value == 0;
+ }
+ inline operator int() const
+ {
+ return _q_value;
+ }
+ inline QBasicAtomicInt &operator=(int value)
+ {
+ _q_value = value;
+ return *this;
+ }
+ static bool isReferenceCountingNative();
+ static bool isReferenceCountingWaitFree();
+ bool ref();
+ bool deref();
+ static bool isTestAndSetNative();
+ static bool isTestAndSetWaitFree();
+ bool testAndSetRelaxed(int expectedValue, int newValue);
+ bool testAndSetAcquire(int expectedValue, int newValue);
+ bool testAndSetRelease(int expectedValue, int newValue);
+ bool testAndSetOrdered(int expectedValue, int newValue);
+ static bool isFetchAndStoreNative();
+ static bool isFetchAndStoreWaitFree();
+ int fetchAndStoreRelaxed(int newValue);
+ int fetchAndStoreAcquire(int newValue);
+ int fetchAndStoreRelease(int newValue);
+ int fetchAndStoreOrdered(int newValue);
+ static bool isFetchAndAddNative();
+ static bool isFetchAndAddWaitFree();
+ int fetchAndAddRelaxed(int valueToAdd);
+ int fetchAndAddAcquire(int valueToAdd);
+ int fetchAndAddRelease(int valueToAdd);
+ int fetchAndAddOrdered(int valueToAdd);
+};
+template <typename T>
+class QBasicAtomicPointer
+{
+public:
+ T * volatile _q_value;
+ inline bool operator==(T *value) const
+ {
+ return _q_value == value;
+ }
+ inline bool operator!=(T *value) const
+ {
+ return !operator==(value);
+ }
+ inline bool operator!() const
+ {
+ return operator==(0);
+ }
+ inline operator T *() const
+ {
+ return _q_value;
+ }
+ inline T *operator->() const
+ {
+ return _q_value;
+ }
+ inline QBasicAtomicPointer<T> &operator=(T *value)
+ {
+ _q_value = value;
+ return *this;
+ }
+ static bool isTestAndSetNative();
+ static bool isTestAndSetWaitFree();
+ bool testAndSetRelaxed(T *expectedValue, T *newValue);
+ bool testAndSetAcquire(T *expectedValue, T *newValue);
+ bool testAndSetRelease(T *expectedValue, T *newValue);
+ bool testAndSetOrdered(T *expectedValue, T *newValue);
+ static bool isFetchAndStoreNative();
+ static bool isFetchAndStoreWaitFree();
+ T *fetchAndStoreRelaxed(T *newValue);
+ T *fetchAndStoreAcquire(T *newValue);
+ T *fetchAndStoreRelease(T *newValue);
+ T *fetchAndStoreOrdered(T *newValue);
+ static bool isFetchAndAddNative();
+ static bool isFetchAndAddWaitFree();
+ T *fetchAndAddRelaxed(qptrdiff valueToAdd);
+ T *fetchAndAddAcquire(qptrdiff valueToAdd);
+ T *fetchAndAddRelease(qptrdiff valueToAdd);
+ T *fetchAndAddOrdered(qptrdiff valueToAdd);
+};
+inline bool QBasicAtomicInt::isReferenceCountingNative()
+{ return false; }
+inline bool QBasicAtomicInt::isReferenceCountingWaitFree()
+{ return false; }
+inline bool QBasicAtomicInt::isTestAndSetNative()
+{ return false; }
+inline bool QBasicAtomicInt::isTestAndSetWaitFree()
+{ return false; }
+inline bool QBasicAtomicInt::isFetchAndStoreNative()
+{ return false; }
+inline bool QBasicAtomicInt::isFetchAndStoreWaitFree()
+{ return false; }
+inline bool QBasicAtomicInt::isFetchAndAddNative()
+{ return false; }
+inline bool QBasicAtomicInt::isFetchAndAddWaitFree()
+{ return false; }
+template <typename T>
+inline bool QBasicAtomicPointer<T>::isTestAndSetNative()
+{ return false; }
+template <typename T>
+inline bool QBasicAtomicPointer<T>::isTestAndSetWaitFree()
+{ return false; }
+template <typename T>
+inline bool QBasicAtomicPointer<T>::isFetchAndStoreNative()
+{ return false; }
+template <typename T>
+inline bool QBasicAtomicPointer<T>::isFetchAndStoreWaitFree()
+{ return false; }
+template <typename T>
+inline bool QBasicAtomicPointer<T>::isFetchAndAddNative()
+{ return false; }
+template <typename T>
+inline bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
+{ return false; }
+__attribute__((visibility("default"))) bool QBasicAtomicInt_testAndSetOrdered(volatile int *, int, int);
+__attribute__((visibility("default"))) int QBasicAtomicInt_fetchAndStoreOrdered(volatile int *, int);
+__attribute__((visibility("default"))) int QBasicAtomicInt_fetchAndAddOrdered(volatile int *, int);
+__attribute__((visibility("default"))) bool QBasicAtomicPointer_testAndSetOrdered(void * volatile *, void *, void *);
+__attribute__((visibility("default"))) void *QBasicAtomicPointer_fetchAndStoreOrdered(void * volatile *, void *);
+__attribute__((visibility("default"))) void *QBasicAtomicPointer_fetchAndAddOrdered(void * volatile *, qptrdiff);
+inline bool QBasicAtomicInt::ref()
+{
+ return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, 1) != -1;
+}
+inline bool QBasicAtomicInt::deref()
+{
+ return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, -1) != 1;
+}
+inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue)
+{
+ return QBasicAtomicInt_testAndSetOrdered(&_q_value, expectedValue, newValue);
+}
+inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
+{
+ return QBasicAtomicInt_fetchAndStoreOrdered(&_q_value, newValue);
+}
+inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd)
+{
+ return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, valueToAdd);
+}
+inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+template <typename T>
+inline bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValue, T *newValue)
+{
+ union { T * volatile * typed; void * volatile * voidp; } pointer;
+ pointer.typed = &_q_value;
+ return QBasicAtomicPointer_testAndSetOrdered(pointer.voidp, expectedValue, newValue);
+}
+template <typename T>
+inline bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+template <typename T>
+inline bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+template <typename T>
+inline bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
+{
+ return testAndSetOrdered(expectedValue, newValue);
+}
+template <typename T>
+inline T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
+{
+ union { T * volatile * typed; void * volatile * voidp; } pointer;
+ union { T *typed; void *voidp; } returnValue;
+ pointer.typed = &_q_value;
+ returnValue.voidp = QBasicAtomicPointer_fetchAndStoreOrdered(pointer.voidp, newValue);
+ return returnValue.typed;
+}
+template <typename T>
+inline T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+template <typename T>
+inline T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+template <typename T>
+inline T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
+{
+ return fetchAndStoreOrdered(newValue);
+}
+template <typename T>
+inline T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
+{
+ union { T * volatile *typed; void * volatile *voidp; } pointer;
+ union { T *typed; void *voidp; } returnValue;
+ pointer.typed = &_q_value;
+ returnValue.voidp = QBasicAtomicPointer_fetchAndAddOrdered(pointer.voidp, valueToAdd * sizeof(T));
+ return returnValue.typed;
+}
+template <typename T>
+inline T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+template <typename T>
+inline T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+template <typename T>
+inline T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
+{
+ return fetchAndAddOrdered(valueToAdd);
+}
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class __attribute__((visibility("default"))) QAtomicInt : public QBasicAtomicInt
+{
+public:
+ inline QAtomicInt(int value = 0)
+ {
+ _q_value = value;
+ }
+ inline QAtomicInt(const QAtomicInt &other)
+ {
+ _q_value = other._q_value;
+ }
+ inline QAtomicInt &operator=(int value)
+ {
+ (void) QBasicAtomicInt::operator=(value);
+ return *this;
+ }
+ inline QAtomicInt &operator=(const QAtomicInt &other)
+ {
+ (void) QBasicAtomicInt::operator=(other);
+ return *this;
+ }
+};
+template <typename T>
+class QAtomicPointer : public QBasicAtomicPointer<T>
+{
+public:
+ inline QAtomicPointer(T *value = 0)
+ {
+ QBasicAtomicPointer<T>::_q_value = value;
+ }
+ inline QAtomicPointer(const QAtomicPointer<T> &other)
+ {
+ QBasicAtomicPointer<T>::_q_value = other._q_value;
+ }
+ inline QAtomicPointer<T> &operator=(T *value)
+ {
+ (void) QBasicAtomicPointer<T>::operator=(value);
+ return *this;
+ }
+ inline QAtomicPointer<T> &operator=(const QAtomicPointer<T> &other)
+ {
+ (void) QBasicAtomicPointer<T>::operator=(other);
+ return *this;
+ }
+};
+template <typename T>
+inline void qAtomicAssign(T *&d, T *x)
+{
+ if (d == x)
+ return;
+ x->ref.ref();
+ if (!d->ref.deref())
+ delete d;
+ d = x;
+}
+template <typename T>
+inline void qAtomicDetach(T *&d)
+{
+ if (d->ref == 1)
+ return;
+ T *x = d;
+ d = new T(*d);
+ if (!x->ref.deref())
+ delete x;
+}
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QString;
+struct QLatin1Char
+{
+public:
+ inline explicit QLatin1Char(char c) : ch(c) {}
+ inline char toLatin1() const { return ch; }
+ inline ushort unicode() const { return ushort(uchar(ch)); }
+private:
+ char ch;
+};
+class __attribute__((visibility("default"))) QChar {
+public:
+ QChar();
+ __attribute__ ((__deprecated__)) QChar(char c);
+ __attribute__ ((__deprecated__)) QChar(uchar c);
+ QChar(QLatin1Char ch);
+ QChar(uchar c, uchar r);
+ inline QChar(ushort rc) : ucs(rc){}
+ QChar(short rc);
+ QChar(uint rc);
+ QChar(int rc);
+ enum SpecialCharacter {
+ Null = 0x0000,
+ Nbsp = 0x00a0,
+ ReplacementCharacter = 0xfffd,
+ ObjectReplacementCharacter = 0xfffc,
+ ByteOrderMark = 0xfeff,
+ ByteOrderSwapped = 0xfffe,
+ ParagraphSeparator = 0x2029,
+ LineSeparator = 0x2028
+ };
+ QChar(SpecialCharacter sc);
+ enum Category
+ {
+ NoCategory,
+ Mark_NonSpacing,
+ Mark_SpacingCombining,
+ Mark_Enclosing,
+ Number_DecimalDigit,
+ Number_Letter,
+ Number_Other,
+ Separator_Space,
+ Separator_Line,
+ Separator_Paragraph,
+ Other_Control,
+ Other_Format,
+ Other_Surrogate,
+ Other_PrivateUse,
+ Other_NotAssigned,
+ Letter_Uppercase,
+ Letter_Lowercase,
+ Letter_Titlecase,
+ Letter_Modifier,
+ Letter_Other,
+ Punctuation_Connector,
+ Punctuation_Dash,
+ Punctuation_Open,
+ Punctuation_Close,
+ Punctuation_InitialQuote,
+ Punctuation_FinalQuote,
+ Punctuation_Other,
+ Symbol_Math,
+ Symbol_Currency,
+ Symbol_Modifier,
+ Symbol_Other,
+ Punctuation_Dask = Punctuation_Dash
+ };
+ enum Direction
+ {
+ DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON,
+ DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN
+ };
+ enum Decomposition
+ {
+ NoDecomposition,
+ Canonical,
+ Font,
+ NoBreak,
+ Initial,
+ Medial,
+ Final,
+ Isolated,
+ Circle,
+ Super,
+ Sub,
+ Vertical,
+ Wide,
+ Narrow,
+ Small,
+ Square,
+ Compat,
+ Fraction
+ };
+ enum Joining
+ {
+ OtherJoining, Dual, Right, Center
+ };
+ enum CombiningClass
+ {
+ Combining_BelowLeftAttached = 200,
+ Combining_BelowAttached = 202,
+ Combining_BelowRightAttached = 204,
+ Combining_LeftAttached = 208,
+ Combining_RightAttached = 210,
+ Combining_AboveLeftAttached = 212,
+ Combining_AboveAttached = 214,
+ Combining_AboveRightAttached = 216,
+ Combining_BelowLeft = 218,
+ Combining_Below = 220,
+ Combining_BelowRight = 222,
+ Combining_Left = 224,
+ Combining_Right = 226,
+ Combining_AboveLeft = 228,
+ Combining_Above = 230,
+ Combining_AboveRight = 232,
+ Combining_DoubleBelow = 233,
+ Combining_DoubleAbove = 234,
+ Combining_IotaSubscript = 240
+ };
+ enum UnicodeVersion {
+ Unicode_Unassigned,
+ Unicode_1_1,
+ Unicode_2_0,
+ Unicode_2_1_2,
+ Unicode_3_0,
+ Unicode_3_1,
+ Unicode_3_2,
+ Unicode_4_0,
+ Unicode_4_1,
+ Unicode_5_0
+ };
+ Category category() const;
+ Direction direction() const;
+ Joining joining() const;
+ bool hasMirrored() const;
+ unsigned char combiningClass() const;
+ QChar mirroredChar() const;
+ QString decomposition() const;
+ Decomposition decompositionTag() const;
+ int digitValue() const;
+ QChar toLower() const;
+ QChar toUpper() const;
+ QChar toTitleCase() const;
+ QChar toCaseFolded() const;
+ UnicodeVersion unicodeVersion() const;
+ char toAscii() const;
+ inline char toLatin1() const;
+ inline ushort unicode() const { return ucs; }
+ inline ushort &unicode() { return const_cast<ushort&>(ucs); }
+ static QChar fromAscii(char c);
+ static QChar fromLatin1(char c);
+ inline bool isNull() const { return ucs == 0; }
+ bool isPrint() const;
+ bool isPunct() const;
+ bool isSpace() const;
+ bool isMark() const;
+ bool isLetter() const;
+ bool isNumber() const;
+ bool isLetterOrNumber() const;
+ bool isDigit() const;
+ bool isSymbol() const;
+ inline bool isLower() const { return category() == Letter_Lowercase; }
+ inline bool isUpper() const { return category() == Letter_Uppercase; }
+ inline bool isTitleCase() const { return category() == Letter_Titlecase; }
+ inline bool isHighSurrogate() const {
+ return ((ucs & 0xfc00) == 0xd800);
+ }
+ inline bool isLowSurrogate() const {
+ return ((ucs & 0xfc00) == 0xdc00);
+ }
+ inline uchar cell() const { return uchar(ucs & 0xff); }
+ inline uchar row() const { return uchar((ucs>>8)&0xff); }
+ inline void setCell(uchar cell);
+ inline void setRow(uchar row);
+ static inline uint surrogateToUcs4(ushort high, ushort low) {
+ return (uint(high)<<10) + low - 0x35fdc00;
+ }
+ static inline uint surrogateToUcs4(QChar high, QChar low) {
+ return (uint(high.ucs)<<10) + low.ucs - 0x35fdc00;
+ }
+ static inline ushort highSurrogate(uint ucs4) {
+ return (ucs4>>10) + 0xd7c0;
+ }
+ static inline ushort lowSurrogate(uint ucs4) {
+ return ucs4%0x400 + 0xdc00;
+ }
+ static Category category(uint ucs4);
+ static Category category(ushort ucs2);
+ static Direction direction(uint ucs4);
+ static Direction direction(ushort ucs2);
+ static Joining joining(uint ucs4);
+ static Joining joining(ushort ucs2);
+ static unsigned char combiningClass(uint ucs4);
+ static unsigned char combiningClass(ushort ucs2);
+ static uint mirroredChar(uint ucs4);
+ static ushort mirroredChar(ushort ucs2);
+ static Decomposition decompositionTag(uint ucs4);
+ static int digitValue(uint ucs4);
+ static int digitValue(ushort ucs2);
+ static uint toLower(uint ucs4);
+ static ushort toLower(ushort ucs2);
+ static uint toUpper(uint ucs4);
+ static ushort toUpper(ushort ucs2);
+ static uint toTitleCase(uint ucs4);
+ static ushort toTitleCase(ushort ucs2);
+ static uint toCaseFolded(uint ucs4);
+ static ushort toCaseFolded(ushort ucs2);
+ static UnicodeVersion unicodeVersion(uint ucs4);
+ static UnicodeVersion unicodeVersion(ushort ucs2);
+ static QString decomposition(uint ucs4);
+private:
+ ushort ucs;
+}
+ ;
+template <> class QTypeInfo<QChar> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QChar)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QChar"; } };
+inline QChar::QChar() : ucs(0) {}
+inline char QChar::toLatin1() const { return ucs > 0xff ? '\0' : char(ucs); }
+inline QChar QChar::fromLatin1(char c) { return QChar(ushort(uchar(c))); }
+inline QChar::QChar(uchar c, uchar r) : ucs((r << 8) | c){}
+inline QChar::QChar(short rc) : ucs(ushort(rc)){}
+inline QChar::QChar(uint rc) : ucs(ushort(rc & 0xffff)){}
+inline QChar::QChar(int rc) : ucs(ushort(rc & 0xffff)){}
+inline QChar::QChar(SpecialCharacter s) : ucs(ushort(s)) {}
+inline QChar::QChar(QLatin1Char ch) : ucs(ch.unicode()) {}
+inline void QChar::setCell(uchar acell)
+{ ucs = (ucs & 0xff00) + acell; }
+inline void QChar::setRow(uchar arow)
+{ ucs = (ushort(arow)<<8) + (ucs&0xff); }
+inline bool operator==(QChar c1, QChar c2) { return c1.unicode() == c2.unicode(); }
+inline bool operator!=(QChar c1, QChar c2) { return c1.unicode() != c2.unicode(); }
+inline bool operator<=(QChar c1, QChar c2) { return c1.unicode() <= c2.unicode(); }
+inline bool operator>=(QChar c1, QChar c2) { return c1.unicode() >= c2.unicode(); }
+inline bool operator<(QChar c1, QChar c2) { return c1.unicode() < c2.unicode(); }
+inline bool operator>(QChar c1, QChar c2) { return c1.unicode() > c2.unicode(); }
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QChar &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QChar &);
+namespace std {
+ struct bidirectional_iterator_tag;
+ struct random_access_iterator_tag;
+}
+typedef QtValidLicenseForCoreModule QtCoreModule;
+namespace std __attribute__ ((__visibility__ ("default"))) {
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ using ::ptrdiff_t;
+ using ::size_t;
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ struct input_iterator_tag {};
+ struct output_iterator_tag {};
+ struct forward_iterator_tag : public input_iterator_tag {};
+ struct bidirectional_iterator_tag : public forward_iterator_tag {};
+ struct random_access_iterator_tag : public bidirectional_iterator_tag {};
+ template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
+ typename _Pointer = _Tp*, typename _Reference = _Tp&>
+ struct iterator
+ {
+ typedef _Category iterator_category;
+ typedef _Tp value_type;
+ typedef _Distance difference_type;
+ typedef _Pointer pointer;
+ typedef _Reference reference;
+ };
+ template<typename _Iterator>
+ struct iterator_traits
+ {
+ typedef typename _Iterator::iterator_category iterator_category;
+ typedef typename _Iterator::value_type value_type;
+ typedef typename _Iterator::difference_type difference_type;
+ typedef typename _Iterator::pointer pointer;
+ typedef typename _Iterator::reference reference;
+ };
+ template<typename _Tp>
+ struct iterator_traits<_Tp*>
+ {
+ typedef random_access_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+ };
+ template<typename _Tp>
+ struct iterator_traits<const _Tp*>
+ {
+ typedef random_access_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef ptrdiff_t difference_type;
+ typedef const _Tp* pointer;
+ typedef const _Tp& reference;
+ };
+ template<typename _Iter>
+ inline typename iterator_traits<_Iter>::iterator_category
+ __iterator_category(const _Iter&)
+ { return typename iterator_traits<_Iter>::iterator_category(); }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _InputIterator>
+ inline typename iterator_traits<_InputIterator>::difference_type
+ __distance(_InputIterator __first, _InputIterator __last,
+ input_iterator_tag)
+ {
+ typename iterator_traits<_InputIterator>::difference_type __n = 0;
+ while (__first != __last)
+ {
+ ++__first;
+ ++__n;
+ }
+ return __n;
+ }
+ template<typename _RandomAccessIterator>
+ inline typename iterator_traits<_RandomAccessIterator>::difference_type
+ __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ random_access_iterator_tag)
+ {
+ return __last - __first;
+ }
+ template<typename _InputIterator>
+ inline typename iterator_traits<_InputIterator>::difference_type
+ distance(_InputIterator __first, _InputIterator __last)
+ {
+ return std::__distance(__first, __last,
+ std::__iterator_category(__first));
+ }
+ template<typename _InputIterator, typename _Distance>
+ inline void
+ __advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
+ {
+ while (__n--)
+ ++__i;
+ }
+ template<typename _BidirectionalIterator, typename _Distance>
+ inline void
+ __advance(_BidirectionalIterator& __i, _Distance __n,
+ bidirectional_iterator_tag)
+ {
+ if (__n > 0)
+ while (__n--)
+ ++__i;
+ else
+ while (__n++)
+ --__i;
+ }
+ template<typename _RandomAccessIterator, typename _Distance>
+ inline void
+ __advance(_RandomAccessIterator& __i, _Distance __n,
+ random_access_iterator_tag)
+ {
+ __i += __n;
+ }
+ template<typename _InputIterator, typename _Distance>
+ inline void
+ advance(_InputIterator& __i, _Distance __n)
+ {
+ typename iterator_traits<_InputIterator>::difference_type __d = __n;
+ std::__advance(__i, __d, std::__iterator_category(__i));
+ }
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Iterator, typename _Container>
+ class __normal_iterator;
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ struct __true_type { };
+ struct __false_type { };
+ template<bool>
+ struct __truth_type
+ { typedef __false_type __type; };
+ template<>
+ struct __truth_type<true>
+ { typedef __true_type __type; };
+ template<class _Sp, class _Tp>
+ struct __traitor
+ {
+ enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
+ typedef typename __truth_type<__value>::__type __type;
+ };
+ template<class _Sp, class _Tp>
+ struct __traitand
+ {
+ enum { __value = bool(_Sp::__value) && bool(_Tp::__value) };
+ typedef typename __truth_type<__value>::__type __type;
+ };
+ template<typename, typename>
+ struct __are_same
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+ template<typename _Tp>
+ struct __are_same<_Tp, _Tp>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<typename _Tp>
+ struct __is_void
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+ template<>
+ struct __is_void<void>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<typename _Tp>
+ struct __is_integer
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+ template<>
+ struct __is_integer<bool>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_integer<char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_integer<signed char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_integer<unsigned char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_integer<short>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_integer<unsigned short>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_integer<int>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_integer<unsigned int>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_integer<long>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_integer<unsigned long>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_integer<long long>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_integer<unsigned long long>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<typename _Tp>
+ struct __is_floating
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+ template<>
+ struct __is_floating<float>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_floating<double>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_floating<long double>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<typename _Tp>
+ struct __is_pointer
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+ template<typename _Tp>
+ struct __is_pointer<_Tp*>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<typename _Tp>
+ struct __is_normal_iterator
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+ template<typename _Iterator, typename _Container>
+ struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
+ _Container> >
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<typename _Tp>
+ struct __is_arithmetic
+ : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
+ { };
+ template<typename _Tp>
+ struct __is_fundamental
+ : public __traitor<__is_void<_Tp>, __is_arithmetic<_Tp> >
+ { };
+ template<typename _Tp>
+ struct __is_scalar
+ : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
+ { };
+ template<typename _Tp>
+ struct __is_char
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+ template<>
+ struct __is_char<char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<typename _Tp>
+ struct __is_byte
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+ template<>
+ struct __is_byte<char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_byte<signed char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<>
+ struct __is_byte<unsigned char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+ template<typename _Tp>
+ struct __is_move_iterator
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ template<bool, typename>
+ struct __enable_if
+ { };
+ template<typename _Tp>
+ struct __enable_if<true, _Tp>
+ { typedef _Tp __type; };
+ template<bool _Cond, typename _Iftrue, typename _Iffalse>
+ struct __conditional_type
+ { typedef _Iftrue __type; };
+ template<typename _Iftrue, typename _Iffalse>
+ struct __conditional_type<false, _Iftrue, _Iffalse>
+ { typedef _Iffalse __type; };
+ template<typename _Tp>
+ struct __add_unsigned
+ {
+ private:
+ typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
+ public:
+ typedef typename __if_type::__type __type;
+ };
+ template<>
+ struct __add_unsigned<char>
+ { typedef unsigned char __type; };
+ template<>
+ struct __add_unsigned<signed char>
+ { typedef unsigned char __type; };
+ template<>
+ struct __add_unsigned<short>
+ { typedef unsigned short __type; };
+ template<>
+ struct __add_unsigned<int>
+ { typedef unsigned int __type; };
+ template<>
+ struct __add_unsigned<long>
+ { typedef unsigned long __type; };
+ template<>
+ struct __add_unsigned<long long>
+ { typedef unsigned long long __type; };
+ template<>
+ struct __add_unsigned<bool>;
+ template<>
+ struct __add_unsigned<wchar_t>;
+ template<typename _Tp>
+ struct __remove_unsigned
+ {
+ private:
+ typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
+ public:
+ typedef typename __if_type::__type __type;
+ };
+ template<>
+ struct __remove_unsigned<char>
+ { typedef signed char __type; };
+ template<>
+ struct __remove_unsigned<unsigned char>
+ { typedef signed char __type; };
+ template<>
+ struct __remove_unsigned<unsigned short>
+ { typedef short __type; };
+ template<>
+ struct __remove_unsigned<unsigned int>
+ { typedef int __type; };
+ template<>
+ struct __remove_unsigned<unsigned long>
+ { typedef long __type; };
+ template<>
+ struct __remove_unsigned<unsigned long long>
+ { typedef long long __type; };
+ template<>
+ struct __remove_unsigned<bool>;
+ template<>
+ struct __remove_unsigned<wchar_t>;
+ template<typename _Type>
+ inline bool
+ __is_null_pointer(_Type* __ptr)
+ { return __ptr == 0; }
+ template<typename _Type>
+ inline bool
+ __is_null_pointer(_Type)
+ { return false; }
+ template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
+ struct __promote
+ { typedef double __type; };
+ template<typename _Tp>
+ struct __promote<_Tp, false>
+ { typedef _Tp __type; };
+ template<typename _Tp, typename _Up>
+ struct __promote_2
+ {
+ private:
+ typedef typename __promote<_Tp>::__type __type1;
+ typedef typename __promote<_Up>::__type __type2;
+ public:
+ typedef __typeof__(__type1() + __type2()) __type;
+ };
+ template<typename _Tp, typename _Up, typename _Vp>
+ struct __promote_3
+ {
+ private:
+ typedef typename __promote<_Tp>::__type __type1;
+ typedef typename __promote<_Up>::__type __type2;
+ typedef typename __promote<_Vp>::__type __type3;
+ public:
+ typedef __typeof__(__type1() + __type2() + __type3()) __type;
+ };
+ template<typename _Tp, typename _Up, typename _Vp, typename _Wp>
+ struct __promote_4
+ {
+ private:
+ typedef typename __promote<_Tp>::__type __type1;
+ typedef typename __promote<_Up>::__type __type2;
+ typedef typename __promote<_Vp>::__type __type3;
+ typedef typename __promote<_Wp>::__type __type4;
+ public:
+ typedef __typeof__(__type1() + __type2() + __type3() + __type4()) __type;
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Tp>
+ inline void
+ swap(_Tp& __a, _Tp& __b)
+ {
+ _Tp __tmp = (__a);
+ __a = (__b);
+ __b = (__tmp);
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Iterator>
+ class reverse_iterator
+ : public iterator<typename iterator_traits<_Iterator>::iterator_category,
+ typename iterator_traits<_Iterator>::value_type,
+ typename iterator_traits<_Iterator>::difference_type,
+ typename iterator_traits<_Iterator>::pointer,
+ typename iterator_traits<_Iterator>::reference>
+ {
+ protected:
+ _Iterator current;
+ public:
+ typedef _Iterator iterator_type;
+ typedef typename iterator_traits<_Iterator>::difference_type
+ difference_type;
+ typedef typename iterator_traits<_Iterator>::reference reference;
+ typedef typename iterator_traits<_Iterator>::pointer pointer;
+ public:
+ reverse_iterator() : current() { }
+ explicit
+ reverse_iterator(iterator_type __x) : current(__x) { }
+ reverse_iterator(const reverse_iterator& __x)
+ : current(__x.current) { }
+ template<typename _Iter>
+ reverse_iterator(const reverse_iterator<_Iter>& __x)
+ : current(__x.base()) { }
+ iterator_type
+ base() const
+ { return current; }
+ reference
+ operator*() const
+ {
+ _Iterator __tmp = current;
+ return *--__tmp;
+ }
+ pointer
+ operator->() const
+ { return &(operator*()); }
+ reverse_iterator&
+ operator++()
+ {
+ --current;
+ return *this;
+ }
+ reverse_iterator
+ operator++(int)
+ {
+ reverse_iterator __tmp = *this;
+ --current;
+ return __tmp;
+ }
+ reverse_iterator&
+ operator--()
+ {
+ ++current;
+ return *this;
+ }
+ reverse_iterator
+ operator--(int)
+ {
+ reverse_iterator __tmp = *this;
+ ++current;
+ return __tmp;
+ }
+ reverse_iterator
+ operator+(difference_type __n) const
+ { return reverse_iterator(current - __n); }
+ reverse_iterator&
+ operator+=(difference_type __n)
+ {
+ current -= __n;
+ return *this;
+ }
+ reverse_iterator
+ operator-(difference_type __n) const
+ { return reverse_iterator(current + __n); }
+ reverse_iterator&
+ operator-=(difference_type __n)
+ {
+ current += __n;
+ return *this;
+ }
+ reference
+ operator[](difference_type __n) const
+ { return *(*this + __n); }
+ };
+ template<typename _Iterator>
+ inline bool
+ operator==(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return __x.base() == __y.base(); }
+ template<typename _Iterator>
+ inline bool
+ operator<(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return __y.base() < __x.base(); }
+ template<typename _Iterator>
+ inline bool
+ operator!=(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return !(__x == __y); }
+ template<typename _Iterator>
+ inline bool
+ operator>(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return __y < __x; }
+ template<typename _Iterator>
+ inline bool
+ operator<=(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return !(__y < __x); }
+ template<typename _Iterator>
+ inline bool
+ operator>=(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return !(__x < __y); }
+ template<typename _Iterator>
+ inline typename reverse_iterator<_Iterator>::difference_type
+ operator-(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return __y.base() - __x.base(); }
+ template<typename _Iterator>
+ inline reverse_iterator<_Iterator>
+ operator+(typename reverse_iterator<_Iterator>::difference_type __n,
+ const reverse_iterator<_Iterator>& __x)
+ { return reverse_iterator<_Iterator>(__x.base() - __n); }
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator==(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return __x.base() == __y.base(); }
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator<(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return __y.base() < __x.base(); }
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator!=(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return !(__x == __y); }
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator>(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return __y < __x; }
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator<=(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return !(__y < __x); }
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator>=(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return !(__x < __y); }
+ template<typename _IteratorL, typename _IteratorR>
+ inline typename reverse_iterator<_IteratorL>::difference_type
+ operator-(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return __y.base() - __x.base(); }
+ template<typename _Container>
+ class back_insert_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ protected:
+ _Container* container;
+ public:
+ typedef _Container container_type;
+ explicit
+ back_insert_iterator(_Container& __x) : container(&__x) { }
+ back_insert_iterator&
+ operator=(typename _Container::const_reference __value)
+ {
+ container->push_back(__value);
+ return *this;
+ }
+ back_insert_iterator&
+ operator*()
+ { return *this; }
+ back_insert_iterator&
+ operator++()
+ { return *this; }
+ back_insert_iterator
+ operator++(int)
+ { return *this; }
+ };
+ template<typename _Container>
+ inline back_insert_iterator<_Container>
+ back_inserter(_Container& __x)
+ { return back_insert_iterator<_Container>(__x); }
+ template<typename _Container>
+ class front_insert_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ protected:
+ _Container* container;
+ public:
+ typedef _Container container_type;
+ explicit front_insert_iterator(_Container& __x) : container(&__x) { }
+ front_insert_iterator&
+ operator=(typename _Container::const_reference __value)
+ {
+ container->push_front(__value);
+ return *this;
+ }
+ front_insert_iterator&
+ operator*()
+ { return *this; }
+ front_insert_iterator&
+ operator++()
+ { return *this; }
+ front_insert_iterator
+ operator++(int)
+ { return *this; }
+ };
+ template<typename _Container>
+ inline front_insert_iterator<_Container>
+ front_inserter(_Container& __x)
+ { return front_insert_iterator<_Container>(__x); }
+ template<typename _Container>
+ class insert_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ protected:
+ _Container* container;
+ typename _Container::iterator iter;
+ public:
+ typedef _Container container_type;
+ insert_iterator(_Container& __x, typename _Container::iterator __i)
+ : container(&__x), iter(__i) {}
+ insert_iterator&
+ operator=(typename _Container::const_reference __value)
+ {
+ iter = container->insert(iter, __value);
+ ++iter;
+ return *this;
+ }
+ insert_iterator&
+ operator*()
+ { return *this; }
+ insert_iterator&
+ operator++()
+ { return *this; }
+ insert_iterator&
+ operator++(int)
+ { return *this; }
+ };
+ template<typename _Container, typename _Iterator>
+ inline insert_iterator<_Container>
+ inserter(_Container& __x, _Iterator __i)
+ {
+ return insert_iterator<_Container>(__x,
+ typename _Container::iterator(__i));
+ }
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ using std::iterator_traits;
+ using std::iterator;
+ template<typename _Iterator, typename _Container>
+ class __normal_iterator
+ {
+ protected:
+ _Iterator _M_current;
+ public:
+ typedef _Iterator iterator_type;
+ typedef typename iterator_traits<_Iterator>::iterator_category
+ iterator_category;
+ typedef typename iterator_traits<_Iterator>::value_type value_type;
+ typedef typename iterator_traits<_Iterator>::difference_type
+ difference_type;
+ typedef typename iterator_traits<_Iterator>::reference reference;
+ typedef typename iterator_traits<_Iterator>::pointer pointer;
+ __normal_iterator() : _M_current(_Iterator()) { }
+ explicit
+ __normal_iterator(const _Iterator& __i) : _M_current(__i) { }
+ template<typename _Iter>
+ __normal_iterator(const __normal_iterator<_Iter,
+ typename __enable_if<
+ (std::__are_same<_Iter, typename _Container::pointer>::__value),
+ _Container>::__type>& __i)
+ : _M_current(__i.base()) { }
+ reference
+ operator*() const
+ { return *_M_current; }
+ pointer
+ operator->() const
+ { return _M_current; }
+ __normal_iterator&
+ operator++()
+ {
+ ++_M_current;
+ return *this;
+ }
+ __normal_iterator
+ operator++(int)
+ { return __normal_iterator(_M_current++); }
+ __normal_iterator&
+ operator--()
+ {
+ --_M_current;
+ return *this;
+ }
+ __normal_iterator
+ operator--(int)
+ { return __normal_iterator(_M_current--); }
+ reference
+ operator[](const difference_type& __n) const
+ { return _M_current[__n]; }
+ __normal_iterator&
+ operator+=(const difference_type& __n)
+ { _M_current += __n; return *this; }
+ __normal_iterator
+ operator+(const difference_type& __n) const
+ { return __normal_iterator(_M_current + __n); }
+ __normal_iterator&
+ operator-=(const difference_type& __n)
+ { _M_current -= __n; return *this; }
+ __normal_iterator
+ operator-(const difference_type& __n) const
+ { return __normal_iterator(_M_current - __n); }
+ const _Iterator&
+ base() const
+ { return _M_current; }
+ };
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() == __rhs.base(); }
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() == __rhs.base(); }
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() != __rhs.base(); }
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() != __rhs.base(); }
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() < __rhs.base(); }
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() < __rhs.base(); }
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() > __rhs.base(); }
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() > __rhs.base(); }
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() <= __rhs.base(); }
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() <= __rhs.base(); }
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() >= __rhs.base(); }
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() >= __rhs.base(); }
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline typename __normal_iterator<_IteratorL, _Container>::difference_type
+ operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() - __rhs.base(); }
+ template<typename _Iterator, typename _Container>
+ inline typename __normal_iterator<_Iterator, _Container>::difference_type
+ operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() - __rhs.base(); }
+ template<typename _Iterator, typename _Container>
+ inline __normal_iterator<_Iterator, _Container>
+ operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
+ __n, const __normal_iterator<_Iterator, _Container>& __i)
+ { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Alloc>
+ class allocator;
+ template<class _CharT>
+ struct char_traits;
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_string;
+ template<> struct char_traits<char>;
+ typedef basic_string<char> string;
+}
+extern "C"
+{
+ typedef struct
+ {
+ int __fill[6];
+ } mbstate_t;
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ using ::mbstate_t;
+}
+typedef signed char int8_t;
+typedef short int int16_t;
+typedef int int32_t;
+__extension__
+typedef long long int int64_t;
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+typedef unsigned int uint32_t;
+__extension__
+typedef unsigned long long int uint64_t;
+typedef signed char int_least8_t;
+typedef short int int_least16_t;
+typedef int int_least32_t;
+__extension__
+typedef long long int int_least64_t;
+typedef unsigned char uint_least8_t;
+typedef unsigned short int uint_least16_t;
+typedef unsigned int uint_least32_t;
+__extension__
+typedef unsigned long long int uint_least64_t;
+typedef signed char int_fast8_t;
+typedef int int_fast16_t;
+typedef int int_fast32_t;
+__extension__
+typedef long long int int_fast64_t;
+typedef unsigned char uint_fast8_t;
+typedef unsigned int uint_fast16_t;
+typedef unsigned int uint_fast32_t;
+__extension__
+typedef unsigned long long int uint_fast64_t;
+typedef int intptr_t;
+typedef unsigned int uintptr_t;
+__extension__
+typedef long long int intmax_t;
+__extension__
+typedef unsigned long long int uintmax_t;
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ typedef int64_t streamoff;
+ typedef ptrdiff_t streamsize;
+ template<typename _StateT>
+ class fpos
+ {
+ private:
+ streamoff _M_off;
+ _StateT _M_state;
+ public:
+ fpos()
+ : _M_off(0), _M_state() { }
+ fpos(streamoff __off)
+ : _M_off(__off), _M_state() { }
+ operator streamoff() const { return _M_off; }
+ void
+ state(_StateT __st)
+ { _M_state = __st; }
+ _StateT
+ state() const
+ { return _M_state; }
+ fpos&
+ operator+=(streamoff __off)
+ {
+ _M_off += __off;
+ return *this;
+ }
+ fpos&
+ operator-=(streamoff __off)
+ {
+ _M_off -= __off;
+ return *this;
+ }
+ fpos
+ operator+(streamoff __off) const
+ {
+ fpos __pos(*this);
+ __pos += __off;
+ return __pos;
+ }
+ fpos
+ operator-(streamoff __off) const
+ {
+ fpos __pos(*this);
+ __pos -= __off;
+ return __pos;
+ }
+ streamoff
+ operator-(const fpos& __other) const
+ { return _M_off - __other._M_off; }
+ };
+ template<typename _StateT>
+ inline bool
+ operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
+ { return streamoff(__lhs) == streamoff(__rhs); }
+ template<typename _StateT>
+ inline bool
+ operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
+ { return streamoff(__lhs) != streamoff(__rhs); }
+ typedef fpos<mbstate_t> streampos;
+ typedef fpos<mbstate_t> wstreampos;
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ios;
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_streambuf;
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_istream;
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ostream;
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_iostream;
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_stringbuf;
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_istringstream;
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_ostringstream;
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_stringstream;
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_filebuf;
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ifstream;
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ofstream;
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_fstream;
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class istreambuf_iterator;
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class ostreambuf_iterator;
+ class ios_base;
+ typedef basic_ios<char> ios;
+ typedef basic_streambuf<char> streambuf;
+ typedef basic_istream<char> istream;
+ typedef basic_ostream<char> ostream;
+ typedef basic_iostream<char> iostream;
+ typedef basic_stringbuf<char> stringbuf;
+ typedef basic_istringstream<char> istringstream;
+ typedef basic_ostringstream<char> ostringstream;
+ typedef basic_stringstream<char> stringstream;
+ typedef basic_filebuf<char> filebuf;
+ typedef basic_ifstream<char> ifstream;
+ typedef basic_ofstream<char> ofstream;
+ typedef basic_fstream<char> fstream;
+}
+extern "C++" {
+namespace std
+{
+ class exception
+ {
+ public:
+ exception() throw() { }
+ virtual ~exception() throw();
+ virtual const char* what() const throw();
+ };
+ class bad_exception : public exception
+ {
+ public:
+ bad_exception() throw() { }
+ virtual ~bad_exception() throw();
+ virtual const char* what() const throw();
+ };
+ typedef void (*terminate_handler) ();
+ typedef void (*unexpected_handler) ();
+ terminate_handler set_terminate(terminate_handler) throw();
+ void terminate() __attribute__ ((__noreturn__));
+ unexpected_handler set_unexpected(unexpected_handler) throw();
+ void unexpected() __attribute__ ((__noreturn__));
+ bool uncaught_exception() throw();
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ void __verbose_terminate_handler ();
+}
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ void
+ __throw_bad_exception(void) __attribute__((__noreturn__));
+ void
+ __throw_bad_alloc(void) __attribute__((__noreturn__));
+ void
+ __throw_bad_cast(void) __attribute__((__noreturn__));
+ void
+ __throw_bad_typeid(void) __attribute__((__noreturn__));
+ void
+ __throw_logic_error(const char*) __attribute__((__noreturn__));
+ void
+ __throw_domain_error(const char*) __attribute__((__noreturn__));
+ void
+ __throw_invalid_argument(const char*) __attribute__((__noreturn__));
+ void
+ __throw_length_error(const char*) __attribute__((__noreturn__));
+ void
+ __throw_out_of_range(const char*) __attribute__((__noreturn__));
+ void
+ __throw_runtime_error(const char*) __attribute__((__noreturn__));
+ void
+ __throw_range_error(const char*) __attribute__((__noreturn__));
+ void
+ __throw_overflow_error(const char*) __attribute__((__noreturn__));
+ void
+ __throw_underflow_error(const char*) __attribute__((__noreturn__));
+ void
+ __throw_ios_failure(const char*) __attribute__((__noreturn__));
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Value>
+ struct __numeric_traits_integer
+ {
+ static const _Value __min = (((_Value)(-1) < 0) ? (_Value)1 << (sizeof(_Value) * 8 - ((_Value)(-1) < 0)) : (_Value)0);
+ static const _Value __max = (((_Value)(-1) < 0) ? (((((_Value)1 << ((sizeof(_Value) * 8 - ((_Value)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(_Value)0);
+ static const bool __is_signed = ((_Value)(-1) < 0);
+ static const int __digits = (sizeof(_Value) * 8 - ((_Value)(-1) < 0));
+ };
+ template<typename _Value>
+ const _Value __numeric_traits_integer<_Value>::__min;
+ template<typename _Value>
+ const _Value __numeric_traits_integer<_Value>::__max;
+ template<typename _Value>
+ const bool __numeric_traits_integer<_Value>::__is_signed;
+ template<typename _Value>
+ const int __numeric_traits_integer<_Value>::__digits;
+ template<typename _Value>
+ struct __numeric_traits_floating
+ {
+ static const int __max_digits10 = (2 + (std::__are_same<_Value, float>::__value ? 24 : std::__are_same<_Value, double>::__value ? 53 : 53) * 3010 / 10000);
+ static const bool __is_signed = true;
+ static const int __digits10 = (std::__are_same<_Value, float>::__value ? 6 : std::__are_same<_Value, double>::__value ? 15 : 15);
+ static const int __max_exponent10 = (std::__are_same<_Value, float>::__value ? 38 : std::__are_same<_Value, double>::__value ? 308 : 308);
+ };
+ template<typename _Value>
+ const int __numeric_traits_floating<_Value>::__max_digits10;
+ template<typename _Value>
+ const bool __numeric_traits_floating<_Value>::__is_signed;
+ template<typename _Value>
+ const int __numeric_traits_floating<_Value>::__digits10;
+ template<typename _Value>
+ const int __numeric_traits_floating<_Value>::__max_exponent10;
+ template<typename _Value>
+ struct __numeric_traits
+ : public __conditional_type<std::__is_integer<_Value>::__value,
+ __numeric_traits_integer<_Value>,
+ __numeric_traits_floating<_Value> >::__type
+ { };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<class _T1, class _T2>
+ struct pair
+ {
+ typedef _T1 first_type;
+ typedef _T2 second_type;
+ _T1 first;
+ _T2 second;
+ pair()
+ : first(), second() { }
+ pair(const _T1& __a, const _T2& __b)
+ : first(__a), second(__b) { }
+ template<class _U1, class _U2>
+ pair(const pair<_U1, _U2>& __p)
+ : first(__p.first),
+ second(__p.second) { }
+ };
+ template<class _T1, class _T2>
+ inline bool
+ operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return __x.first == __y.first && __x.second == __y.second; }
+ template<class _T1, class _T2>
+ inline bool
+ operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return __x.first < __y.first
+ || (!(__y.first < __x.first) && __x.second < __y.second); }
+ template<class _T1, class _T2>
+ inline bool
+ operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return !(__x == __y); }
+ template<class _T1, class _T2>
+ inline bool
+ operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return __y < __x; }
+ template<class _T1, class _T2>
+ inline bool
+ operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return !(__y < __x); }
+ template<class _T1, class _T2>
+ inline bool
+ operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return !(__x < __y); }
+ template<class _T1, class _T2>
+ inline pair<_T1, _T2>
+ make_pair(_T1 __x, _T2 __y)
+ { return pair<_T1, _T2>(__x, __y); }
+}
+namespace std
+{
+ namespace __debug { }
+}
+namespace __gnu_debug
+{
+ using namespace std::__debug;
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<bool _BoolType>
+ struct __iter_swap
+ {
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ static void
+ iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
+ {
+ typedef typename iterator_traits<_ForwardIterator1>::value_type
+ _ValueType1;
+ _ValueType1 __tmp = (*__a);
+ *__a = (*__b);
+ *__b = (__tmp);
+ }
+ };
+ template<>
+ struct __iter_swap<true>
+ {
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ static void
+ iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
+ {
+ swap(*__a, *__b);
+ }
+ };
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ inline void
+ iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
+ {
+ typedef typename iterator_traits<_ForwardIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_ForwardIterator2>::value_type
+ _ValueType2;
+ typedef typename iterator_traits<_ForwardIterator1>::reference
+ _ReferenceType1;
+ typedef typename iterator_traits<_ForwardIterator2>::reference
+ _ReferenceType2;
+ std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value
+ && __are_same<_ValueType1&, _ReferenceType1>::__value
+ && __are_same<_ValueType2&, _ReferenceType2>::__value>::
+ iter_swap(__a, __b);
+ }
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ _ForwardIterator2
+ swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2)
+ {
+ ;
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ std::iter_swap(__first1, __first2);
+ return __first2;
+ }
+ template<typename _Tp>
+ inline const _Tp&
+ min(const _Tp& __a, const _Tp& __b)
+ {
+ if (__b < __a)
+ return __b;
+ return __a;
+ }
+ template<typename _Tp>
+ inline const _Tp&
+ max(const _Tp& __a, const _Tp& __b)
+ {
+ if (__a < __b)
+ return __b;
+ return __a;
+ }
+ template<typename _Tp, typename _Compare>
+ inline const _Tp&
+ min(const _Tp& __a, const _Tp& __b, _Compare __comp)
+ {
+ if (__comp(__b, __a))
+ return __b;
+ return __a;
+ }
+ template<typename _Tp, typename _Compare>
+ inline const _Tp&
+ max(const _Tp& __a, const _Tp& __b, _Compare __comp)
+ {
+ if (__comp(__a, __b))
+ return __b;
+ return __a;
+ }
+ template<typename _Iterator,
+ bool _IsNormal = __is_normal_iterator<_Iterator>::__value>
+ struct __niter_base
+ {
+ static _Iterator
+ __b(_Iterator __it)
+ { return __it; }
+ };
+ template<typename _Iterator>
+ struct __niter_base<_Iterator, true>
+ {
+ static typename _Iterator::iterator_type
+ __b(_Iterator __it)
+ { return __it.base(); }
+ };
+ template<typename _Iterator,
+ bool _IsMove = __is_move_iterator<_Iterator>::__value>
+ struct __miter_base
+ {
+ static _Iterator
+ __b(_Iterator __it)
+ { return __it; }
+ };
+ template<typename _Iterator>
+ struct __miter_base<_Iterator, true>
+ {
+ static typename _Iterator::iterator_type
+ __b(_Iterator __it)
+ { return __it.base(); }
+ };
+ template<bool, bool, typename>
+ struct __copy_move
+ {
+ template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+ for (; __first != __last; ++__result, ++__first)
+ *__result = *__first;
+ return __result;
+ }
+ };
+ template<>
+ struct __copy_move<false, false, random_access_iterator_tag>
+ {
+ template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+ typedef typename iterator_traits<_II>::difference_type _Distance;
+ for(_Distance __n = __last - __first; __n > 0; --__n)
+ {
+ *__result = *__first;
+ ++__first;
+ ++__result;
+ }
+ return __result;
+ }
+ };
+ template<bool _IsMove>
+ struct __copy_move<_IsMove, true, random_access_iterator_tag>
+ {
+ template<typename _Tp>
+ static _Tp*
+ __copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)
+ {
+ __builtin_memmove(__result, __first,
+ sizeof(_Tp) * (__last - __first));
+ return __result + (__last - __first);
+ }
+ };
+ template<bool _IsMove, typename _II, typename _OI>
+ inline _OI
+ __copy_move_a(_II __first, _II __last, _OI __result)
+ {
+ typedef typename iterator_traits<_II>::value_type _ValueTypeI;
+ typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
+ typedef typename iterator_traits<_II>::iterator_category _Category;
+ const bool __simple = (__is_pod(_ValueTypeI)
+ && __is_pointer<_II>::__value
+ && __is_pointer<_OI>::__value
+ && __are_same<_ValueTypeI, _ValueTypeO>::__value);
+ return std::__copy_move<_IsMove, __simple,
+ _Category>::__copy_m(__first, __last, __result);
+ }
+ template<typename _CharT>
+ struct char_traits;
+ template<typename _CharT, typename _Traits>
+ class istreambuf_iterator;
+ template<typename _CharT, typename _Traits>
+ class ostreambuf_iterator;
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
+ __copy_move_a2(_CharT*, _CharT*,
+ ostreambuf_iterator<_CharT, char_traits<_CharT> >);
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
+ __copy_move_a2(const _CharT*, const _CharT*,
+ ostreambuf_iterator<_CharT, char_traits<_CharT> >);
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ _CharT*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,
+ istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);
+ template<bool _IsMove, typename _II, typename _OI>
+ inline _OI
+ __copy_move_a2(_II __first, _II __last, _OI __result)
+ {
+ return _OI(std::__copy_move_a<_IsMove>
+ (std::__niter_base<_II>::__b(__first),
+ std::__niter_base<_II>::__b(__last),
+ std::__niter_base<_OI>::__b(__result)));
+ }
+ template<typename _II, typename _OI>
+ inline _OI
+ copy(_II __first, _II __last, _OI __result)
+ {
+ ;
+ return (std::__copy_move_a2<__is_move_iterator<_II>::__value>
+ (std::__miter_base<_II>::__b(__first),
+ std::__miter_base<_II>::__b(__last), __result));
+ }
+ template<bool, bool, typename>
+ struct __copy_move_backward
+ {
+ template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ while (__first != __last)
+ *--__result = *--__last;
+ return __result;
+ }
+ };
+ template<>
+ struct __copy_move_backward<false, false, random_access_iterator_tag>
+ {
+ template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ typename iterator_traits<_BI1>::difference_type __n;
+ for (__n = __last - __first; __n > 0; --__n)
+ *--__result = *--__last;
+ return __result;
+ }
+ };
+ template<bool _IsMove>
+ struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
+ {
+ template<typename _Tp>
+ static _Tp*
+ __copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
+ {
+ const ptrdiff_t _Num = __last - __first;
+ __builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
+ return __result - _Num;
+ }
+ };
+ template<bool _IsMove, typename _BI1, typename _BI2>
+ inline _BI2
+ __copy_move_backward_a(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ typedef typename iterator_traits<_BI1>::value_type _ValueType1;
+ typedef typename iterator_traits<_BI2>::value_type _ValueType2;
+ typedef typename iterator_traits<_BI1>::iterator_category _Category;
+ const bool __simple = (__is_pod(_ValueType1)
+ && __is_pointer<_BI1>::__value
+ && __is_pointer<_BI2>::__value
+ && __are_same<_ValueType1, _ValueType2>::__value);
+ return std::__copy_move_backward<_IsMove, __simple,
+ _Category>::__copy_move_b(__first,
+ __last,
+ __result);
+ }
+ template<bool _IsMove, typename _BI1, typename _BI2>
+ inline _BI2
+ __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ return _BI2(std::__copy_move_backward_a<_IsMove>
+ (std::__niter_base<_BI1>::__b(__first),
+ std::__niter_base<_BI1>::__b(__last),
+ std::__niter_base<_BI2>::__b(__result)));
+ }
+ template<typename _BI1, typename _BI2>
+ inline _BI2
+ copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ ;
+ return (std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value>
+ (std::__miter_base<_BI1>::__b(__first),
+ std::__miter_base<_BI1>::__b(__last), __result));
+ }
+ template<typename _ForwardIterator, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
+ __fill_a(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __value)
+ {
+ for (; __first != __last; ++__first)
+ *__first = __value;
+ }
+ template<typename _ForwardIterator, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type
+ __fill_a(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __value)
+ {
+ const _Tp __tmp = __value;
+ for (; __first != __last; ++__first)
+ *__first = __tmp;
+ }
+ template<typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
+ __fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)
+ {
+ const _Tp __tmp = __c;
+ __builtin_memset(__first, static_cast<unsigned char>(__tmp),
+ __last - __first);
+ }
+ template<typename _ForwardIterator, typename _Tp>
+ inline void
+ fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
+ {
+ ;
+ std::__fill_a(std::__niter_base<_ForwardIterator>::__b(__first),
+ std::__niter_base<_ForwardIterator>::__b(__last), __value);
+ }
+ template<typename _OutputIterator, typename _Size, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
+ __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
+ {
+ for (; __n > 0; --__n, ++__first)
+ *__first = __value;
+ return __first;
+ }
+ template<typename _OutputIterator, typename _Size, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type
+ __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
+ {
+ const _Tp __tmp = __value;
+ for (; __n > 0; --__n, ++__first)
+ *__first = __tmp;
+ return __first;
+ }
+ template<typename _Size, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, _Tp*>::__type
+ __fill_n_a(_Tp* __first, _Size __n, const _Tp& __c)
+ {
+ std::__fill_a(__first, __first + __n, __c);
+ return __first + __n;
+ }
+ template<typename _OI, typename _Size, typename _Tp>
+ inline _OI
+ fill_n(_OI __first, _Size __n, const _Tp& __value)
+ {
+ return _OI(std::__fill_n_a(std::__niter_base<_OI>::__b(__first),
+ __n, __value));
+ }
+ template<bool _BoolType>
+ struct __equal
+ {
+ template<typename _II1, typename _II2>
+ static bool
+ equal(_II1 __first1, _II1 __last1, _II2 __first2)
+ {
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ if (!(*__first1 == *__first2))
+ return false;
+ return true;
+ }
+ };
+ template<>
+ struct __equal<true>
+ {
+ template<typename _Tp>
+ static bool
+ equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)
+ {
+ return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
+ * (__last1 - __first1));
+ }
+ };
+ template<typename _II1, typename _II2>
+ inline bool
+ __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
+ {
+ typedef typename iterator_traits<_II1>::value_type _ValueType1;
+ typedef typename iterator_traits<_II2>::value_type _ValueType2;
+ const bool __simple = (__is_integer<_ValueType1>::__value
+ && __is_pointer<_II1>::__value
+ && __is_pointer<_II2>::__value
+ && __are_same<_ValueType1, _ValueType2>::__value);
+ return std::__equal<__simple>::equal(__first1, __last1, __first2);
+ }
+ template<typename, typename>
+ struct __lc_rai
+ {
+ template<typename _II1, typename _II2>
+ static _II1
+ __newlast1(_II1, _II1 __last1, _II2, _II2)
+ { return __last1; }
+ template<typename _II>
+ static bool
+ __cnd2(_II __first, _II __last)
+ { return __first != __last; }
+ };
+ template<>
+ struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag>
+ {
+ template<typename _RAI1, typename _RAI2>
+ static _RAI1
+ __newlast1(_RAI1 __first1, _RAI1 __last1,
+ _RAI2 __first2, _RAI2 __last2)
+ {
+ const typename iterator_traits<_RAI1>::difference_type
+ __diff1 = __last1 - __first1;
+ const typename iterator_traits<_RAI2>::difference_type
+ __diff2 = __last2 - __first2;
+ return __diff2 < __diff1 ? __first1 + __diff2 : __last1;
+ }
+ template<typename _RAI>
+ static bool
+ __cnd2(_RAI, _RAI)
+ { return true; }
+ };
+ template<bool _BoolType>
+ struct __lexicographical_compare
+ {
+ template<typename _II1, typename _II2>
+ static bool __lc(_II1, _II1, _II2, _II2);
+ };
+ template<bool _BoolType>
+ template<typename _II1, typename _II2>
+ bool
+ __lexicographical_compare<_BoolType>::
+ __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
+ {
+ typedef typename iterator_traits<_II1>::iterator_category _Category1;
+ typedef typename iterator_traits<_II2>::iterator_category _Category2;
+ typedef std::__lc_rai<_Category1, _Category2> __rai_type;
+ __last1 = __rai_type::__newlast1(__first1, __last1,
+ __first2, __last2);
+ for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
+ ++__first1, ++__first2)
+ {
+ if (*__first1 < *__first2)
+ return true;
+ if (*__first2 < *__first1)
+ return false;
+ }
+ return __first1 == __last1 && __first2 != __last2;
+ }
+ template<>
+ struct __lexicographical_compare<true>
+ {
+ template<typename _Tp, typename _Up>
+ static bool
+ __lc(const _Tp* __first1, const _Tp* __last1,
+ const _Up* __first2, const _Up* __last2)
+ {
+ const size_t __len1 = __last1 - __first1;
+ const size_t __len2 = __last2 - __first2;
+ const int __result = __builtin_memcmp(__first1, __first2,
+ std::min(__len1, __len2));
+ return __result != 0 ? __result < 0 : __len1 < __len2;
+ }
+ };
+ template<typename _II1, typename _II2>
+ inline bool
+ __lexicographical_compare_aux(_II1 __first1, _II1 __last1,
+ _II2 __first2, _II2 __last2)
+ {
+ typedef typename iterator_traits<_II1>::value_type _ValueType1;
+ typedef typename iterator_traits<_II2>::value_type _ValueType2;
+ const bool __simple =
+ (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value
+ && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
+ && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed
+ && __is_pointer<_II1>::__value
+ && __is_pointer<_II2>::__value);
+ return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
+ __first2, __last2);
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _II1, typename _II2>
+ inline bool
+ equal(_II1 __first1, _II1 __last1, _II2 __first2)
+ {
+ ;
+ return std::__equal_aux(std::__niter_base<_II1>::__b(__first1),
+ std::__niter_base<_II1>::__b(__last1),
+ std::__niter_base<_II2>::__b(__first2));
+ }
+ template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+ inline bool
+ equal(_IIter1 __first1, _IIter1 __last1,
+ _IIter2 __first2, _BinaryPredicate __binary_pred)
+ {
+ ;
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ if (!bool(__binary_pred(*__first1, *__first2)))
+ return false;
+ return true;
+ }
+ template<typename _II1, typename _II2>
+ inline bool
+ lexicographical_compare(_II1 __first1, _II1 __last1,
+ _II2 __first2, _II2 __last2)
+ {
+ typedef typename iterator_traits<_II1>::value_type _ValueType1;
+ typedef typename iterator_traits<_II2>::value_type _ValueType2;
+ ;
+ ;
+ return std::__lexicographical_compare_aux
+ (std::__niter_base<_II1>::__b(__first1),
+ std::__niter_base<_II1>::__b(__last1),
+ std::__niter_base<_II2>::__b(__first2),
+ std::__niter_base<_II2>::__b(__last2));
+ }
+ template<typename _II1, typename _II2, typename _Compare>
+ bool
+ lexicographical_compare(_II1 __first1, _II1 __last1,
+ _II2 __first2, _II2 __last2, _Compare __comp)
+ {
+ typedef typename iterator_traits<_II1>::iterator_category _Category1;
+ typedef typename iterator_traits<_II2>::iterator_category _Category2;
+ typedef std::__lc_rai<_Category1, _Category2> __rai_type;
+ ;
+ ;
+ __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
+ for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
+ ++__first1, ++__first2)
+ {
+ if (__comp(*__first1, *__first2))
+ return true;
+ if (__comp(*__first2, *__first1))
+ return false;
+ }
+ return __first1 == __last1 && __first2 != __last2;
+ }
+ template<typename _InputIterator1, typename _InputIterator2>
+ pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2)
+ {
+ ;
+ while (__first1 != __last1 && *__first1 == *__first2)
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+ }
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _BinaryPredicate>
+ pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _BinaryPredicate __binary_pred)
+ {
+ ;
+ while (__first1 != __last1 && bool(__binary_pred(*__first1, *__first2)))
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+ }
+}
+extern "C" {
+typedef unsigned short __kernel_dev_t;
+typedef unsigned long __kernel_ino_t;
+typedef unsigned short __kernel_mode_t;
+typedef unsigned short __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef unsigned int __kernel_ipc_pid_t;
+typedef unsigned int __kernel_uid_t;
+typedef unsigned int __kernel_gid_t;
+typedef unsigned int __kernel_size_t;
+typedef int __kernel_ssize_t;
+typedef int __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef unsigned int __kernel_uid32_t;
+typedef unsigned int __kernel_gid32_t;
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+typedef long long __kernel_loff_t;
+typedef __kernel_dev_t __kernel_old_dev_t;
+typedef struct {
+ int __val[2];
+} __kernel_fsid_t;
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+__extension__ typedef signed long long int __int64_t;
+__extension__ typedef unsigned long long int __uint64_t;
+__extension__ typedef long long int __quad_t;
+__extension__ typedef unsigned long long int __u_quad_t;
+__extension__ typedef __u_quad_t __dev_t;
+__extension__ typedef unsigned int __uid_t;
+__extension__ typedef unsigned int __gid_t;
+__extension__ typedef unsigned long int __ino_t;
+__extension__ typedef __u_quad_t __ino64_t;
+__extension__ typedef unsigned int __mode_t;
+__extension__ typedef unsigned int __nlink_t;
+__extension__ typedef long int __off_t;
+__extension__ typedef __quad_t __off64_t;
+__extension__ typedef int __pid_t;
+__extension__ typedef struct { int __val[2]; } __fsid_t;
+__extension__ typedef long int __clock_t;
+__extension__ typedef unsigned long int __rlim_t;
+__extension__ typedef __u_quad_t __rlim64_t;
+__extension__ typedef unsigned int __id_t;
+__extension__ typedef long int __time_t;
+__extension__ typedef unsigned int __useconds_t;
+__extension__ typedef long int __suseconds_t;
+__extension__ typedef int __daddr_t;
+__extension__ typedef long int __swblk_t;
+__extension__ typedef int __key_t;
+__extension__ typedef int __clockid_t;
+__extension__ typedef void * __timer_t;
+__extension__ typedef long int __blksize_t;
+__extension__ typedef long int __blkcnt_t;
+__extension__ typedef __quad_t __blkcnt64_t;
+__extension__ typedef unsigned long int __fsblkcnt_t;
+__extension__ typedef __u_quad_t __fsblkcnt64_t;
+__extension__ typedef unsigned long int __fsfilcnt_t;
+__extension__ typedef __u_quad_t __fsfilcnt64_t;
+__extension__ typedef long int __ssize_t;
+typedef __off64_t __loff_t;
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+__extension__ typedef int __intptr_t;
+__extension__ typedef unsigned int __socklen_t;
+typedef __kernel_ipc_pid_t __ipc_pid_t;
+struct __sched_param
+ {
+ int __sched_priority;
+ };
+struct _pthread_fastlock
+{
+ long int __status;
+ int __spinlock;
+};
+typedef struct _pthread_descr_struct *_pthread_descr;
+typedef struct __pthread_attr_s
+{
+ int __detachstate;
+ int __schedpolicy;
+ struct __sched_param __schedparam;
+ int __inheritsched;
+ int __scope;
+ size_t __guardsize;
+ int __stackaddr_set;
+ void *__stackaddr;
+ size_t __stacksize;
+} pthread_attr_t;
+typedef struct
+{
+ struct _pthread_fastlock __c_lock;
+ _pthread_descr __c_waiting;
+} pthread_cond_t;
+typedef struct
+{
+ int __dummy;
+} pthread_condattr_t;
+typedef unsigned int pthread_key_t;
+typedef struct
+{
+ int __m_reserved;
+ int __m_count;
+ _pthread_descr __m_owner;
+ int __m_kind;
+ struct _pthread_fastlock __m_lock;
+} pthread_mutex_t;
+typedef struct
+{
+ int __mutexkind;
+} pthread_mutexattr_t;
+typedef int pthread_once_t;
+typedef struct _pthread_rwlock_t
+{
+ struct _pthread_fastlock __rw_lock;
+ int __rw_readers;
+ _pthread_descr __rw_writer;
+ _pthread_descr __rw_read_waiting;
+ _pthread_descr __rw_write_waiting;
+ int __rw_kind;
+ int __rw_pshared;
+} pthread_rwlock_t;
+typedef struct
+{
+ int __lockkind;
+ int __pshared;
+} pthread_rwlockattr_t;
+typedef volatile int pthread_spinlock_t;
+typedef struct {
+ struct _pthread_fastlock __ba_lock;
+ int __ba_required;
+ int __ba_present;
+ _pthread_descr __ba_waiting;
+} pthread_barrier_t;
+typedef struct {
+ int __pshared;
+} pthread_barrierattr_t;
+typedef unsigned long int pthread_t;
+typedef struct __STDIO_FILE_STRUCT FILE;
+typedef struct __STDIO_FILE_STRUCT __FILE;
+struct timespec
+ {
+ __time_t tv_sec;
+ long int tv_nsec;
+ };
+struct sched_param
+ {
+ int __sched_priority;
+ };
+extern "C" {
+extern int clone (int (*__fn) (void *__arg), void *__child_stack,
+ int __flags, void *__arg, ...) throw ();
+}
+typedef unsigned long int __cpu_mask;
+typedef struct
+{
+ __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
+} cpu_set_t;
+extern "C" {
+extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
+ throw ();
+extern int sched_getparam (__pid_t __pid, struct sched_param *__param) throw ();
+extern int sched_setscheduler (__pid_t __pid, int __policy,
+ __const struct sched_param *__param) throw ();
+extern int sched_getscheduler (__pid_t __pid) throw ();
+extern int sched_yield (void) throw ();
+extern int sched_get_priority_max (int __algorithm) throw ();
+extern int sched_get_priority_min (int __algorithm) throw ();
+extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw ();
+extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
+ __const cpu_set_t *__cpuset) throw ();
+extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
+ cpu_set_t *__cpuset) throw ();
+}
+extern "C" {
+typedef __clock_t clock_t;
+typedef __time_t time_t;
+typedef __clockid_t clockid_t;
+typedef __timer_t timer_t;
+struct tm
+{
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+ long int tm_gmtoff;
+ __const char *tm_zone;
+};
+struct itimerspec
+ {
+ struct timespec it_interval;
+ struct timespec it_value;
+ };
+struct sigevent;
+typedef __pid_t pid_t;
+extern clock_t clock (void) throw ();
+extern time_t time (time_t *__timer) throw ();
+extern double difftime (time_t __time1, time_t __time0)
+ throw () __attribute__ ((__const__));
+extern time_t mktime (struct tm *__tp) throw ();
+extern size_t strftime (char *__restrict __s, size_t __maxsize,
+ __const char *__restrict __format,
+ __const struct tm *__restrict __tp) throw ();
+extern char *strptime (__const char *__restrict __s,
+ __const char *__restrict __fmt, struct tm *__tp)
+ throw ();
+extern struct tm *gmtime (__const time_t *__timer) throw ();
+extern struct tm *localtime (__const time_t *__timer) throw ();
+extern struct tm *gmtime_r (__const time_t *__restrict __timer,
+ struct tm *__restrict __tp) throw ();
+extern struct tm *localtime_r (__const time_t *__restrict __timer,
+ struct tm *__restrict __tp) throw ();
+extern char *asctime (__const struct tm *__tp) throw ();
+extern char *ctime (__const time_t *__timer) throw ();
+extern char *asctime_r (__const struct tm *__restrict __tp,
+ char *__restrict __buf) throw ();
+extern char *ctime_r (__const time_t *__restrict __timer,
+ char *__restrict __buf) throw ();
+extern char *tzname[2];
+extern void tzset (void) throw ();
+extern int daylight;
+extern long int timezone;
+extern int stime (__const time_t *__when) throw ();
+extern time_t timegm (struct tm *__tp) throw ();
+extern time_t timelocal (struct tm *__tp) throw ();
+extern int dysize (int __year) throw () __attribute__ ((__const__));
+extern int nanosleep (__const struct timespec *__requested_time,
+ struct timespec *__remaining);
+extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw ();
+extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw ();
+extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
+ throw ();
+extern int timer_create (clockid_t __clock_id,
+ struct sigevent *__restrict __evp,
+ timer_t *__restrict __timerid) throw ();
+extern int timer_delete (timer_t __timerid) throw ();
+extern int timer_settime (timer_t __timerid, int __flags,
+ __const struct itimerspec *__restrict __value,
+ struct itimerspec *__restrict __ovalue) throw ();
+extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
+ throw ();
+extern int timer_getoverrun (timer_t __timerid) throw ();
+}
+extern "C" {
+typedef int __sig_atomic_t;
+typedef struct
+ {
+ unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
+ } __sigset_t;
+typedef __sigset_t sigset_t;
+}
+extern "C" {
+enum
+{
+ PTHREAD_CREATE_JOINABLE,
+ PTHREAD_CREATE_DETACHED
+};
+enum
+{
+ PTHREAD_INHERIT_SCHED,
+ PTHREAD_EXPLICIT_SCHED
+};
+enum
+{
+ PTHREAD_SCOPE_SYSTEM,
+ PTHREAD_SCOPE_PROCESS
+};
+enum
+{
+ PTHREAD_MUTEX_ADAPTIVE_NP,
+ PTHREAD_MUTEX_RECURSIVE_NP,
+ PTHREAD_MUTEX_ERRORCHECK_NP,
+ PTHREAD_MUTEX_TIMED_NP
+ ,
+ PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_ADAPTIVE_NP,
+ PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
+ PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
+ PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
+ , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_ADAPTIVE_NP
+};
+enum
+{
+ PTHREAD_PROCESS_PRIVATE,
+ PTHREAD_PROCESS_SHARED
+};
+enum
+{
+ PTHREAD_RWLOCK_PREFER_READER_NP,
+ PTHREAD_RWLOCK_PREFER_WRITER_NP,
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
+ PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_WRITER_NP
+};
+struct _pthread_cleanup_buffer
+{
+ void (*__routine) (void *);
+ void *__arg;
+ int __canceltype;
+ struct _pthread_cleanup_buffer *__prev;
+};
+enum
+{
+ PTHREAD_CANCEL_ENABLE,
+ PTHREAD_CANCEL_DISABLE
+};
+enum
+{
+ PTHREAD_CANCEL_DEFERRED,
+ PTHREAD_CANCEL_ASYNCHRONOUS
+};
+extern int pthread_create (pthread_t *__restrict __threadp,
+ __const pthread_attr_t *__restrict __attr,
+ void *(*__start_routine) (void *),
+ void *__restrict __arg) throw ();
+extern pthread_t pthread_self (void) throw ();
+extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) throw ();
+extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
+extern int pthread_join (pthread_t __th, void **__thread_return);
+extern int pthread_detach (pthread_t __th) throw ();
+extern int pthread_attr_init (pthread_attr_t *__attr) throw ();
+extern int pthread_attr_destroy (pthread_attr_t *__attr) throw ();
+extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
+ int __detachstate) throw ();
+extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
+ int *__detachstate) throw ();
+extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
+ __const struct sched_param *__restrict
+ __param) throw ();
+extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
+ __attr,
+ struct sched_param *__restrict __param)
+ throw ();
+extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
+ throw ();
+extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
+ __attr, int *__restrict __policy)
+ throw ();
+extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
+ int __inherit) throw ();
+extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
+ __attr, int *__restrict __inherit)
+ throw ();
+extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
+ throw ();
+extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
+ int *__restrict __scope) throw ();
+extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
+ size_t __guardsize) throw ();
+extern int pthread_attr_getguardsize (__const pthread_attr_t *__restrict
+ __attr, size_t *__restrict __guardsize)
+ throw ();
+extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
+ void *__stackaddr) throw ();
+extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
+ __attr, void **__restrict __stackaddr)
+ throw ();
+extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
+ size_t __stacksize) throw ();
+extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
+ void **__restrict __stackaddr,
+ size_t *__restrict __stacksize) throw ();
+extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
+ size_t __stacksize) throw ();
+extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
+ __attr, size_t *__restrict __stacksize)
+ throw ();
+extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
+ __const struct sched_param *__param)
+ throw ();
+extern int pthread_getschedparam (pthread_t __target_thread,
+ int *__restrict __policy,
+ struct sched_param *__restrict __param)
+ throw ();
+extern int pthread_getconcurrency (void) throw ();
+extern int pthread_setconcurrency (int __level) throw ();
+extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex,
+ __const pthread_mutexattr_t *__restrict
+ __mutex_attr) throw ();
+extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) throw ();
+extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) throw ();
+extern int pthread_mutex_lock (pthread_mutex_t *__mutex) throw ();
+extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
+ __const struct timespec *__restrict
+ __abstime) throw ();
+extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) throw ();
+extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) throw ();
+extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) throw ();
+extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
+ __restrict __attr,
+ int *__restrict __pshared) throw ();
+extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
+ int __pshared) throw ();
+extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
+ throw ();
+extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
+ __attr, int *__restrict __kind) throw ();
+extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
+ __const pthread_condattr_t *__restrict
+ __cond_attr) throw ();
+extern int pthread_cond_destroy (pthread_cond_t *__cond) throw ();
+extern int pthread_cond_signal (pthread_cond_t *__cond) throw ();
+extern int pthread_cond_broadcast (pthread_cond_t *__cond) throw ();
+extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex);
+extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex,
+ __const struct timespec *__restrict
+ __abstime);
+extern int pthread_condattr_init (pthread_condattr_t *__attr) throw ();
+extern int pthread_condattr_destroy (pthread_condattr_t *__attr) throw ();
+extern int pthread_condattr_getpshared (__const pthread_condattr_t *
+ __restrict __attr,
+ int *__restrict __pshared) throw ();
+extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
+ int __pshared) throw ();
+extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
+ __const pthread_rwlockattr_t *__restrict
+ __attr) throw ();
+extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) throw ();
+extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) throw ();
+extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) throw ();
+extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
+ __const struct timespec *__restrict
+ __abstime) throw ();
+extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) throw ();
+extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) throw ();
+extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
+ __const struct timespec *__restrict
+ __abstime) throw ();
+extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) throw ();
+extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) throw ();
+extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) throw ();
+extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
+ __restrict __attr,
+ int *__restrict __pshared) throw ();
+extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
+ int __pshared) throw ();
+extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *__attr,
+ int *__pref) throw ();
+extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
+ int __pref) throw ();
+extern int pthread_key_create (pthread_key_t *__key,
+ void (*__destr_function) (void *)) throw ();
+extern int pthread_key_delete (pthread_key_t __key) throw ();
+extern int pthread_setspecific (pthread_key_t __key,
+ __const void *__pointer) throw ();
+extern void *pthread_getspecific (pthread_key_t __key) throw ();
+extern int pthread_once (pthread_once_t *__once_control,
+ void (*__init_routine) (void));
+extern int pthread_setcancelstate (int __state, int *__oldstate);
+extern int pthread_setcanceltype (int __type, int *__oldtype);
+extern int pthread_cancel (pthread_t __cancelthread);
+extern void pthread_testcancel (void);
+extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer,
+ void (*__routine) (void *),
+ void *__arg) throw ();
+extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer,
+ int __execute) throw ();
+extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer,
+ void (*__routine) (void *),
+ void *__arg) throw ();
+extern void __pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer,
+ void (*__routine) (void *),
+ void *__arg) throw ();
+extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer,
+ int __execute) throw ();
+extern void __pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer,
+ int __execute) throw ();
+extern int pthread_sigmask (int __how,
+ __const __sigset_t *__restrict __newmask,
+ __sigset_t *__restrict __oldmask)throw ();
+extern int pthread_kill (pthread_t __threadid, int __signo) throw ();
+extern int pthread_atfork (void (*__prepare) (void),
+ void (*__parent) (void),
+ void (*__child) (void)) throw ();
+extern void pthread_kill_other_threads_np (void) throw ();
+}
+typedef struct {
+ __off_t __pos;
+} __STDIO_fpos_t;
+typedef struct {
+ __off64_t __pos;
+} __STDIO_fpos64_t;
+typedef __off64_t __offmax_t;
+struct __STDIO_FILE_STRUCT {
+ unsigned short __modeflags;
+ unsigned char __ungot[2];
+ int __filedes;
+ unsigned char *__bufstart;
+ unsigned char *__bufend;
+ unsigned char *__bufpos;
+ unsigned char *__bufread;
+ unsigned char *__bufgetc_u;
+ unsigned char *__bufputc_u;
+ struct __STDIO_FILE_STRUCT *__nextopen;
+ int __user_locking;
+ pthread_mutex_t __lock;
+};
+extern int __fgetc_unlocked(FILE *__stream);
+extern int __fputc_unlocked(int __c, FILE *__stream);
+extern FILE *__stdin;
+extern FILE *__stdout;
+typedef __builtin_va_list __gnuc_va_list;
+typedef __STDIO_fpos_t fpos_t;
+typedef __STDIO_fpos64_t fpos64_t;
+extern FILE *stdin;
+extern FILE *stdout;
+extern FILE *stderr;
+extern int remove (__const char *__filename) throw ();
+extern int rename (__const char *__old, __const char *__new) throw ();
+extern FILE *tmpfile (void) ;
+extern FILE *tmpfile64 (void) ;
+extern char *tmpnam (char *__s) throw () ;
+extern char *tmpnam_r (char *__s) throw () ;
+extern char *tempnam (__const char *__dir, __const char *__pfx)
+ throw () __attribute__ ((__malloc__)) ;
+extern int fclose (FILE *__stream);
+extern int fflush (FILE *__stream);
+extern int fflush_unlocked (FILE *__stream);
+extern int fcloseall (void);
+extern FILE *fopen (__const char *__restrict __filename,
+ __const char *__restrict __modes) ;
+extern FILE *freopen (__const char *__restrict __filename,
+ __const char *__restrict __modes,
+ FILE *__restrict __stream) ;
+extern FILE *fopen64 (__const char *__restrict __filename,
+ __const char *__restrict __modes) ;
+extern FILE *freopen64 (__const char *__restrict __filename,
+ __const char *__restrict __modes,
+ FILE *__restrict __stream) ;
+extern FILE *fdopen (int __fd, __const char *__modes) throw () ;
+extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();
+extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
+ int __modes, size_t __n) throw ();
+extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
+ size_t __size) throw ();
+extern void setlinebuf (FILE *__stream) throw ();
+extern int fprintf (FILE *__restrict __stream,
+ __const char *__restrict __format, ...);
+extern int printf (__const char *__restrict __format, ...);
+extern int sprintf (char *__restrict __s,
+ __const char *__restrict __format, ...) throw ();
+extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
+ __gnuc_va_list __arg);
+extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
+extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
+ __gnuc_va_list __arg) throw ();
+extern int snprintf (char *__restrict __s, size_t __maxlen,
+ __const char *__restrict __format, ...)
+ throw () __attribute__ ((__format__ (__printf__, 3, 4)));
+extern int vsnprintf (char *__restrict __s, size_t __maxlen,
+ __const char *__restrict __format, __gnuc_va_list __arg)
+ throw () __attribute__ ((__format__ (__printf__, 3, 0)));
+extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
+ __gnuc_va_list __arg)
+ throw () __attribute__ ((__format__ (__printf__, 2, 0))) ;
+extern int asprintf (char **__restrict __ptr,
+ __const char *__restrict __fmt, ...)
+ throw () __attribute__ ((__format__ (__printf__, 2, 3))) ;
+extern int vdprintf (int __fd, __const char *__restrict __fmt,
+ __gnuc_va_list __arg)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int fscanf (FILE *__restrict __stream,
+ __const char *__restrict __format, ...) ;
+extern int scanf (__const char *__restrict __format, ...) ;
+extern int sscanf (__const char *__restrict __s,
+ __const char *__restrict __format, ...) throw ();
+extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
+ __gnuc_va_list __arg)
+ __attribute__ ((__format__ (__scanf__, 2, 0))) ;
+extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
+ __attribute__ ((__format__ (__scanf__, 1, 0))) ;
+extern int vsscanf (__const char *__restrict __s,
+ __const char *__restrict __format, __gnuc_va_list __arg)
+ throw () __attribute__ ((__format__ (__scanf__, 2, 0)));
+extern int fgetc (FILE *__stream);
+extern int getc (FILE *__stream);
+extern int getchar (void);
+extern int getc_unlocked (FILE *__stream);
+extern int getchar_unlocked (void);
+extern int fgetc_unlocked (FILE *__stream);
+extern int fputc (int __c, FILE *__stream);
+extern int putc (int __c, FILE *__stream);
+extern int putchar (int __c);
+extern int fputc_unlocked (int __c, FILE *__stream);
+extern int putc_unlocked (int __c, FILE *__stream);
+extern int putchar_unlocked (int __c);
+extern int getw (FILE *__stream);
+extern int putw (int __w, FILE *__stream);
+extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
+ ;
+extern char *gets (char *__s) ;
+extern char *fgets_unlocked (char *__restrict __s, int __n,
+ FILE *__restrict __stream) ;
+extern __ssize_t getdelim (char **__restrict __lineptr,
+ size_t *__restrict __n, int __delimiter,
+ FILE *__restrict __stream) ;
+extern __ssize_t getline (char **__restrict __lineptr,
+ size_t *__restrict __n,
+ FILE *__restrict __stream) ;
+extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
+extern int puts (__const char *__s);
+extern int ungetc (int __c, FILE *__stream);
+extern size_t fread (void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream) ;
+extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __s) ;
+extern int fputs_unlocked (__const char *__restrict __s,
+ FILE *__restrict __stream);
+extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream) ;
+extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream) ;
+extern int fseek (FILE *__stream, long int __off, int __whence);
+extern long int ftell (FILE *__stream) ;
+extern void rewind (FILE *__stream);
+extern int fseeko (FILE *__stream, __off_t __off, int __whence);
+extern __off_t ftello (FILE *__stream) ;
+extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
+extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
+extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
+extern __off64_t ftello64 (FILE *__stream) ;
+extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
+extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);
+extern void clearerr (FILE *__stream) throw ();
+extern int feof (FILE *__stream) throw () ;
+extern int ferror (FILE *__stream) throw () ;
+extern void clearerr_unlocked (FILE *__stream) throw ();
+extern int feof_unlocked (FILE *__stream) throw () ;
+extern int ferror_unlocked (FILE *__stream) throw () ;
+extern void perror (__const char *__s);
+extern int fileno (FILE *__stream) throw () ;
+extern int fileno_unlocked (FILE *__stream) throw () ;
+extern FILE *popen (__const char *__command, __const char *__modes) ;
+extern int pclose (FILE *__stream);
+extern char *ctermid (char *__s) throw ();
+extern char *cuserid (char *__s);
+extern void flockfile (FILE *__stream) throw ();
+extern int ftrylockfile (FILE *__stream) throw () ;
+extern void funlockfile (FILE *__stream) throw ();
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ using ::FILE;
+ using ::fpos_t;
+ using ::clearerr;
+ using ::fclose;
+ using ::feof;
+ using ::ferror;
+ using ::fflush;
+ using ::fgetc;
+ using ::fgetpos;
+ using ::fgets;
+ using ::fopen;
+ using ::fprintf;
+ using ::fputc;
+ using ::fputs;
+ using ::fread;
+ using ::freopen;
+ using ::fscanf;
+ using ::fseek;
+ using ::fsetpos;
+ using ::ftell;
+ using ::fwrite;
+ using ::getc;
+ using ::getchar;
+ using ::gets;
+ using ::perror;
+ using ::printf;
+ using ::putc;
+ using ::putchar;
+ using ::puts;
+ using ::remove;
+ using ::rename;
+ using ::rewind;
+ using ::scanf;
+ using ::setbuf;
+ using ::setvbuf;
+ using ::sprintf;
+ using ::sscanf;
+ using ::tmpfile;
+ using ::tmpnam;
+ using ::ungetc;
+ using ::vfprintf;
+ using ::vprintf;
+ using ::vsprintf;
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT>
+ struct _Char_types
+ {
+ typedef unsigned long int_type;
+ typedef std::streampos pos_type;
+ typedef std::streamoff off_type;
+ typedef std::mbstate_t state_type;
+ };
+ template<typename _CharT>
+ struct char_traits
+ {
+ typedef _CharT char_type;
+ typedef typename _Char_types<_CharT>::int_type int_type;
+ typedef typename _Char_types<_CharT>::pos_type pos_type;
+ typedef typename _Char_types<_CharT>::off_type off_type;
+ typedef typename _Char_types<_CharT>::state_type state_type;
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+ static int
+ compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
+ static std::size_t
+ length(const char_type* __s);
+ static const char_type*
+ find(const char_type* __s, std::size_t __n, const char_type& __a);
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, std::size_t __n);
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, std::size_t __n);
+ static char_type*
+ assign(char_type* __s, std::size_t __n, char_type __a);
+ static char_type
+ to_char_type(const int_type& __c)
+ { return static_cast<char_type>(__c); }
+ static int_type
+ to_int_type(const char_type& __c)
+ { return static_cast<int_type>(__c); }
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+ static int_type
+ eof()
+ { return static_cast<int_type>((-1)); }
+ static int_type
+ not_eof(const int_type& __c)
+ { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
+ };
+ template<typename _CharT>
+ int
+ char_traits<_CharT>::
+ compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
+ {
+ for (std::size_t __i = 0; __i < __n; ++__i)
+ if (lt(__s1[__i], __s2[__i]))
+ return -1;
+ else if (lt(__s2[__i], __s1[__i]))
+ return 1;
+ return 0;
+ }
+ template<typename _CharT>
+ std::size_t
+ char_traits<_CharT>::
+ length(const char_type* __p)
+ {
+ std::size_t __i = 0;
+ while (!eq(__p[__i], char_type()))
+ ++__i;
+ return __i;
+ }
+ template<typename _CharT>
+ const typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ find(const char_type* __s, std::size_t __n, const char_type& __a)
+ {
+ for (std::size_t __i = 0; __i < __n; ++__i)
+ if (eq(__s[__i], __a))
+ return __s + __i;
+ return 0;
+ }
+ template<typename _CharT>
+ typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ move(char_type* __s1, const char_type* __s2, std::size_t __n)
+ {
+ return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
+ __n * sizeof(char_type)));
+ }
+ template<typename _CharT>
+ typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ copy(char_type* __s1, const char_type* __s2, std::size_t __n)
+ {
+ std::copy(__s2, __s2 + __n, __s1);
+ return __s1;
+ }
+ template<typename _CharT>
+ typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ assign(char_type* __s, std::size_t __n, char_type __a)
+ {
+ std::fill_n(__s, __n, __a);
+ return __s;
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<class _CharT>
+ struct char_traits : public __gnu_cxx::char_traits<_CharT>
+ { };
+ template<>
+ struct char_traits<char>
+ {
+ typedef char char_type;
+ typedef int int_type;
+ typedef streampos pos_type;
+ typedef streamoff off_type;
+ typedef mbstate_t state_type;
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ { return __builtin_memcmp(__s1, __s2, __n); }
+ static size_t
+ length(const char_type* __s)
+ { return __builtin_strlen(__s); }
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ { return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); }
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ { return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n)); }
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ { return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n)); }
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ { return static_cast<char_type*>(__builtin_memset(__s, __a, __n)); }
+ static char_type
+ to_char_type(const int_type& __c)
+ { return static_cast<char_type>(__c); }
+ static int_type
+ to_int_type(const char_type& __c)
+ { return static_cast<int_type>(static_cast<unsigned char>(__c)); }
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+ static int_type
+ eof() { return static_cast<int_type>((-1)); }
+ static int_type
+ not_eof(const int_type& __c)
+ { return (__c == eof()) ? 0 : __c; }
+ };
+}
+extern "C" {
+struct lconv
+{
+ char *decimal_point;
+ char *thousands_sep;
+ char *grouping;
+ char *int_curr_symbol;
+ char *currency_symbol;
+ char *mon_decimal_point;
+ char *mon_thousands_sep;
+ char *mon_grouping;
+ char *positive_sign;
+ char *negative_sign;
+ char int_frac_digits;
+ char frac_digits;
+ char p_cs_precedes;
+ char p_sep_by_space;
+ char n_cs_precedes;
+ char n_sep_by_space;
+ char p_sign_posn;
+ char n_sign_posn;
+ char int_p_cs_precedes;
+ char int_p_sep_by_space;
+ char int_n_cs_precedes;
+ char int_n_sep_by_space;
+ char int_p_sign_posn;
+ char int_n_sign_posn;
+};
+extern char *setlocale (int __category, __const char *__locale) throw ();
+extern struct lconv *localeconv (void) throw ();
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ using ::lconv;
+ using ::setlocale;
+ using ::localeconv;
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ typedef int* __c_locale;
+ inline int
+ __convert_from_v(const __c_locale&, char* __out,
+ const int __size __attribute__((__unused__)),
+ const char* __fmt, ...)
+ {
+ char* __old = std::setlocale(1, __null);
+ char* __sav = __null;
+ if (__builtin_strcmp(__old, "C"))
+ {
+ const size_t __len = __builtin_strlen(__old) + 1;
+ __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
+ std::setlocale(1, "C");
+ }
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
+ __builtin_va_end(__args);
+ if (__sav)
+ {
+ std::setlocale(1, __sav);
+ delete [] __sav;
+ }
+ return __ret;
+ }
+}
+extern "C" {
+enum
+{
+ _ISupper = (1 << (0)),
+ _ISlower = (1 << (1)),
+ _ISalpha = (1 << (2)),
+ _ISdigit = (1 << (3)),
+ _ISxdigit = (1 << (4)),
+ _ISspace = (1 << (5)),
+ _ISprint = (1 << (6)),
+ _ISgraph = (1 << (7)),
+ _ISblank = (1 << (8)),
+ _IScntrl = (1 << (9)),
+ _ISpunct = (1 << (10)),
+ _ISalnum = (1 << (11))
+};
+typedef __uint16_t __ctype_mask_t;
+typedef __int16_t __ctype_touplow_t;
+extern const __ctype_mask_t *__C_ctype_b;
+extern const __ctype_touplow_t *__C_ctype_toupper;
+extern const __ctype_touplow_t *__C_ctype_tolower;
+extern const __ctype_mask_t *__ctype_b;
+extern const __ctype_touplow_t *__ctype_toupper;
+extern const __ctype_touplow_t *__ctype_tolower;
+extern int isalnum (int) throw ();
+extern int isalpha (int) throw ();
+extern int iscntrl (int) throw ();
+extern int isdigit (int) throw ();
+extern int islower (int) throw ();
+extern int isgraph (int) throw ();
+extern int isprint (int) throw ();
+extern int ispunct (int) throw ();
+extern int isspace (int) throw ();
+extern int isupper (int) throw ();
+extern int isxdigit (int) throw ();
+extern int tolower (int __c) throw ();
+extern int toupper (int __c) throw ();
+extern int isblank (int) throw ();
+extern int isctype (int __c, int __mask) throw ();
+extern int isascii (int __c) throw ();
+extern int toascii (int __c) throw ();
+extern int _toupper (int) throw ();
+extern int _tolower (int) throw ();
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ using ::isalnum;
+ using ::isalpha;
+ using ::iscntrl;
+ using ::isdigit;
+ using ::isgraph;
+ using ::islower;
+ using ::isprint;
+ using ::ispunct;
+ using ::isspace;
+ using ::isupper;
+ using ::isxdigit;
+ using ::tolower;
+ using ::toupper;
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ class locale;
+ template<typename _Facet>
+ bool
+ has_facet(const locale&) throw();
+ template<typename _Facet>
+ const _Facet&
+ use_facet(const locale&);
+ template<typename _CharT>
+ bool
+ isspace(_CharT, const locale&);
+ template<typename _CharT>
+ bool
+ isprint(_CharT, const locale&);
+ template<typename _CharT>
+ bool
+ iscntrl(_CharT, const locale&);
+ template<typename _CharT>
+ bool
+ isupper(_CharT, const locale&);
+ template<typename _CharT>
+ bool
+ islower(_CharT, const locale&);
+ template<typename _CharT>
+ bool
+ isalpha(_CharT, const locale&);
+ template<typename _CharT>
+ bool
+ isdigit(_CharT, const locale&);
+ template<typename _CharT>
+ bool
+ ispunct(_CharT, const locale&);
+ template<typename _CharT>
+ bool
+ isxdigit(_CharT, const locale&);
+ template<typename _CharT>
+ bool
+ isalnum(_CharT, const locale&);
+ template<typename _CharT>
+ bool
+ isgraph(_CharT, const locale&);
+ template<typename _CharT>
+ _CharT
+ toupper(_CharT, const locale&);
+ template<typename _CharT>
+ _CharT
+ tolower(_CharT, const locale&);
+ class ctype_base;
+ template<typename _CharT>
+ class ctype;
+ template<> class ctype<char>;
+ template<typename _CharT>
+ class ctype_byname;
+ class codecvt_base;
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ class codecvt;
+ template<> class codecvt<char, char, mbstate_t>;
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ class codecvt_byname;
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class num_get;
+ template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+ class num_put;
+ template<typename _CharT> class numpunct;
+ template<typename _CharT> class numpunct_byname;
+ template<typename _CharT>
+ class collate;
+ template<typename _CharT> class
+ collate_byname;
+ class time_base;
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class time_get;
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class time_get_byname;
+ template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+ class time_put;
+ template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+ class time_put_byname;
+ class money_base;
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class money_get;
+ template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+ class money_put;
+ template<typename _CharT, bool _Intl = false>
+ class moneypunct;
+ template<typename _CharT, bool _Intl = false>
+ class moneypunct_byname;
+ class messages_base;
+ template<typename _CharT>
+ class messages;
+ template<typename _CharT>
+ class messages_byname;
+}
+extern "C" {
+typedef __ssize_t ssize_t;
+typedef __gid_t gid_t;
+typedef __uid_t uid_t;
+typedef __off_t off_t;
+typedef __off64_t off64_t;
+typedef __useconds_t useconds_t;
+typedef __socklen_t socklen_t;
+extern int access (__const char *__name, int __type) throw () __attribute__ ((__nonnull__ (1)));
+extern __off_t lseek (int __fd, __off_t __offset, int __whence) throw ();
+extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
+ throw ();
+extern int close (int __fd);
+extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ;
+extern ssize_t write (int __fd, __const void *__buf, size_t __n) ;
+extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
+ __off_t __offset) ;
+extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
+ __off_t __offset) ;
+extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
+ __off64_t __offset) ;
+extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n,
+ __off64_t __offset) ;
+extern int pipe (int __pipedes[2]) throw () ;
+extern unsigned int alarm (unsigned int __seconds) throw ();
+extern unsigned int sleep (unsigned int __seconds);
+extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
+ throw ();
+extern int usleep (__useconds_t __useconds);
+extern int pause (void);
+extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern int fchown (int __fd, __uid_t __owner, __gid_t __group) throw () ;
+extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern int chdir (__const char *__path) throw () __attribute__ ((__nonnull__ (1))) ;
+extern int fchdir (int __fd) throw () ;
+extern char *getcwd (char *__buf, size_t __size) throw () ;
+extern char *get_current_dir_name (void) throw ();
+extern int dup (int __fd) throw () ;
+extern int dup2 (int __fd, int __fd2) throw ();
+extern char **__environ;
+extern char **environ;
+extern int execve (__const char *__path, char *__const __argv[],
+ char *__const __envp[]) throw () __attribute__ ((__nonnull__ (1)));
+extern int execv (__const char *__path, char *__const __argv[])
+ throw () __attribute__ ((__nonnull__ (1)));
+extern int execle (__const char *__path, __const char *__arg, ...)
+ throw () __attribute__ ((__nonnull__ (1)));
+extern int execl (__const char *__path, __const char *__arg, ...)
+ throw () __attribute__ ((__nonnull__ (1)));
+extern int execvp (__const char *__file, char *__const __argv[])
+ throw () __attribute__ ((__nonnull__ (1)));
+extern int execlp (__const char *__file, __const char *__arg, ...)
+ throw () __attribute__ ((__nonnull__ (1)));
+extern int nice (int __inc) throw () ;
+extern void _exit (int __status) __attribute__ ((__noreturn__));
+enum
+ {
+ _PC_LINK_MAX,
+ _PC_MAX_CANON,
+ _PC_MAX_INPUT,
+ _PC_NAME_MAX,
+ _PC_PATH_MAX,
+ _PC_PIPE_BUF,
+ _PC_CHOWN_RESTRICTED,
+ _PC_NO_TRUNC,
+ _PC_VDISABLE,
+ _PC_SYNC_IO,
+ _PC_ASYNC_IO,
+ _PC_PRIO_IO,
+ _PC_SOCK_MAXBUF,
+ _PC_FILESIZEBITS,
+ _PC_REC_INCR_XFER_SIZE,
+ _PC_REC_MAX_XFER_SIZE,
+ _PC_REC_MIN_XFER_SIZE,
+ _PC_REC_XFER_ALIGN,
+ _PC_ALLOC_SIZE_MIN,
+ _PC_SYMLINK_MAX,
+ _PC_2_SYMLINKS
+ };
+enum
+ {
+ _SC_ARG_MAX,
+ _SC_CHILD_MAX,
+ _SC_CLK_TCK,
+ _SC_NGROUPS_MAX,
+ _SC_OPEN_MAX,
+ _SC_STREAM_MAX,
+ _SC_TZNAME_MAX,
+ _SC_JOB_CONTROL,
+ _SC_SAVED_IDS,
+ _SC_REALTIME_SIGNALS,
+ _SC_PRIORITY_SCHEDULING,
+ _SC_TIMERS,
+ _SC_ASYNCHRONOUS_IO,
+ _SC_PRIORITIZED_IO,
+ _SC_SYNCHRONIZED_IO,
+ _SC_FSYNC,
+ _SC_MAPPED_FILES,
+ _SC_MEMLOCK,
+ _SC_MEMLOCK_RANGE,
+ _SC_MEMORY_PROTECTION,
+ _SC_MESSAGE_PASSING,
+ _SC_SEMAPHORES,
+ _SC_SHARED_MEMORY_OBJECTS,
+ _SC_AIO_LISTIO_MAX,
+ _SC_AIO_MAX,
+ _SC_AIO_PRIO_DELTA_MAX,
+ _SC_DELAYTIMER_MAX,
+ _SC_MQ_OPEN_MAX,
+ _SC_MQ_PRIO_MAX,
+ _SC_VERSION,
+ _SC_PAGESIZE,
+ _SC_RTSIG_MAX,
+ _SC_SEM_NSEMS_MAX,
+ _SC_SEM_VALUE_MAX,
+ _SC_SIGQUEUE_MAX,
+ _SC_TIMER_MAX,
+ _SC_BC_BASE_MAX,
+ _SC_BC_DIM_MAX,
+ _SC_BC_SCALE_MAX,
+ _SC_BC_STRING_MAX,
+ _SC_COLL_WEIGHTS_MAX,
+ _SC_EQUIV_CLASS_MAX,
+ _SC_EXPR_NEST_MAX,
+ _SC_LINE_MAX,
+ _SC_RE_DUP_MAX,
+ _SC_CHARCLASS_NAME_MAX,
+ _SC_2_VERSION,
+ _SC_2_C_BIND,
+ _SC_2_C_DEV,
+ _SC_2_FORT_DEV,
+ _SC_2_FORT_RUN,
+ _SC_2_SW_DEV,
+ _SC_2_LOCALEDEF,
+ _SC_PII,
+ _SC_PII_XTI,
+ _SC_PII_SOCKET,
+ _SC_PII_INTERNET,
+ _SC_PII_OSI,
+ _SC_POLL,
+ _SC_SELECT,
+ _SC_UIO_MAXIOV,
+ _SC_IOV_MAX = _SC_UIO_MAXIOV,
+ _SC_PII_INTERNET_STREAM,
+ _SC_PII_INTERNET_DGRAM,
+ _SC_PII_OSI_COTS,
+ _SC_PII_OSI_CLTS,
+ _SC_PII_OSI_M,
+ _SC_T_IOV_MAX,
+ _SC_THREADS,
+ _SC_THREAD_SAFE_FUNCTIONS,
+ _SC_GETGR_R_SIZE_MAX,
+ _SC_GETPW_R_SIZE_MAX,
+ _SC_LOGIN_NAME_MAX,
+ _SC_TTY_NAME_MAX,
+ _SC_THREAD_DESTRUCTOR_ITERATIONS,
+ _SC_THREAD_KEYS_MAX,
+ _SC_THREAD_STACK_MIN,
+ _SC_THREAD_THREADS_MAX,
+ _SC_THREAD_ATTR_STACKADDR,
+ _SC_THREAD_ATTR_STACKSIZE,
+ _SC_THREAD_PRIORITY_SCHEDULING,
+ _SC_THREAD_PRIO_INHERIT,
+ _SC_THREAD_PRIO_PROTECT,
+ _SC_THREAD_PROCESS_SHARED,
+ _SC_NPROCESSORS_CONF,
+ _SC_NPROCESSORS_ONLN,
+ _SC_PHYS_PAGES,
+ _SC_AVPHYS_PAGES,
+ _SC_ATEXIT_MAX,
+ _SC_PASS_MAX,
+ _SC_XOPEN_VERSION,
+ _SC_XOPEN_XCU_VERSION,
+ _SC_XOPEN_UNIX,
+ _SC_XOPEN_CRYPT,
+ _SC_XOPEN_ENH_I18N,
+ _SC_XOPEN_SHM,
+ _SC_2_CHAR_TERM,
+ _SC_2_C_VERSION,
+ _SC_2_UPE,
+ _SC_XOPEN_XPG2,
+ _SC_XOPEN_XPG3,
+ _SC_XOPEN_XPG4,
+ _SC_CHAR_BIT,
+ _SC_CHAR_MAX,
+ _SC_CHAR_MIN,
+ _SC_INT_MAX,
+ _SC_INT_MIN,
+ _SC_LONG_BIT,
+ _SC_WORD_BIT,
+ _SC_MB_LEN_MAX,
+ _SC_NZERO,
+ _SC_SSIZE_MAX,
+ _SC_SCHAR_MAX,
+ _SC_SCHAR_MIN,
+ _SC_SHRT_MAX,
+ _SC_SHRT_MIN,
+ _SC_UCHAR_MAX,
+ _SC_UINT_MAX,
+ _SC_ULONG_MAX,
+ _SC_USHRT_MAX,
+ _SC_NL_ARGMAX,
+ _SC_NL_LANGMAX,
+ _SC_NL_MSGMAX,
+ _SC_NL_NMAX,
+ _SC_NL_SETMAX,
+ _SC_NL_TEXTMAX,
+ _SC_XBS5_ILP32_OFF32,
+ _SC_XBS5_ILP32_OFFBIG,
+ _SC_XBS5_LP64_OFF64,
+ _SC_XBS5_LPBIG_OFFBIG,
+ _SC_XOPEN_LEGACY,
+ _SC_XOPEN_REALTIME,
+ _SC_XOPEN_REALTIME_THREADS,
+ _SC_ADVISORY_INFO,
+ _SC_BARRIERS,
+ _SC_BASE,
+ _SC_C_LANG_SUPPORT,
+ _SC_C_LANG_SUPPORT_R,
+ _SC_CLOCK_SELECTION,
+ _SC_CPUTIME,
+ _SC_THREAD_CPUTIME,
+ _SC_DEVICE_IO,
+ _SC_DEVICE_SPECIFIC,
+ _SC_DEVICE_SPECIFIC_R,
+ _SC_FD_MGMT,
+ _SC_FIFO,
+ _SC_PIPE,
+ _SC_FILE_ATTRIBUTES,
+ _SC_FILE_LOCKING,
+ _SC_FILE_SYSTEM,
+ _SC_MONOTONIC_CLOCK,
+ _SC_MULTI_PROCESS,
+ _SC_SINGLE_PROCESS,
+ _SC_NETWORKING,
+ _SC_READER_WRITER_LOCKS,
+ _SC_SPIN_LOCKS,
+ _SC_REGEXP,
+ _SC_REGEX_VERSION,
+ _SC_SHELL,
+ _SC_SIGNALS,
+ _SC_SPAWN,
+ _SC_SPORADIC_SERVER,
+ _SC_THREAD_SPORADIC_SERVER,
+ _SC_SYSTEM_DATABASE,
+ _SC_SYSTEM_DATABASE_R,
+ _SC_TIMEOUTS,
+ _SC_TYPED_MEMORY_OBJECTS,
+ _SC_USER_GROUPS,
+ _SC_USER_GROUPS_R,
+ _SC_2_PBS,
+ _SC_2_PBS_ACCOUNTING,
+ _SC_2_PBS_LOCATE,
+ _SC_2_PBS_MESSAGE,
+ _SC_2_PBS_TRACK,
+ _SC_SYMLOOP_MAX,
+ _SC_STREAMS,
+ _SC_2_PBS_CHECKPOINT,
+ _SC_V6_ILP32_OFF32,
+ _SC_V6_ILP32_OFFBIG,
+ _SC_V6_LP64_OFF64,
+ _SC_V6_LPBIG_OFFBIG,
+ _SC_HOST_NAME_MAX,
+ _SC_TRACE,
+ _SC_TRACE_EVENT_FILTER,
+ _SC_TRACE_INHERIT,
+ _SC_TRACE_LOG,
+ _SC_LEVEL1_ICACHE_SIZE,
+ _SC_LEVEL1_ICACHE_ASSOC,
+ _SC_LEVEL1_ICACHE_LINESIZE,
+ _SC_LEVEL1_DCACHE_SIZE,
+ _SC_LEVEL1_DCACHE_ASSOC,
+ _SC_LEVEL1_DCACHE_LINESIZE,
+ _SC_LEVEL2_CACHE_SIZE,
+ _SC_LEVEL2_CACHE_ASSOC,
+ _SC_LEVEL2_CACHE_LINESIZE,
+ _SC_LEVEL3_CACHE_SIZE,
+ _SC_LEVEL3_CACHE_ASSOC,
+ _SC_LEVEL3_CACHE_LINESIZE,
+ _SC_LEVEL4_CACHE_SIZE,
+ _SC_LEVEL4_CACHE_ASSOC,
+ _SC_LEVEL4_CACHE_LINESIZE,
+ _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
+ _SC_RAW_SOCKETS
+ };
+enum
+ {
+ _CS_PATH,
+ _CS_V6_WIDTH_RESTRICTED_ENVS,
+ _CS_LFS_CFLAGS = 1000,
+ _CS_LFS_LDFLAGS,
+ _CS_LFS_LIBS,
+ _CS_LFS_LINTFLAGS,
+ _CS_LFS64_CFLAGS,
+ _CS_LFS64_LDFLAGS,
+ _CS_LFS64_LIBS,
+ _CS_LFS64_LINTFLAGS,
+ _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
+ _CS_XBS5_ILP32_OFF32_LDFLAGS,
+ _CS_XBS5_ILP32_OFF32_LIBS,
+ _CS_XBS5_ILP32_OFF32_LINTFLAGS,
+ _CS_XBS5_ILP32_OFFBIG_CFLAGS,
+ _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
+ _CS_XBS5_ILP32_OFFBIG_LIBS,
+ _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
+ _CS_XBS5_LP64_OFF64_CFLAGS,
+ _CS_XBS5_LP64_OFF64_LDFLAGS,
+ _CS_XBS5_LP64_OFF64_LIBS,
+ _CS_XBS5_LP64_OFF64_LINTFLAGS,
+ _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
+ _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
+ _CS_XBS5_LPBIG_OFFBIG_LIBS,
+ _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
+ _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
+ _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
+ _CS_POSIX_V6_ILP32_OFF32_LIBS,
+ _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
+ _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
+ _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
+ _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
+ _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
+ _CS_POSIX_V6_LP64_OFF64_CFLAGS,
+ _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
+ _CS_POSIX_V6_LP64_OFF64_LIBS,
+ _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
+ _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
+ _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
+ _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
+ _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+ };
+extern long int pathconf (__const char *__path, int __name)
+ throw () __attribute__ ((__nonnull__ (1)));
+extern long int fpathconf (int __fd, int __name) throw ();
+extern long int sysconf (int __name) throw ();
+extern size_t confstr (int __name, char *__buf, size_t __len) throw ();
+extern __pid_t getpid (void) throw ();
+extern __pid_t getppid (void) throw ();
+extern __pid_t getpgrp (void) throw ();
+extern __pid_t __getpgid (__pid_t __pid) throw ();
+extern __pid_t getpgid (__pid_t __pid) throw ();
+extern int setpgid (__pid_t __pid, __pid_t __pgid) throw ();
+extern int setpgrp (void) throw ();
+extern __pid_t setsid (void) throw ();
+extern __pid_t getsid (__pid_t __pid) throw ();
+extern __uid_t getuid (void) throw ();
+extern __uid_t geteuid (void) throw ();
+extern __gid_t getgid (void) throw ();
+extern __gid_t getegid (void) throw ();
+extern int getgroups (int __size, __gid_t __list[]) throw () ;
+extern int setuid (__uid_t __uid) throw ();
+extern int setreuid (__uid_t __ruid, __uid_t __euid) throw ();
+extern int seteuid (__uid_t __uid) throw ();
+extern int setgid (__gid_t __gid) throw ();
+extern int setregid (__gid_t __rgid, __gid_t __egid) throw ();
+extern int setegid (__gid_t __gid) throw ();
+extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
+ throw ();
+extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
+ throw ();
+extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
+ throw ();
+extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
+ throw ();
+extern __pid_t vfork (void) throw ();
+extern char *ttyname (int __fd) throw ();
+extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
+ throw () __attribute__ ((__nonnull__ (2))) ;
+extern int isatty (int __fd) throw ();
+extern int link (__const char *__from, __const char *__to)
+ throw () __attribute__ ((__nonnull__ (1, 2))) ;
+extern int symlink (__const char *__from, __const char *__to)
+ throw () __attribute__ ((__nonnull__ (1, 2))) ;
+extern ssize_t readlink (__const char *__restrict __path,
+ char *__restrict __buf, size_t __len)
+ throw () __attribute__ ((__nonnull__ (1, 2))) ;
+extern int unlink (__const char *__name) throw () __attribute__ ((__nonnull__ (1)));
+extern int rmdir (__const char *__path) throw () __attribute__ ((__nonnull__ (1)));
+extern __pid_t tcgetpgrp (int __fd) throw ();
+extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) throw ();
+extern char *getlogin (void);
+extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)));
+extern "C" {
+extern char *optarg;
+extern int optind;
+extern int opterr;
+extern int optopt;
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
+ throw ();
+}
+extern int gethostname (char *__name, size_t __len) throw () __attribute__ ((__nonnull__ (1)));
+extern int sethostname (__const char *__name, size_t __len)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern int sethostid (long int __id) throw () ;
+extern int getdomainname (char *__name, size_t __len)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern int setdomainname (__const char *__name, size_t __len)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern int vhangup (void) throw ();
+extern int acct (__const char *__name) throw ();
+extern char *getusershell (void) throw ();
+extern void endusershell (void) throw ();
+extern void setusershell (void) throw ();
+extern int daemon (int __nochdir, int __noclose) throw () ;
+extern int chroot (__const char *__path) throw () __attribute__ ((__nonnull__ (1))) ;
+extern char *getpass (__const char *__prompt) __attribute__ ((__nonnull__ (1)));
+extern int fsync (int __fd);
+extern long int gethostid (void);
+extern void sync (void) throw ();
+extern int getpagesize (void) throw () __attribute__ ((__const__));
+extern int getdtablesize (void) throw ();
+extern int truncate (__const char *__file, __off_t __length)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern int truncate64 (__const char *__file, __off64_t __length)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern int ftruncate (int __fd, __off_t __length) throw () ;
+extern int ftruncate64 (int __fd, __off64_t __length) throw () ;
+extern int brk (void *__addr) throw () ;
+extern void *sbrk (intptr_t __delta) throw ();
+extern long int syscall (long int __sysno, ...) throw ();
+extern int lockf (int __fd, int __cmd, __off_t __len) ;
+extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
+extern int fdatasync (int __fildes) throw ();
+extern char *crypt (__const char *__key, __const char *__salt)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern void encrypt (char *__block, int __edflag) throw () __attribute__ ((__nonnull__ (1)));
+extern void swab (__const void *__restrict __from, void *__restrict __to,
+ ssize_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
+extern char *ctermid (char *__s) throw ();
+}
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
+typedef pthread_mutex_t __gthread_recursive_mutex_t;
+typedef pthread_cond_t __gthread_cond_t;
+static __typeof(pthread_once) __gthrw_pthread_once __attribute__ ((__weakref__("pthread_once")));
+static __typeof(pthread_getspecific) __gthrw_pthread_getspecific __attribute__ ((__weakref__("pthread_getspecific")));
+static __typeof(pthread_setspecific) __gthrw_pthread_setspecific __attribute__ ((__weakref__("pthread_setspecific")));
+static __typeof(pthread_create) __gthrw_pthread_create __attribute__ ((__weakref__("pthread_create")));
+static __typeof(pthread_cancel) __gthrw_pthread_cancel __attribute__ ((__weakref__("pthread_cancel")));
+static __typeof(pthread_mutex_lock) __gthrw_pthread_mutex_lock __attribute__ ((__weakref__("pthread_mutex_lock")));
+static __typeof(pthread_mutex_trylock) __gthrw_pthread_mutex_trylock __attribute__ ((__weakref__("pthread_mutex_trylock")));
+static __typeof(pthread_mutex_unlock) __gthrw_pthread_mutex_unlock __attribute__ ((__weakref__("pthread_mutex_unlock")));
+static __typeof(pthread_mutex_init) __gthrw_pthread_mutex_init __attribute__ ((__weakref__("pthread_mutex_init")));
+static __typeof(pthread_cond_broadcast) __gthrw_pthread_cond_broadcast __attribute__ ((__weakref__("pthread_cond_broadcast")));
+static __typeof(pthread_cond_wait) __gthrw_pthread_cond_wait __attribute__ ((__weakref__("pthread_cond_wait")));
+static __typeof(pthread_key_create) __gthrw_pthread_key_create __attribute__ ((__weakref__("pthread_key_create")));
+static __typeof(pthread_key_delete) __gthrw_pthread_key_delete __attribute__ ((__weakref__("pthread_key_delete")));
+static __typeof(pthread_mutexattr_init) __gthrw_pthread_mutexattr_init __attribute__ ((__weakref__("pthread_mutexattr_init")));
+static __typeof(pthread_mutexattr_settype) __gthrw_pthread_mutexattr_settype __attribute__ ((__weakref__("pthread_mutexattr_settype")));
+static __typeof(pthread_mutexattr_destroy) __gthrw_pthread_mutexattr_destroy __attribute__ ((__weakref__("pthread_mutexattr_destroy")));
+static inline int
+__gthread_active_p (void)
+{
+ static void *const __gthread_active_ptr
+ = __extension__ (void *) &__gthrw_pthread_cancel;
+ return __gthread_active_ptr != 0;
+}
+static inline int
+__gthread_once (__gthread_once_t *once, void (*func) (void))
+{
+ if (__gthread_active_p ())
+ return __gthrw_pthread_once (once, func);
+ else
+ return -1;
+}
+static inline int
+__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
+{
+ return __gthrw_pthread_key_create (key, dtor);
+}
+static inline int
+__gthread_key_delete (__gthread_key_t key)
+{
+ return __gthrw_pthread_key_delete (key);
+}
+static inline void *
+__gthread_getspecific (__gthread_key_t key)
+{
+ return __gthrw_pthread_getspecific (key);
+}
+static inline int
+__gthread_setspecific (__gthread_key_t key, const void *ptr)
+{
+ return __gthrw_pthread_setspecific (key, ptr);
+}
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_pthread_mutex_lock (mutex);
+ else
+ return 0;
+}
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_pthread_mutex_trylock (mutex);
+ else
+ return 0;
+}
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_pthread_mutex_unlock (mutex);
+ else
+ return 0;
+}
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex)
+{
+ return __gthread_mutex_lock (mutex);
+}
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex)
+{
+ return __gthread_mutex_trylock (mutex);
+}
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex)
+{
+ return __gthread_mutex_unlock (mutex);
+}
+static inline int
+__gthread_cond_broadcast (__gthread_cond_t *cond)
+{
+ return __gthrw_pthread_cond_broadcast (cond);
+}
+static inline int
+__gthread_cond_wait (__gthread_cond_t *cond, __gthread_mutex_t *mutex)
+{
+ return __gthrw_pthread_cond_wait (cond, mutex);
+}
+static inline int
+__gthread_cond_wait_recursive (__gthread_cond_t *cond,
+ __gthread_recursive_mutex_t *mutex)
+{
+ return __gthread_cond_wait (cond, mutex);
+}
+typedef int _Atomic_word;
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ static inline _Atomic_word
+ __exchange_and_add(volatile _Atomic_word* __mem, int __val)
+ { return __sync_fetch_and_add(__mem, __val); }
+ static inline void
+ __atomic_add(volatile _Atomic_word* __mem, int __val)
+ { __sync_fetch_and_add(__mem, __val); }
+ static inline _Atomic_word
+ __exchange_and_add_single(_Atomic_word* __mem, int __val)
+ {
+ _Atomic_word __result = *__mem;
+ *__mem += __val;
+ return __result;
+ }
+ static inline void
+ __atomic_add_single(_Atomic_word* __mem, int __val)
+ { *__mem += __val; }
+ static inline _Atomic_word
+ __attribute__ ((__unused__))
+ __exchange_and_add_dispatch(_Atomic_word* __mem, int __val)
+ {
+ if (__gthread_active_p())
+ return __exchange_and_add(__mem, __val);
+ else
+ return __exchange_and_add_single(__mem, __val);
+ }
+ static inline void
+ __attribute__ ((__unused__))
+ __atomic_add_dispatch(_Atomic_word* __mem, int __val)
+ {
+ if (__gthread_active_p())
+ __atomic_add(__mem, __val);
+ else
+ __atomic_add_single(__mem, __val);
+ }
+}
+extern "C++" {
+namespace std
+{
+ class bad_alloc : public exception
+ {
+ public:
+ bad_alloc() throw() { }
+ virtual ~bad_alloc() throw();
+ virtual const char* what() const throw();
+ };
+ struct nothrow_t { };
+ extern const nothrow_t nothrow;
+ typedef void (*new_handler)();
+ new_handler set_new_handler(new_handler) throw();
+}
+void* operator new(std::size_t) throw (std::bad_alloc);
+void* operator new[](std::size_t) throw (std::bad_alloc);
+void operator delete(void*) throw();
+void operator delete[](void*) throw();
+void* operator new(std::size_t, const std::nothrow_t&) throw();
+void* operator new[](std::size_t, const std::nothrow_t&) throw();
+void operator delete(void*, const std::nothrow_t&) throw();
+void operator delete[](void*, const std::nothrow_t&) throw();
+inline void* operator new(std::size_t, void* __p) throw() { return __p; }
+inline void* operator new[](std::size_t, void* __p) throw() { return __p; }
+inline void operator delete (void*, void*) throw() { }
+inline void operator delete[](void*, void*) throw() { }
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ using std::size_t;
+ using std::ptrdiff_t;
+ template<typename _Tp>
+ class new_allocator
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+ template<typename _Tp1>
+ struct rebind
+ { typedef new_allocator<_Tp1> other; };
+ new_allocator() throw() { }
+ new_allocator(const new_allocator&) throw() { }
+ template<typename _Tp1>
+ new_allocator(const new_allocator<_Tp1>&) throw() { }
+ ~new_allocator() throw() { }
+ pointer
+ address(reference __x) const { return &__x; }
+ const_pointer
+ address(const_reference __x) const { return &__x; }
+ pointer
+ allocate(size_type __n, const void* = 0)
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+ return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
+ }
+ void
+ deallocate(pointer __p, size_type)
+ { ::operator delete(__p); }
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new((void *)__p) _Tp(__val); }
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+ };
+ template<typename _Tp>
+ inline bool
+ operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
+ { return true; }
+ template<typename _Tp>
+ inline bool
+ operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
+ { return false; }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Tp>
+ class allocator;
+ template<>
+ class allocator<void>
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef void* pointer;
+ typedef const void* const_pointer;
+ typedef void value_type;
+ template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+ };
+ template<typename _Tp>
+ class allocator: public __gnu_cxx::new_allocator<_Tp>
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+ template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+ allocator() throw() { }
+ allocator(const allocator& __a) throw()
+ : __gnu_cxx::new_allocator<_Tp>(__a) { }
+ template<typename _Tp1>
+ allocator(const allocator<_Tp1>&) throw() { }
+ ~allocator() throw() { }
+ };
+ template<typename _T1, typename _T2>
+ inline bool
+ operator==(const allocator<_T1>&, const allocator<_T2>&)
+ { return true; }
+ template<typename _Tp>
+ inline bool
+ operator==(const allocator<_Tp>&, const allocator<_Tp>&)
+ { return true; }
+ template<typename _T1, typename _T2>
+ inline bool
+ operator!=(const allocator<_T1>&, const allocator<_T2>&)
+ { return false; }
+ template<typename _Tp>
+ inline bool
+ operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
+ { return false; }
+ extern template class allocator<char>;
+ extern template class allocator<wchar_t>;
+ template<typename _Alloc, bool = __is_empty(_Alloc)>
+ struct __alloc_swap
+ { static void _S_do_it(_Alloc&, _Alloc&) { } };
+ template<typename _Alloc>
+ struct __alloc_swap<_Alloc, false>
+ {
+ static void
+ _S_do_it(_Alloc& __one, _Alloc& __two)
+ {
+ if (__one != __two)
+ swap(__one, __two);
+ }
+ };
+ template<typename _Alloc, bool = __is_empty(_Alloc)>
+ struct __alloc_neq
+ {
+ static bool
+ _S_do_it(const _Alloc&, const _Alloc&)
+ { return false; }
+ };
+ template<typename _Alloc>
+ struct __alloc_neq<_Alloc, false>
+ {
+ static bool
+ _S_do_it(const _Alloc& __one, const _Alloc& __two)
+ { return __one != __two; }
+ };
+}
+namespace __cxxabiv1
+{
+ class __forced_unwind
+ {
+ virtual ~__forced_unwind() throw();
+ virtual void __pure_dummy() = 0;
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits>
+ inline void
+ __ostream_write(basic_ostream<_CharT, _Traits>& __out,
+ const _CharT* __s, streamsize __n)
+ {
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+ const streamsize __put = __out.rdbuf()->sputn(__s, __n);
+ if (__put != __n)
+ __out.setstate(__ios_base::badbit);
+ }
+ template<typename _CharT, typename _Traits>
+ inline void
+ __ostream_fill(basic_ostream<_CharT, _Traits>& __out, streamsize __n)
+ {
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+ const _CharT __c = __out.fill();
+ for (; __n > 0; --__n)
+ {
+ const typename _Traits::int_type __put = __out.rdbuf()->sputc(__c);
+ if (_Traits::eq_int_type(__put, _Traits::eof()))
+ {
+ __out.setstate(__ios_base::badbit);
+ break;
+ }
+ }
+ }
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ __ostream_insert(basic_ostream<_CharT, _Traits>& __out,
+ const _CharT* __s, streamsize __n)
+ {
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+ typename __ostream_type::sentry __cerb(__out);
+ if (__cerb)
+ {
+ try
+ {
+ const streamsize __w = __out.width();
+ if (__w > __n)
+ {
+ const bool __left = ((__out.flags()
+ & __ios_base::adjustfield)
+ == __ios_base::left);
+ if (!__left)
+ __ostream_fill(__out, __w - __n);
+ if (__out.good())
+ __ostream_write(__out, __s, __n);
+ if (__left && __out.good())
+ __ostream_fill(__out, __w - __n);
+ }
+ else
+ __ostream_write(__out, __s, __n);
+ __out.width(0);
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __out._M_setstate(__ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { __out._M_setstate(__ios_base::badbit); }
+ }
+ return __out;
+ }
+ extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Arg, typename _Result>
+ struct unary_function
+ {
+ typedef _Arg argument_type;
+ typedef _Result result_type;
+ };
+ template<typename _Arg1, typename _Arg2, typename _Result>
+ struct binary_function
+ {
+ typedef _Arg1 first_argument_type;
+ typedef _Arg2 second_argument_type;
+ typedef _Result result_type;
+ };
+ template<typename _Tp>
+ struct plus : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x + __y; }
+ };
+ template<typename _Tp>
+ struct minus : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x - __y; }
+ };
+ template<typename _Tp>
+ struct multiplies : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x * __y; }
+ };
+ template<typename _Tp>
+ struct divides : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x / __y; }
+ };
+ template<typename _Tp>
+ struct modulus : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x % __y; }
+ };
+ template<typename _Tp>
+ struct negate : public unary_function<_Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x) const
+ { return -__x; }
+ };
+ template<typename _Tp>
+ struct equal_to : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x == __y; }
+ };
+ template<typename _Tp>
+ struct not_equal_to : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x != __y; }
+ };
+ template<typename _Tp>
+ struct greater : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x > __y; }
+ };
+ template<typename _Tp>
+ struct less : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x < __y; }
+ };
+ template<typename _Tp>
+ struct greater_equal : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x >= __y; }
+ };
+ template<typename _Tp>
+ struct less_equal : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x <= __y; }
+ };
+ template<typename _Tp>
+ struct logical_and : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x && __y; }
+ };
+ template<typename _Tp>
+ struct logical_or : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x || __y; }
+ };
+ template<typename _Tp>
+ struct logical_not : public unary_function<_Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x) const
+ { return !__x; }
+ };
+ template<typename _Tp>
+ struct bit_and : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x & __y; }
+ };
+ template<typename _Tp>
+ struct bit_or : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x | __y; }
+ };
+ template<typename _Tp>
+ struct bit_xor : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x ^ __y; }
+ };
+ template<typename _Predicate>
+ class unary_negate
+ : public unary_function<typename _Predicate::argument_type, bool>
+ {
+ protected:
+ _Predicate _M_pred;
+ public:
+ explicit
+ unary_negate(const _Predicate& __x) : _M_pred(__x) { }
+ bool
+ operator()(const typename _Predicate::argument_type& __x) const
+ { return !_M_pred(__x); }
+ };
+ template<typename _Predicate>
+ inline unary_negate<_Predicate>
+ not1(const _Predicate& __pred)
+ { return unary_negate<_Predicate>(__pred); }
+ template<typename _Predicate>
+ class binary_negate
+ : public binary_function<typename _Predicate::first_argument_type,
+ typename _Predicate::second_argument_type, bool>
+ {
+ protected:
+ _Predicate _M_pred;
+ public:
+ explicit
+ binary_negate(const _Predicate& __x) : _M_pred(__x) { }
+ bool
+ operator()(const typename _Predicate::first_argument_type& __x,
+ const typename _Predicate::second_argument_type& __y) const
+ { return !_M_pred(__x, __y); }
+ };
+ template<typename _Predicate>
+ inline binary_negate<_Predicate>
+ not2(const _Predicate& __pred)
+ { return binary_negate<_Predicate>(__pred); }
+ template<typename _Arg, typename _Result>
+ class pointer_to_unary_function : public unary_function<_Arg, _Result>
+ {
+ protected:
+ _Result (*_M_ptr)(_Arg);
+ public:
+ pointer_to_unary_function() { }
+ explicit
+ pointer_to_unary_function(_Result (*__x)(_Arg))
+ : _M_ptr(__x) { }
+ _Result
+ operator()(_Arg __x) const
+ { return _M_ptr(__x); }
+ };
+ template<typename _Arg, typename _Result>
+ inline pointer_to_unary_function<_Arg, _Result>
+ ptr_fun(_Result (*__x)(_Arg))
+ { return pointer_to_unary_function<_Arg, _Result>(__x); }
+ template<typename _Arg1, typename _Arg2, typename _Result>
+ class pointer_to_binary_function
+ : public binary_function<_Arg1, _Arg2, _Result>
+ {
+ protected:
+ _Result (*_M_ptr)(_Arg1, _Arg2);
+ public:
+ pointer_to_binary_function() { }
+ explicit
+ pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
+ : _M_ptr(__x) { }
+ _Result
+ operator()(_Arg1 __x, _Arg2 __y) const
+ { return _M_ptr(__x, __y); }
+ };
+ template<typename _Arg1, typename _Arg2, typename _Result>
+ inline pointer_to_binary_function<_Arg1, _Arg2, _Result>
+ ptr_fun(_Result (*__x)(_Arg1, _Arg2))
+ { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); }
+ template<typename _Tp>
+ struct _Identity : public unary_function<_Tp,_Tp>
+ {
+ _Tp&
+ operator()(_Tp& __x) const
+ { return __x; }
+ const _Tp&
+ operator()(const _Tp& __x) const
+ { return __x; }
+ };
+ template<typename _Pair>
+ struct _Select1st : public unary_function<_Pair,
+ typename _Pair::first_type>
+ {
+ typename _Pair::first_type&
+ operator()(_Pair& __x) const
+ { return __x.first; }
+ const typename _Pair::first_type&
+ operator()(const _Pair& __x) const
+ { return __x.first; }
+ };
+ template<typename _Pair>
+ struct _Select2nd : public unary_function<_Pair,
+ typename _Pair::second_type>
+ {
+ typename _Pair::second_type&
+ operator()(_Pair& __x) const
+ { return __x.second; }
+ const typename _Pair::second_type&
+ operator()(const _Pair& __x) const
+ { return __x.second; }
+ };
+ template<typename _Ret, typename _Tp>
+ class mem_fun_t : public unary_function<_Tp*, _Ret>
+ {
+ public:
+ explicit
+ mem_fun_t(_Ret (_Tp::*__pf)())
+ : _M_f(__pf) { }
+ _Ret
+ operator()(_Tp* __p) const
+ { return (__p->*_M_f)(); }
+ private:
+ _Ret (_Tp::*_M_f)();
+ };
+ template<typename _Ret, typename _Tp>
+ class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
+ {
+ public:
+ explicit
+ const_mem_fun_t(_Ret (_Tp::*__pf)() const)
+ : _M_f(__pf) { }
+ _Ret
+ operator()(const _Tp* __p) const
+ { return (__p->*_M_f)(); }
+ private:
+ _Ret (_Tp::*_M_f)() const;
+ };
+ template<typename _Ret, typename _Tp>
+ class mem_fun_ref_t : public unary_function<_Tp, _Ret>
+ {
+ public:
+ explicit
+ mem_fun_ref_t(_Ret (_Tp::*__pf)())
+ : _M_f(__pf) { }
+ _Ret
+ operator()(_Tp& __r) const
+ { return (__r.*_M_f)(); }
+ private:
+ _Ret (_Tp::*_M_f)();
+ };
+ template<typename _Ret, typename _Tp>
+ class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
+ {
+ public:
+ explicit
+ const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const)
+ : _M_f(__pf) { }
+ _Ret
+ operator()(const _Tp& __r) const
+ { return (__r.*_M_f)(); }
+ private:
+ _Ret (_Tp::*_M_f)() const;
+ };
+ template<typename _Ret, typename _Tp, typename _Arg>
+ class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret>
+ {
+ public:
+ explicit
+ mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
+ : _M_f(__pf) { }
+ _Ret
+ operator()(_Tp* __p, _Arg __x) const
+ { return (__p->*_M_f)(__x); }
+ private:
+ _Ret (_Tp::*_M_f)(_Arg);
+ };
+ template<typename _Ret, typename _Tp, typename _Arg>
+ class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret>
+ {
+ public:
+ explicit
+ const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const)
+ : _M_f(__pf) { }
+ _Ret
+ operator()(const _Tp* __p, _Arg __x) const
+ { return (__p->*_M_f)(__x); }
+ private:
+ _Ret (_Tp::*_M_f)(_Arg) const;
+ };
+ template<typename _Ret, typename _Tp, typename _Arg>
+ class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
+ {
+ public:
+ explicit
+ mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg))
+ : _M_f(__pf) { }
+ _Ret
+ operator()(_Tp& __r, _Arg __x) const
+ { return (__r.*_M_f)(__x); }
+ private:
+ _Ret (_Tp::*_M_f)(_Arg);
+ };
+ template<typename _Ret, typename _Tp, typename _Arg>
+ class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
+ {
+ public:
+ explicit
+ const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const)
+ : _M_f(__pf) { }
+ _Ret
+ operator()(const _Tp& __r, _Arg __x) const
+ { return (__r.*_M_f)(__x); }
+ private:
+ _Ret (_Tp::*_M_f)(_Arg) const;
+ };
+ template<typename _Ret, typename _Tp>
+ inline mem_fun_t<_Ret, _Tp>
+ mem_fun(_Ret (_Tp::*__f)())
+ { return mem_fun_t<_Ret, _Tp>(__f); }
+ template<typename _Ret, typename _Tp>
+ inline const_mem_fun_t<_Ret, _Tp>
+ mem_fun(_Ret (_Tp::*__f)() const)
+ { return const_mem_fun_t<_Ret, _Tp>(__f); }
+ template<typename _Ret, typename _Tp>
+ inline mem_fun_ref_t<_Ret, _Tp>
+ mem_fun_ref(_Ret (_Tp::*__f)())
+ { return mem_fun_ref_t<_Ret, _Tp>(__f); }
+ template<typename _Ret, typename _Tp>
+ inline const_mem_fun_ref_t<_Ret, _Tp>
+ mem_fun_ref(_Ret (_Tp::*__f)() const)
+ { return const_mem_fun_ref_t<_Ret, _Tp>(__f); }
+ template<typename _Ret, typename _Tp, typename _Arg>
+ inline mem_fun1_t<_Ret, _Tp, _Arg>
+ mem_fun(_Ret (_Tp::*__f)(_Arg))
+ { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+ template<typename _Ret, typename _Tp, typename _Arg>
+ inline const_mem_fun1_t<_Ret, _Tp, _Arg>
+ mem_fun(_Ret (_Tp::*__f)(_Arg) const)
+ { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+ template<typename _Ret, typename _Tp, typename _Arg>
+ inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
+ mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
+ { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+ template<typename _Ret, typename _Tp, typename _Arg>
+ inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
+ mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
+ { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Operation>
+ class binder1st
+ : public unary_function<typename _Operation::second_argument_type,
+ typename _Operation::result_type>
+ {
+ protected:
+ _Operation op;
+ typename _Operation::first_argument_type value;
+ public:
+ binder1st(const _Operation& __x,
+ const typename _Operation::first_argument_type& __y)
+ : op(__x), value(__y) { }
+ typename _Operation::result_type
+ operator()(const typename _Operation::second_argument_type& __x) const
+ { return op(value, __x); }
+ typename _Operation::result_type
+ operator()(typename _Operation::second_argument_type& __x) const
+ { return op(value, __x); }
+ } ;
+ template<typename _Operation, typename _Tp>
+ inline binder1st<_Operation>
+ bind1st(const _Operation& __fn, const _Tp& __x)
+ {
+ typedef typename _Operation::first_argument_type _Arg1_type;
+ return binder1st<_Operation>(__fn, _Arg1_type(__x));
+ }
+ template<typename _Operation>
+ class binder2nd
+ : public unary_function<typename _Operation::first_argument_type,
+ typename _Operation::result_type>
+ {
+ protected:
+ _Operation op;
+ typename _Operation::second_argument_type value;
+ public:
+ binder2nd(const _Operation& __x,
+ const typename _Operation::second_argument_type& __y)
+ : op(__x), value(__y) { }
+ typename _Operation::result_type
+ operator()(const typename _Operation::first_argument_type& __x) const
+ { return op(__x, value); }
+ typename _Operation::result_type
+ operator()(typename _Operation::first_argument_type& __x) const
+ { return op(__x, value); }
+ } ;
+ template<typename _Operation, typename _Tp>
+ inline binder2nd<_Operation>
+ bind2nd(const _Operation& __fn, const _Tp& __x)
+ {
+ typedef typename _Operation::second_argument_type _Arg2_type;
+ return binder2nd<_Operation>(__fn, _Arg2_type(__x));
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class basic_string
+ {
+ typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
+ public:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef _Alloc allocator_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+ typedef typename _CharT_alloc_type::difference_type difference_type;
+ typedef typename _CharT_alloc_type::reference reference;
+ typedef typename _CharT_alloc_type::const_reference const_reference;
+ typedef typename _CharT_alloc_type::pointer pointer;
+ typedef typename _CharT_alloc_type::const_pointer const_pointer;
+ typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator;
+ typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
+ const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ private:
+ struct _Rep_base
+ {
+ size_type _M_length;
+ size_type _M_capacity;
+ _Atomic_word _M_refcount;
+ };
+ struct _Rep : _Rep_base
+ {
+ typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc;
+ static const size_type _S_max_size;
+ static const _CharT _S_terminal;
+ static size_type _S_empty_rep_storage[];
+ static _Rep&
+ _S_empty_rep()
+ {
+ void* __p = reinterpret_cast<void*>(&_S_empty_rep_storage);
+ return *reinterpret_cast<_Rep*>(__p);
+ }
+ bool
+ _M_is_leaked() const
+ { return this->_M_refcount < 0; }
+ bool
+ _M_is_shared() const
+ { return this->_M_refcount > 0; }
+ void
+ _M_set_leaked()
+ { this->_M_refcount = -1; }
+ void
+ _M_set_sharable()
+ { this->_M_refcount = 0; }
+ void
+ _M_set_length_and_sharable(size_type __n)
+ {
+ this->_M_set_sharable();
+ this->_M_length = __n;
+ traits_type::assign(this->_M_refdata()[__n], _S_terminal);
+ }
+ _CharT*
+ _M_refdata() throw()
+ { return reinterpret_cast<_CharT*>(this + 1); }
+ _CharT*
+ _M_grab(const _Alloc& __alloc1, const _Alloc& __alloc2)
+ {
+ return (!_M_is_leaked() && __alloc1 == __alloc2)
+ ? _M_refcopy() : _M_clone(__alloc1);
+ }
+ static _Rep*
+ _S_create(size_type, size_type, const _Alloc&);
+ void
+ _M_dispose(const _Alloc& __a)
+ {
+ if (__builtin_expect(this != &_S_empty_rep(), false))
+ if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount,
+ -1) <= 0)
+ _M_destroy(__a);
+ }
+ void
+ _M_destroy(const _Alloc&) throw();
+ _CharT*
+ _M_refcopy() throw()
+ {
+ if (__builtin_expect(this != &_S_empty_rep(), false))
+ __gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1);
+ return _M_refdata();
+ }
+ _CharT*
+ _M_clone(const _Alloc&, size_type __res = 0);
+ };
+ struct _Alloc_hider : _Alloc
+ {
+ _Alloc_hider(_CharT* __dat, const _Alloc& __a)
+ : _Alloc(__a), _M_p(__dat) { }
+ _CharT* _M_p;
+ };
+ public:
+ static const size_type npos = static_cast<size_type>(-1);
+ private:
+ mutable _Alloc_hider _M_dataplus;
+ _CharT*
+ _M_data() const
+ { return _M_dataplus._M_p; }
+ _CharT*
+ _M_data(_CharT* __p)
+ { return (_M_dataplus._M_p = __p); }
+ _Rep*
+ _M_rep() const
+ { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }
+ iterator
+ _M_ibegin() const
+ { return iterator(_M_data()); }
+ iterator
+ _M_iend() const
+ { return iterator(_M_data() + this->size()); }
+ void
+ _M_leak()
+ {
+ if (!_M_rep()->_M_is_leaked())
+ _M_leak_hard();
+ }
+ size_type
+ _M_check(size_type __pos, const char* __s) const
+ {
+ if (__pos > this->size())
+ __throw_out_of_range((__s));
+ return __pos;
+ }
+ void
+ _M_check_length(size_type __n1, size_type __n2, const char* __s) const
+ {
+ if (this->max_size() - (this->size() - __n1) < __n2)
+ __throw_length_error((__s));
+ }
+ size_type
+ _M_limit(size_type __pos, size_type __off) const
+ {
+ const bool __testoff = __off < this->size() - __pos;
+ return __testoff ? __off : this->size() - __pos;
+ }
+ bool
+ _M_disjunct(const _CharT* __s) const
+ {
+ return (less<const _CharT*>()(__s, _M_data())
+ || less<const _CharT*>()(_M_data() + this->size(), __s));
+ }
+ static void
+ _M_copy(_CharT* __d, const _CharT* __s, size_type __n)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, *__s);
+ else
+ traits_type::copy(__d, __s, __n);
+ }
+ static void
+ _M_move(_CharT* __d, const _CharT* __s, size_type __n)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, *__s);
+ else
+ traits_type::move(__d, __s, __n);
+ }
+ static void
+ _M_assign(_CharT* __d, size_type __n, _CharT __c)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, __c);
+ else
+ traits_type::assign(__d, __n, __c);
+ }
+ template<class _Iterator>
+ static void
+ _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
+ {
+ for (; __k1 != __k2; ++__k1, ++__p)
+ traits_type::assign(*__p, *__k1);
+ }
+ static void
+ _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+ static void
+ _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+ static void
+ _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2)
+ { _M_copy(__p, __k1, __k2 - __k1); }
+ static void
+ _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
+ { _M_copy(__p, __k1, __k2 - __k1); }
+ static int
+ _S_compare(size_type __n1, size_type __n2)
+ {
+ const difference_type __d = difference_type(__n1 - __n2);
+ if (__d > __gnu_cxx::__numeric_traits<int>::__max)
+ return __gnu_cxx::__numeric_traits<int>::__max;
+ else if (__d < __gnu_cxx::__numeric_traits<int>::__min)
+ return __gnu_cxx::__numeric_traits<int>::__min;
+ else
+ return int(__d);
+ }
+ void
+ _M_mutate(size_type __pos, size_type __len1, size_type __len2);
+ void
+ _M_leak_hard();
+ static _Rep&
+ _S_empty_rep()
+ { return _Rep::_S_empty_rep(); }
+ public:
+ inline
+ basic_string();
+ explicit
+ basic_string(const _Alloc& __a);
+ basic_string(const basic_string& __str);
+ basic_string(const basic_string& __str, size_type __pos,
+ size_type __n = npos);
+ basic_string(const basic_string& __str, size_type __pos,
+ size_type __n, const _Alloc& __a);
+ basic_string(const _CharT* __s, size_type __n,
+ const _Alloc& __a = _Alloc());
+ basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
+ basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
+ template<class _InputIterator>
+ basic_string(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a = _Alloc());
+ ~basic_string()
+ { _M_rep()->_M_dispose(this->get_allocator()); }
+ basic_string&
+ operator=(const basic_string& __str)
+ { return this->assign(__str); }
+ basic_string&
+ operator=(const _CharT* __s)
+ { return this->assign(__s); }
+ basic_string&
+ operator=(_CharT __c)
+ {
+ this->assign(1, __c);
+ return *this;
+ }
+ iterator
+ begin()
+ {
+ _M_leak();
+ return iterator(_M_data());
+ }
+ const_iterator
+ begin() const
+ { return const_iterator(_M_data()); }
+ iterator
+ end()
+ {
+ _M_leak();
+ return iterator(_M_data() + this->size());
+ }
+ const_iterator
+ end() const
+ { return const_iterator(_M_data() + this->size()); }
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(this->end()); }
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(this->end()); }
+ reverse_iterator
+ rend()
+ { return reverse_iterator(this->begin()); }
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(this->begin()); }
+ public:
+ size_type
+ size() const
+ { return _M_rep()->_M_length; }
+ size_type
+ length() const
+ { return _M_rep()->_M_length; }
+ size_type
+ max_size() const
+ { return _Rep::_S_max_size; }
+ void
+ resize(size_type __n, _CharT __c);
+ void
+ resize(size_type __n)
+ { this->resize(__n, _CharT()); }
+ size_type
+ capacity() const
+ { return _M_rep()->_M_capacity; }
+ void
+ reserve(size_type __res_arg = 0);
+ void
+ clear()
+ { _M_mutate(0, this->size(), 0); }
+ bool
+ empty() const
+ { return this->size() == 0; }
+ const_reference
+ operator[] (size_type __pos) const
+ {
+ ;
+ return _M_data()[__pos];
+ }
+ reference
+ operator[](size_type __pos)
+ {
+ ;
+ ;
+ _M_leak();
+ return _M_data()[__pos];
+ }
+ const_reference
+ at(size_type __n) const
+ {
+ if (__n >= this->size())
+ __throw_out_of_range(("basic_string::at"));
+ return _M_data()[__n];
+ }
+ reference
+ at(size_type __n)
+ {
+ if (__n >= size())
+ __throw_out_of_range(("basic_string::at"));
+ _M_leak();
+ return _M_data()[__n];
+ }
+ basic_string&
+ operator+=(const basic_string& __str)
+ { return this->append(__str); }
+ basic_string&
+ operator+=(const _CharT* __s)
+ { return this->append(__s); }
+ basic_string&
+ operator+=(_CharT __c)
+ {
+ this->push_back(__c);
+ return *this;
+ }
+ basic_string&
+ append(const basic_string& __str);
+ basic_string&
+ append(const basic_string& __str, size_type __pos, size_type __n);
+ basic_string&
+ append(const _CharT* __s, size_type __n);
+ basic_string&
+ append(const _CharT* __s)
+ {
+ ;
+ return this->append(__s, traits_type::length(__s));
+ }
+ basic_string&
+ append(size_type __n, _CharT __c);
+ template<class _InputIterator>
+ basic_string&
+ append(_InputIterator __first, _InputIterator __last)
+ { return this->replace(_M_iend(), _M_iend(), __first, __last); }
+ void
+ push_back(_CharT __c)
+ {
+ const size_type __len = 1 + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ this->reserve(__len);
+ traits_type::assign(_M_data()[this->size()], __c);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ basic_string&
+ assign(const basic_string& __str);
+ basic_string&
+ assign(const basic_string& __str, size_type __pos, size_type __n)
+ { return this->assign(__str._M_data()
+ + __str._M_check(__pos, "basic_string::assign"),
+ __str._M_limit(__pos, __n)); }
+ basic_string&
+ assign(const _CharT* __s, size_type __n);
+ basic_string&
+ assign(const _CharT* __s)
+ {
+ ;
+ return this->assign(__s, traits_type::length(__s));
+ }
+ basic_string&
+ assign(size_type __n, _CharT __c)
+ { return _M_replace_aux(size_type(0), this->size(), __n, __c); }
+ template<class _InputIterator>
+ basic_string&
+ assign(_InputIterator __first, _InputIterator __last)
+ { return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
+ void
+ insert(iterator __p, size_type __n, _CharT __c)
+ { this->replace(__p, __p, __n, __c); }
+ template<class _InputIterator>
+ void
+ insert(iterator __p, _InputIterator __beg, _InputIterator __end)
+ { this->replace(__p, __p, __beg, __end); }
+ basic_string&
+ insert(size_type __pos1, const basic_string& __str)
+ { return this->insert(__pos1, __str, size_type(0), __str.size()); }
+ basic_string&
+ insert(size_type __pos1, const basic_string& __str,
+ size_type __pos2, size_type __n)
+ { return this->insert(__pos1, __str._M_data()
+ + __str._M_check(__pos2, "basic_string::insert"),
+ __str._M_limit(__pos2, __n)); }
+ basic_string&
+ insert(size_type __pos, const _CharT* __s, size_type __n);
+ basic_string&
+ insert(size_type __pos, const _CharT* __s)
+ {
+ ;
+ return this->insert(__pos, __s, traits_type::length(__s));
+ }
+ basic_string&
+ insert(size_type __pos, size_type __n, _CharT __c)
+ { return _M_replace_aux(_M_check(__pos, "basic_string::insert"),
+ size_type(0), __n, __c); }
+ iterator
+ insert(iterator __p, _CharT __c)
+ {
+ ;
+ const size_type __pos = __p - _M_ibegin();
+ _M_replace_aux(__pos, size_type(0), size_type(1), __c);
+ _M_rep()->_M_set_leaked();
+ return iterator(_M_data() + __pos);
+ }
+ basic_string&
+ erase(size_type __pos = 0, size_type __n = npos)
+ {
+ _M_mutate(_M_check(__pos, "basic_string::erase"),
+ _M_limit(__pos, __n), size_type(0));
+ return *this;
+ }
+ iterator
+ erase(iterator __position)
+ {
+ ;
+ const size_type __pos = __position - _M_ibegin();
+ _M_mutate(__pos, size_type(1), size_type(0));
+ _M_rep()->_M_set_leaked();
+ return iterator(_M_data() + __pos);
+ }
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ ;
+ const size_type __pos = __first - _M_ibegin();
+ _M_mutate(__pos, __last - __first, size_type(0));
+ _M_rep()->_M_set_leaked();
+ return iterator(_M_data() + __pos);
+ }
+ basic_string&
+ replace(size_type __pos, size_type __n, const basic_string& __str)
+ { return this->replace(__pos, __n, __str._M_data(), __str.size()); }
+ basic_string&
+ replace(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2)
+ { return this->replace(__pos1, __n1, __str._M_data()
+ + __str._M_check(__pos2, "basic_string::replace"),
+ __str._M_limit(__pos2, __n2)); }
+ basic_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2);
+ basic_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s)
+ {
+ ;
+ return this->replace(__pos, __n1, __s, traits_type::length(__s));
+ }
+ basic_string&
+ replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
+ { return _M_replace_aux(_M_check(__pos, "basic_string::replace"),
+ _M_limit(__pos, __n1), __n2, __c); }
+ basic_string&
+ replace(iterator __i1, iterator __i2, const basic_string& __str)
+ { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
+ basic_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
+ {
+ ;
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
+ }
+ basic_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s)
+ {
+ ;
+ return this->replace(__i1, __i2, __s, traits_type::length(__s));
+ }
+ basic_string&
+ replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
+ {
+ ;
+ return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
+ }
+ template<class _InputIterator>
+ basic_string&
+ replace(iterator __i1, iterator __i2,
+ _InputIterator __k1, _InputIterator __k2)
+ {
+ ;
+ ;
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
+ }
+ basic_string&
+ replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
+ {
+ ;
+ ;
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1, __k2 - __k1);
+ }
+ basic_string&
+ replace(iterator __i1, iterator __i2,
+ const _CharT* __k1, const _CharT* __k2)
+ {
+ ;
+ ;
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1, __k2 - __k1);
+ }
+ basic_string&
+ replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
+ {
+ ;
+ ;
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1.base(), __k2 - __k1);
+ }
+ basic_string&
+ replace(iterator __i1, iterator __i2,
+ const_iterator __k1, const_iterator __k2)
+ {
+ ;
+ ;
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1.base(), __k2 - __k1);
+ }
+ private:
+ template<class _Integer>
+ basic_string&
+ _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
+ _Integer __val, __true_type)
+ { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
+ template<class _InputIterator>
+ basic_string&
+ _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+ _InputIterator __k2, __false_type);
+ basic_string&
+ _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+ _CharT __c);
+ basic_string&
+ _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
+ size_type __n2);
+ template<class _InIterator>
+ static _CharT*
+ _S_construct_aux(_InIterator __beg, _InIterator __end,
+ const _Alloc& __a, __false_type)
+ {
+ typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
+ return _S_construct(__beg, __end, __a, _Tag());
+ }
+ template<class _Integer>
+ static _CharT*
+ _S_construct_aux(_Integer __beg, _Integer __end,
+ const _Alloc& __a, __true_type)
+ { return _S_construct(static_cast<size_type>(__beg), __end, __a); }
+ template<class _InIterator>
+ static _CharT*
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a)
+ {
+ typedef typename std::__is_integer<_InIterator>::__type _Integral;
+ return _S_construct_aux(__beg, __end, __a, _Integral());
+ }
+ template<class _InIterator>
+ static _CharT*
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ input_iterator_tag);
+ template<class _FwdIterator>
+ static _CharT*
+ _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a,
+ forward_iterator_tag);
+ static _CharT*
+ _S_construct(size_type __req, _CharT __c, const _Alloc& __a);
+ public:
+ size_type
+ copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
+ void
+ swap(basic_string& __s);
+ const _CharT*
+ c_str() const
+ { return _M_data(); }
+ const _CharT*
+ data() const
+ { return _M_data(); }
+ allocator_type
+ get_allocator() const
+ { return _M_dataplus; }
+ size_type
+ find(const _CharT* __s, size_type __pos, size_type __n) const;
+ size_type
+ find(const basic_string& __str, size_type __pos = 0) const
+ { return this->find(__str.data(), __pos, __str.size()); }
+ size_type
+ find(const _CharT* __s, size_type __pos = 0) const
+ {
+ ;
+ return this->find(__s, __pos, traits_type::length(__s));
+ }
+ size_type
+ find(_CharT __c, size_type __pos = 0) const;
+ size_type
+ rfind(const basic_string& __str, size_type __pos = npos) const
+ { return this->rfind(__str.data(), __pos, __str.size()); }
+ size_type
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const;
+ size_type
+ rfind(const _CharT* __s, size_type __pos = npos) const
+ {
+ ;
+ return this->rfind(__s, __pos, traits_type::length(__s));
+ }
+ size_type
+ rfind(_CharT __c, size_type __pos = npos) const;
+ size_type
+ find_first_of(const basic_string& __str, size_type __pos = 0) const
+ { return this->find_first_of(__str.data(), __pos, __str.size()); }
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ ;
+ return this->find_first_of(__s, __pos, traits_type::length(__s));
+ }
+ size_type
+ find_first_of(_CharT __c, size_type __pos = 0) const
+ { return this->find(__c, __pos); }
+ size_type
+ find_last_of(const basic_string& __str, size_type __pos = npos) const
+ { return this->find_last_of(__str.data(), __pos, __str.size()); }
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos = npos) const
+ {
+ ;
+ return this->find_last_of(__s, __pos, traits_type::length(__s));
+ }
+ size_type
+ find_last_of(_CharT __c, size_type __pos = npos) const
+ { return this->rfind(__c, __pos); }
+ size_type
+ find_first_not_of(const basic_string& __str, size_type __pos = 0) const
+ { return this->find_first_not_of(__str.data(), __pos, __str.size()); }
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos,
+ size_type __n) const;
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ ;
+ return this->find_first_not_of(__s, __pos, traits_type::length(__s));
+ }
+ size_type
+ find_first_not_of(_CharT __c, size_type __pos = 0) const;
+ size_type
+ find_last_not_of(const basic_string& __str, size_type __pos = npos) const
+ { return this->find_last_not_of(__str.data(), __pos, __str.size()); }
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos,
+ size_type __n) const;
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos = npos) const
+ {
+ ;
+ return this->find_last_not_of(__s, __pos, traits_type::length(__s));
+ }
+ size_type
+ find_last_not_of(_CharT __c, size_type __pos = npos) const;
+ basic_string
+ substr(size_type __pos = 0, size_type __n = npos) const
+ { return basic_string(*this,
+ _M_check(__pos, "basic_string::substr"), __n); }
+ int
+ compare(const basic_string& __str) const
+ {
+ const size_type __size = this->size();
+ const size_type __osize = __str.size();
+ const size_type __len = std::min(__size, __osize);
+ int __r = traits_type::compare(_M_data(), __str.data(), __len);
+ if (!__r)
+ __r = _S_compare(__size, __osize);
+ return __r;
+ }
+ int
+ compare(size_type __pos, size_type __n, const basic_string& __str) const;
+ int
+ compare(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2) const;
+ int
+ compare(const _CharT* __s) const;
+ int
+ compare(size_type __pos, size_type __n1, const _CharT* __s) const;
+ int
+ compare(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2) const;
+ };
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_string<_CharT, _Traits, _Alloc>::
+ basic_string()
+ : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>
+ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ {
+ basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT,_Traits,_Alloc>
+ operator+(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT,_Traits,_Alloc>
+ operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_string<_CharT, _Traits, _Alloc>
+ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ {
+ basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_string<_CharT, _Traits, _Alloc>
+ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
+ {
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ __string_type __str(__lhs);
+ __str.append(__size_type(1), __rhs);
+ return __str;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) == 0; }
+ template<typename _CharT>
+ inline
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, bool>::__type
+ operator==(const basic_string<_CharT>& __lhs,
+ const basic_string<_CharT>& __rhs)
+ { return (__lhs.size() == __rhs.size()
+ && !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(),
+ __lhs.size())); }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator==(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) == 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) == 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return !(__lhs == __rhs); }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator!=(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return !(__lhs == __rhs); }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return !(__lhs == __rhs); }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) < 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) < 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) > 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) > 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) > 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) < 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) <= 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) <= 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<=(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) >= 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) >= 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) >= 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>=(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) <= 0; }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline void
+ swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is,
+ basic_string<_CharT, _Traits, _Alloc>& __str);
+ template<>
+ basic_istream<char>&
+ operator>>(basic_istream<char>& __is, basic_string<char>& __str);
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os,
+ const basic_string<_CharT, _Traits, _Alloc>& __str)
+ {
+ return __ostream_insert(__os, __str.data(), __str.size());
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __is,
+ basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim);
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __is,
+ basic_string<_CharT, _Traits, _Alloc>& __str)
+ { return getline(__is, __str, __is.widen('\n')); }
+ template<>
+ basic_istream<char>&
+ getline(basic_istream<char>& __in, basic_string<char>& __str,
+ char __delim);
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ const typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ _Rep::_S_max_size = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4;
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ const _CharT
+ basic_string<_CharT, _Traits, _Alloc>::
+ _Rep::_S_terminal = _CharT();
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ const typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::npos;
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
+ (sizeof(_Rep_base) + sizeof(_CharT) + sizeof(size_type) - 1) /
+ sizeof(size_type)];
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InIterator>
+ _CharT*
+ basic_string<_CharT, _Traits, _Alloc>::
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ input_iterator_tag)
+ {
+ if (__beg == __end && __a == _Alloc())
+ return _S_empty_rep()._M_refdata();
+ _CharT __buf[128];
+ size_type __len = 0;
+ while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT))
+ {
+ __buf[__len++] = *__beg;
+ ++__beg;
+ }
+ _Rep* __r = _Rep::_S_create(__len, size_type(0), __a);
+ _M_copy(__r->_M_refdata(), __buf, __len);
+ try
+ {
+ while (__beg != __end)
+ {
+ if (__len == __r->_M_capacity)
+ {
+ _Rep* __another = _Rep::_S_create(__len + 1, __len, __a);
+ _M_copy(__another->_M_refdata(), __r->_M_refdata(), __len);
+ __r->_M_destroy(__a);
+ __r = __another;
+ }
+ __r->_M_refdata()[__len++] = *__beg;
+ ++__beg;
+ }
+ }
+ catch(...)
+ {
+ __r->_M_destroy(__a);
+ throw;
+ }
+ __r->_M_set_length_and_sharable(__len);
+ return __r->_M_refdata();
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template <typename _InIterator>
+ _CharT*
+ basic_string<_CharT, _Traits, _Alloc>::
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ forward_iterator_tag)
+ {
+ if (__beg == __end && __a == _Alloc())
+ return _S_empty_rep()._M_refdata();
+ if (__builtin_expect(__gnu_cxx::__is_null_pointer(__beg)
+ && __beg != __end, 0))
+ __throw_logic_error(("basic_string::_S_construct NULL not valid"));
+ const size_type __dnew = static_cast<size_type>(std::distance(__beg,
+ __end));
+ _Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a);
+ try
+ { _S_copy_chars(__r->_M_refdata(), __beg, __end); }
+ catch(...)
+ {
+ __r->_M_destroy(__a);
+ throw;
+ }
+ __r->_M_set_length_and_sharable(__dnew);
+ return __r->_M_refdata();
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ _CharT*
+ basic_string<_CharT, _Traits, _Alloc>::
+ _S_construct(size_type __n, _CharT __c, const _Alloc& __a)
+ {
+ if (__n == 0 && __a == _Alloc())
+ return _S_empty_rep()._M_refdata();
+ _Rep* __r = _Rep::_S_create(__n, size_type(0), __a);
+ if (__n)
+ _M_assign(__r->_M_refdata(), __n, __c);
+ __r->_M_set_length_and_sharable(__n);
+ return __r->_M_refdata();
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const basic_string& __str)
+ : _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()),
+ __str.get_allocator()),
+ __str.get_allocator())
+ { }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const _Alloc& __a)
+ : _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a)
+ { }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const basic_string& __str, size_type __pos, size_type __n)
+ : _M_dataplus(_S_construct(__str._M_data()
+ + __str._M_check(__pos,
+ "basic_string::basic_string"),
+ __str._M_data() + __str._M_limit(__pos, __n)
+ + __pos, _Alloc()), _Alloc())
+ { }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const basic_string& __str, size_type __pos,
+ size_type __n, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__str._M_data()
+ + __str._M_check(__pos,
+ "basic_string::basic_string"),
+ __str._M_data() + __str._M_limit(__pos, __n)
+ + __pos, __a), __a)
+ { }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const _CharT* __s, size_type __n, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__s, __s + __n, __a), __a)
+ { }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const _CharT* __s, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) :
+ __s + npos, __a), __a)
+ { }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(size_type __n, _CharT __c, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__n, __c, __a), __a)
+ { }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InputIterator>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__beg, __end, __a), __a)
+ { }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ assign(const basic_string& __str)
+ {
+ if (_M_rep() != __str._M_rep())
+ {
+ const allocator_type __a = this->get_allocator();
+ _CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator());
+ _M_rep()->_M_dispose(__a);
+ _M_data(__tmp);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ assign(const _CharT* __s, size_type __n)
+ {
+ ;
+ _M_check_length(this->size(), __n, "basic_string::assign");
+ if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
+ return _M_replace_safe(size_type(0), this->size(), __s, __n);
+ else
+ {
+ const size_type __pos = __s - _M_data();
+ if (__pos >= __n)
+ _M_copy(_M_data(), __s, __n);
+ else if (__pos)
+ _M_move(_M_data(), __s, __n);
+ _M_rep()->_M_set_length_and_sharable(__n);
+ return *this;
+ }
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ append(size_type __n, _CharT __c)
+ {
+ if (__n)
+ {
+ _M_check_length(size_type(0), __n, "basic_string::append");
+ const size_type __len = __n + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ this->reserve(__len);
+ _M_assign(_M_data() + this->size(), __n, __c);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ append(const _CharT* __s, size_type __n)
+ {
+ ;
+ if (__n)
+ {
+ _M_check_length(size_type(0), __n, "basic_string::append");
+ const size_type __len = __n + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ {
+ if (_M_disjunct(__s))
+ this->reserve(__len);
+ else
+ {
+ const size_type __off = __s - _M_data();
+ this->reserve(__len);
+ __s = _M_data() + __off;
+ }
+ }
+ _M_copy(_M_data() + this->size(), __s, __n);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ append(const basic_string& __str)
+ {
+ const size_type __size = __str.size();
+ if (__size)
+ {
+ const size_type __len = __size + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ this->reserve(__len);
+ _M_copy(_M_data() + this->size(), __str._M_data(), __size);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ append(const basic_string& __str, size_type __pos, size_type __n)
+ {
+ __str._M_check(__pos, "basic_string::append");
+ __n = __str._M_limit(__pos, __n);
+ if (__n)
+ {
+ const size_type __len = __n + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ this->reserve(__len);
+ _M_copy(_M_data() + this->size(), __str._M_data() + __pos, __n);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ insert(size_type __pos, const _CharT* __s, size_type __n)
+ {
+ ;
+ _M_check(__pos, "basic_string::insert");
+ _M_check_length(size_type(0), __n, "basic_string::insert");
+ if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
+ return _M_replace_safe(__pos, size_type(0), __s, __n);
+ else
+ {
+ const size_type __off = __s - _M_data();
+ _M_mutate(__pos, 0, __n);
+ __s = _M_data() + __off;
+ _CharT* __p = _M_data() + __pos;
+ if (__s + __n <= __p)
+ _M_copy(__p, __s, __n);
+ else if (__s >= __p)
+ _M_copy(__p, __s + __n, __n);
+ else
+ {
+ const size_type __nleft = __p - __s;
+ _M_copy(__p, __s, __nleft);
+ _M_copy(__p + __nleft, __p + __n, __n - __nleft);
+ }
+ return *this;
+ }
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ replace(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2)
+ {
+ ;
+ _M_check(__pos, "basic_string::replace");
+ __n1 = _M_limit(__pos, __n1);
+ _M_check_length(__n1, __n2, "basic_string::replace");
+ bool __left;
+ if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
+ return _M_replace_safe(__pos, __n1, __s, __n2);
+ else if ((__left = __s + __n2 <= _M_data() + __pos)
+ || _M_data() + __pos + __n1 <= __s)
+ {
+ size_type __off = __s - _M_data();
+ __left ? __off : (__off += __n2 - __n1);
+ _M_mutate(__pos, __n1, __n2);
+ _M_copy(_M_data() + __pos, _M_data() + __off, __n2);
+ return *this;
+ }
+ else
+ {
+ const basic_string __tmp(__s, __n2);
+ return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2);
+ }
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::_Rep::
+ _M_destroy(const _Alloc& __a) throw ()
+ {
+ const size_type __size = sizeof(_Rep_base) +
+ (this->_M_capacity + 1) * sizeof(_CharT);
+ _Raw_bytes_alloc(__a).deallocate(reinterpret_cast<char*>(this), __size);
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_leak_hard()
+ {
+ if (_M_rep() == &_S_empty_rep())
+ return;
+ if (_M_rep()->_M_is_shared())
+ _M_mutate(0, 0, 0);
+ _M_rep()->_M_set_leaked();
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_mutate(size_type __pos, size_type __len1, size_type __len2)
+ {
+ const size_type __old_size = this->size();
+ const size_type __new_size = __old_size + __len2 - __len1;
+ const size_type __how_much = __old_size - __pos - __len1;
+ if (__new_size > this->capacity() || _M_rep()->_M_is_shared())
+ {
+ const allocator_type __a = get_allocator();
+ _Rep* __r = _Rep::_S_create(__new_size, this->capacity(), __a);
+ if (__pos)
+ _M_copy(__r->_M_refdata(), _M_data(), __pos);
+ if (__how_much)
+ _M_copy(__r->_M_refdata() + __pos + __len2,
+ _M_data() + __pos + __len1, __how_much);
+ _M_rep()->_M_dispose(__a);
+ _M_data(__r->_M_refdata());
+ }
+ else if (__how_much && __len1 != __len2)
+ {
+ _M_move(_M_data() + __pos + __len2,
+ _M_data() + __pos + __len1, __how_much);
+ }
+ _M_rep()->_M_set_length_and_sharable(__new_size);
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ reserve(size_type __res)
+ {
+ if (__res != this->capacity() || _M_rep()->_M_is_shared())
+ {
+ if (__res < this->size())
+ __res = this->size();
+ const allocator_type __a = get_allocator();
+ _CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size());
+ _M_rep()->_M_dispose(__a);
+ _M_data(__tmp);
+ }
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ swap(basic_string& __s)
+ {
+ if (_M_rep()->_M_is_leaked())
+ _M_rep()->_M_set_sharable();
+ if (__s._M_rep()->_M_is_leaked())
+ __s._M_rep()->_M_set_sharable();
+ if (this->get_allocator() == __s.get_allocator())
+ {
+ _CharT* __tmp = _M_data();
+ _M_data(__s._M_data());
+ __s._M_data(__tmp);
+ }
+ else
+ {
+ const basic_string __tmp1(_M_ibegin(), _M_iend(),
+ __s.get_allocator());
+ const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(),
+ this->get_allocator());
+ *this = __tmp2;
+ __s = __tmp1;
+ }
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::_Rep*
+ basic_string<_CharT, _Traits, _Alloc>::_Rep::
+ _S_create(size_type __capacity, size_type __old_capacity,
+ const _Alloc& __alloc)
+ {
+ if (__capacity > _S_max_size)
+ __throw_length_error(("basic_string::_S_create"));
+ const size_type __pagesize = 4096;
+ const size_type __malloc_header_size = 4 * sizeof(void*);
+ if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
+ __capacity = 2 * __old_capacity;
+ size_type __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
+ const size_type __adj_size = __size + __malloc_header_size;
+ if (__adj_size > __pagesize && __capacity > __old_capacity)
+ {
+ const size_type __extra = __pagesize - __adj_size % __pagesize;
+ __capacity += __extra / sizeof(_CharT);
+ if (__capacity > _S_max_size)
+ __capacity = _S_max_size;
+ __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
+ }
+ void* __place = _Raw_bytes_alloc(__alloc).allocate(__size);
+ _Rep *__p = new (__place) _Rep;
+ __p->_M_capacity = __capacity;
+ __p->_M_set_sharable();
+ return __p;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ _CharT*
+ basic_string<_CharT, _Traits, _Alloc>::_Rep::
+ _M_clone(const _Alloc& __alloc, size_type __res)
+ {
+ const size_type __requested_cap = this->_M_length + __res;
+ _Rep* __r = _Rep::_S_create(__requested_cap, this->_M_capacity,
+ __alloc);
+ if (this->_M_length)
+ _M_copy(__r->_M_refdata(), _M_refdata(), this->_M_length);
+ __r->_M_set_length_and_sharable(this->_M_length);
+ return __r->_M_refdata();
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ resize(size_type __n, _CharT __c)
+ {
+ const size_type __size = this->size();
+ _M_check_length(__size, __n, "basic_string::resize");
+ if (__size < __n)
+ this->append(__n - __size, __c);
+ else if (__n < __size)
+ this->erase(__n);
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InputIterator>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+ _InputIterator __k2, __false_type)
+ {
+ const basic_string __s(__k1, __k2);
+ const size_type __n1 = __i2 - __i1;
+ _M_check_length(__n1, __s.size(), "basic_string::_M_replace_dispatch");
+ return _M_replace_safe(__i1 - _M_ibegin(), __n1, __s._M_data(),
+ __s.size());
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+ _CharT __c)
+ {
+ _M_check_length(__n1, __n2, "basic_string::_M_replace_aux");
+ _M_mutate(__pos1, __n1, __n2);
+ if (__n2)
+ _M_assign(_M_data() + __pos1, __n2, __c);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
+ size_type __n2)
+ {
+ _M_mutate(__pos1, __n1, __n2);
+ if (__n2)
+ _M_copy(_M_data() + __pos1, __s, __n2);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>
+ operator+(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ {
+ ;
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ const __size_type __len = _Traits::length(__lhs);
+ __string_type __str;
+ __str.reserve(__len + __rhs.size());
+ __str.append(__lhs, __len);
+ __str.append(__rhs);
+ return __str;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>
+ operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ {
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ __string_type __str;
+ const __size_type __len = __rhs.size();
+ __str.reserve(__len + 1);
+ __str.append(__size_type(1), __lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ copy(_CharT* __s, size_type __n, size_type __pos) const
+ {
+ _M_check(__pos, "basic_string::copy");
+ __n = _M_limit(__pos, __n);
+ ;
+ if (__n)
+ _M_copy(__s, _M_data() + __pos, __n);
+ return __n;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ ;
+ const size_type __size = this->size();
+ const _CharT* __data = _M_data();
+ if (__n == 0)
+ return __pos <= __size ? __pos : npos;
+ if (__n <= __size)
+ {
+ for (; __pos <= __size - __n; ++__pos)
+ if (traits_type::eq(__data[__pos], __s[0])
+ && traits_type::compare(__data + __pos + 1,
+ __s + 1, __n - 1) == 0)
+ return __pos;
+ }
+ return npos;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find(_CharT __c, size_type __pos) const
+ {
+ size_type __ret = npos;
+ const size_type __size = this->size();
+ if (__pos < __size)
+ {
+ const _CharT* __data = _M_data();
+ const size_type __n = __size - __pos;
+ const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
+ if (__p)
+ __ret = __p - __data;
+ }
+ return __ret;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ ;
+ const size_type __size = this->size();
+ if (__n <= __size)
+ {
+ __pos = std::min(size_type(__size - __n), __pos);
+ const _CharT* __data = _M_data();
+ do
+ {
+ if (traits_type::compare(__data + __pos, __s, __n) == 0)
+ return __pos;
+ }
+ while (__pos-- > 0);
+ }
+ return npos;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ rfind(_CharT __c, size_type __pos) const
+ {
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ for (++__size; __size-- > 0; )
+ if (traits_type::eq(_M_data()[__size], __c))
+ return __size;
+ }
+ return npos;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ ;
+ for (; __n && __pos < this->size(); ++__pos)
+ {
+ const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
+ if (__p)
+ return __pos;
+ }
+ return npos;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ ;
+ size_type __size = this->size();
+ if (__size && __n)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (traits_type::find(__s, __n, _M_data()[__size]))
+ return __size;
+ }
+ while (__size-- != 0);
+ }
+ return npos;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ ;
+ for (; __pos < this->size(); ++__pos)
+ if (!traits_type::find(__s, __n, _M_data()[__pos]))
+ return __pos;
+ return npos;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_first_not_of(_CharT __c, size_type __pos) const
+ {
+ for (; __pos < this->size(); ++__pos)
+ if (!traits_type::eq(_M_data()[__pos], __c))
+ return __pos;
+ return npos;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ ;
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (!traits_type::find(__s, __n, _M_data()[__size]))
+ return __size;
+ }
+ while (__size--);
+ }
+ return npos;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_last_not_of(_CharT __c, size_type __pos) const
+ {
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (!traits_type::eq(_M_data()[__size], __c))
+ return __size;
+ }
+ while (__size--);
+ }
+ return npos;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string<_CharT, _Traits, _Alloc>::
+ compare(size_type __pos, size_type __n, const basic_string& __str) const
+ {
+ _M_check(__pos, "basic_string::compare");
+ __n = _M_limit(__pos, __n);
+ const size_type __osize = __str.size();
+ const size_type __len = std::min(__n, __osize);
+ int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
+ if (!__r)
+ __r = _S_compare(__n, __osize);
+ return __r;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string<_CharT, _Traits, _Alloc>::
+ compare(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2) const
+ {
+ _M_check(__pos1, "basic_string::compare");
+ __str._M_check(__pos2, "basic_string::compare");
+ __n1 = _M_limit(__pos1, __n1);
+ __n2 = __str._M_limit(__pos2, __n2);
+ const size_type __len = std::min(__n1, __n2);
+ int __r = traits_type::compare(_M_data() + __pos1,
+ __str.data() + __pos2, __len);
+ if (!__r)
+ __r = _S_compare(__n1, __n2);
+ return __r;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string<_CharT, _Traits, _Alloc>::
+ compare(const _CharT* __s) const
+ {
+ ;
+ const size_type __size = this->size();
+ const size_type __osize = traits_type::length(__s);
+ const size_type __len = std::min(__size, __osize);
+ int __r = traits_type::compare(_M_data(), __s, __len);
+ if (!__r)
+ __r = _S_compare(__size, __osize);
+ return __r;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string <_CharT, _Traits, _Alloc>::
+ compare(size_type __pos, size_type __n1, const _CharT* __s) const
+ {
+ ;
+ _M_check(__pos, "basic_string::compare");
+ __n1 = _M_limit(__pos, __n1);
+ const size_type __osize = traits_type::length(__s);
+ const size_type __len = std::min(__n1, __osize);
+ int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+ if (!__r)
+ __r = _S_compare(__n1, __osize);
+ return __r;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string <_CharT, _Traits, _Alloc>::
+ compare(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2) const
+ {
+ ;
+ _M_check(__pos, "basic_string::compare");
+ __n1 = _M_limit(__pos, __n1);
+ const size_type __len = std::min(__n1, __n2);
+ int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+ if (!__r)
+ __r = _S_compare(__n1, __n2);
+ return __r;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in,
+ basic_string<_CharT, _Traits, _Alloc>& __str)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __istream_type::ios_base __ios_base;
+ typedef typename __istream_type::int_type __int_type;
+ typedef typename __string_type::size_type __size_type;
+ typedef ctype<_CharT> __ctype_type;
+ typedef typename __ctype_type::ctype_base __ctype_base;
+ __size_type __extracted = 0;
+ typename __ios_base::iostate __err = __ios_base::goodbit;
+ typename __istream_type::sentry __cerb(__in, false);
+ if (__cerb)
+ {
+ try
+ {
+ __str.erase();
+ _CharT __buf[128];
+ __size_type __len = 0;
+ const streamsize __w = __in.width();
+ const __size_type __n = __w > 0 ? static_cast<__size_type>(__w)
+ : __str.max_size();
+ const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+ const __int_type __eof = _Traits::eof();
+ __int_type __c = __in.rdbuf()->sgetc();
+ while (__extracted < __n
+ && !_Traits::eq_int_type(__c, __eof)
+ && !__ct.is(__ctype_base::space,
+ _Traits::to_char_type(__c)))
+ {
+ if (__len == sizeof(__buf) / sizeof(_CharT))
+ {
+ __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
+ __len = 0;
+ }
+ __buf[__len++] = _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __in.rdbuf()->snextc();
+ }
+ __str.append(__buf, __len);
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= __ios_base::eofbit;
+ __in.width(0);
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ }
+ }
+ if (!__extracted)
+ __err |= __ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __in,
+ basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __istream_type::ios_base __ios_base;
+ typedef typename __istream_type::int_type __int_type;
+ typedef typename __string_type::size_type __size_type;
+ __size_type __extracted = 0;
+ const __size_type __n = __str.max_size();
+ typename __ios_base::iostate __err = __ios_base::goodbit;
+ typename __istream_type::sentry __cerb(__in, true);
+ if (__cerb)
+ {
+ try
+ {
+ __str.erase();
+ const __int_type __idelim = _Traits::to_int_type(__delim);
+ const __int_type __eof = _Traits::eof();
+ __int_type __c = __in.rdbuf()->sgetc();
+ while (__extracted < __n
+ && !_Traits::eq_int_type(__c, __eof)
+ && !_Traits::eq_int_type(__c, __idelim))
+ {
+ __str += _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __in.rdbuf()->snextc();
+ }
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= __ios_base::eofbit;
+ else if (_Traits::eq_int_type(__c, __idelim))
+ {
+ ++__extracted;
+ __in.rdbuf()->sbumpc();
+ }
+ else
+ __err |= __ios_base::failbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ }
+ }
+ if (!__extracted)
+ __err |= __ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+ extern template class basic_string<char>;
+ extern template
+ basic_istream<char>&
+ operator>>(basic_istream<char>&, string&);
+ extern template
+ basic_ostream<char>&
+ operator<<(basic_ostream<char>&, const string&);
+ extern template
+ basic_istream<char>&
+ getline(basic_istream<char>&, string&, char);
+ extern template
+ basic_istream<char>&
+ getline(basic_istream<char>&, string&);
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ class locale
+ {
+ public:
+ typedef int category;
+ class facet;
+ class id;
+ class _Impl;
+ friend class facet;
+ friend class _Impl;
+ template<typename _Facet>
+ friend bool
+ has_facet(const locale&) throw();
+ template<typename _Facet>
+ friend const _Facet&
+ use_facet(const locale&);
+ template<typename _Cache>
+ friend struct __use_cache;
+ static const category none = 0;
+ static const category ctype = 1L << 0;
+ static const category numeric = 1L << 1;
+ static const category collate = 1L << 2;
+ static const category time = 1L << 3;
+ static const category monetary = 1L << 4;
+ static const category messages = 1L << 5;
+ static const category all = (ctype | numeric | collate |
+ time | monetary | messages);
+ locale() throw();
+ locale(const locale& __other) throw();
+ explicit
+ locale(const char* __s);
+ locale(const locale& __base, const char* __s, category __cat);
+ locale(const locale& __base, const locale& __add, category __cat);
+ template<typename _Facet>
+ locale(const locale& __other, _Facet* __f);
+ ~locale() throw();
+ const locale&
+ operator=(const locale& __other) throw();
+ template<typename _Facet>
+ locale
+ combine(const locale& __other) const;
+ string
+ name() const;
+ bool
+ operator==(const locale& __other) const throw ();
+ bool
+ operator!=(const locale& __other) const throw ()
+ { return !(this->operator==(__other)); }
+ template<typename _Char, typename _Traits, typename _Alloc>
+ bool
+ operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
+ const basic_string<_Char, _Traits, _Alloc>& __s2) const;
+ static locale
+ global(const locale&);
+ static const locale&
+ classic();
+ private:
+ _Impl* _M_impl;
+ static _Impl* _S_classic;
+ static _Impl* _S_global;
+ static const char* const* const _S_categories;
+ enum { _S_categories_size = 6 + 0 };
+ static __gthread_once_t _S_once;
+ explicit
+ locale(_Impl*) throw();
+ static void
+ _S_initialize();
+ static void
+ _S_initialize_once();
+ static category
+ _S_normalize_category(category);
+ void
+ _M_coalesce(const locale& __base, const locale& __add, category __cat);
+ };
+ class locale::facet
+ {
+ private:
+ friend class locale;
+ friend class locale::_Impl;
+ mutable _Atomic_word _M_refcount;
+ static __c_locale _S_c_locale;
+ static const char _S_c_name[2];
+ static __gthread_once_t _S_once;
+ static void
+ _S_initialize_once();
+ protected:
+ explicit
+ facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)
+ { }
+ virtual
+ ~facet();
+ static void
+ _S_create_c_locale(__c_locale& __cloc, const char* __s,
+ __c_locale __old = 0);
+ static __c_locale
+ _S_clone_c_locale(__c_locale& __cloc);
+ static void
+ _S_destroy_c_locale(__c_locale& __cloc);
+ static __c_locale
+ _S_get_c_locale();
+ static const char*
+ _S_get_c_name();
+ private:
+ void
+ _M_add_reference() const throw()
+ { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+ void
+ _M_remove_reference() const throw()
+ {
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
+ {
+ try
+ { delete this; }
+ catch(...)
+ { }
+ }
+ }
+ facet(const facet&);
+ facet&
+ operator=(const facet&);
+ };
+ class locale::id
+ {
+ private:
+ friend class locale;
+ friend class locale::_Impl;
+ template<typename _Facet>
+ friend const _Facet&
+ use_facet(const locale&);
+ template<typename _Facet>
+ friend bool
+ has_facet(const locale&) throw ();
+ mutable size_t _M_index;
+ static _Atomic_word _S_refcount;
+ void
+ operator=(const id&);
+ id(const id&);
+ public:
+ id() { }
+ size_t
+ _M_id() const;
+ };
+ class locale::_Impl
+ {
+ public:
+ friend class locale;
+ friend class locale::facet;
+ template<typename _Facet>
+ friend bool
+ has_facet(const locale&) throw();
+ template<typename _Facet>
+ friend const _Facet&
+ use_facet(const locale&);
+ template<typename _Cache>
+ friend struct __use_cache;
+ private:
+ _Atomic_word _M_refcount;
+ const facet** _M_facets;
+ size_t _M_facets_size;
+ const facet** _M_caches;
+ char** _M_names;
+ static const locale::id* const _S_id_ctype[];
+ static const locale::id* const _S_id_numeric[];
+ static const locale::id* const _S_id_collate[];
+ static const locale::id* const _S_id_time[];
+ static const locale::id* const _S_id_monetary[];
+ static const locale::id* const _S_id_messages[];
+ static const locale::id* const* const _S_facet_categories[];
+ void
+ _M_add_reference() throw()
+ { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+ void
+ _M_remove_reference() throw()
+ {
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
+ {
+ try
+ { delete this; }
+ catch(...)
+ { }
+ }
+ }
+ _Impl(const _Impl&, size_t);
+ _Impl(const char*, size_t);
+ _Impl(size_t) throw();
+ ~_Impl() throw();
+ _Impl(const _Impl&);
+ void
+ operator=(const _Impl&);
+ bool
+ _M_check_same_name()
+ {
+ bool __ret = true;
+ if (_M_names[1])
+ for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i)
+ __ret = __builtin_strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
+ return __ret;
+ }
+ void
+ _M_replace_categories(const _Impl*, category);
+ void
+ _M_replace_category(const _Impl*, const locale::id* const*);
+ void
+ _M_replace_facet(const _Impl*, const locale::id*);
+ void
+ _M_install_facet(const locale::id*, const facet*);
+ template<typename _Facet>
+ void
+ _M_init_facet(_Facet* __facet)
+ { _M_install_facet(&_Facet::id, __facet); }
+ void
+ _M_install_cache(const facet*, size_t);
+ };
+ template<typename _Facet>
+ bool
+ has_facet(const locale& __loc) throw();
+ template<typename _Facet>
+ const _Facet&
+ use_facet(const locale& __loc);
+ template<typename _CharT>
+ class collate : public locale::facet
+ {
+ public:
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ protected:
+ __c_locale _M_c_locale_collate;
+ public:
+ static locale::id id;
+ explicit
+ collate(size_t __refs = 0)
+ : facet(__refs), _M_c_locale_collate(_S_get_c_locale())
+ { }
+ explicit
+ collate(__c_locale __cloc, size_t __refs = 0)
+ : facet(__refs), _M_c_locale_collate(_S_clone_c_locale(__cloc))
+ { }
+ int
+ compare(const _CharT* __lo1, const _CharT* __hi1,
+ const _CharT* __lo2, const _CharT* __hi2) const
+ { return this->do_compare(__lo1, __hi1, __lo2, __hi2); }
+ string_type
+ transform(const _CharT* __lo, const _CharT* __hi) const
+ { return this->do_transform(__lo, __hi); }
+ long
+ hash(const _CharT* __lo, const _CharT* __hi) const
+ { return this->do_hash(__lo, __hi); }
+ int
+ _M_compare(const _CharT*, const _CharT*) const;
+ size_t
+ _M_transform(_CharT*, const _CharT*, size_t) const;
+ protected:
+ virtual
+ ~collate()
+ { _S_destroy_c_locale(_M_c_locale_collate); }
+ virtual int
+ do_compare(const _CharT* __lo1, const _CharT* __hi1,
+ const _CharT* __lo2, const _CharT* __hi2) const;
+ virtual string_type
+ do_transform(const _CharT* __lo, const _CharT* __hi) const;
+ virtual long
+ do_hash(const _CharT* __lo, const _CharT* __hi) const;
+ };
+ template<typename _CharT>
+ locale::id collate<_CharT>::id;
+ template<>
+ int
+ collate<char>::_M_compare(const char*, const char*) const;
+ template<>
+ size_t
+ collate<char>::_M_transform(char*, const char*, size_t) const;
+ template<typename _CharT>
+ class collate_byname : public collate<_CharT>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ explicit
+ collate_byname(const char* __s, size_t __refs = 0)
+ : collate<_CharT>(__refs)
+ {
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
+ {
+ this->_S_destroy_c_locale(this->_M_c_locale_collate);
+ this->_S_create_c_locale(this->_M_c_locale_collate, __s);
+ }
+ }
+ protected:
+ virtual
+ ~collate_byname() { }
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Facet>
+ locale::
+ locale(const locale& __other, _Facet* __f)
+ {
+ _M_impl = new _Impl(*__other._M_impl, 1);
+ try
+ { _M_impl->_M_install_facet(&_Facet::id, __f); }
+ catch(...)
+ {
+ _M_impl->_M_remove_reference();
+ throw;
+ }
+ delete [] _M_impl->_M_names[0];
+ _M_impl->_M_names[0] = 0;
+ }
+ template<typename _Facet>
+ locale
+ locale::
+ combine(const locale& __other) const
+ {
+ _Impl* __tmp = new _Impl(*_M_impl, 1);
+ try
+ {
+ __tmp->_M_replace_facet(__other._M_impl, &_Facet::id);
+ }
+ catch(...)
+ {
+ __tmp->_M_remove_reference();
+ throw;
+ }
+ return locale(__tmp);
+ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ bool
+ locale::
+ operator()(const basic_string<_CharT, _Traits, _Alloc>& __s1,
+ const basic_string<_CharT, _Traits, _Alloc>& __s2) const
+ {
+ typedef std::collate<_CharT> __collate_type;
+ const __collate_type& __collate = use_facet<__collate_type>(*this);
+ return (__collate.compare(__s1.data(), __s1.data() + __s1.length(),
+ __s2.data(), __s2.data() + __s2.length()) < 0);
+ }
+ template<typename _Facet>
+ bool
+ has_facet(const locale& __loc) throw()
+ {
+ const size_t __i = _Facet::id._M_id();
+ const locale::facet** __facets = __loc._M_impl->_M_facets;
+ return (__i < __loc._M_impl->_M_facets_size
+ && dynamic_cast<const _Facet*>(__facets[__i]));
+ }
+ template<typename _Facet>
+ const _Facet&
+ use_facet(const locale& __loc)
+ {
+ const size_t __i = _Facet::id._M_id();
+ const locale::facet** __facets = __loc._M_impl->_M_facets;
+ if (__i >= __loc._M_impl->_M_facets_size || !__facets[__i])
+ __throw_bad_cast();
+ return dynamic_cast<const _Facet&>(*__facets[__i]);
+ }
+ template<typename _CharT>
+ int
+ collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const
+ { return 0; }
+ template<typename _CharT>
+ size_t
+ collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const
+ { return 0; }
+ template<typename _CharT>
+ int
+ collate<_CharT>::
+ do_compare(const _CharT* __lo1, const _CharT* __hi1,
+ const _CharT* __lo2, const _CharT* __hi2) const
+ {
+ const string_type __one(__lo1, __hi1);
+ const string_type __two(__lo2, __hi2);
+ const _CharT* __p = __one.c_str();
+ const _CharT* __pend = __one.data() + __one.length();
+ const _CharT* __q = __two.c_str();
+ const _CharT* __qend = __two.data() + __two.length();
+ for (;;)
+ {
+ const int __res = _M_compare(__p, __q);
+ if (__res)
+ return __res;
+ __p += char_traits<_CharT>::length(__p);
+ __q += char_traits<_CharT>::length(__q);
+ if (__p == __pend && __q == __qend)
+ return 0;
+ else if (__p == __pend)
+ return -1;
+ else if (__q == __qend)
+ return 1;
+ __p++;
+ __q++;
+ }
+ }
+ template<typename _CharT>
+ typename collate<_CharT>::string_type
+ collate<_CharT>::
+ do_transform(const _CharT* __lo, const _CharT* __hi) const
+ {
+ string_type __ret;
+ const string_type __str(__lo, __hi);
+ const _CharT* __p = __str.c_str();
+ const _CharT* __pend = __str.data() + __str.length();
+ size_t __len = (__hi - __lo) * 2;
+ _CharT* __c = new _CharT[__len];
+ try
+ {
+ for (;;)
+ {
+ size_t __res = _M_transform(__c, __p, __len);
+ if (__res >= __len)
+ {
+ __len = __res + 1;
+ delete [] __c, __c = 0;
+ __c = new _CharT[__len];
+ __res = _M_transform(__c, __p, __len);
+ }
+ __ret.append(__c, __res);
+ __p += char_traits<_CharT>::length(__p);
+ if (__p == __pend)
+ break;
+ __p++;
+ __ret.push_back(_CharT());
+ }
+ }
+ catch(...)
+ {
+ delete [] __c;
+ throw;
+ }
+ delete [] __c;
+ return __ret;
+ }
+ template<typename _CharT>
+ long
+ collate<_CharT>::
+ do_hash(const _CharT* __lo, const _CharT* __hi) const
+ {
+ unsigned long __val = 0;
+ for (; __lo < __hi; ++__lo)
+ __val =
+ *__lo + ((__val << 7)
+ | (__val >> (__gnu_cxx::__numeric_traits<unsigned long>::
+ __digits - 7)));
+ return static_cast<long>(__val);
+ }
+ extern template class collate<char>;
+ extern template class collate_byname<char>;
+ extern template
+ const collate<char>&
+ use_facet<collate<char> >(const locale&);
+ extern template
+ bool
+ has_facet<collate<char> >(const locale&);
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ enum _Ios_Fmtflags
+ {
+ _S_boolalpha = 1L << 0,
+ _S_dec = 1L << 1,
+ _S_fixed = 1L << 2,
+ _S_hex = 1L << 3,
+ _S_internal = 1L << 4,
+ _S_left = 1L << 5,
+ _S_oct = 1L << 6,
+ _S_right = 1L << 7,
+ _S_scientific = 1L << 8,
+ _S_showbase = 1L << 9,
+ _S_showpoint = 1L << 10,
+ _S_showpos = 1L << 11,
+ _S_skipws = 1L << 12,
+ _S_unitbuf = 1L << 13,
+ _S_uppercase = 1L << 14,
+ _S_adjustfield = _S_left | _S_right | _S_internal,
+ _S_basefield = _S_dec | _S_oct | _S_hex,
+ _S_floatfield = _S_scientific | _S_fixed,
+ _S_ios_fmtflags_end = 1L << 16
+ };
+ inline _Ios_Fmtflags
+ operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+ { return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
+ inline _Ios_Fmtflags
+ operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+ { return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
+ inline _Ios_Fmtflags
+ operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+ { return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+ inline _Ios_Fmtflags&
+ operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+ { return __a = __a | __b; }
+ inline _Ios_Fmtflags&
+ operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+ { return __a = __a & __b; }
+ inline _Ios_Fmtflags&
+ operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+ { return __a = __a ^ __b; }
+ inline _Ios_Fmtflags
+ operator~(_Ios_Fmtflags __a)
+ { return _Ios_Fmtflags(~static_cast<int>(__a)); }
+ enum _Ios_Openmode
+ {
+ _S_app = 1L << 0,
+ _S_ate = 1L << 1,
+ _S_bin = 1L << 2,
+ _S_in = 1L << 3,
+ _S_out = 1L << 4,
+ _S_trunc = 1L << 5,
+ _S_ios_openmode_end = 1L << 16
+ };
+ inline _Ios_Openmode
+ operator&(_Ios_Openmode __a, _Ios_Openmode __b)
+ { return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
+ inline _Ios_Openmode
+ operator|(_Ios_Openmode __a, _Ios_Openmode __b)
+ { return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
+ inline _Ios_Openmode
+ operator^(_Ios_Openmode __a, _Ios_Openmode __b)
+ { return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+ inline _Ios_Openmode&
+ operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
+ { return __a = __a | __b; }
+ inline _Ios_Openmode&
+ operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
+ { return __a = __a & __b; }
+ inline _Ios_Openmode&
+ operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
+ { return __a = __a ^ __b; }
+ inline _Ios_Openmode
+ operator~(_Ios_Openmode __a)
+ { return _Ios_Openmode(~static_cast<int>(__a)); }
+ enum _Ios_Iostate
+ {
+ _S_goodbit = 0,
+ _S_badbit = 1L << 0,
+ _S_eofbit = 1L << 1,
+ _S_failbit = 1L << 2,
+ _S_ios_iostate_end = 1L << 16
+ };
+ inline _Ios_Iostate
+ operator&(_Ios_Iostate __a, _Ios_Iostate __b)
+ { return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
+ inline _Ios_Iostate
+ operator|(_Ios_Iostate __a, _Ios_Iostate __b)
+ { return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
+ inline _Ios_Iostate
+ operator^(_Ios_Iostate __a, _Ios_Iostate __b)
+ { return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+ inline _Ios_Iostate&
+ operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
+ { return __a = __a | __b; }
+ inline _Ios_Iostate&
+ operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
+ { return __a = __a & __b; }
+ inline _Ios_Iostate&
+ operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
+ { return __a = __a ^ __b; }
+ inline _Ios_Iostate
+ operator~(_Ios_Iostate __a)
+ { return _Ios_Iostate(~static_cast<int>(__a)); }
+ enum _Ios_Seekdir
+ {
+ _S_beg = 0,
+ _S_cur = 1,
+ _S_end = 2,
+ _S_ios_seekdir_end = 1L << 16
+ };
+ class ios_base
+ {
+ public:
+ class failure : public exception
+ {
+ public:
+ explicit
+ failure(const string& __str) throw();
+ virtual
+ ~failure() throw();
+ virtual const char*
+ what() const throw();
+ private:
+ string _M_msg;
+ };
+ typedef _Ios_Fmtflags fmtflags;
+ static const fmtflags boolalpha = _S_boolalpha;
+ static const fmtflags dec = _S_dec;
+ static const fmtflags fixed = _S_fixed;
+ static const fmtflags hex = _S_hex;
+ static const fmtflags internal = _S_internal;
+ static const fmtflags left = _S_left;
+ static const fmtflags oct = _S_oct;
+ static const fmtflags right = _S_right;
+ static const fmtflags scientific = _S_scientific;
+ static const fmtflags showbase = _S_showbase;
+ static const fmtflags showpoint = _S_showpoint;
+ static const fmtflags showpos = _S_showpos;
+ static const fmtflags skipws = _S_skipws;
+ static const fmtflags unitbuf = _S_unitbuf;
+ static const fmtflags uppercase = _S_uppercase;
+ static const fmtflags adjustfield = _S_adjustfield;
+ static const fmtflags basefield = _S_basefield;
+ static const fmtflags floatfield = _S_floatfield;
+ typedef _Ios_Iostate iostate;
+ static const iostate badbit = _S_badbit;
+ static const iostate eofbit = _S_eofbit;
+ static const iostate failbit = _S_failbit;
+ static const iostate goodbit = _S_goodbit;
+ typedef _Ios_Openmode openmode;
+ static const openmode app = _S_app;
+ static const openmode ate = _S_ate;
+ static const openmode binary = _S_bin;
+ static const openmode in = _S_in;
+ static const openmode out = _S_out;
+ static const openmode trunc = _S_trunc;
+ typedef _Ios_Seekdir seekdir;
+ static const seekdir beg = _S_beg;
+ static const seekdir cur = _S_cur;
+ static const seekdir end = _S_end;
+ typedef int io_state;
+ typedef int open_mode;
+ typedef int seek_dir;
+ typedef std::streampos streampos;
+ typedef std::streamoff streamoff;
+ enum event
+ {
+ erase_event,
+ imbue_event,
+ copyfmt_event
+ };
+ typedef void (*event_callback) (event, ios_base&, int);
+ void
+ register_callback(event_callback __fn, int __index);
+ protected:
+ streamsize _M_precision;
+ streamsize _M_width;
+ fmtflags _M_flags;
+ iostate _M_exception;
+ iostate _M_streambuf_state;
+ struct _Callback_list
+ {
+ _Callback_list* _M_next;
+ ios_base::event_callback _M_fn;
+ int _M_index;
+ _Atomic_word _M_refcount;
+ _Callback_list(ios_base::event_callback __fn, int __index,
+ _Callback_list* __cb)
+ : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
+ void
+ _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+ int
+ _M_remove_reference()
+ { return __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1); }
+ };
+ _Callback_list* _M_callbacks;
+ void
+ _M_call_callbacks(event __ev) throw();
+ void
+ _M_dispose_callbacks(void);
+ struct _Words
+ {
+ void* _M_pword;
+ long _M_iword;
+ _Words() : _M_pword(0), _M_iword(0) { }
+ };
+ _Words _M_word_zero;
+ enum { _S_local_word_size = 8 };
+ _Words _M_local_word[_S_local_word_size];
+ int _M_word_size;
+ _Words* _M_word;
+ _Words&
+ _M_grow_words(int __index, bool __iword);
+ locale _M_ios_locale;
+ void
+ _M_init();
+ public:
+ class Init
+ {
+ friend class ios_base;
+ public:
+ Init();
+ ~Init();
+ private:
+ static _Atomic_word _S_refcount;
+ static bool _S_synced_with_stdio;
+ };
+ fmtflags
+ flags() const
+ { return _M_flags; }
+ fmtflags
+ flags(fmtflags __fmtfl)
+ {
+ fmtflags __old = _M_flags;
+ _M_flags = __fmtfl;
+ return __old;
+ }
+ fmtflags
+ setf(fmtflags __fmtfl)
+ {
+ fmtflags __old = _M_flags;
+ _M_flags |= __fmtfl;
+ return __old;
+ }
+ fmtflags
+ setf(fmtflags __fmtfl, fmtflags __mask)
+ {
+ fmtflags __old = _M_flags;
+ _M_flags &= ~__mask;
+ _M_flags |= (__fmtfl & __mask);
+ return __old;
+ }
+ void
+ unsetf(fmtflags __mask)
+ { _M_flags &= ~__mask; }
+ streamsize
+ precision() const
+ { return _M_precision; }
+ streamsize
+ precision(streamsize __prec)
+ {
+ streamsize __old = _M_precision;
+ _M_precision = __prec;
+ return __old;
+ }
+ streamsize
+ width() const
+ { return _M_width; }
+ streamsize
+ width(streamsize __wide)
+ {
+ streamsize __old = _M_width;
+ _M_width = __wide;
+ return __old;
+ }
+ static bool
+ sync_with_stdio(bool __sync = true);
+ locale
+ imbue(const locale& __loc);
+ locale
+ getloc() const
+ { return _M_ios_locale; }
+ const locale&
+ _M_getloc() const
+ { return _M_ios_locale; }
+ static int
+ xalloc() throw();
+ long&
+ iword(int __ix)
+ {
+ _Words& __word = (__ix < _M_word_size)
+ ? _M_word[__ix] : _M_grow_words(__ix, true);
+ return __word._M_iword;
+ }
+ void*&
+ pword(int __ix)
+ {
+ _Words& __word = (__ix < _M_word_size)
+ ? _M_word[__ix] : _M_grow_words(__ix, false);
+ return __word._M_pword;
+ }
+ virtual ~ios_base();
+ protected:
+ ios_base();
+ private:
+ ios_base(const ios_base&);
+ ios_base&
+ operator=(const ios_base&);
+ };
+ inline ios_base&
+ boolalpha(ios_base& __base)
+ {
+ __base.setf(ios_base::boolalpha);
+ return __base;
+ }
+ inline ios_base&
+ noboolalpha(ios_base& __base)
+ {
+ __base.unsetf(ios_base::boolalpha);
+ return __base;
+ }
+ inline ios_base&
+ showbase(ios_base& __base)
+ {
+ __base.setf(ios_base::showbase);
+ return __base;
+ }
+ inline ios_base&
+ noshowbase(ios_base& __base)
+ {
+ __base.unsetf(ios_base::showbase);
+ return __base;
+ }
+ inline ios_base&
+ showpoint(ios_base& __base)
+ {
+ __base.setf(ios_base::showpoint);
+ return __base;
+ }
+ inline ios_base&
+ noshowpoint(ios_base& __base)
+ {
+ __base.unsetf(ios_base::showpoint);
+ return __base;
+ }
+ inline ios_base&
+ showpos(ios_base& __base)
+ {
+ __base.setf(ios_base::showpos);
+ return __base;
+ }
+ inline ios_base&
+ noshowpos(ios_base& __base)
+ {
+ __base.unsetf(ios_base::showpos);
+ return __base;
+ }
+ inline ios_base&
+ skipws(ios_base& __base)
+ {
+ __base.setf(ios_base::skipws);
+ return __base;
+ }
+ inline ios_base&
+ noskipws(ios_base& __base)
+ {
+ __base.unsetf(ios_base::skipws);
+ return __base;
+ }
+ inline ios_base&
+ uppercase(ios_base& __base)
+ {
+ __base.setf(ios_base::uppercase);
+ return __base;
+ }
+ inline ios_base&
+ nouppercase(ios_base& __base)
+ {
+ __base.unsetf(ios_base::uppercase);
+ return __base;
+ }
+ inline ios_base&
+ unitbuf(ios_base& __base)
+ {
+ __base.setf(ios_base::unitbuf);
+ return __base;
+ }
+ inline ios_base&
+ nounitbuf(ios_base& __base)
+ {
+ __base.unsetf(ios_base::unitbuf);
+ return __base;
+ }
+ inline ios_base&
+ internal(ios_base& __base)
+ {
+ __base.setf(ios_base::internal, ios_base::adjustfield);
+ return __base;
+ }
+ inline ios_base&
+ left(ios_base& __base)
+ {
+ __base.setf(ios_base::left, ios_base::adjustfield);
+ return __base;
+ }
+ inline ios_base&
+ right(ios_base& __base)
+ {
+ __base.setf(ios_base::right, ios_base::adjustfield);
+ return __base;
+ }
+ inline ios_base&
+ dec(ios_base& __base)
+ {
+ __base.setf(ios_base::dec, ios_base::basefield);
+ return __base;
+ }
+ inline ios_base&
+ hex(ios_base& __base)
+ {
+ __base.setf(ios_base::hex, ios_base::basefield);
+ return __base;
+ }
+ inline ios_base&
+ oct(ios_base& __base)
+ {
+ __base.setf(ios_base::oct, ios_base::basefield);
+ return __base;
+ }
+ inline ios_base&
+ fixed(ios_base& __base)
+ {
+ __base.setf(ios_base::fixed, ios_base::floatfield);
+ return __base;
+ }
+ inline ios_base&
+ scientific(ios_base& __base)
+ {
+ __base.setf(ios_base::scientific, ios_base::floatfield);
+ return __base;
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits>
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*,
+ basic_streambuf<_CharT, _Traits>*, bool&);
+ template<typename _CharT, typename _Traits>
+ class basic_streambuf
+ {
+ public:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+ typedef basic_streambuf<char_type, traits_type> __streambuf_type;
+ friend class basic_ios<char_type, traits_type>;
+ friend class basic_istream<char_type, traits_type>;
+ friend class basic_ostream<char_type, traits_type>;
+ friend class istreambuf_iterator<char_type, traits_type>;
+ friend class ostreambuf_iterator<char_type, traits_type>;
+ friend streamsize
+ __copy_streambufs_eof<>(__streambuf_type*, __streambuf_type*, bool&);
+ template<bool _IsMove, typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ _CharT2*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT2>,
+ istreambuf_iterator<_CharT2>, _CharT2*);
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ istreambuf_iterator<_CharT2> >::__type
+ find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ const _CharT2&);
+ template<typename _CharT2, typename _Traits2>
+ friend basic_istream<_CharT2, _Traits2>&
+ operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2*);
+ template<typename _CharT2, typename _Traits2, typename _Alloc>
+ friend basic_istream<_CharT2, _Traits2>&
+ operator>>(basic_istream<_CharT2, _Traits2>&,
+ basic_string<_CharT2, _Traits2, _Alloc>&);
+ template<typename _CharT2, typename _Traits2, typename _Alloc>
+ friend basic_istream<_CharT2, _Traits2>&
+ getline(basic_istream<_CharT2, _Traits2>&,
+ basic_string<_CharT2, _Traits2, _Alloc>&, _CharT2);
+ protected:
+ char_type* _M_in_beg;
+ char_type* _M_in_cur;
+ char_type* _M_in_end;
+ char_type* _M_out_beg;
+ char_type* _M_out_cur;
+ char_type* _M_out_end;
+ locale _M_buf_locale;
+ public:
+ virtual
+ ~basic_streambuf()
+ { }
+ locale
+ pubimbue(const locale &__loc)
+ {
+ locale __tmp(this->getloc());
+ this->imbue(__loc);
+ _M_buf_locale = __loc;
+ return __tmp;
+ }
+ locale
+ getloc() const
+ { return _M_buf_locale; }
+ __streambuf_type*
+ pubsetbuf(char_type* __s, streamsize __n)
+ { return this->setbuf(__s, __n); }
+ pos_type
+ pubseekoff(off_type __off, ios_base::seekdir __way,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ { return this->seekoff(__off, __way, __mode); }
+ pos_type
+ pubseekpos(pos_type __sp,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ { return this->seekpos(__sp, __mode); }
+ int
+ pubsync() { return this->sync(); }
+ streamsize
+ in_avail()
+ {
+ const streamsize __ret = this->egptr() - this->gptr();
+ return __ret ? __ret : this->showmanyc();
+ }
+ int_type
+ snextc()
+ {
+ int_type __ret = traits_type::eof();
+ if (__builtin_expect(!traits_type::eq_int_type(this->sbumpc(),
+ __ret), true))
+ __ret = this->sgetc();
+ return __ret;
+ }
+ int_type
+ sbumpc()
+ {
+ int_type __ret;
+ if (__builtin_expect(this->gptr() < this->egptr(), true))
+ {
+ __ret = traits_type::to_int_type(*this->gptr());
+ this->gbump(1);
+ }
+ else
+ __ret = this->uflow();
+ return __ret;
+ }
+ int_type
+ sgetc()
+ {
+ int_type __ret;
+ if (__builtin_expect(this->gptr() < this->egptr(), true))
+ __ret = traits_type::to_int_type(*this->gptr());
+ else
+ __ret = this->underflow();
+ return __ret;
+ }
+ streamsize
+ sgetn(char_type* __s, streamsize __n)
+ { return this->xsgetn(__s, __n); }
+ int_type
+ sputbackc(char_type __c)
+ {
+ int_type __ret;
+ const bool __testpos = this->eback() < this->gptr();
+ if (__builtin_expect(!__testpos ||
+ !traits_type::eq(__c, this->gptr()[-1]), false))
+ __ret = this->pbackfail(traits_type::to_int_type(__c));
+ else
+ {
+ this->gbump(-1);
+ __ret = traits_type::to_int_type(*this->gptr());
+ }
+ return __ret;
+ }
+ int_type
+ sungetc()
+ {
+ int_type __ret;
+ if (__builtin_expect(this->eback() < this->gptr(), true))
+ {
+ this->gbump(-1);
+ __ret = traits_type::to_int_type(*this->gptr());
+ }
+ else
+ __ret = this->pbackfail();
+ return __ret;
+ }
+ int_type
+ sputc(char_type __c)
+ {
+ int_type __ret;
+ if (__builtin_expect(this->pptr() < this->epptr(), true))
+ {
+ *this->pptr() = __c;
+ this->pbump(1);
+ __ret = traits_type::to_int_type(__c);
+ }
+ else
+ __ret = this->overflow(traits_type::to_int_type(__c));
+ return __ret;
+ }
+ streamsize
+ sputn(const char_type* __s, streamsize __n)
+ { return this->xsputn(__s, __n); }
+ protected:
+ basic_streambuf()
+ : _M_in_beg(0), _M_in_cur(0), _M_in_end(0),
+ _M_out_beg(0), _M_out_cur(0), _M_out_end(0),
+ _M_buf_locale(locale())
+ { }
+ char_type*
+ eback() const { return _M_in_beg; }
+ char_type*
+ gptr() const { return _M_in_cur; }
+ char_type*
+ egptr() const { return _M_in_end; }
+ void
+ gbump(int __n) { _M_in_cur += __n; }
+ void
+ setg(char_type* __gbeg, char_type* __gnext, char_type* __gend)
+ {
+ _M_in_beg = __gbeg;
+ _M_in_cur = __gnext;
+ _M_in_end = __gend;
+ }
+ char_type*
+ pbase() const { return _M_out_beg; }
+ char_type*
+ pptr() const { return _M_out_cur; }
+ char_type*
+ epptr() const { return _M_out_end; }
+ void
+ pbump(int __n) { _M_out_cur += __n; }
+ void
+ setp(char_type* __pbeg, char_type* __pend)
+ {
+ _M_out_beg = _M_out_cur = __pbeg;
+ _M_out_end = __pend;
+ }
+ virtual void
+ imbue(const locale&)
+ { }
+ virtual basic_streambuf<char_type,_Traits>*
+ setbuf(char_type*, streamsize)
+ { return this; }
+ virtual pos_type
+ seekoff(off_type, ios_base::seekdir,
+ ios_base::openmode = ios_base::in | ios_base::out)
+ { return pos_type(off_type(-1)); }
+ virtual pos_type
+ seekpos(pos_type,
+ ios_base::openmode = ios_base::in | ios_base::out)
+ { return pos_type(off_type(-1)); }
+ virtual int
+ sync() { return 0; }
+ virtual streamsize
+ showmanyc() { return 0; }
+ virtual streamsize
+ xsgetn(char_type* __s, streamsize __n);
+ virtual int_type
+ underflow()
+ { return traits_type::eof(); }
+ virtual int_type
+ uflow()
+ {
+ int_type __ret = traits_type::eof();
+ const bool __testeof = traits_type::eq_int_type(this->underflow(),
+ __ret);
+ if (!__testeof)
+ {
+ __ret = traits_type::to_int_type(*this->gptr());
+ this->gbump(1);
+ }
+ return __ret;
+ }
+ virtual int_type
+ pbackfail(int_type = traits_type::eof())
+ { return traits_type::eof(); }
+ virtual streamsize
+ xsputn(const char_type* __s, streamsize __n);
+ virtual int_type
+ overflow(int_type = traits_type::eof())
+ { return traits_type::eof(); }
+ public:
+ void
+ stossc()
+ {
+ if (this->gptr() < this->egptr())
+ this->gbump(1);
+ else
+ this->uflow();
+ }
+ private:
+ basic_streambuf(const __streambuf_type& __sb)
+ : _M_in_beg(__sb._M_in_beg), _M_in_cur(__sb._M_in_cur),
+ _M_in_end(__sb._M_in_end), _M_out_beg(__sb._M_out_beg),
+ _M_out_cur(__sb._M_out_cur), _M_out_end(__sb._M_out_cur),
+ _M_buf_locale(__sb._M_buf_locale)
+ { }
+ __streambuf_type&
+ operator=(const __streambuf_type&) { return *this; };
+ };
+ template<>
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<char>* __sbin,
+ basic_streambuf<char>* __sbout, bool& __ineof);
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_streambuf<_CharT, _Traits>::
+ xsgetn(char_type* __s, streamsize __n)
+ {
+ streamsize __ret = 0;
+ while (__ret < __n)
+ {
+ const streamsize __buf_len = this->egptr() - this->gptr();
+ if (__buf_len)
+ {
+ const streamsize __remaining = __n - __ret;
+ const streamsize __len = std::min(__buf_len, __remaining);
+ traits_type::copy(__s, this->gptr(), __len);
+ __ret += __len;
+ __s += __len;
+ this->gbump(__len);
+ }
+ if (__ret < __n)
+ {
+ const int_type __c = this->uflow();
+ if (!traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ traits_type::assign(*__s++, traits_type::to_char_type(__c));
+ ++__ret;
+ }
+ else
+ break;
+ }
+ }
+ return __ret;
+ }
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_streambuf<_CharT, _Traits>::
+ xsputn(const char_type* __s, streamsize __n)
+ {
+ streamsize __ret = 0;
+ while (__ret < __n)
+ {
+ const streamsize __buf_len = this->epptr() - this->pptr();
+ if (__buf_len)
+ {
+ const streamsize __remaining = __n - __ret;
+ const streamsize __len = std::min(__buf_len, __remaining);
+ traits_type::copy(this->pptr(), __s, __len);
+ __ret += __len;
+ __s += __len;
+ this->pbump(__len);
+ }
+ if (__ret < __n)
+ {
+ int_type __c = this->overflow(traits_type::to_int_type(*__s));
+ if (!traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ ++__ret;
+ ++__s;
+ }
+ else
+ break;
+ }
+ }
+ return __ret;
+ }
+ template<typename _CharT, typename _Traits>
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>* __sbin,
+ basic_streambuf<_CharT, _Traits>* __sbout,
+ bool& __ineof)
+ {
+ streamsize __ret = 0;
+ __ineof = true;
+ typename _Traits::int_type __c = __sbin->sgetc();
+ while (!_Traits::eq_int_type(__c, _Traits::eof()))
+ {
+ __c = __sbout->sputc(_Traits::to_char_type(__c));
+ if (_Traits::eq_int_type(__c, _Traits::eof()))
+ {
+ __ineof = false;
+ break;
+ }
+ ++__ret;
+ __c = __sbin->snextc();
+ }
+ return __ret;
+ }
+ template<typename _CharT, typename _Traits>
+ inline streamsize
+ __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
+ basic_streambuf<_CharT, _Traits>* __sbout)
+ {
+ bool __ineof;
+ return __copy_streambufs_eof(__sbin, __sbout, __ineof);
+ }
+ extern template class basic_streambuf<char>;
+ extern template
+ streamsize
+ __copy_streambufs(basic_streambuf<char>*,
+ basic_streambuf<char>*);
+ extern template
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<char>*,
+ basic_streambuf<char>*, bool&);
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ struct ctype_base
+ {
+ typedef const __ctype_touplow_t* __to_type;
+ typedef __ctype_mask_t mask;
+ static const mask upper = _ISupper;
+ static const mask lower = _ISlower;
+ static const mask alpha = _ISalpha;
+ static const mask digit = _ISdigit;
+ static const mask xdigit = _ISxdigit;
+ static const mask space = _ISspace;
+ static const mask print = _ISprint;
+ static const mask graph = _ISalpha | _ISdigit | _ISpunct;
+ static const mask cntrl = _IScntrl;
+ static const mask punct = _ISpunct;
+ static const mask alnum = _ISalpha | _ISdigit;
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits>
+ class istreambuf_iterator
+ : public iterator<input_iterator_tag, _CharT, typename _Traits::off_type,
+ _CharT*, _CharT&>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename _Traits::int_type int_type;
+ typedef basic_streambuf<_CharT, _Traits> streambuf_type;
+ typedef basic_istream<_CharT, _Traits> istream_type;
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ ostreambuf_iterator<_CharT2> >::__type
+ copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ ostreambuf_iterator<_CharT2>);
+ template<bool _IsMove, typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ _CharT2*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT2>,
+ istreambuf_iterator<_CharT2>, _CharT2*);
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ istreambuf_iterator<_CharT2> >::__type
+ find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ const _CharT2&);
+ private:
+ mutable streambuf_type* _M_sbuf;
+ mutable int_type _M_c;
+ public:
+ istreambuf_iterator() throw()
+ : _M_sbuf(0), _M_c(traits_type::eof()) { }
+ istreambuf_iterator(istream_type& __s) throw()
+ : _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { }
+ istreambuf_iterator(streambuf_type* __s) throw()
+ : _M_sbuf(__s), _M_c(traits_type::eof()) { }
+ char_type
+ operator*() const
+ {
+ return traits_type::to_char_type(_M_get());
+ }
+ istreambuf_iterator&
+ operator++()
+ {
+ ;
+ if (_M_sbuf)
+ {
+ _M_sbuf->sbumpc();
+ _M_c = traits_type::eof();
+ }
+ return *this;
+ }
+ istreambuf_iterator
+ operator++(int)
+ {
+ ;
+ istreambuf_iterator __old = *this;
+ if (_M_sbuf)
+ {
+ __old._M_c = _M_sbuf->sbumpc();
+ _M_c = traits_type::eof();
+ }
+ return __old;
+ }
+ bool
+ equal(const istreambuf_iterator& __b) const
+ { return _M_at_eof() == __b._M_at_eof(); }
+ private:
+ int_type
+ _M_get() const
+ {
+ const int_type __eof = traits_type::eof();
+ int_type __ret = __eof;
+ if (_M_sbuf)
+ {
+ if (!traits_type::eq_int_type(_M_c, __eof))
+ __ret = _M_c;
+ else if (!traits_type::eq_int_type((__ret = _M_sbuf->sgetc()),
+ __eof))
+ _M_c = __ret;
+ else
+ _M_sbuf = 0;
+ }
+ return __ret;
+ }
+ bool
+ _M_at_eof() const
+ {
+ const int_type __eof = traits_type::eof();
+ return traits_type::eq_int_type(_M_get(), __eof);
+ }
+ };
+ template<typename _CharT, typename _Traits>
+ inline bool
+ operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
+ const istreambuf_iterator<_CharT, _Traits>& __b)
+ { return __a.equal(__b); }
+ template<typename _CharT, typename _Traits>
+ inline bool
+ operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
+ const istreambuf_iterator<_CharT, _Traits>& __b)
+ { return !__a.equal(__b); }
+ template<typename _CharT, typename _Traits>
+ class ostreambuf_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_streambuf<_CharT, _Traits> streambuf_type;
+ typedef basic_ostream<_CharT, _Traits> ostream_type;
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ ostreambuf_iterator<_CharT2> >::__type
+ copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ ostreambuf_iterator<_CharT2>);
+ private:
+ streambuf_type* _M_sbuf;
+ bool _M_failed;
+ public:
+ ostreambuf_iterator(ostream_type& __s) throw ()
+ : _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { }
+ ostreambuf_iterator(streambuf_type* __s) throw ()
+ : _M_sbuf(__s), _M_failed(!_M_sbuf) { }
+ ostreambuf_iterator&
+ operator=(_CharT __c)
+ {
+ if (!_M_failed &&
+ _Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof()))
+ _M_failed = true;
+ return *this;
+ }
+ ostreambuf_iterator&
+ operator*()
+ { return *this; }
+ ostreambuf_iterator&
+ operator++(int)
+ { return *this; }
+ ostreambuf_iterator&
+ operator++()
+ { return *this; }
+ bool
+ failed() const throw()
+ { return _M_failed; }
+ ostreambuf_iterator&
+ _M_put(const _CharT* __ws, streamsize __len)
+ {
+ if (__builtin_expect(!_M_failed, true)
+ && __builtin_expect(this->_M_sbuf->sputn(__ws, __len) != __len,
+ false))
+ _M_failed = true;
+ return *this;
+ }
+ };
+ template<typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT> >::__type
+ copy(istreambuf_iterator<_CharT> __first,
+ istreambuf_iterator<_CharT> __last,
+ ostreambuf_iterator<_CharT> __result)
+ {
+ if (__first._M_sbuf && !__last._M_sbuf && !__result._M_failed)
+ {
+ bool __ineof;
+ __copy_streambufs_eof(__first._M_sbuf, __result._M_sbuf, __ineof);
+ if (!__ineof)
+ __result._M_failed = true;
+ }
+ return __result;
+ }
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT> >::__type
+ __copy_move_a2(_CharT* __first, _CharT* __last,
+ ostreambuf_iterator<_CharT> __result)
+ {
+ const streamsize __num = __last - __first;
+ if (__num > 0)
+ __result._M_put(__first, __num);
+ return __result;
+ }
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT> >::__type
+ __copy_move_a2(const _CharT* __first, const _CharT* __last,
+ ostreambuf_iterator<_CharT> __result)
+ {
+ const streamsize __num = __last - __first;
+ if (__num > 0)
+ __result._M_put(__first, __num);
+ return __result;
+ }
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ _CharT*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT> __first,
+ istreambuf_iterator<_CharT> __last, _CharT* __result)
+ {
+ typedef istreambuf_iterator<_CharT> __is_iterator_type;
+ typedef typename __is_iterator_type::traits_type traits_type;
+ typedef typename __is_iterator_type::streambuf_type streambuf_type;
+ typedef typename traits_type::int_type int_type;
+ if (__first._M_sbuf && !__last._M_sbuf)
+ {
+ streambuf_type* __sb = __first._M_sbuf;
+ int_type __c = __sb->sgetc();
+ while (!traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ const streamsize __n = __sb->egptr() - __sb->gptr();
+ if (__n > 1)
+ {
+ traits_type::copy(__result, __sb->gptr(), __n);
+ __sb->gbump(__n);
+ __result += __n;
+ __c = __sb->underflow();
+ }
+ else
+ {
+ *__result++ = traits_type::to_char_type(__c);
+ __c = __sb->snextc();
+ }
+ }
+ }
+ return __result;
+ }
+ template<typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ istreambuf_iterator<_CharT> >::__type
+ find(istreambuf_iterator<_CharT> __first,
+ istreambuf_iterator<_CharT> __last, const _CharT& __val)
+ {
+ typedef istreambuf_iterator<_CharT> __is_iterator_type;
+ typedef typename __is_iterator_type::traits_type traits_type;
+ typedef typename __is_iterator_type::streambuf_type streambuf_type;
+ typedef typename traits_type::int_type int_type;
+ if (__first._M_sbuf && !__last._M_sbuf)
+ {
+ const int_type __ival = traits_type::to_int_type(__val);
+ streambuf_type* __sb = __first._M_sbuf;
+ int_type __c = __sb->sgetc();
+ while (!traits_type::eq_int_type(__c, traits_type::eof())
+ && !traits_type::eq_int_type(__c, __ival))
+ {
+ streamsize __n = __sb->egptr() - __sb->gptr();
+ if (__n > 1)
+ {
+ const _CharT* __p = traits_type::find(__sb->gptr(),
+ __n, __val);
+ if (__p)
+ __n = __p - __sb->gptr();
+ __sb->gbump(__n);
+ __c = __sb->sgetc();
+ }
+ else
+ __c = __sb->snextc();
+ }
+ if (!traits_type::eq_int_type(__c, traits_type::eof()))
+ __first._M_c = __c;
+ else
+ __first._M_sbuf = 0;
+ }
+ return __first;
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Tv>
+ void
+ __convert_to_v(const char* __in, _Tv& __out, ios_base::iostate& __err,
+ const __c_locale& __cloc);
+ template<>
+ void
+ __convert_to_v(const char*, float&, ios_base::iostate&,
+ const __c_locale&);
+ template<>
+ void
+ __convert_to_v(const char*, double&, ios_base::iostate&,
+ const __c_locale&);
+ template<>
+ void
+ __convert_to_v(const char*, long double&, ios_base::iostate&,
+ const __c_locale&);
+ template<typename _CharT, typename _Traits>
+ struct __pad
+ {
+ static void
+ _S_pad(ios_base& __io, _CharT __fill, _CharT* __news,
+ const _CharT* __olds, const streamsize __newlen,
+ const streamsize __oldlen);
+ };
+ template<typename _CharT>
+ _CharT*
+ __add_grouping(_CharT* __s, _CharT __sep,
+ const char* __gbeg, size_t __gsize,
+ const _CharT* __first, const _CharT* __last);
+ template<typename _CharT>
+ inline
+ ostreambuf_iterator<_CharT>
+ __write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len)
+ {
+ __s._M_put(__ws, __len);
+ return __s;
+ }
+ template<typename _CharT, typename _OutIter>
+ inline
+ _OutIter
+ __write(_OutIter __s, const _CharT* __ws, int __len)
+ {
+ for (int __j = 0; __j < __len; __j++, ++__s)
+ *__s = __ws[__j];
+ return __s;
+ }
+ template<typename _CharT>
+ class __ctype_abstract_base : public locale::facet, public ctype_base
+ {
+ public:
+ typedef _CharT char_type;
+ bool
+ is(mask __m, char_type __c) const
+ { return this->do_is(__m, __c); }
+ const char_type*
+ is(const char_type *__lo, const char_type *__hi, mask *__vec) const
+ { return this->do_is(__lo, __hi, __vec); }
+ const char_type*
+ scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
+ { return this->do_scan_is(__m, __lo, __hi); }
+ const char_type*
+ scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
+ { return this->do_scan_not(__m, __lo, __hi); }
+ char_type
+ toupper(char_type __c) const
+ { return this->do_toupper(__c); }
+ const char_type*
+ toupper(char_type *__lo, const char_type* __hi) const
+ { return this->do_toupper(__lo, __hi); }
+ char_type
+ tolower(char_type __c) const
+ { return this->do_tolower(__c); }
+ const char_type*
+ tolower(char_type* __lo, const char_type* __hi) const
+ { return this->do_tolower(__lo, __hi); }
+ char_type
+ widen(char __c) const
+ { return this->do_widen(__c); }
+ const char*
+ widen(const char* __lo, const char* __hi, char_type* __to) const
+ { return this->do_widen(__lo, __hi, __to); }
+ char
+ narrow(char_type __c, char __dfault) const
+ { return this->do_narrow(__c, __dfault); }
+ const char_type*
+ narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char *__to) const
+ { return this->do_narrow(__lo, __hi, __dfault, __to); }
+ protected:
+ explicit
+ __ctype_abstract_base(size_t __refs = 0): facet(__refs) { }
+ virtual
+ ~__ctype_abstract_base() { }
+ virtual bool
+ do_is(mask __m, char_type __c) const = 0;
+ virtual const char_type*
+ do_is(const char_type* __lo, const char_type* __hi,
+ mask* __vec) const = 0;
+ virtual const char_type*
+ do_scan_is(mask __m, const char_type* __lo,
+ const char_type* __hi) const = 0;
+ virtual const char_type*
+ do_scan_not(mask __m, const char_type* __lo,
+ const char_type* __hi) const = 0;
+ virtual char_type
+ do_toupper(char_type) const = 0;
+ virtual const char_type*
+ do_toupper(char_type* __lo, const char_type* __hi) const = 0;
+ virtual char_type
+ do_tolower(char_type) const = 0;
+ virtual const char_type*
+ do_tolower(char_type* __lo, const char_type* __hi) const = 0;
+ virtual char_type
+ do_widen(char) const = 0;
+ virtual const char*
+ do_widen(const char* __lo, const char* __hi,
+ char_type* __dest) const = 0;
+ virtual char
+ do_narrow(char_type, char __dfault) const = 0;
+ virtual const char_type*
+ do_narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char* __dest) const = 0;
+ };
+ template<typename _CharT>
+ class ctype : public __ctype_abstract_base<_CharT>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef typename __ctype_abstract_base<_CharT>::mask mask;
+ static locale::id id;
+ explicit
+ ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { }
+ protected:
+ virtual
+ ~ctype();
+ virtual bool
+ do_is(mask __m, char_type __c) const;
+ virtual const char_type*
+ do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
+ virtual const char_type*
+ do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
+ virtual const char_type*
+ do_scan_not(mask __m, const char_type* __lo,
+ const char_type* __hi) const;
+ virtual char_type
+ do_toupper(char_type __c) const;
+ virtual const char_type*
+ do_toupper(char_type* __lo, const char_type* __hi) const;
+ virtual char_type
+ do_tolower(char_type __c) const;
+ virtual const char_type*
+ do_tolower(char_type* __lo, const char_type* __hi) const;
+ virtual char_type
+ do_widen(char __c) const;
+ virtual const char*
+ do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
+ virtual char
+ do_narrow(char_type, char __dfault) const;
+ virtual const char_type*
+ do_narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char* __dest) const;
+ };
+ template<typename _CharT>
+ locale::id ctype<_CharT>::id;
+ template<>
+ class ctype<char> : public locale::facet, public ctype_base
+ {
+ public:
+ typedef char char_type;
+ protected:
+ __c_locale _M_c_locale_ctype;
+ bool _M_del;
+ __to_type _M_toupper;
+ __to_type _M_tolower;
+ const mask* _M_table;
+ mutable char _M_widen_ok;
+ mutable char _M_widen[1 + static_cast<unsigned char>(-1)];
+ mutable char _M_narrow[1 + static_cast<unsigned char>(-1)];
+ mutable char _M_narrow_ok;
+ public:
+ static locale::id id;
+ static const size_t table_size = 1 + static_cast<unsigned char>(-1);
+ explicit
+ ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
+ explicit
+ ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false,
+ size_t __refs = 0);
+ inline bool
+ is(mask __m, char __c) const;
+ inline const char*
+ is(const char* __lo, const char* __hi, mask* __vec) const;
+ inline const char*
+ scan_is(mask __m, const char* __lo, const char* __hi) const;
+ inline const char*
+ scan_not(mask __m, const char* __lo, const char* __hi) const;
+ char_type
+ toupper(char_type __c) const
+ { return this->do_toupper(__c); }
+ const char_type*
+ toupper(char_type *__lo, const char_type* __hi) const
+ { return this->do_toupper(__lo, __hi); }
+ char_type
+ tolower(char_type __c) const
+ { return this->do_tolower(__c); }
+ const char_type*
+ tolower(char_type* __lo, const char_type* __hi) const
+ { return this->do_tolower(__lo, __hi); }
+ char_type
+ widen(char __c) const
+ {
+ if (_M_widen_ok)
+ return _M_widen[static_cast<unsigned char>(__c)];
+ this->_M_widen_init();
+ return this->do_widen(__c);
+ }
+ const char*
+ widen(const char* __lo, const char* __hi, char_type* __to) const
+ {
+ if (_M_widen_ok == 1)
+ {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+ }
+ if (!_M_widen_ok)
+ _M_widen_init();
+ return this->do_widen(__lo, __hi, __to);
+ }
+ char
+ narrow(char_type __c, char __dfault) const
+ {
+ if (_M_narrow[static_cast<unsigned char>(__c)])
+ return _M_narrow[static_cast<unsigned char>(__c)];
+ const char __t = do_narrow(__c, __dfault);
+ if (__t != __dfault)
+ _M_narrow[static_cast<unsigned char>(__c)] = __t;
+ return __t;
+ }
+ const char_type*
+ narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char *__to) const
+ {
+ if (__builtin_expect(_M_narrow_ok == 1, true))
+ {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+ }
+ if (!_M_narrow_ok)
+ _M_narrow_init();
+ return this->do_narrow(__lo, __hi, __dfault, __to);
+ }
+ const mask*
+ table() const throw()
+ { return _M_table; }
+ static const mask*
+ classic_table() throw();
+ protected:
+ virtual
+ ~ctype();
+ virtual char_type
+ do_toupper(char_type) const;
+ virtual const char_type*
+ do_toupper(char_type* __lo, const char_type* __hi) const;
+ virtual char_type
+ do_tolower(char_type) const;
+ virtual const char_type*
+ do_tolower(char_type* __lo, const char_type* __hi) const;
+ virtual char_type
+ do_widen(char __c) const
+ { return __c; }
+ virtual const char*
+ do_widen(const char* __lo, const char* __hi, char_type* __dest) const
+ {
+ __builtin_memcpy(__dest, __lo, __hi - __lo);
+ return __hi;
+ }
+ virtual char
+ do_narrow(char_type __c, char) const
+ { return __c; }
+ virtual const char_type*
+ do_narrow(const char_type* __lo, const char_type* __hi,
+ char, char* __dest) const
+ {
+ __builtin_memcpy(__dest, __lo, __hi - __lo);
+ return __hi;
+ }
+ private:
+ void _M_widen_init() const
+ {
+ char __tmp[sizeof(_M_widen)];
+ for (size_t __i = 0; __i < sizeof(_M_widen); ++__i)
+ __tmp[__i] = __i;
+ do_widen(__tmp, __tmp + sizeof(__tmp), _M_widen);
+ _M_widen_ok = 1;
+ if (__builtin_memcmp(__tmp, _M_widen, sizeof(_M_widen)))
+ _M_widen_ok = 2;
+ }
+ void _M_narrow_init() const
+ {
+ char __tmp[sizeof(_M_narrow)];
+ for (size_t __i = 0; __i < sizeof(_M_narrow); ++__i)
+ __tmp[__i] = __i;
+ do_narrow(__tmp, __tmp + sizeof(__tmp), 0, _M_narrow);
+ _M_narrow_ok = 1;
+ if (__builtin_memcmp(__tmp, _M_narrow, sizeof(_M_narrow)))
+ _M_narrow_ok = 2;
+ else
+ {
+ char __c;
+ do_narrow(__tmp, __tmp + 1, 1, &__c);
+ if (__c == 1)
+ _M_narrow_ok = 2;
+ }
+ }
+ };
+ template<>
+ const ctype<char>&
+ use_facet<ctype<char> >(const locale& __loc);
+ template<typename _CharT>
+ class ctype_byname : public ctype<_CharT>
+ {
+ public:
+ typedef typename ctype<_CharT>::mask mask;
+ explicit
+ ctype_byname(const char* __s, size_t __refs = 0);
+ protected:
+ virtual
+ ~ctype_byname() { };
+ };
+ template<>
+ class ctype_byname<char> : public ctype<char>
+ {
+ public:
+ explicit
+ ctype_byname(const char* __s, size_t __refs = 0);
+ protected:
+ virtual
+ ~ctype_byname();
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ bool
+ ctype<char>::
+ is(mask __m, char __c) const
+ { return _M_table[static_cast<unsigned char>(__c)] & __m; }
+ const char*
+ ctype<char>::
+ is(const char* __low, const char* __high, mask* __vec) const
+ {
+ while (__low < __high)
+ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
+ return __high;
+ }
+ const char*
+ ctype<char>::
+ scan_is(mask __m, const char* __low, const char* __high) const
+ {
+ while (__low < __high
+ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
+ ++__low;
+ return __low;
+ }
+ const char*
+ ctype<char>::
+ scan_not(mask __m, const char* __low, const char* __high) const
+ {
+ while (__low < __high
+ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
+ ++__low;
+ return __low;
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ class __num_base
+ {
+ public:
+ enum
+ {
+ _S_ominus,
+ _S_oplus,
+ _S_ox,
+ _S_oX,
+ _S_odigits,
+ _S_odigits_end = _S_odigits + 16,
+ _S_oudigits = _S_odigits_end,
+ _S_oudigits_end = _S_oudigits + 16,
+ _S_oe = _S_odigits + 14,
+ _S_oE = _S_oudigits + 14,
+ _S_oend = _S_oudigits_end
+ };
+ static const char* _S_atoms_out;
+ static const char* _S_atoms_in;
+ enum
+ {
+ _S_iminus,
+ _S_iplus,
+ _S_ix,
+ _S_iX,
+ _S_izero,
+ _S_ie = _S_izero + 14,
+ _S_iE = _S_izero + 20,
+ _S_iend = 26
+ };
+ static void
+ _S_format_float(const ios_base& __io, char* __fptr, char __mod);
+ };
+ template<typename _CharT>
+ struct __numpunct_cache : public locale::facet
+ {
+ const char* _M_grouping;
+ size_t _M_grouping_size;
+ bool _M_use_grouping;
+ const _CharT* _M_truename;
+ size_t _M_truename_size;
+ const _CharT* _M_falsename;
+ size_t _M_falsename_size;
+ _CharT _M_decimal_point;
+ _CharT _M_thousands_sep;
+ _CharT _M_atoms_out[__num_base::_S_oend];
+ _CharT _M_atoms_in[__num_base::_S_iend];
+ bool _M_allocated;
+ __numpunct_cache(size_t __refs = 0) : facet(__refs),
+ _M_grouping(__null), _M_grouping_size(0), _M_use_grouping(false),
+ _M_truename(__null), _M_truename_size(0), _M_falsename(__null),
+ _M_falsename_size(0), _M_decimal_point(_CharT()),
+ _M_thousands_sep(_CharT()), _M_allocated(false)
+ { }
+ ~__numpunct_cache();
+ void
+ _M_cache(const locale& __loc);
+ private:
+ __numpunct_cache&
+ operator=(const __numpunct_cache&);
+ explicit
+ __numpunct_cache(const __numpunct_cache&);
+ };
+ template<typename _CharT>
+ __numpunct_cache<_CharT>::~__numpunct_cache()
+ {
+ if (_M_allocated)
+ {
+ delete [] _M_grouping;
+ delete [] _M_truename;
+ delete [] _M_falsename;
+ }
+ }
+ template<typename _CharT>
+ class numpunct : public locale::facet
+ {
+ public:
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ protected:
+ __cache_type* _M_data;
+ public:
+ static locale::id id;
+ explicit
+ numpunct(size_t __refs = 0) : facet(__refs), _M_data(__null)
+ { _M_initialize_numpunct(); }
+ explicit
+ numpunct(__cache_type* __cache, size_t __refs = 0)
+ : facet(__refs), _M_data(__cache)
+ { _M_initialize_numpunct(); }
+ explicit
+ numpunct(__c_locale __cloc, size_t __refs = 0)
+ : facet(__refs), _M_data(__null)
+ { _M_initialize_numpunct(__cloc); }
+ char_type
+ decimal_point() const
+ { return this->do_decimal_point(); }
+ char_type
+ thousands_sep() const
+ { return this->do_thousands_sep(); }
+ string
+ grouping() const
+ { return this->do_grouping(); }
+ string_type
+ truename() const
+ { return this->do_truename(); }
+ string_type
+ falsename() const
+ { return this->do_falsename(); }
+ protected:
+ virtual
+ ~numpunct();
+ virtual char_type
+ do_decimal_point() const
+ { return _M_data->_M_decimal_point; }
+ virtual char_type
+ do_thousands_sep() const
+ { return _M_data->_M_thousands_sep; }
+ virtual string
+ do_grouping() const
+ { return _M_data->_M_grouping; }
+ virtual string_type
+ do_truename() const
+ { return _M_data->_M_truename; }
+ virtual string_type
+ do_falsename() const
+ { return _M_data->_M_falsename; }
+ void
+ _M_initialize_numpunct(__c_locale __cloc = __null);
+ };
+ template<typename _CharT>
+ locale::id numpunct<_CharT>::id;
+ template<>
+ numpunct<char>::~numpunct();
+ template<>
+ void
+ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc);
+ template<typename _CharT>
+ class numpunct_byname : public numpunct<_CharT>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ explicit
+ numpunct_byname(const char* __s, size_t __refs = 0)
+ : numpunct<_CharT>(__refs)
+ {
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
+ {
+ __c_locale __tmp;
+ this->_S_create_c_locale(__tmp, __s);
+ this->_M_initialize_numpunct(__tmp);
+ this->_S_destroy_c_locale(__tmp);
+ }
+ }
+ protected:
+ virtual
+ ~numpunct_byname() { }
+ };
+ template<typename _CharT, typename _InIter>
+ class num_get : public locale::facet
+ {
+ public:
+ typedef _CharT char_type;
+ typedef _InIter iter_type;
+ static locale::id id;
+ explicit
+ num_get(size_t __refs = 0) : facet(__refs) { }
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, bool& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned short& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned int& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned long& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long long& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned long long& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, float& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, double& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long double& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, void*& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ protected:
+ virtual ~num_get() { }
+ iter_type
+ _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&,
+ string& __xtrc) const;
+ template<typename _ValueT>
+ iter_type
+ _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
+ _ValueT& __v) const;
+ template<typename _CharT2>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, int>::__type
+ _M_find(const _CharT2*, size_t __len, _CharT2 __c) const
+ {
+ int __ret = -1;
+ if (__len <= 10)
+ {
+ if (__c >= _CharT2('0') && __c < _CharT2(_CharT2('0') + __len))
+ __ret = __c - _CharT2('0');
+ }
+ else
+ {
+ if (__c >= _CharT2('0') && __c <= _CharT2('9'))
+ __ret = __c - _CharT2('0');
+ else if (__c >= _CharT2('a') && __c <= _CharT2('f'))
+ __ret = 10 + (__c - _CharT2('a'));
+ else if (__c >= _CharT2('A') && __c <= _CharT2('F'))
+ __ret = 10 + (__c - _CharT2('A'));
+ }
+ return __ret;
+ }
+ template<typename _CharT2>
+ typename __gnu_cxx::__enable_if<!__is_char<_CharT2>::__value,
+ int>::__type
+ _M_find(const _CharT2* __zero, size_t __len, _CharT2 __c) const
+ {
+ int __ret = -1;
+ const char_type* __q = char_traits<_CharT2>::find(__zero, __len, __c);
+ if (__q)
+ {
+ __ret = __q - __zero;
+ if (__ret > 15)
+ __ret -= 6;
+ }
+ return __ret;
+ }
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, long&) const;
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ unsigned short&) const;
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ unsigned int&) const;
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ unsigned long&) const;
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ long long&) const;
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ unsigned long long&) const;
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ float&) const;
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ double&) const;
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ long double&) const;
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ void*&) const;
+ };
+ template<typename _CharT, typename _InIter>
+ locale::id num_get<_CharT, _InIter>::id;
+ template<typename _CharT, typename _OutIter>
+ class num_put : public locale::facet
+ {
+ public:
+ typedef _CharT char_type;
+ typedef _OutIter iter_type;
+ static locale::id id;
+ explicit
+ num_put(size_t __refs = 0) : facet(__refs) { }
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill, long __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill,
+ unsigned long __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill, long long __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill,
+ unsigned long long __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill, double __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill,
+ long double __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill,
+ const void* __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+ protected:
+ template<typename _ValueT>
+ iter_type
+ _M_insert_float(iter_type, ios_base& __io, char_type __fill,
+ char __mod, _ValueT __v) const;
+ void
+ _M_group_float(const char* __grouping, size_t __grouping_size,
+ char_type __sep, const char_type* __p, char_type* __new,
+ char_type* __cs, int& __len) const;
+ template<typename _ValueT>
+ iter_type
+ _M_insert_int(iter_type, ios_base& __io, char_type __fill,
+ _ValueT __v) const;
+ void
+ _M_group_int(const char* __grouping, size_t __grouping_size,
+ char_type __sep, ios_base& __io, char_type* __new,
+ char_type* __cs, int& __len) const;
+ void
+ _M_pad(char_type __fill, streamsize __w, ios_base& __io,
+ char_type* __new, const char_type* __cs, int& __len) const;
+ virtual
+ ~num_put() { };
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, bool __v) const;
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, long __v) const;
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, unsigned long) const;
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, long long __v) const;
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, unsigned long long) const;
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, double __v) const;
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, const void* __v) const;
+ };
+ template <typename _CharT, typename _OutIter>
+ locale::id num_put<_CharT, _OutIter>::id;
+ template<typename _CharT>
+ inline bool
+ isspace(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); }
+ template<typename _CharT>
+ inline bool
+ isprint(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); }
+ template<typename _CharT>
+ inline bool
+ iscntrl(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); }
+ template<typename _CharT>
+ inline bool
+ isupper(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); }
+ template<typename _CharT>
+ inline bool
+ islower(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); }
+ template<typename _CharT>
+ inline bool
+ isalpha(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); }
+ template<typename _CharT>
+ inline bool
+ isdigit(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); }
+ template<typename _CharT>
+ inline bool
+ ispunct(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); }
+ template<typename _CharT>
+ inline bool
+ isxdigit(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); }
+ template<typename _CharT>
+ inline bool
+ isalnum(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); }
+ template<typename _CharT>
+ inline bool
+ isgraph(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); }
+ template<typename _CharT>
+ inline _CharT
+ toupper(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).toupper(__c); }
+ template<typename _CharT>
+ inline _CharT
+ tolower(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).tolower(__c); }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Facet>
+ struct __use_cache
+ {
+ const _Facet*
+ operator() (const locale& __loc) const;
+ };
+ template<typename _CharT>
+ struct __use_cache<__numpunct_cache<_CharT> >
+ {
+ const __numpunct_cache<_CharT>*
+ operator() (const locale& __loc) const
+ {
+ const size_t __i = numpunct<_CharT>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+ {
+ __numpunct_cache<_CharT>* __tmp = __null;
+ try
+ {
+ __tmp = new __numpunct_cache<_CharT>;
+ __tmp->_M_cache(__loc);
+ }
+ catch(...)
+ {
+ delete __tmp;
+ throw;
+ }
+ __loc._M_impl->_M_install_cache(__tmp, __i);
+ }
+ return static_cast<const __numpunct_cache<_CharT>*>(__caches[__i]);
+ }
+ };
+ template<typename _CharT>
+ void
+ __numpunct_cache<_CharT>::_M_cache(const locale& __loc)
+ {
+ _M_allocated = true;
+ const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
+ _M_grouping_size = __np.grouping().size();
+ char* __grouping = new char[_M_grouping_size];
+ __np.grouping().copy(__grouping, _M_grouping_size);
+ _M_grouping = __grouping;
+ _M_use_grouping = (_M_grouping_size
+ && static_cast<signed char>(__np.grouping()[0]) > 0);
+ _M_truename_size = __np.truename().size();
+ _CharT* __truename = new _CharT[_M_truename_size];
+ __np.truename().copy(__truename, _M_truename_size);
+ _M_truename = __truename;
+ _M_falsename_size = __np.falsename().size();
+ _CharT* __falsename = new _CharT[_M_falsename_size];
+ __np.falsename().copy(__falsename, _M_falsename_size);
+ _M_falsename = __falsename;
+ _M_decimal_point = __np.decimal_point();
+ _M_thousands_sep = __np.thousands_sep();
+ const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
+ __ct.widen(__num_base::_S_atoms_out,
+ __num_base::_S_atoms_out + __num_base::_S_oend, _M_atoms_out);
+ __ct.widen(__num_base::_S_atoms_in,
+ __num_base::_S_atoms_in + __num_base::_S_iend, _M_atoms_in);
+ }
+ bool
+ __verify_grouping(const char* __grouping, size_t __grouping_size,
+ const string& __grouping_tmp);
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
+ ios_base::iostate& __err, string& __xtrc) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_in;
+ char_type __c = char_type();
+ bool __testeof = __beg == __end;
+ if (!__testeof)
+ {
+ __c = *__beg;
+ const bool __plus = __c == __lit[__num_base::_S_iplus];
+ if ((__plus || __c == __lit[__num_base::_S_iminus])
+ && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ && !(__c == __lc->_M_decimal_point))
+ {
+ __xtrc += __plus ? '+' : '-';
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ }
+ bool __found_mantissa = false;
+ int __sep_pos = 0;
+ while (!__testeof)
+ {
+ if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ || __c == __lc->_M_decimal_point)
+ break;
+ else if (__c == __lit[__num_base::_S_izero])
+ {
+ if (!__found_mantissa)
+ {
+ __xtrc += '0';
+ __found_mantissa = true;
+ }
+ ++__sep_pos;
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ else
+ break;
+ }
+ bool __found_dec = false;
+ bool __found_sci = false;
+ string __found_grouping;
+ if (__lc->_M_use_grouping)
+ __found_grouping.reserve(32);
+ const char_type* __lit_zero = __lit + __num_base::_S_izero;
+ if (!__lc->_M_allocated)
+ while (!__testeof)
+ {
+ const int __digit = _M_find(__lit_zero, 10, __c);
+ if (__digit != -1)
+ {
+ __xtrc += '0' + __digit;
+ __found_mantissa = true;
+ }
+ else if (__c == __lc->_M_decimal_point
+ && !__found_dec && !__found_sci)
+ {
+ __xtrc += '.';
+ __found_dec = true;
+ }
+ else if ((__c == __lit[__num_base::_S_ie]
+ || __c == __lit[__num_base::_S_iE])
+ && !__found_sci && __found_mantissa)
+ {
+ __xtrc += 'e';
+ __found_sci = true;
+ if (++__beg != __end)
+ {
+ __c = *__beg;
+ const bool __plus = __c == __lit[__num_base::_S_iplus];
+ if (__plus || __c == __lit[__num_base::_S_iminus])
+ __xtrc += __plus ? '+' : '-';
+ else
+ continue;
+ }
+ else
+ {
+ __testeof = true;
+ break;
+ }
+ }
+ else
+ break;
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ else
+ while (!__testeof)
+ {
+ if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ {
+ if (!__found_dec && !__found_sci)
+ {
+ if (__sep_pos)
+ {
+ __found_grouping += static_cast<char>(__sep_pos);
+ __sep_pos = 0;
+ }
+ else
+ {
+ __xtrc.clear();
+ break;
+ }
+ }
+ else
+ break;
+ }
+ else if (__c == __lc->_M_decimal_point)
+ {
+ if (!__found_dec && !__found_sci)
+ {
+ if (__found_grouping.size())
+ __found_grouping += static_cast<char>(__sep_pos);
+ __xtrc += '.';
+ __found_dec = true;
+ }
+ else
+ break;
+ }
+ else
+ {
+ const char_type* __q =
+ __traits_type::find(__lit_zero, 10, __c);
+ if (__q)
+ {
+ __xtrc += '0' + (__q - __lit_zero);
+ __found_mantissa = true;
+ ++__sep_pos;
+ }
+ else if ((__c == __lit[__num_base::_S_ie]
+ || __c == __lit[__num_base::_S_iE])
+ && !__found_sci && __found_mantissa)
+ {
+ if (__found_grouping.size() && !__found_dec)
+ __found_grouping += static_cast<char>(__sep_pos);
+ __xtrc += 'e';
+ __found_sci = true;
+ if (++__beg != __end)
+ {
+ __c = *__beg;
+ const bool __plus = __c == __lit[__num_base::_S_iplus];
+ if ((__plus || __c == __lit[__num_base::_S_iminus])
+ && !(__lc->_M_use_grouping
+ && __c == __lc->_M_thousands_sep)
+ && !(__c == __lc->_M_decimal_point))
+ __xtrc += __plus ? '+' : '-';
+ else
+ continue;
+ }
+ else
+ {
+ __testeof = true;
+ break;
+ }
+ }
+ else
+ break;
+ }
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ if (__found_grouping.size())
+ {
+ if (!__found_dec && !__found_sci)
+ __found_grouping += static_cast<char>(__sep_pos);
+ if (!std::__verify_grouping(__lc->_M_grouping,
+ __lc->_M_grouping_size,
+ __found_grouping))
+ __err |= ios_base::failbit;
+ }
+ if (__testeof)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+ template<typename _CharT, typename _InIter>
+ template<typename _ValueT>
+ _InIter
+ num_get<_CharT, _InIter>::
+ _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
+ ios_base::iostate& __err, _ValueT& __v) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ using __gnu_cxx::__add_unsigned;
+ typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_in;
+ char_type __c = char_type();
+ const ios_base::fmtflags __basefield = __io.flags()
+ & ios_base::basefield;
+ const bool __oct = __basefield == ios_base::oct;
+ int __base = __oct ? 8 : (__basefield == ios_base::hex ? 16 : 10);
+ bool __testeof = __beg == __end;
+ bool __negative = false;
+ if (!__testeof)
+ {
+ __c = *__beg;
+ if (__gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+ __negative = __c == __lit[__num_base::_S_iminus];
+ if ((__negative || __c == __lit[__num_base::_S_iplus])
+ && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ && !(__c == __lc->_M_decimal_point))
+ {
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ }
+ bool __found_zero = false;
+ int __sep_pos = 0;
+ while (!__testeof)
+ {
+ if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ || __c == __lc->_M_decimal_point)
+ break;
+ else if (__c == __lit[__num_base::_S_izero]
+ && (!__found_zero || __base == 10))
+ {
+ __found_zero = true;
+ ++__sep_pos;
+ if (__basefield == 0)
+ __base = 8;
+ if (__base == 8)
+ __sep_pos = 0;
+ }
+ else if (__found_zero
+ && (__c == __lit[__num_base::_S_ix]
+ || __c == __lit[__num_base::_S_iX]))
+ {
+ if (__basefield == 0)
+ __base = 16;
+ if (__base == 16)
+ {
+ __found_zero = false;
+ __sep_pos = 0;
+ }
+ else
+ break;
+ }
+ else
+ break;
+ if (++__beg != __end)
+ {
+ __c = *__beg;
+ if (!__found_zero)
+ break;
+ }
+ else
+ __testeof = true;
+ }
+ const size_t __len = (__base == 16 ? __num_base::_S_iend
+ - __num_base::_S_izero : __base);
+ string __found_grouping;
+ if (__lc->_M_use_grouping)
+ __found_grouping.reserve(32);
+ bool __testfail = false;
+ const __unsigned_type __max = __negative
+ ? -__gnu_cxx::__numeric_traits<_ValueT>::__min
+ : __gnu_cxx::__numeric_traits<_ValueT>::__max;
+ const __unsigned_type __smax = __max / __base;
+ __unsigned_type __result = 0;
+ int __digit = 0;
+ const char_type* __lit_zero = __lit + __num_base::_S_izero;
+ if (!__lc->_M_allocated)
+ while (!__testeof)
+ {
+ __digit = _M_find(__lit_zero, __len, __c);
+ if (__digit == -1)
+ break;
+ if (__result > __smax)
+ __testfail = true;
+ else
+ {
+ __result *= __base;
+ __testfail |= __result > __max - __digit;
+ __result += __digit;
+ ++__sep_pos;
+ }
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ else
+ while (!__testeof)
+ {
+ if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ {
+ if (__sep_pos)
+ {
+ __found_grouping += static_cast<char>(__sep_pos);
+ __sep_pos = 0;
+ }
+ else
+ {
+ __testfail = true;
+ break;
+ }
+ }
+ else if (__c == __lc->_M_decimal_point)
+ break;
+ else
+ {
+ const char_type* __q =
+ __traits_type::find(__lit_zero, __len, __c);
+ if (!__q)
+ break;
+ __digit = __q - __lit_zero;
+ if (__digit > 15)
+ __digit -= 6;
+ if (__result > __smax)
+ __testfail = true;
+ else
+ {
+ __result *= __base;
+ __testfail |= __result > __max - __digit;
+ __result += __digit;
+ ++__sep_pos;
+ }
+ }
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ if (__found_grouping.size())
+ {
+ __found_grouping += static_cast<char>(__sep_pos);
+ if (!std::__verify_grouping(__lc->_M_grouping,
+ __lc->_M_grouping_size,
+ __found_grouping))
+ __err |= ios_base::failbit;
+ }
+ if (!__testfail && (__sep_pos || __found_zero
+ || __found_grouping.size()))
+ __v = __negative ? -__result : __result;
+ else
+ __err |= ios_base::failbit;
+ if (__testeof)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, bool& __v) const
+ {
+ if (!(__io.flags() & ios_base::boolalpha))
+ {
+ long __l = -1;
+ __beg = _M_extract_int(__beg, __end, __io, __err, __l);
+ if (__l == 0 || __l == 1)
+ __v = bool(__l);
+ else
+ __err |= ios_base::failbit;
+ }
+ else
+ {
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ bool __testf = true;
+ bool __testt = true;
+ size_t __n;
+ bool __testeof = __beg == __end;
+ for (__n = 0; !__testeof; ++__n)
+ {
+ const char_type __c = *__beg;
+ if (__testf)
+ {
+ if (__n < __lc->_M_falsename_size)
+ __testf = __c == __lc->_M_falsename[__n];
+ else
+ break;
+ }
+ if (__testt)
+ {
+ if (__n < __lc->_M_truename_size)
+ __testt = __c == __lc->_M_truename[__n];
+ else
+ break;
+ }
+ if (!__testf && !__testt)
+ break;
+ if (++__beg == __end)
+ __testeof = true;
+ }
+ if (__testf && __n == __lc->_M_falsename_size)
+ __v = false;
+ else if (__testt && __n == __lc->_M_truename_size)
+ __v = true;
+ else
+ __err |= ios_base::failbit;
+ if (__testeof)
+ __err |= ios_base::eofbit;
+ }
+ return __beg;
+ }
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned short& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned int& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned long& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long long& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned long long& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, float& __v) const
+ {
+ string __xtrc;
+ __xtrc.reserve(32);
+ __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+ return __beg;
+ }
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, double& __v) const
+ {
+ string __xtrc;
+ __xtrc.reserve(32);
+ __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+ return __beg;
+ }
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long double& __v) const
+ {
+ string __xtrc;
+ __xtrc.reserve(32);
+ __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+ return __beg;
+ }
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, void*& __v) const
+ {
+ typedef ios_base::fmtflags fmtflags;
+ const fmtflags __fmt = __io.flags();
+ __io.flags((__fmt & ~ios_base::basefield) | ios_base::hex);
+ typedef __gnu_cxx::__conditional_type<(sizeof(void*)
+ <= sizeof(unsigned long)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+ _UIntPtrType __ul;
+ __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
+ __io.flags(__fmt);
+ if (!(__err & ios_base::failbit))
+ __v = reinterpret_cast<void*>(__ul);
+ return __beg;
+ }
+ template<typename _CharT, typename _OutIter>
+ void
+ num_put<_CharT, _OutIter>::
+ _M_pad(_CharT __fill, streamsize __w, ios_base& __io,
+ _CharT* __new, const _CharT* __cs, int& __len) const
+ {
+ __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new,
+ __cs, __w, __len);
+ __len = static_cast<int>(__w);
+ }
+ template<typename _CharT, typename _ValueT>
+ int
+ __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit,
+ ios_base::fmtflags __flags, bool __dec)
+ {
+ _CharT* __buf = __bufend;
+ if (__builtin_expect(__dec, true))
+ {
+ do
+ {
+ *--__buf = __lit[(__v % 10) + __num_base::_S_odigits];
+ __v /= 10;
+ }
+ while (__v != 0);
+ }
+ else if ((__flags & ios_base::basefield) == ios_base::oct)
+ {
+ do
+ {
+ *--__buf = __lit[(__v & 0x7) + __num_base::_S_odigits];
+ __v >>= 3;
+ }
+ while (__v != 0);
+ }
+ else
+ {
+ const bool __uppercase = __flags & ios_base::uppercase;
+ const int __case_offset = __uppercase ? __num_base::_S_oudigits
+ : __num_base::_S_odigits;
+ do
+ {
+ *--__buf = __lit[(__v & 0xf) + __case_offset];
+ __v >>= 4;
+ }
+ while (__v != 0);
+ }
+ return __bufend - __buf;
+ }
+ template<typename _CharT, typename _OutIter>
+ void
+ num_put<_CharT, _OutIter>::
+ _M_group_int(const char* __grouping, size_t __grouping_size, _CharT __sep,
+ ios_base&, _CharT* __new, _CharT* __cs, int& __len) const
+ {
+ _CharT* __p = std::__add_grouping(__new, __sep, __grouping,
+ __grouping_size, __cs, __cs + __len);
+ __len = __p - __new;
+ }
+ template<typename _CharT, typename _OutIter>
+ template<typename _ValueT>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
+ _ValueT __v) const
+ {
+ using __gnu_cxx::__add_unsigned;
+ typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_out;
+ const ios_base::fmtflags __flags = __io.flags();
+ const int __ilen = 5 * sizeof(_ValueT);
+ _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __ilen));
+ const ios_base::fmtflags __basefield = __flags & ios_base::basefield;
+ const bool __dec = (__basefield != ios_base::oct
+ && __basefield != ios_base::hex);
+ const __unsigned_type __u = ((__v > 0 || !__dec)
+ ? __unsigned_type(__v)
+ : -__unsigned_type(__v));
+ int __len = __int_to_char(__cs + __ilen, __u, __lit, __flags, __dec);
+ __cs += __ilen - __len;
+ if (__lc->_M_use_grouping)
+ {
+ _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * (__len + 1)
+ * 2));
+ _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size,
+ __lc->_M_thousands_sep, __io, __cs2 + 2, __cs, __len);
+ __cs = __cs2 + 2;
+ }
+ if (__builtin_expect(__dec, true))
+ {
+ if (__v >= 0)
+ {
+ if (bool(__flags & ios_base::showpos)
+ && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+ *--__cs = __lit[__num_base::_S_oplus], ++__len;
+ }
+ else
+ *--__cs = __lit[__num_base::_S_ominus], ++__len;
+ }
+ else if (bool(__flags & ios_base::showbase) && __v)
+ {
+ if (__basefield == ios_base::oct)
+ *--__cs = __lit[__num_base::_S_odigits], ++__len;
+ else
+ {
+ const bool __uppercase = __flags & ios_base::uppercase;
+ *--__cs = __lit[__num_base::_S_ox + __uppercase];
+ *--__cs = __lit[__num_base::_S_odigits];
+ __len += 2;
+ }
+ }
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+ {
+ _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __w));
+ _M_pad(__fill, __w, __io, __cs3, __cs, __len);
+ __cs = __cs3;
+ }
+ __io.width(0);
+ return std::__write(__s, __cs, __len);
+ }
+ template<typename _CharT, typename _OutIter>
+ void
+ num_put<_CharT, _OutIter>::
+ _M_group_float(const char* __grouping, size_t __grouping_size,
+ _CharT __sep, const _CharT* __p, _CharT* __new,
+ _CharT* __cs, int& __len) const
+ {
+ const int __declen = __p ? __p - __cs : __len;
+ _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping,
+ __grouping_size,
+ __cs, __cs + __declen);
+ int __newlen = __p2 - __new;
+ if (__p)
+ {
+ char_traits<_CharT>::copy(__p2, __p, __len - __declen);
+ __newlen += __len - __declen;
+ }
+ __len = __newlen;
+ }
+ template<typename _CharT, typename _OutIter>
+ template<typename _ValueT>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod,
+ _ValueT __v) const
+ {
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const streamsize __prec = __io.precision() < 0 ? 6 : __io.precision();
+ const int __max_digits =
+ __gnu_cxx::__numeric_traits<_ValueT>::__digits10;
+ int __len;
+ char __fbuf[16];
+ __num_base::_S_format_float(__io, __fbuf, __mod);
+ const bool __fixed = __io.flags() & ios_base::fixed;
+ const int __max_exp =
+ __gnu_cxx::__numeric_traits<_ValueT>::__max_exponent10;
+ const int __cs_size = __fixed ? __max_exp + __prec + 4
+ : __max_digits * 2 + __prec;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf,
+ __prec, __v);
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+ _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __len));
+ __ctype.widen(__cs, __cs + __len, __ws);
+ _CharT* __wp = 0;
+ const char* __p = char_traits<char>::find(__cs, __len, '.');
+ if (__p)
+ {
+ __wp = __ws + (__p - __cs);
+ *__wp = __lc->_M_decimal_point;
+ }
+ if (__lc->_M_use_grouping
+ && (__wp || __len < 3 || (__cs[1] <= '9' && __cs[2] <= '9'
+ && __cs[1] >= '0' && __cs[2] >= '0')))
+ {
+ _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __len * 2));
+ streamsize __off = 0;
+ if (__cs[0] == '-' || __cs[0] == '+')
+ {
+ __off = 1;
+ __ws2[0] = __ws[0];
+ __len -= 1;
+ }
+ _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size,
+ __lc->_M_thousands_sep, __wp, __ws2 + __off,
+ __ws + __off, __len);
+ __len += __off;
+ __ws = __ws2;
+ }
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+ {
+ _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __w));
+ _M_pad(__fill, __w, __io, __ws3, __ws, __len);
+ __ws = __ws3;
+ }
+ __io.width(0);
+ return std::__write(__s, __ws, __len);
+ }
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
+ {
+ const ios_base::fmtflags __flags = __io.flags();
+ if ((__flags & ios_base::boolalpha) == 0)
+ {
+ const long __l = __v;
+ __s = _M_insert_int(__s, __io, __fill, __l);
+ }
+ else
+ {
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __name = __v ? __lc->_M_truename
+ : __lc->_M_falsename;
+ int __len = __v ? __lc->_M_truename_size
+ : __lc->_M_falsename_size;
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+ {
+ _CharT* __cs
+ = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __w));
+ _M_pad(__fill, __w, __io, __cs, __name, __len);
+ __name = __cs;
+ }
+ __io.width(0);
+ __s = std::__write(__s, __name, __len);
+ }
+ return __s;
+ }
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
+ { return _M_insert_int(__s, __io, __fill, __v); }
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ unsigned long __v) const
+ { return _M_insert_int(__s, __io, __fill, __v); }
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill, long long __v) const
+ { return _M_insert_int(__s, __io, __fill, __v); }
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ unsigned long long __v) const
+ { return _M_insert_int(__s, __io, __fill, __v); }
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+ { return _M_insert_float(__s, __io, __fill, char(), __v); }
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ long double __v) const
+ { return _M_insert_float(__s, __io, __fill, 'L', __v); }
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ const void* __v) const
+ {
+ const ios_base::fmtflags __flags = __io.flags();
+ const ios_base::fmtflags __fmt = ~(ios_base::basefield
+ | ios_base::uppercase
+ | ios_base::internal);
+ __io.flags((__flags & __fmt) | (ios_base::hex | ios_base::showbase));
+ typedef __gnu_cxx::__conditional_type<(sizeof(const void*)
+ <= sizeof(unsigned long)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+ __s = _M_insert_int(__s, __io, __fill,
+ reinterpret_cast<_UIntPtrType>(__v));
+ __io.flags(__flags);
+ return __s;
+ }
+ template<typename _CharT, typename _Traits>
+ void
+ __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill,
+ _CharT* __news, const _CharT* __olds,
+ const streamsize __newlen,
+ const streamsize __oldlen)
+ {
+ const size_t __plen = static_cast<size_t>(__newlen - __oldlen);
+ const ios_base::fmtflags __adjust = __io.flags() & ios_base::adjustfield;
+ if (__adjust == ios_base::left)
+ {
+ _Traits::copy(__news, __olds, __oldlen);
+ _Traits::assign(__news + __oldlen, __plen, __fill);
+ return;
+ }
+ size_t __mod = 0;
+ if (__adjust == ios_base::internal)
+ {
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+ if (__ctype.widen('-') == __olds[0]
+ || __ctype.widen('+') == __olds[0])
+ {
+ __news[0] = __olds[0];
+ __mod = 1;
+ ++__news;
+ }
+ else if (__ctype.widen('0') == __olds[0]
+ && __oldlen > 1
+ && (__ctype.widen('x') == __olds[1]
+ || __ctype.widen('X') == __olds[1]))
+ {
+ __news[0] = __olds[0];
+ __news[1] = __olds[1];
+ __mod = 2;
+ __news += 2;
+ }
+ }
+ _Traits::assign(__news, __plen, __fill);
+ _Traits::copy(__news + __plen, __olds + __mod, __oldlen - __mod);
+ }
+ template<typename _CharT>
+ _CharT*
+ __add_grouping(_CharT* __s, _CharT __sep,
+ const char* __gbeg, size_t __gsize,
+ const _CharT* __first, const _CharT* __last)
+ {
+ size_t __idx = 0;
+ size_t __ctr = 0;
+ while (__last - __first > __gbeg[__idx]
+ && static_cast<signed char>(__gbeg[__idx]) > 0)
+ {
+ __last -= __gbeg[__idx];
+ __idx < __gsize - 1 ? ++__idx : ++__ctr;
+ }
+ while (__first != __last)
+ *__s++ = *__first++;
+ while (__ctr--)
+ {
+ *__s++ = __sep;
+ for (char __i = __gbeg[__idx]; __i > 0; --__i)
+ *__s++ = *__first++;
+ }
+ while (__idx--)
+ {
+ *__s++ = __sep;
+ for (char __i = __gbeg[__idx]; __i > 0; --__i)
+ *__s++ = *__first++;
+ }
+ return __s;
+ }
+ extern template class numpunct<char>;
+ extern template class numpunct_byname<char>;
+ extern template class num_get<char>;
+ extern template class num_put<char>;
+ extern template class ctype_byname<char>;
+ extern template
+ const numpunct<char>&
+ use_facet<numpunct<char> >(const locale&);
+ extern template
+ const num_put<char>&
+ use_facet<num_put<char> >(const locale&);
+ extern template
+ const num_get<char>&
+ use_facet<num_get<char> >(const locale&);
+ extern template
+ bool
+ has_facet<ctype<char> >(const locale&);
+ extern template
+ bool
+ has_facet<numpunct<char> >(const locale&);
+ extern template
+ bool
+ has_facet<num_put<char> >(const locale&);
+ extern template
+ bool
+ has_facet<num_get<char> >(const locale&);
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Facet>
+ inline const _Facet&
+ __check_facet(const _Facet* __f)
+ {
+ if (!__f)
+ __throw_bad_cast();
+ return *__f;
+ }
+ template<typename _CharT, typename _Traits>
+ class basic_ios : public ios_base
+ {
+ public:
+ typedef _CharT char_type;
+ typedef typename _Traits::int_type int_type;
+ typedef typename _Traits::pos_type pos_type;
+ typedef typename _Traits::off_type off_type;
+ typedef _Traits traits_type;
+ typedef ctype<_CharT> __ctype_type;
+ typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
+ __num_put_type;
+ typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+ __num_get_type;
+ protected:
+ basic_ostream<_CharT, _Traits>* _M_tie;
+ mutable char_type _M_fill;
+ mutable bool _M_fill_init;
+ basic_streambuf<_CharT, _Traits>* _M_streambuf;
+ const __ctype_type* _M_ctype;
+ const __num_put_type* _M_num_put;
+ const __num_get_type* _M_num_get;
+ public:
+ operator void*() const
+ { return this->fail() ? 0 : const_cast<basic_ios*>(this); }
+ bool
+ operator!() const
+ { return this->fail(); }
+ iostate
+ rdstate() const
+ { return _M_streambuf_state; }
+ void
+ clear(iostate __state = goodbit);
+ void
+ setstate(iostate __state)
+ { this->clear(this->rdstate() | __state); }
+ void
+ _M_setstate(iostate __state)
+ {
+ _M_streambuf_state |= __state;
+ if (this->exceptions() & __state)
+ throw;
+ }
+ bool
+ good() const
+ { return this->rdstate() == 0; }
+ bool
+ eof() const
+ { return (this->rdstate() & eofbit) != 0; }
+ bool
+ fail() const
+ { return (this->rdstate() & (badbit | failbit)) != 0; }
+ bool
+ bad() const
+ { return (this->rdstate() & badbit) != 0; }
+ iostate
+ exceptions() const
+ { return _M_exception; }
+ void
+ exceptions(iostate __except)
+ {
+ _M_exception = __except;
+ this->clear(_M_streambuf_state);
+ }
+ explicit
+ basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
+ : ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
+ _M_ctype(0), _M_num_put(0), _M_num_get(0)
+ { this->init(__sb); }
+ virtual
+ ~basic_ios() { }
+ basic_ostream<_CharT, _Traits>*
+ tie() const
+ { return _M_tie; }
+ basic_ostream<_CharT, _Traits>*
+ tie(basic_ostream<_CharT, _Traits>* __tiestr)
+ {
+ basic_ostream<_CharT, _Traits>* __old = _M_tie;
+ _M_tie = __tiestr;
+ return __old;
+ }
+ basic_streambuf<_CharT, _Traits>*
+ rdbuf() const
+ { return _M_streambuf; }
+ basic_streambuf<_CharT, _Traits>*
+ rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
+ basic_ios&
+ copyfmt(const basic_ios& __rhs);
+ char_type
+ fill() const
+ {
+ if (!_M_fill_init)
+ {
+ _M_fill = this->widen(' ');
+ _M_fill_init = true;
+ }
+ return _M_fill;
+ }
+ char_type
+ fill(char_type __ch)
+ {
+ char_type __old = this->fill();
+ _M_fill = __ch;
+ return __old;
+ }
+ locale
+ imbue(const locale& __loc);
+ char
+ narrow(char_type __c, char __dfault) const
+ { return __check_facet(_M_ctype).narrow(__c, __dfault); }
+ char_type
+ widen(char __c) const
+ { return __check_facet(_M_ctype).widen(__c); }
+ protected:
+ basic_ios()
+ : ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false),
+ _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
+ { }
+ void
+ init(basic_streambuf<_CharT, _Traits>* __sb);
+ void
+ _M_cache_locale(const locale& __loc);
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits>
+ void
+ basic_ios<_CharT, _Traits>::clear(iostate __state)
+ {
+ if (this->rdbuf())
+ _M_streambuf_state = __state;
+ else
+ _M_streambuf_state = __state | badbit;
+ if (this->exceptions() & this->rdstate())
+ __throw_ios_failure(("basic_ios::clear"));
+ }
+ template<typename _CharT, typename _Traits>
+ basic_streambuf<_CharT, _Traits>*
+ basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
+ {
+ basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
+ _M_streambuf = __sb;
+ this->clear();
+ return __old;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_ios<_CharT, _Traits>&
+ basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
+ {
+ if (this != &__rhs)
+ {
+ _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ?
+ _M_local_word : new _Words[__rhs._M_word_size];
+ _Callback_list* __cb = __rhs._M_callbacks;
+ if (__cb)
+ __cb->_M_add_reference();
+ _M_call_callbacks(erase_event);
+ if (_M_word != _M_local_word)
+ {
+ delete [] _M_word;
+ _M_word = 0;
+ }
+ _M_dispose_callbacks();
+ _M_callbacks = __cb;
+ for (int __i = 0; __i < __rhs._M_word_size; ++__i)
+ __words[__i] = __rhs._M_word[__i];
+ _M_word = __words;
+ _M_word_size = __rhs._M_word_size;
+ this->flags(__rhs.flags());
+ this->width(__rhs.width());
+ this->precision(__rhs.precision());
+ this->tie(__rhs.tie());
+ this->fill(__rhs.fill());
+ _M_ios_locale = __rhs.getloc();
+ _M_cache_locale(_M_ios_locale);
+ _M_call_callbacks(copyfmt_event);
+ this->exceptions(__rhs.exceptions());
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ locale
+ basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
+ {
+ locale __old(this->getloc());
+ ios_base::imbue(__loc);
+ _M_cache_locale(__loc);
+ if (this->rdbuf() != 0)
+ this->rdbuf()->pubimbue(__loc);
+ return __old;
+ }
+ template<typename _CharT, typename _Traits>
+ void
+ basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb)
+ {
+ ios_base::_M_init();
+ _M_cache_locale(_M_ios_locale);
+ _M_fill = _CharT();
+ _M_fill_init = false;
+ _M_tie = 0;
+ _M_exception = goodbit;
+ _M_streambuf = __sb;
+ _M_streambuf_state = __sb ? goodbit : badbit;
+ }
+ template<typename _CharT, typename _Traits>
+ void
+ basic_ios<_CharT, _Traits>::_M_cache_locale(const locale& __loc)
+ {
+ if (__builtin_expect(has_facet<__ctype_type>(__loc), true))
+ _M_ctype = &use_facet<__ctype_type>(__loc);
+ else
+ _M_ctype = 0;
+ if (__builtin_expect(has_facet<__num_put_type>(__loc), true))
+ _M_num_put = &use_facet<__num_put_type>(__loc);
+ else
+ _M_num_put = 0;
+ if (__builtin_expect(has_facet<__num_get_type>(__loc), true))
+ _M_num_get = &use_facet<__num_get_type>(__loc);
+ else
+ _M_num_get = 0;
+ }
+ extern template class basic_ios<char>;
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits>
+ class basic_ostream : virtual public basic_ios<_CharT, _Traits>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef typename _Traits::int_type int_type;
+ typedef typename _Traits::pos_type pos_type;
+ typedef typename _Traits::off_type off_type;
+ typedef _Traits traits_type;
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef basic_ios<_CharT, _Traits> __ios_type;
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
+ __num_put_type;
+ typedef ctype<_CharT> __ctype_type;
+ explicit
+ basic_ostream(__streambuf_type* __sb)
+ { this->init(__sb); }
+ virtual
+ ~basic_ostream() { }
+ class sentry;
+ friend class sentry;
+ __ostream_type&
+ operator<<(__ostream_type& (*__pf)(__ostream_type&))
+ {
+ return __pf(*this);
+ }
+ __ostream_type&
+ operator<<(__ios_type& (*__pf)(__ios_type&))
+ {
+ __pf(*this);
+ return *this;
+ }
+ __ostream_type&
+ operator<<(ios_base& (*__pf) (ios_base&))
+ {
+ __pf(*this);
+ return *this;
+ }
+ __ostream_type&
+ operator<<(long __n)
+ { return _M_insert(__n); }
+ __ostream_type&
+ operator<<(unsigned long __n)
+ { return _M_insert(__n); }
+ __ostream_type&
+ operator<<(bool __n)
+ { return _M_insert(__n); }
+ __ostream_type&
+ operator<<(short __n);
+ __ostream_type&
+ operator<<(unsigned short __n)
+ {
+ return _M_insert(static_cast<unsigned long>(__n));
+ }
+ __ostream_type&
+ operator<<(int __n);
+ __ostream_type&
+ operator<<(unsigned int __n)
+ {
+ return _M_insert(static_cast<unsigned long>(__n));
+ }
+ __ostream_type&
+ operator<<(long long __n)
+ { return _M_insert(__n); }
+ __ostream_type&
+ operator<<(unsigned long long __n)
+ { return _M_insert(__n); }
+ __ostream_type&
+ operator<<(double __f)
+ { return _M_insert(__f); }
+ __ostream_type&
+ operator<<(float __f)
+ {
+ return _M_insert(static_cast<double>(__f));
+ }
+ __ostream_type&
+ operator<<(long double __f)
+ { return _M_insert(__f); }
+ __ostream_type&
+ operator<<(const void* __p)
+ { return _M_insert(__p); }
+ __ostream_type&
+ operator<<(__streambuf_type* __sb);
+ __ostream_type&
+ put(char_type __c);
+ void
+ _M_write(const char_type* __s, streamsize __n)
+ {
+ const streamsize __put = this->rdbuf()->sputn(__s, __n);
+ if (__put != __n)
+ this->setstate(ios_base::badbit);
+ }
+ __ostream_type&
+ write(const char_type* __s, streamsize __n);
+ __ostream_type&
+ flush();
+ pos_type
+ tellp();
+ __ostream_type&
+ seekp(pos_type);
+ __ostream_type&
+ seekp(off_type, ios_base::seekdir);
+ protected:
+ basic_ostream()
+ { this->init(0); }
+ template<typename _ValueT>
+ __ostream_type&
+ _M_insert(_ValueT __v);
+ };
+ template <typename _CharT, typename _Traits>
+ class basic_ostream<_CharT, _Traits>::sentry
+ {
+ bool _M_ok;
+ basic_ostream<_CharT, _Traits>& _M_os;
+ public:
+ explicit
+ sentry(basic_ostream<_CharT, _Traits>& __os);
+ ~sentry()
+ {
+ if (bool(_M_os.flags() & ios_base::unitbuf) && !uncaught_exception())
+ {
+ if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
+ _M_os.setstate(ios_base::badbit);
+ }
+ }
+ operator bool() const
+ { return _M_ok; }
+ };
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
+ { return __ostream_insert(__out, &__c, 1); }
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
+ { return (__out << __out.widen(__c)); }
+ template <class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, char __c)
+ { return __ostream_insert(__out, &__c, 1); }
+ template<class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
+ { return (__out << static_cast<char>(__c)); }
+ template<class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
+ { return (__out << static_cast<char>(__c)); }
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
+ {
+ if (!__s)
+ __out.setstate(ios_base::badbit);
+ else
+ __ostream_insert(__out, __s,
+ static_cast<streamsize>(_Traits::length(__s)));
+ return __out;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits> &
+ operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s);
+ template<class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
+ {
+ if (!__s)
+ __out.setstate(ios_base::badbit);
+ else
+ __ostream_insert(__out, __s,
+ static_cast<streamsize>(_Traits::length(__s)));
+ return __out;
+ }
+ template<class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
+ { return (__out << reinterpret_cast<const char*>(__s)); }
+ template<class _Traits>
+ inline basic_ostream<char, _Traits> &
+ operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
+ { return (__out << reinterpret_cast<const char*>(__s)); }
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ endl(basic_ostream<_CharT, _Traits>& __os)
+ { return flush(__os.put(__os.widen('\n'))); }
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ ends(basic_ostream<_CharT, _Traits>& __os)
+ { return __os.put(_CharT()); }
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ flush(basic_ostream<_CharT, _Traits>& __os)
+ { return __os.flush(); }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>::sentry::
+ sentry(basic_ostream<_CharT, _Traits>& __os)
+ : _M_ok(false), _M_os(__os)
+ {
+ if (__os.tie() && __os.good())
+ __os.tie()->flush();
+ if (__os.good())
+ _M_ok = true;
+ else
+ __os.setstate(ios_base::failbit);
+ }
+ template<typename _CharT, typename _Traits>
+ template<typename _ValueT>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ _M_insert(_ValueT __v)
+ {
+ sentry __cerb(*this);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ const __num_put_type& __np = __check_facet(this->_M_num_put);
+ if (__np.put(*this, *this, this->fill(), __v).failed())
+ __err |= ios_base::badbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(short __n)
+ {
+ const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
+ if (__fmt == ios_base::oct || __fmt == ios_base::hex)
+ return _M_insert(static_cast<long>(static_cast<unsigned short>(__n)));
+ else
+ return _M_insert(static_cast<long>(__n));
+ }
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(int __n)
+ {
+ const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
+ if (__fmt == ios_base::oct || __fmt == ios_base::hex)
+ return _M_insert(static_cast<long>(static_cast<unsigned int>(__n)));
+ else
+ return _M_insert(static_cast<long>(__n));
+ }
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(__streambuf_type* __sbin)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this);
+ if (__cerb && __sbin)
+ {
+ try
+ {
+ if (!__copy_streambufs(__sbin, this->rdbuf()))
+ __err |= ios_base::failbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::failbit); }
+ }
+ else if (!__sbin)
+ __err |= ios_base::badbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ put(char_type __c)
+ {
+ sentry __cerb(*this);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ const int_type __put = this->rdbuf()->sputc(__c);
+ if (traits_type::eq_int_type(__put, traits_type::eof()))
+ __err |= ios_base::badbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ write(const _CharT* __s, streamsize __n)
+ {
+ sentry __cerb(*this);
+ if (__cerb)
+ {
+ try
+ { _M_write(__s, __n); }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ flush()
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ if (this->rdbuf() && this->rdbuf()->pubsync() == -1)
+ __err |= ios_base::badbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ typename basic_ostream<_CharT, _Traits>::pos_type
+ basic_ostream<_CharT, _Traits>::
+ tellp()
+ {
+ pos_type __ret = pos_type(-1);
+ try
+ {
+ if (!this->fail())
+ __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ return __ret;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ seekp(pos_type __pos)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ if (!this->fail())
+ {
+ const pos_type __p = this->rdbuf()->pubseekpos(__pos,
+ ios_base::out);
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ seekp(off_type __off, ios_base::seekdir __dir)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ if (!this->fail())
+ {
+ const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+ ios_base::out);
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
+ {
+ if (!__s)
+ __out.setstate(ios_base::badbit);
+ else
+ {
+ const size_t __clen = char_traits<char>::length(__s);
+ try
+ {
+ struct __ptr_guard
+ {
+ _CharT *__p;
+ __ptr_guard (_CharT *__ip): __p(__ip) { }
+ ~__ptr_guard() { delete[] __p; }
+ _CharT* __get() { return __p; }
+ } __pg (new _CharT[__clen]);
+ _CharT *__ws = __pg.__get();
+ for (size_t __i = 0; __i < __clen; ++__i)
+ __ws[__i] = __out.widen(__s[__i]);
+ __ostream_insert(__out, __ws, __clen);
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __out._M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { __out._M_setstate(ios_base::badbit); }
+ }
+ return __out;
+ }
+ extern template class basic_ostream<char>;
+ extern template ostream& endl(ostream&);
+ extern template ostream& ends(ostream&);
+ extern template ostream& flush(ostream&);
+ extern template ostream& operator<<(ostream&, char);
+ extern template ostream& operator<<(ostream&, unsigned char);
+ extern template ostream& operator<<(ostream&, signed char);
+ extern template ostream& operator<<(ostream&, const char*);
+ extern template ostream& operator<<(ostream&, const unsigned char*);
+ extern template ostream& operator<<(ostream&, const signed char*);
+ extern template ostream& ostream::_M_insert(long);
+ extern template ostream& ostream::_M_insert(unsigned long);
+ extern template ostream& ostream::_M_insert(bool);
+ extern template ostream& ostream::_M_insert(long long);
+ extern template ostream& ostream::_M_insert(unsigned long long);
+ extern template ostream& ostream::_M_insert(double);
+ extern template ostream& ostream::_M_insert(long double);
+ extern template ostream& ostream::_M_insert(const void*);
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits>
+ class basic_istream : virtual public basic_ios<_CharT, _Traits>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef typename _Traits::int_type int_type;
+ typedef typename _Traits::pos_type pos_type;
+ typedef typename _Traits::off_type off_type;
+ typedef _Traits traits_type;
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef basic_ios<_CharT, _Traits> __ios_type;
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+ __num_get_type;
+ typedef ctype<_CharT> __ctype_type;
+ protected:
+ streamsize _M_gcount;
+ public:
+ explicit
+ basic_istream(__streambuf_type* __sb)
+ : _M_gcount(streamsize(0))
+ { this->init(__sb); }
+ virtual
+ ~basic_istream()
+ { _M_gcount = streamsize(0); }
+ class sentry;
+ friend class sentry;
+ __istream_type&
+ operator>>(__istream_type& (*__pf)(__istream_type&))
+ { return __pf(*this); }
+ __istream_type&
+ operator>>(__ios_type& (*__pf)(__ios_type&))
+ {
+ __pf(*this);
+ return *this;
+ }
+ __istream_type&
+ operator>>(ios_base& (*__pf)(ios_base&))
+ {
+ __pf(*this);
+ return *this;
+ }
+ __istream_type&
+ operator>>(bool& __n)
+ { return _M_extract(__n); }
+ __istream_type&
+ operator>>(short& __n);
+ __istream_type&
+ operator>>(unsigned short& __n)
+ { return _M_extract(__n); }
+ __istream_type&
+ operator>>(int& __n);
+ __istream_type&
+ operator>>(unsigned int& __n)
+ { return _M_extract(__n); }
+ __istream_type&
+ operator>>(long& __n)
+ { return _M_extract(__n); }
+ __istream_type&
+ operator>>(unsigned long& __n)
+ { return _M_extract(__n); }
+ __istream_type&
+ operator>>(long long& __n)
+ { return _M_extract(__n); }
+ __istream_type&
+ operator>>(unsigned long long& __n)
+ { return _M_extract(__n); }
+ __istream_type&
+ operator>>(float& __f)
+ { return _M_extract(__f); }
+ __istream_type&
+ operator>>(double& __f)
+ { return _M_extract(__f); }
+ __istream_type&
+ operator>>(long double& __f)
+ { return _M_extract(__f); }
+ __istream_type&
+ operator>>(void*& __p)
+ { return _M_extract(__p); }
+ __istream_type&
+ operator>>(__streambuf_type* __sb);
+ streamsize
+ gcount() const
+ { return _M_gcount; }
+ int_type
+ get();
+ __istream_type&
+ get(char_type& __c);
+ __istream_type&
+ get(char_type* __s, streamsize __n, char_type __delim);
+ __istream_type&
+ get(char_type* __s, streamsize __n)
+ { return this->get(__s, __n, this->widen('\n')); }
+ __istream_type&
+ get(__streambuf_type& __sb, char_type __delim);
+ __istream_type&
+ get(__streambuf_type& __sb)
+ { return this->get(__sb, this->widen('\n')); }
+ __istream_type&
+ getline(char_type* __s, streamsize __n, char_type __delim);
+ __istream_type&
+ getline(char_type* __s, streamsize __n)
+ { return this->getline(__s, __n, this->widen('\n')); }
+ __istream_type&
+ ignore();
+ __istream_type&
+ ignore(streamsize __n);
+ __istream_type&
+ ignore(streamsize __n, int_type __delim);
+ int_type
+ peek();
+ __istream_type&
+ read(char_type* __s, streamsize __n);
+ streamsize
+ readsome(char_type* __s, streamsize __n);
+ __istream_type&
+ putback(char_type __c);
+ __istream_type&
+ unget();
+ int
+ sync();
+ pos_type
+ tellg();
+ __istream_type&
+ seekg(pos_type);
+ __istream_type&
+ seekg(off_type, ios_base::seekdir);
+ protected:
+ basic_istream()
+ : _M_gcount(streamsize(0))
+ { this->init(0); }
+ template<typename _ValueT>
+ __istream_type&
+ _M_extract(_ValueT& __v);
+ };
+ template<>
+ basic_istream<char>&
+ basic_istream<char>::
+ getline(char_type* __s, streamsize __n, char_type __delim);
+ template<>
+ basic_istream<char>&
+ basic_istream<char>::
+ ignore(streamsize __n);
+ template<>
+ basic_istream<char>&
+ basic_istream<char>::
+ ignore(streamsize __n, int_type __delim);
+ template<typename _CharT, typename _Traits>
+ class basic_istream<_CharT, _Traits>::sentry
+ {
+ public:
+ typedef _Traits traits_type;
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::__ctype_type __ctype_type;
+ typedef typename _Traits::int_type __int_type;
+ explicit
+ sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
+ operator bool() const
+ { return _M_ok; }
+ private:
+ bool _M_ok;
+ };
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c);
+ template<class _Traits>
+ inline basic_istream<char, _Traits>&
+ operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
+ { return (__in >> reinterpret_cast<char&>(__c)); }
+ template<class _Traits>
+ inline basic_istream<char, _Traits>&
+ operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
+ { return (__in >> reinterpret_cast<char&>(__c)); }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s);
+ template<>
+ basic_istream<char>&
+ operator>>(basic_istream<char>& __in, char* __s);
+ template<class _Traits>
+ inline basic_istream<char, _Traits>&
+ operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
+ { return (__in >> reinterpret_cast<char*>(__s)); }
+ template<class _Traits>
+ inline basic_istream<char, _Traits>&
+ operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
+ { return (__in >> reinterpret_cast<char*>(__s)); }
+ template<typename _CharT, typename _Traits>
+ class basic_iostream
+ : public basic_istream<_CharT, _Traits>,
+ public basic_ostream<_CharT, _Traits>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef typename _Traits::int_type int_type;
+ typedef typename _Traits::pos_type pos_type;
+ typedef typename _Traits::off_type off_type;
+ typedef _Traits traits_type;
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ explicit
+ basic_iostream(basic_streambuf<_CharT, _Traits>* __sb)
+ : __istream_type(__sb), __ostream_type(__sb) { }
+ virtual
+ ~basic_iostream() { }
+ protected:
+ basic_iostream()
+ : __istream_type(), __ostream_type() { }
+ };
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ ws(basic_istream<_CharT, _Traits>& __is);
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>::sentry::
+ sentry(basic_istream<_CharT, _Traits>& __in, bool __noskip) : _M_ok(false)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (__in.good())
+ {
+ if (__in.tie())
+ __in.tie()->flush();
+ if (!__noskip && bool(__in.flags() & ios_base::skipws))
+ {
+ const __int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = __in.rdbuf();
+ __int_type __c = __sb->sgetc();
+ const __ctype_type& __ct = __check_facet(__in._M_ctype);
+ while (!traits_type::eq_int_type(__c, __eof)
+ && __ct.is(ctype_base::space,
+ traits_type::to_char_type(__c)))
+ __c = __sb->snextc();
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ }
+ if (__in.good() && __err == ios_base::goodbit)
+ _M_ok = true;
+ else
+ {
+ __err |= ios_base::failbit;
+ __in.setstate(__err);
+ }
+ }
+ template<typename _CharT, typename _Traits>
+ template<typename _ValueT>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ _M_extract(_ValueT& __v)
+ {
+ sentry __cerb(*this, false);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __v);
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ operator>>(short& __n)
+ {
+ long __l;
+ _M_extract(__l);
+ if (!this->fail())
+ {
+ if (__gnu_cxx::__numeric_traits<short>::__min <= __l
+ && __l <= __gnu_cxx::__numeric_traits<short>::__max)
+ __n = short(__l);
+ else
+ this->setstate(ios_base::failbit);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ operator>>(int& __n)
+ {
+ long __l;
+ _M_extract(__l);
+ if (!this->fail())
+ {
+ if (__gnu_cxx::__numeric_traits<int>::__min <= __l
+ && __l <= __gnu_cxx::__numeric_traits<int>::__max)
+ __n = int(__l);
+ else
+ this->setstate(ios_base::failbit);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ operator>>(__streambuf_type* __sbout)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, false);
+ if (__cerb && __sbout)
+ {
+ try
+ {
+ bool __ineof;
+ if (!__copy_streambufs_eof(this->rdbuf(), __sbout, __ineof))
+ __err |= ios_base::failbit;
+ if (__ineof)
+ __err |= ios_base::eofbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::failbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::failbit); }
+ }
+ else if (!__sbout)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ typename basic_istream<_CharT, _Traits>::int_type
+ basic_istream<_CharT, _Traits>::
+ get(void)
+ {
+ const int_type __eof = traits_type::eof();
+ int_type __c = __eof;
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ try
+ {
+ __c = this->rdbuf()->sbumpc();
+ if (!traits_type::eq_int_type(__c, __eof))
+ _M_gcount = 1;
+ else
+ __err |= ios_base::eofbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return __c;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ get(char_type& __c)
+ {
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ try
+ {
+ const int_type __cb = this->rdbuf()->sbumpc();
+ if (!traits_type::eq_int_type(__cb, traits_type::eof()))
+ {
+ _M_gcount = 1;
+ __c = traits_type::to_char_type(__cb);
+ }
+ else
+ __err |= ios_base::eofbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ get(char_type* __s, streamsize __n, char_type __delim)
+ {
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ try
+ {
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sgetc();
+ while (_M_gcount + 1 < __n
+ && !traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __idelim))
+ {
+ *__s++ = traits_type::to_char_type(__c);
+ ++_M_gcount;
+ __c = __sb->snextc();
+ }
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ if (__n > 0)
+ *__s = char_type();
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ get(__streambuf_type& __sb, char_type __delim)
+ {
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ try
+ {
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __this_sb = this->rdbuf();
+ int_type __c = __this_sb->sgetc();
+ char_type __c2 = traits_type::to_char_type(__c);
+ while (!traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __idelim)
+ && !traits_type::eq_int_type(__sb.sputc(__c2), __eof))
+ {
+ ++_M_gcount;
+ __c = __this_sb->snextc();
+ __c2 = traits_type::to_char_type(__c);
+ }
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ getline(char_type* __s, streamsize __n, char_type __delim)
+ {
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ try
+ {
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sgetc();
+ while (_M_gcount + 1 < __n
+ && !traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __idelim))
+ {
+ *__s++ = traits_type::to_char_type(__c);
+ __c = __sb->snextc();
+ ++_M_gcount;
+ }
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ else
+ {
+ if (traits_type::eq_int_type(__c, __idelim))
+ {
+ __sb->sbumpc();
+ ++_M_gcount;
+ }
+ else
+ __err |= ios_base::failbit;
+ }
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ if (__n > 0)
+ *__s = char_type();
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ ignore(void)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ if (traits_type::eq_int_type(__sb->sbumpc(), __eof))
+ __err |= ios_base::eofbit;
+ else
+ _M_gcount = 1;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ ignore(streamsize __n)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb && __n > 0)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sgetc();
+ bool __large_ignore = false;
+ while (true)
+ {
+ while (_M_gcount < __n
+ && !traits_type::eq_int_type(__c, __eof))
+ {
+ ++_M_gcount;
+ __c = __sb->snextc();
+ }
+ if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
+ && !traits_type::eq_int_type(__c, __eof))
+ {
+ _M_gcount =
+ __gnu_cxx::__numeric_traits<streamsize>::__min;
+ __large_ignore = true;
+ }
+ else
+ break;
+ }
+ if (__large_ignore)
+ _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ ignore(streamsize __n, int_type __delim)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb && __n > 0)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sgetc();
+ bool __large_ignore = false;
+ while (true)
+ {
+ while (_M_gcount < __n
+ && !traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __delim))
+ {
+ ++_M_gcount;
+ __c = __sb->snextc();
+ }
+ if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
+ && !traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __delim))
+ {
+ _M_gcount =
+ __gnu_cxx::__numeric_traits<streamsize>::__min;
+ __large_ignore = true;
+ }
+ else
+ break;
+ }
+ if (__large_ignore)
+ _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ else if (traits_type::eq_int_type(__c, __delim))
+ {
+ if (_M_gcount
+ < __gnu_cxx::__numeric_traits<streamsize>::__max)
+ ++_M_gcount;
+ __sb->sbumpc();
+ }
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ typename basic_istream<_CharT, _Traits>::int_type
+ basic_istream<_CharT, _Traits>::
+ peek(void)
+ {
+ int_type __c = traits_type::eof();
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ __c = this->rdbuf()->sgetc();
+ if (traits_type::eq_int_type(__c, traits_type::eof()))
+ __err |= ios_base::eofbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return __c;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ read(char_type* __s, streamsize __n)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ _M_gcount = this->rdbuf()->sgetn(__s, __n);
+ if (_M_gcount != __n)
+ __err |= (ios_base::eofbit | ios_base::failbit);
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_istream<_CharT, _Traits>::
+ readsome(char_type* __s, streamsize __n)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ const streamsize __num = this->rdbuf()->in_avail();
+ if (__num > 0)
+ _M_gcount = this->rdbuf()->sgetn(__s, std::min(__num, __n));
+ else if (__num == -1)
+ __err |= ios_base::eofbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return _M_gcount;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ putback(char_type __c)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ if (!__sb
+ || traits_type::eq_int_type(__sb->sputbackc(__c), __eof))
+ __err |= ios_base::badbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ unget(void)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ if (!__sb
+ || traits_type::eq_int_type(__sb->sungetc(), __eof))
+ __err |= ios_base::badbit;
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ int
+ basic_istream<_CharT, _Traits>::
+ sync(void)
+ {
+ int __ret = -1;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ __streambuf_type* __sb = this->rdbuf();
+ if (__sb)
+ {
+ if (__sb->pubsync() == -1)
+ __err |= ios_base::badbit;
+ else
+ __ret = 0;
+ }
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return __ret;
+ }
+ template<typename _CharT, typename _Traits>
+ typename basic_istream<_CharT, _Traits>::pos_type
+ basic_istream<_CharT, _Traits>::
+ tellg(void)
+ {
+ pos_type __ret = pos_type(-1);
+ try
+ {
+ if (!this->fail())
+ __ret = this->rdbuf()->pubseekoff(0, ios_base::cur,
+ ios_base::in);
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ return __ret;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ seekg(pos_type __pos)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ if (!this->fail())
+ {
+ const pos_type __p = this->rdbuf()->pubseekpos(__pos,
+ ios_base::in);
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ seekg(off_type __off, ios_base::seekdir __dir)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ if (!this->fail())
+ {
+ const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+ ios_base::in);
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::int_type __int_type;
+ typename __istream_type::sentry __cerb(__in, false);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ const __int_type __cb = __in.rdbuf()->sbumpc();
+ if (!_Traits::eq_int_type(__cb, _Traits::eof()))
+ __c = _Traits::to_char_type(__cb);
+ else
+ __err |= (ios_base::eofbit | ios_base::failbit);
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { __in._M_setstate(ios_base::badbit); }
+ if (__err)
+ __in.setstate(__err);
+ }
+ return __in;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef typename _Traits::int_type int_type;
+ typedef _CharT char_type;
+ typedef ctype<_CharT> __ctype_type;
+ streamsize __extracted = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ typename __istream_type::sentry __cerb(__in, false);
+ if (__cerb)
+ {
+ try
+ {
+ streamsize __num = __in.width();
+ if (__num <= 0)
+ __num = __gnu_cxx::__numeric_traits<streamsize>::__max;
+ const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+ const int_type __eof = _Traits::eof();
+ __streambuf_type* __sb = __in.rdbuf();
+ int_type __c = __sb->sgetc();
+ while (__extracted < __num - 1
+ && !_Traits::eq_int_type(__c, __eof)
+ && !__ct.is(ctype_base::space,
+ _Traits::to_char_type(__c)))
+ {
+ *__s++ = _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __sb->snextc();
+ }
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ *__s = char_type();
+ __in.width(0);
+ }
+ catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ throw;
+ }
+ catch(...)
+ { __in._M_setstate(ios_base::badbit); }
+ }
+ if (!__extracted)
+ __err |= ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ ws(basic_istream<_CharT, _Traits>& __in)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef typename __istream_type::int_type __int_type;
+ typedef ctype<_CharT> __ctype_type;
+ const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+ const __int_type __eof = _Traits::eof();
+ __streambuf_type* __sb = __in.rdbuf();
+ __int_type __c = __sb->sgetc();
+ while (!_Traits::eq_int_type(__c, __eof)
+ && __ct.is(ctype_base::space, _Traits::to_char_type(__c)))
+ __c = __sb->snextc();
+ if (_Traits::eq_int_type(__c, __eof))
+ __in.setstate(ios_base::eofbit);
+ return __in;
+ }
+ extern template class basic_istream<char>;
+ extern template istream& ws(istream&);
+ extern template istream& operator>>(istream&, char&);
+ extern template istream& operator>>(istream&, char*);
+ extern template istream& operator>>(istream&, unsigned char&);
+ extern template istream& operator>>(istream&, signed char&);
+ extern template istream& operator>>(istream&, unsigned char*);
+ extern template istream& operator>>(istream&, signed char*);
+ extern template istream& istream::_M_extract(unsigned short&);
+ extern template istream& istream::_M_extract(unsigned int&);
+ extern template istream& istream::_M_extract(long&);
+ extern template istream& istream::_M_extract(unsigned long&);
+ extern template istream& istream::_M_extract(bool&);
+ extern template istream& istream::_M_extract(long long&);
+ extern template istream& istream::_M_extract(unsigned long long&);
+ extern template istream& istream::_M_extract(float&);
+ extern template istream& istream::_M_extract(double&);
+ extern template istream& istream::_M_extract(long double&);
+ extern template istream& istream::_M_extract(void*&);
+ extern template class basic_iostream<char>;
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Tp, typename _CharT = char,
+ typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
+ class istream_iterator
+ : public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_istream<_CharT, _Traits> istream_type;
+ private:
+ istream_type* _M_stream;
+ _Tp _M_value;
+ bool _M_ok;
+ public:
+ istream_iterator()
+ : _M_stream(0), _M_value(), _M_ok(false) {}
+ istream_iterator(istream_type& __s)
+ : _M_stream(&__s)
+ { _M_read(); }
+ istream_iterator(const istream_iterator& __obj)
+ : _M_stream(__obj._M_stream), _M_value(__obj._M_value),
+ _M_ok(__obj._M_ok)
+ { }
+ const _Tp&
+ operator*() const
+ {
+ ;
+ return _M_value;
+ }
+ const _Tp*
+ operator->() const { return &(operator*()); }
+ istream_iterator&
+ operator++()
+ {
+ ;
+ _M_read();
+ return *this;
+ }
+ istream_iterator
+ operator++(int)
+ {
+ ;
+ istream_iterator __tmp = *this;
+ _M_read();
+ return __tmp;
+ }
+ bool
+ _M_equal(const istream_iterator& __x) const
+ { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); }
+ private:
+ void
+ _M_read()
+ {
+ _M_ok = (_M_stream && *_M_stream) ? true : false;
+ if (_M_ok)
+ {
+ *_M_stream >> _M_value;
+ _M_ok = *_M_stream ? true : false;
+ }
+ }
+ };
+ template<typename _Tp, typename _CharT, typename _Traits, typename _Dist>
+ inline bool
+ operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
+ const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
+ { return __x._M_equal(__y); }
+ template <class _Tp, class _CharT, class _Traits, class _Dist>
+ inline bool
+ operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
+ const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
+ { return !__x._M_equal(__y); }
+ template<typename _Tp, typename _CharT = char,
+ typename _Traits = char_traits<_CharT> >
+ class ostream_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_ostream<_CharT, _Traits> ostream_type;
+ private:
+ ostream_type* _M_stream;
+ const _CharT* _M_string;
+ public:
+ ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {}
+ ostream_iterator(ostream_type& __s, const _CharT* __c)
+ : _M_stream(&__s), _M_string(__c) { }
+ ostream_iterator(const ostream_iterator& __obj)
+ : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
+ ostream_iterator&
+ operator=(const _Tp& __value)
+ {
+ ;
+ *_M_stream << __value;
+ if (_M_string) *_M_stream << _M_string;
+ return *this;
+ }
+ ostream_iterator&
+ operator*()
+ { return *this; }
+ ostream_iterator&
+ operator++()
+ { return *this; }
+ ostream_iterator&
+ operator++(int)
+ { return *this; }
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ struct _List_node_base
+ {
+ _List_node_base* _M_next;
+ _List_node_base* _M_prev;
+ static void
+ swap(_List_node_base& __x, _List_node_base& __y);
+ void
+ transfer(_List_node_base * const __first,
+ _List_node_base * const __last);
+ void
+ reverse();
+ void
+ hook(_List_node_base * const __position);
+ void
+ unhook();
+ };
+ template<typename _Tp>
+ struct _List_node : public _List_node_base
+ {
+ _Tp _M_data;
+ };
+ template<typename _Tp>
+ struct _List_iterator
+ {
+ typedef _List_iterator<_Tp> _Self;
+ typedef _List_node<_Tp> _Node;
+ typedef ptrdiff_t difference_type;
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+ _List_iterator()
+ : _M_node() { }
+ explicit
+ _List_iterator(_List_node_base* __x)
+ : _M_node(__x) { }
+ reference
+ operator*() const
+ { return static_cast<_Node*>(_M_node)->_M_data; }
+ pointer
+ operator->() const
+ { return &static_cast<_Node*>(_M_node)->_M_data; }
+ _Self&
+ operator++()
+ {
+ _M_node = _M_node->_M_next;
+ return *this;
+ }
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_next;
+ return __tmp;
+ }
+ _Self&
+ operator--()
+ {
+ _M_node = _M_node->_M_prev;
+ return *this;
+ }
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_prev;
+ return __tmp;
+ }
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+ _List_node_base* _M_node;
+ };
+ template<typename _Tp>
+ struct _List_const_iterator
+ {
+ typedef _List_const_iterator<_Tp> _Self;
+ typedef const _List_node<_Tp> _Node;
+ typedef _List_iterator<_Tp> iterator;
+ typedef ptrdiff_t difference_type;
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef const _Tp* pointer;
+ typedef const _Tp& reference;
+ _List_const_iterator()
+ : _M_node() { }
+ explicit
+ _List_const_iterator(const _List_node_base* __x)
+ : _M_node(__x) { }
+ _List_const_iterator(const iterator& __x)
+ : _M_node(__x._M_node) { }
+ reference
+ operator*() const
+ { return static_cast<_Node*>(_M_node)->_M_data; }
+ pointer
+ operator->() const
+ { return &static_cast<_Node*>(_M_node)->_M_data; }
+ _Self&
+ operator++()
+ {
+ _M_node = _M_node->_M_next;
+ return *this;
+ }
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_next;
+ return __tmp;
+ }
+ _Self&
+ operator--()
+ {
+ _M_node = _M_node->_M_prev;
+ return *this;
+ }
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_prev;
+ return __tmp;
+ }
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+ const _List_node_base* _M_node;
+ };
+ template<typename _Val>
+ inline bool
+ operator==(const _List_iterator<_Val>& __x,
+ const _List_const_iterator<_Val>& __y)
+ { return __x._M_node == __y._M_node; }
+ template<typename _Val>
+ inline bool
+ operator!=(const _List_iterator<_Val>& __x,
+ const _List_const_iterator<_Val>& __y)
+ { return __x._M_node != __y._M_node; }
+ template<typename _Tp, typename _Alloc>
+ class _List_base
+ {
+ protected:
+ typedef typename _Alloc::template rebind<_List_node<_Tp> >::other
+ _Node_alloc_type;
+ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+ struct _List_impl
+ : public _Node_alloc_type
+ {
+ _List_node_base _M_node;
+ _List_impl()
+ : _Node_alloc_type(), _M_node()
+ { }
+ _List_impl(const _Node_alloc_type& __a)
+ : _Node_alloc_type(__a), _M_node()
+ { }
+ };
+ _List_impl _M_impl;
+ _List_node<_Tp>*
+ _M_get_node()
+ { return _M_impl._Node_alloc_type::allocate(1); }
+ void
+ _M_put_node(_List_node<_Tp>* __p)
+ { _M_impl._Node_alloc_type::deallocate(__p, 1); }
+ public:
+ typedef _Alloc allocator_type;
+ _Node_alloc_type&
+ _M_get_Node_allocator()
+ { return *static_cast<_Node_alloc_type*>(&this->_M_impl); }
+ const _Node_alloc_type&
+ _M_get_Node_allocator() const
+ { return *static_cast<const _Node_alloc_type*>(&this->_M_impl); }
+ _Tp_alloc_type
+ _M_get_Tp_allocator() const
+ { return _Tp_alloc_type(_M_get_Node_allocator()); }
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Node_allocator()); }
+ _List_base()
+ : _M_impl()
+ { _M_init(); }
+ _List_base(const allocator_type& __a)
+ : _M_impl(__a)
+ { _M_init(); }
+ ~_List_base()
+ { _M_clear(); }
+ void
+ _M_clear();
+ void
+ _M_init()
+ {
+ this->_M_impl._M_node._M_next = &this->_M_impl._M_node;
+ this->_M_impl._M_node._M_prev = &this->_M_impl._M_node;
+ }
+ };
+ template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
+ class list : protected _List_base<_Tp, _Alloc>
+ {
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ typedef _List_base<_Tp, _Alloc> _Base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+ public:
+ typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef typename _Tp_alloc_type::const_pointer const_pointer;
+ typedef typename _Tp_alloc_type::reference reference;
+ typedef typename _Tp_alloc_type::const_reference const_reference;
+ typedef _List_iterator<_Tp> iterator;
+ typedef _List_const_iterator<_Tp> const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+ protected:
+ typedef _List_node<_Tp> _Node;
+ using _Base::_M_impl;
+ using _Base::_M_put_node;
+ using _Base::_M_get_node;
+ using _Base::_M_get_Tp_allocator;
+ using _Base::_M_get_Node_allocator;
+ _Node*
+ _M_create_node(const value_type& __x)
+ {
+ _Node* __p = this->_M_get_node();
+ try
+ {
+ _M_get_Tp_allocator().construct(&__p->_M_data, __x);
+ }
+ catch(...)
+ {
+ _M_put_node(__p);
+ throw;
+ }
+ return __p;
+ }
+ public:
+ list()
+ : _Base() { }
+ explicit
+ list(const allocator_type& __a)
+ : _Base(__a) { }
+ explicit
+ list(size_type __n, const value_type& __value = value_type(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_fill_initialize(__n, __value); }
+ list(const list& __x)
+ : _Base(__x._M_get_Node_allocator())
+ { _M_initialize_dispatch(__x.begin(), __x.end(), __false_type()); }
+ template<typename _InputIterator>
+ list(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+ list&
+ operator=(const list& __x);
+ void
+ assign(size_type __n, const value_type& __val)
+ { _M_fill_assign(__n, __val); }
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+ allocator_type
+ get_allocator() const
+ { return _Base::get_allocator(); }
+ iterator
+ begin()
+ { return iterator(this->_M_impl._M_node._M_next); }
+ const_iterator
+ begin() const
+ { return const_iterator(this->_M_impl._M_node._M_next); }
+ iterator
+ end()
+ { return iterator(&this->_M_impl._M_node); }
+ const_iterator
+ end() const
+ { return const_iterator(&this->_M_impl._M_node); }
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+ bool
+ empty() const
+ { return this->_M_impl._M_node._M_next == &this->_M_impl._M_node; }
+ size_type
+ size() const
+ { return std::distance(begin(), end()); }
+ size_type
+ max_size() const
+ { return _M_get_Tp_allocator().max_size(); }
+ void
+ resize(size_type __new_size, value_type __x = value_type());
+ reference
+ front()
+ { return *begin(); }
+ const_reference
+ front() const
+ { return *begin(); }
+ reference
+ back()
+ {
+ iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+ }
+ const_reference
+ back() const
+ {
+ const_iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+ }
+ void
+ push_front(const value_type& __x)
+ { this->_M_insert(begin(), __x); }
+ void
+ pop_front()
+ { this->_M_erase(begin()); }
+ void
+ push_back(const value_type& __x)
+ { this->_M_insert(end(), __x); }
+ void
+ pop_back()
+ { this->_M_erase(iterator(this->_M_impl._M_node._M_prev)); }
+ iterator
+ insert(iterator __position, const value_type& __x);
+ void
+ insert(iterator __position, size_type __n, const value_type& __x)
+ {
+ list __tmp(__n, __x, _M_get_Node_allocator());
+ splice(__position, __tmp);
+ }
+ template<typename _InputIterator>
+ void
+ insert(iterator __position, _InputIterator __first,
+ _InputIterator __last)
+ {
+ list __tmp(__first, __last, _M_get_Node_allocator());
+ splice(__position, __tmp);
+ }
+ iterator
+ erase(iterator __position);
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ while (__first != __last)
+ __first = erase(__first);
+ return __last;
+ }
+ void
+ swap(list& __x)
+ {
+ _List_node_base::swap(this->_M_impl._M_node, __x._M_impl._M_node);
+ std::__alloc_swap<typename _Base::_Node_alloc_type>::
+ _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator());
+ }
+ void
+ clear()
+ {
+ _Base::_M_clear();
+ _Base::_M_init();
+ }
+ void
+ splice(iterator __position, list& __x)
+ {
+ if (!__x.empty())
+ {
+ _M_check_equal_allocators(__x);
+ this->_M_transfer(__position, __x.begin(), __x.end());
+ }
+ }
+ void
+ splice(iterator __position, list& __x, iterator __i)
+ {
+ iterator __j = __i;
+ ++__j;
+ if (__position == __i || __position == __j)
+ return;
+ if (this != &__x)
+ _M_check_equal_allocators(__x);
+ this->_M_transfer(__position, __i, __j);
+ }
+ void
+ splice(iterator __position, list& __x, iterator __first,
+ iterator __last)
+ {
+ if (__first != __last)
+ {
+ if (this != &__x)
+ _M_check_equal_allocators(__x);
+ this->_M_transfer(__position, __first, __last);
+ }
+ }
+ void
+ remove(const _Tp& __value);
+ template<typename _Predicate>
+ void
+ remove_if(_Predicate);
+ void
+ unique();
+ template<typename _BinaryPredicate>
+ void
+ unique(_BinaryPredicate);
+ void
+ merge(list& __x);
+ template<typename _StrictWeakOrdering>
+ void
+ merge(list&, _StrictWeakOrdering);
+ void
+ reverse()
+ { this->_M_impl._M_node.reverse(); }
+ void
+ sort();
+ template<typename _StrictWeakOrdering>
+ void
+ sort(_StrictWeakOrdering);
+ protected:
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
+ { _M_fill_initialize(static_cast<size_type>(__n), __x); }
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+ void
+ _M_fill_initialize(size_type __n, const value_type& __x)
+ {
+ for (; __n > 0; --__n)
+ push_back(__x);
+ }
+ template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+ template<typename _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type);
+ void
+ _M_fill_assign(size_type __n, const value_type& __val);
+ void
+ _M_transfer(iterator __position, iterator __first, iterator __last)
+ { __position._M_node->transfer(__first._M_node, __last._M_node); }
+ void
+ _M_insert(iterator __position, const value_type& __x)
+ {
+ _Node* __tmp = _M_create_node(__x);
+ __tmp->hook(__position._M_node);
+ }
+ void
+ _M_erase(iterator __position)
+ {
+ __position._M_node->unhook();
+ _Node* __n = static_cast<_Node*>(__position._M_node);
+ _M_get_Tp_allocator().destroy(&__n->_M_data);
+ _M_put_node(__n);
+ }
+ void
+ _M_check_equal_allocators(list& __x)
+ {
+ if (std::__alloc_neq<typename _Base::_Node_alloc_type>::
+ _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator()))
+ __throw_runtime_error(("list::_M_check_equal_allocators"));
+ }
+ };
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ {
+ typedef typename list<_Tp, _Alloc>::const_iterator const_iterator;
+ const_iterator __end1 = __x.end();
+ const_iterator __end2 = __y.end();
+ const_iterator __i1 = __x.begin();
+ const_iterator __i2 = __y.begin();
+ while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
+ {
+ ++__i1;
+ ++__i2;
+ }
+ return __i1 == __end1 && __i2 == __end2;
+ }
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return std::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end()); }
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return !(__x == __y); }
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return __y < __x; }
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return !(__y < __x); }
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return !(__x < __y); }
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
+ { __x.swap(__y); }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Tp, typename _Alloc>
+ void
+ _List_base<_Tp, _Alloc>::
+ _M_clear()
+ {
+ typedef _List_node<_Tp> _Node;
+ _Node* __cur = static_cast<_Node*>(this->_M_impl._M_node._M_next);
+ while (__cur != &this->_M_impl._M_node)
+ {
+ _Node* __tmp = __cur;
+ __cur = static_cast<_Node*>(__cur->_M_next);
+ _M_get_Tp_allocator().destroy(&__tmp->_M_data);
+ _M_put_node(__tmp);
+ }
+ }
+ template<typename _Tp, typename _Alloc>
+ typename list<_Tp, _Alloc>::iterator
+ list<_Tp, _Alloc>::
+ insert(iterator __position, const value_type& __x)
+ {
+ _Node* __tmp = _M_create_node(__x);
+ __tmp->hook(__position._M_node);
+ return iterator(__tmp);
+ }
+ template<typename _Tp, typename _Alloc>
+ typename list<_Tp, _Alloc>::iterator
+ list<_Tp, _Alloc>::
+ erase(iterator __position)
+ {
+ iterator __ret = iterator(__position._M_node->_M_next);
+ _M_erase(__position);
+ return __ret;
+ }
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ resize(size_type __new_size, value_type __x)
+ {
+ iterator __i = begin();
+ size_type __len = 0;
+ for (; __i != end() && __len < __new_size; ++__i, ++__len)
+ ;
+ if (__len == __new_size)
+ erase(__i, end());
+ else
+ insert(end(), __new_size - __len, __x);
+ }
+ template<typename _Tp, typename _Alloc>
+ list<_Tp, _Alloc>&
+ list<_Tp, _Alloc>::
+ operator=(const list& __x)
+ {
+ if (this != &__x)
+ {
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ const_iterator __first2 = __x.begin();
+ const_iterator __last2 = __x.end();
+ for (; __first1 != __last1 && __first2 != __last2;
+ ++__first1, ++__first2)
+ *__first1 = *__first2;
+ if (__first2 == __last2)
+ erase(__first1, __last1);
+ else
+ insert(__last1, __first2, __last2);
+ }
+ return *this;
+ }
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ _M_fill_assign(size_type __n, const value_type& __val)
+ {
+ iterator __i = begin();
+ for (; __i != end() && __n > 0; ++__i, --__n)
+ *__i = __val;
+ if (__n > 0)
+ insert(end(), __n, __val);
+ else
+ erase(__i, end());
+ }
+ template<typename _Tp, typename _Alloc>
+ template <typename _InputIterator>
+ void
+ list<_Tp, _Alloc>::
+ _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
+ __false_type)
+ {
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ for (; __first1 != __last1 && __first2 != __last2;
+ ++__first1, ++__first2)
+ *__first1 = *__first2;
+ if (__first2 == __last2)
+ erase(__first1, __last1);
+ else
+ insert(__last1, __first2, __last2);
+ }
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ remove(const value_type& __value)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ iterator __extra = __last;
+ while (__first != __last)
+ {
+ iterator __next = __first;
+ ++__next;
+ if (*__first == __value)
+ {
+ if (&*__first != &__value)
+ _M_erase(__first);
+ else
+ __extra = __first;
+ }
+ __first = __next;
+ }
+ if (__extra != __last)
+ _M_erase(__extra);
+ }
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ unique()
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (*__first == *__next)
+ _M_erase(__next);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ merge(list& __x)
+ {
+ if (this != &__x)
+ {
+ _M_check_equal_allocators(__x);
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ iterator __first2 = __x.begin();
+ iterator __last2 = __x.end();
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first2 < *__first1)
+ {
+ iterator __next = __first2;
+ _M_transfer(__first1, __first2, ++__next);
+ __first2 = __next;
+ }
+ else
+ ++__first1;
+ if (__first2 != __last2)
+ _M_transfer(__last1, __first2, __last2);
+ }
+ }
+ template<typename _Tp, typename _Alloc>
+ template <typename _StrictWeakOrdering>
+ void
+ list<_Tp, _Alloc>::
+ merge(list& __x, _StrictWeakOrdering __comp)
+ {
+ if (this != &__x)
+ {
+ _M_check_equal_allocators(__x);
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ iterator __first2 = __x.begin();
+ iterator __last2 = __x.end();
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(*__first2, *__first1))
+ {
+ iterator __next = __first2;
+ _M_transfer(__first1, __first2, ++__next);
+ __first2 = __next;
+ }
+ else
+ ++__first1;
+ if (__first2 != __last2)
+ _M_transfer(__last1, __first2, __last2);
+ }
+ }
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ sort()
+ {
+ if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
+ && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
+ {
+ list __carry;
+ list __tmp[64];
+ list * __fill = &__tmp[0];
+ list * __counter;
+ do
+ {
+ __carry.splice(__carry.begin(), *this, begin());
+ for(__counter = &__tmp[0];
+ __counter != __fill && !__counter->empty();
+ ++__counter)
+ {
+ __counter->merge(__carry);
+ __carry.swap(*__counter);
+ }
+ __carry.swap(*__counter);
+ if (__counter == __fill)
+ ++__fill;
+ }
+ while ( !empty() );
+ for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
+ __counter->merge(*(__counter - 1));
+ swap( *(__fill - 1) );
+ }
+ }
+ template<typename _Tp, typename _Alloc>
+ template <typename _Predicate>
+ void
+ list<_Tp, _Alloc>::
+ remove_if(_Predicate __pred)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ while (__first != __last)
+ {
+ iterator __next = __first;
+ ++__next;
+ if (__pred(*__first))
+ _M_erase(__first);
+ __first = __next;
+ }
+ }
+ template<typename _Tp, typename _Alloc>
+ template <typename _BinaryPredicate>
+ void
+ list<_Tp, _Alloc>::
+ unique(_BinaryPredicate __binary_pred)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (__binary_pred(*__first, *__next))
+ _M_erase(__next);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+ template<typename _Tp, typename _Alloc>
+ template <typename _StrictWeakOrdering>
+ void
+ list<_Tp, _Alloc>::
+ sort(_StrictWeakOrdering __comp)
+ {
+ if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
+ && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
+ {
+ list __carry;
+ list __tmp[64];
+ list * __fill = &__tmp[0];
+ list * __counter;
+ do
+ {
+ __carry.splice(__carry.begin(), *this, begin());
+ for(__counter = &__tmp[0];
+ __counter != __fill && !__counter->empty();
+ ++__counter)
+ {
+ __counter->merge(__carry, __comp);
+ __carry.swap(*__counter);
+ }
+ __carry.swap(*__counter);
+ if (__counter == __fill)
+ ++__fill;
+ }
+ while ( !empty() );
+ for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
+ __counter->merge(*(__counter - 1), __comp);
+ swap(*(__fill - 1));
+ }
+ }
+}
+typedef QtValidLicenseForCoreModule QtCoreModule;
+template <typename T> class QVector;
+template <typename T> class QSet;
+struct __attribute__((visibility("default"))) QListData {
+ struct Data {
+ QBasicAtomicInt ref;
+ int alloc, begin, end;
+ uint sharable : 1;
+ void *array[1];
+ };
+ enum { DataHeaderSize = sizeof(Data) - sizeof(void *) };
+ Data *detach();
+ Data *detach2();
+ void realloc(int alloc);
+ static Data shared_null;
+ Data *d;
+ void **erase(void **xi);
+ void **append();
+ void **append(const QListData &l);
+ void **prepend();
+ void **insert(int i);
+ void remove(int i);
+ void remove(int i, int n);
+ void move(int from, int to);
+ inline int size() const { return d->end - d->begin; }
+ inline bool isEmpty() const { return d->end == d->begin; }
+ inline void **at(int i) const { return d->array + d->begin + i; }
+ inline void **begin() const { return d->array + d->begin; }
+ inline void **end() const { return d->array + d->end; }
+};
+template <typename T>
+class QList
+{
+ struct Node { void *v;
+ inline T &t()
+ { return *reinterpret_cast<T*>(QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic
+ ? v : this); }
+ };
+ union { QListData p; QListData::Data *d; };
+public:
+ inline QList() : d(&QListData::shared_null) { d->ref.ref(); }
+ inline QList(const QList<T> &l) : d(l.d) { d->ref.ref(); if (!d->sharable) detach_helper(); }
+ ~QList();
+ QList<T> &operator=(const QList<T> &l);
+ bool operator==(const QList<T> &l) const;
+ inline bool operator!=(const QList<T> &l) const { return !(*this == l); }
+ inline int size() const { return p.size(); }
+ inline void detach() { if (d->ref != 1) detach_helper(); }
+ inline bool isDetached() const { return d->ref == 1; }
+ inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
+ inline bool isEmpty() const { return p.isEmpty(); }
+ void clear();
+ const T &at(int i) const;
+ const T &operator[](int i) const;
+ T &operator[](int i);
+ void append(const T &t);
+ void append(const QList<T> &t);
+ void prepend(const T &t);
+ void insert(int i, const T &t);
+ void replace(int i, const T &t);
+ void removeAt(int i);
+ int removeAll(const T &t);
+ bool removeOne(const T &t);
+ T takeAt(int i);
+ T takeFirst();
+ T takeLast();
+ void move(int from, int to);
+ void swap(int i, int j);
+ int indexOf(const T &t, int from = 0) const;
+ int lastIndexOf(const T &t, int from = -1) const;
+ QBool contains(const T &t) const;
+ int count(const T &t) const;
+ class const_iterator;
+ class iterator {
+ public:
+ Node *i;
+ typedef std::random_access_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef T *pointer;
+ typedef T &reference;
+ inline iterator() : i(0) {}
+ inline iterator(Node *n) : i(n) {}
+ inline iterator(const iterator &o): i(o.i){}
+ inline T &operator*() const { return i->t(); }
+ inline T *operator->() const { return &i->t(); }
+ inline T &operator[](int j) const { return i[j].t(); }
+ inline bool operator==(const iterator &o) const { return i == o.i; }
+ inline bool operator!=(const iterator &o) const { return i != o.i; }
+ inline bool operator<(const iterator& other) const { return i < other.i; }
+ inline bool operator<=(const iterator& other) const { return i <= other.i; }
+ inline bool operator>(const iterator& other) const { return i > other.i; }
+ inline bool operator>=(const iterator& other) const { return i >= other.i; }
+ inline bool operator==(const const_iterator &o) const
+ { return i == o.i; }
+ inline bool operator!=(const const_iterator &o) const
+ { return i != o.i; }
+ inline bool operator<(const const_iterator& other) const
+ { return i < other.i; }
+ inline bool operator<=(const const_iterator& other) const
+ { return i <= other.i; }
+ inline bool operator>(const const_iterator& other) const
+ { return i > other.i; }
+ inline bool operator>=(const const_iterator& other) const
+ { return i >= other.i; }
+ inline iterator &operator++() { ++i; return *this; }
+ inline iterator operator++(int) { Node *n = i; ++i; return n; }
+ inline iterator &operator--() { i--; return *this; }
+ inline iterator operator--(int) { Node *n = i; i--; return n; }
+ inline iterator &operator+=(int j) { i+=j; return *this; }
+ inline iterator &operator-=(int j) { i-=j; return *this; }
+ inline iterator operator+(int j) const { return iterator(i+j); }
+ inline iterator operator-(int j) const { return iterator(i-j); }
+ inline int operator-(iterator j) const { return i - j.i; }
+ };
+ friend class iterator;
+ class const_iterator {
+ public:
+ Node *i;
+ typedef std::random_access_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef const T *pointer;
+ typedef const T &reference;
+ inline const_iterator() : i(0) {}
+ inline const_iterator(Node *n) : i(n) {}
+ inline const_iterator(const const_iterator &o): i(o.i) {}
+ inline const_iterator(const iterator &o): i(o.i) {}
+ inline const T &operator*() const { return i->t(); }
+ inline const T *operator->() const { return &i->t(); }
+ inline const T &operator[](int j) const { return i[j].t(); }
+ inline bool operator==(const const_iterator &o) const { return i == o.i; }
+ inline bool operator!=(const const_iterator &o) const { return i != o.i; }
+ inline bool operator<(const const_iterator& other) const { return i < other.i; }
+ inline bool operator<=(const const_iterator& other) const { return i <= other.i; }
+ inline bool operator>(const const_iterator& other) const { return i > other.i; }
+ inline bool operator>=(const const_iterator& other) const { return i >= other.i; }
+ inline const_iterator &operator++() { ++i; return *this; }
+ inline const_iterator operator++(int) { Node *n = i; ++i; return n; }
+ inline const_iterator &operator--() { i--; return *this; }
+ inline const_iterator operator--(int) { Node *n = i; i--; return n; }
+ inline const_iterator &operator+=(int j) { i+=j; return *this; }
+ inline const_iterator &operator-=(int j) { i-=j; return *this; }
+ inline const_iterator operator+(int j) const { return const_iterator(i+j); }
+ inline const_iterator operator-(int j) const { return const_iterator(i-j); }
+ inline int operator-(const_iterator j) const { return i - j.i; }
+ };
+ friend class const_iterator;
+ inline iterator begin() { detach(); return reinterpret_cast<Node *>(p.begin()); }
+ inline const_iterator begin() const { return reinterpret_cast<Node *>(p.begin()); }
+ inline const_iterator constBegin() const { return reinterpret_cast<Node *>(p.begin()); }
+ inline iterator end() { detach(); return reinterpret_cast<Node *>(p.end()); }
+ inline const_iterator end() const { return reinterpret_cast<Node *>(p.end()); }
+ inline const_iterator constEnd() const { return reinterpret_cast<Node *>(p.end()); }
+ iterator insert(iterator before, const T &t);
+ iterator erase(iterator pos);
+ iterator erase(iterator first, iterator last);
+ typedef iterator Iterator;
+ typedef const_iterator ConstIterator;
+ inline int count() const { return p.size(); }
+ inline int length() const { return p.size(); }
+ inline T& first() { qt_noop(); return *begin(); }
+ inline const T& first() const { qt_noop(); return *begin(); }
+ T& last() { qt_noop(); return *(--end()); }
+ const T& last() const { qt_noop(); return *(--end()); }
+ inline void removeFirst() { qt_noop(); erase(begin()); }
+ inline void removeLast() { qt_noop(); erase(--end()); }
+ inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; }
+ inline bool endsWith(const T &t) const { return !isEmpty() && last() == t; }
+ QList<T> mid(int pos, int length = -1) const;
+ T value(int i) const;
+ T value(int i, const T &defaultValue) const;
+ inline void push_back(const T &t) { append(t); }
+ inline void push_front(const T &t) { prepend(t); }
+ inline T& front() { return first(); }
+ inline const T& front() const { return first(); }
+ inline T& back() { return last(); }
+ inline const T& back() const { return last(); }
+ inline void pop_front() { removeFirst(); }
+ inline void pop_back() { removeLast(); }
+ inline bool empty() const { return isEmpty(); }
+ typedef int size_type;
+ typedef T value_type;
+ typedef value_type *pointer;
+ typedef const value_type *const_pointer;
+ typedef value_type &reference;
+ typedef const value_type &const_reference;
+ typedef ptrdiff_t difference_type;
+ QList<T> &operator+=(const QList<T> &l);
+ inline QList<T> operator+(const QList<T> &l) const
+ { QList n = *this; n += l; return n; }
+ inline QList<T> &operator+=(const T &t)
+ { append(t); return *this; }
+ inline QList<T> &operator<< (const T &t)
+ { append(t); return *this; }
+ inline QList<T> &operator<<(const QList<T> &l)
+ { *this += l; return *this; }
+ QVector<T> toVector() const;
+ QSet<T> toSet() const;
+ static QList<T> fromVector(const QVector<T> &vector);
+ static QList<T> fromSet(const QSet<T> &set);
+ static inline QList<T> fromStdList(const std::list<T> &list)
+ { QList<T> tmp; qCopy(list.begin(), list.end(), std::back_inserter(tmp)); return tmp; }
+ inline std::list<T> toStdList() const
+ { std::list<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
+private:
+ void detach_helper();
+ void free(QListData::Data *d);
+ void node_construct(Node *n, const T &t);
+ void node_destruct(Node *n);
+ void node_copy(Node *from, Node *to, Node *src);
+ void node_destruct(Node *from, Node *to);
+};
+template <typename T>
+inline void QList<T>::node_construct(Node *n, const T &t)
+{
+ if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) n->v = new T(t);
+ else if (QTypeInfo<T>::isComplex) new (n) T(t);
+ else *reinterpret_cast<T*>(n) = t;
+}
+template <typename T>
+inline void QList<T>::node_destruct(Node *n)
+{
+ if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) delete reinterpret_cast<T*>(n->v);
+ else if (QTypeInfo<T>::isComplex) reinterpret_cast<T*>(n)->~T();
+}
+template <typename T>
+inline void QList<T>::node_copy(Node *from, Node *to, Node *src)
+{
+ if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic)
+ while(from != to)
+ (from++)->v = new T(*reinterpret_cast<T*>((src++)->v));
+ else if (QTypeInfo<T>::isComplex)
+ while(from != to)
+ new (from++) T(*reinterpret_cast<T*>(src++));
+}
+template <typename T>
+inline void QList<T>::node_destruct(Node *from, Node *to)
+{
+ if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic)
+ while(from != to) --to, delete reinterpret_cast<T*>(to->v);
+ else if (QTypeInfo<T>::isComplex)
+ while (from != to) --to, reinterpret_cast<T*>(to)->~T();
+}
+template <typename T>
+inline QList<T> &QList<T>::operator=(const QList<T> &l)
+{
+ if (d != l.d) {
+ l.d->ref.ref();
+ if (!d->ref.deref())
+ free(d);
+ d = l.d;
+ if (!d->sharable)
+ detach_helper();
+ }
+ return *this;
+}
+template <typename T>
+inline typename QList<T>::iterator QList<T>::insert(iterator before, const T &t)
+{ Node *n = reinterpret_cast<Node *>(p.insert(before.i-reinterpret_cast<Node *>(p.begin())));
+ node_construct(n,t); return n; }
+template <typename T>
+inline typename QList<T>::iterator QList<T>::erase(iterator it)
+{ node_destruct(it.i);
+ return reinterpret_cast<Node *>(p.erase(reinterpret_cast<void**>(it.i))); }
+template <typename T>
+inline const T &QList<T>::at(int i) const
+{ qt_noop();
+ return reinterpret_cast<Node *>(p.at(i))->t(); }
+template <typename T>
+inline const T &QList<T>::operator[](int i) const
+{ qt_noop();
+ return reinterpret_cast<Node *>(p.at(i))->t(); }
+template <typename T>
+inline T &QList<T>::operator[](int i)
+{ qt_noop();
+ detach(); return reinterpret_cast<Node *>(p.at(i))->t(); }
+template <typename T>
+inline void QList<T>::removeAt(int i)
+{ if(i >= 0 && i < p.size()) { detach();
+ node_destruct(reinterpret_cast<Node *>(p.at(i))); p.remove(i); } }
+template <typename T>
+inline T QList<T>::takeAt(int i)
+{ qt_noop();
+ detach(); Node *n = reinterpret_cast<Node *>(p.at(i)); T t = n->t(); node_destruct(n);
+ p.remove(i); return t; }
+template <typename T>
+inline T QList<T>::takeFirst()
+{ T t = first(); removeFirst(); return t; }
+template <typename T>
+inline T QList<T>::takeLast()
+{ T t = last(); removeLast(); return t; }
+template <typename T>
+ void QList<T>::append(const T &t)
+{
+ detach();
+ if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
+ node_construct(reinterpret_cast<Node *>(p.append()), t);
+ } else {
+ const T cpy(t);
+ node_construct(reinterpret_cast<Node *>(p.append()), cpy);
+ }
+}
+template <typename T>
+inline void QList<T>::prepend(const T &t)
+{
+ detach();
+ if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
+ node_construct(reinterpret_cast<Node *>(p.prepend()), t);
+ } else {
+ const T cpy(t);
+ node_construct(reinterpret_cast<Node *>(p.prepend()), cpy);
+ }
+}
+template <typename T>
+inline void QList<T>::insert(int i, const T &t)
+{
+ detach();
+ if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
+ node_construct(reinterpret_cast<Node *>(p.insert(i)), t);
+ } else {
+ const T cpy(t);
+ node_construct(reinterpret_cast<Node *>(p.insert(i)), cpy);
+ }
+}
+template <typename T>
+inline void QList<T>::replace(int i, const T &t)
+{
+ qt_noop();
+ detach();
+ if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
+ reinterpret_cast<Node *>(p.at(i))->t() = t;
+ } else {
+ const T cpy(t);
+ reinterpret_cast<Node *>(p.at(i))->t() = cpy;
+ }
+}
+template <typename T>
+inline void QList<T>::swap(int i, int j)
+{
+ qt_noop();
+ detach();
+ void *t = d->array[d->begin + i];
+ d->array[d->begin + i] = d->array[d->begin + j];
+ d->array[d->begin + j] = t;
+}
+template <typename T>
+inline void QList<T>::move(int from, int to)
+{
+ qt_noop();
+ detach();
+ p.move(from, to);
+}
+template<typename T>
+ QList<T> QList<T>::mid(int pos, int alength) const
+{
+ if (alength < 0)
+ alength = size() - pos;
+ if (pos == 0 && alength == size())
+ return *this;
+ QList<T> cpy;
+ if (pos + alength > size())
+ alength = size() - pos;
+ for (int i = pos; i < pos + alength; ++i)
+ cpy += at(i);
+ return cpy;
+}
+template<typename T>
+ T QList<T>::value(int i) const
+{
+ if (i < 0 || i >= p.size()) {
+ return T();
+ }
+ return reinterpret_cast<Node *>(p.at(i))->t();
+}
+template<typename T>
+ T QList<T>::value(int i, const T& defaultValue) const
+{
+ return ((i < 0 || i >= p.size()) ? defaultValue : reinterpret_cast<Node *>(p.at(i))->t());
+}
+template <typename T>
+ void QList<T>::detach_helper()
+{
+ Node *n = reinterpret_cast<Node *>(p.begin());
+ QListData::Data *x = p.detach2();
+ node_copy(reinterpret_cast<Node *>(p.begin()), reinterpret_cast<Node *>(p.end()), n);
+ if (!x->ref.deref())
+ free(x);
+}
+template <typename T>
+ QList<T>::~QList()
+{
+ if (d && !d->ref.deref())
+ free(d);
+}
+template <typename T>
+ bool QList<T>::operator==(const QList<T> &l) const
+{
+ if (p.size() != l.p.size())
+ return false;
+ if (d == l.d)
+ return true;
+ Node *i = reinterpret_cast<Node *>(p.end());
+ Node *b = reinterpret_cast<Node *>(p.begin());
+ Node *li = reinterpret_cast<Node *>(l.p.end());
+ while (i != b) {
+ --i; --li;
+ if (!(i->t() == li->t()))
+ return false;
+ }
+ return true;
+}
+template <typename T>
+ void QList<T>::free(QListData::Data *data)
+{
+ node_destruct(reinterpret_cast<Node *>(data->array + data->begin),
+ reinterpret_cast<Node *>(data->array + data->end));
+ if (data->ref == 0)
+ qFree(data);
+}
+template <typename T>
+ void QList<T>::clear()
+{
+ *this = QList<T>();
+}
+template <typename T>
+ int QList<T>::removeAll(const T &_t)
+{
+ detach();
+ const T t = _t;
+ int removedCount=0, i=0;
+ Node *n;
+ while (i < p.size())
+ if ((n = reinterpret_cast<Node *>(p.at(i)))->t() == t) {
+ node_destruct(n);
+ p.remove(i);
+ ++removedCount;
+ } else {
+ ++i;
+ }
+ return removedCount;
+}
+template <typename T>
+ bool QList<T>::removeOne(const T &_t)
+{
+ detach();
+ int index = indexOf(_t);
+ if (index != -1) {
+ removeAt(index);
+ return true;
+ }
+ return false;
+}
+template <typename T>
+ typename QList<T>::iterator QList<T>::erase(typename QList<T>::iterator afirst,
+ typename QList<T>::iterator alast)
+{
+ for (Node *n = afirst.i; n < alast.i; ++n)
+ node_destruct(n);
+ int idx = afirst - begin();
+ p.remove(idx, alast - afirst);
+ return begin() + idx;
+}
+template <typename T>
+ QList<T> &QList<T>::operator+=(const QList<T> &l)
+{
+ detach();
+ Node *n = reinterpret_cast<Node *>(p.append(l.p));
+ node_copy(n, reinterpret_cast<Node *>(p.end()), reinterpret_cast<Node *>(l.p.begin()));
+ return *this;
+}
+template <typename T>
+inline void QList<T>::append(const QList<T> &t)
+{
+ *this += t;
+}
+template <typename T>
+ int QList<T>::indexOf(const T &t, int from) const
+{
+ if (from < 0)
+ from = qMax(from + p.size(), 0);
+ if (from < p.size()) {
+ Node *n = reinterpret_cast<Node *>(p.at(from -1));
+ Node *e = reinterpret_cast<Node *>(p.end());
+ while (++n != e)
+ if (n->t() == t)
+ return n - reinterpret_cast<Node *>(p.begin());
+ }
+ return -1;
+}
+template <typename T>
+ int QList<T>::lastIndexOf(const T &t, int from) const
+{
+ if (from < 0)
+ from += p.size();
+ else if (from >= p.size())
+ from = p.size()-1;
+ if (from >= 0) {
+ Node *b = reinterpret_cast<Node *>(p.begin());
+ Node *n = reinterpret_cast<Node *>(p.at(from + 1));
+ while (n-- != b) {
+ if (n->t() == t)
+ return n - b;
+ }
+ }
+ return -1;
+}
+template <typename T>
+ QBool QList<T>::contains(const T &t) const
+{
+ Node *b = reinterpret_cast<Node *>(p.begin());
+ Node *i = reinterpret_cast<Node *>(p.end());
+ while (i-- != b)
+ if (i->t() == t)
+ return QBool(true);
+ return QBool(false);
+}
+template <typename T>
+ int QList<T>::count(const T &t) const
+{
+ int c = 0;
+ Node *b = reinterpret_cast<Node *>(p.begin());
+ Node *i = reinterpret_cast<Node *>(p.end());
+ while (i-- != b)
+ if (i->t() == t)
+ ++c;
+ return c;
+}
+template <class T> class QListIterator { typedef typename QList<T>::const_iterator const_iterator; QList<T> c; const_iterator i; public: inline QListIterator(const QList<T> &container) : c(container), i(c.constBegin()) {} inline QListIterator &operator=(const QList<T> &container) { c = container; i = c.constBegin(); return *this; } inline void toFront() { i = c.constBegin(); } inline void toBack() { i = c.constEnd(); } inline bool hasNext() const { return i != c.constEnd(); } inline const T &next() { return *i++; } inline const T &peekNext() const { return *i; } inline bool hasPrevious() const { return i != c.constBegin(); } inline const T &previous() { return *--i; } inline const T &peekPrevious() const { const_iterator p = i; return *--p; } inline bool findNext(const T &t) { while (i != c.constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (i != c.constBegin()) if (*(--i) == t) return true; return false; } };
+template <class T> class QMutableListIterator { typedef typename QList<T>::iterator iterator; typedef typename QList<T>::const_iterator const_iterator; QList<T> *c; iterator i, n; inline bool item_exists() const { return const_iterator(n) != c->constEnd(); } public: inline QMutableListIterator(QList<T> &container) : c(&container) { c->setSharable(false); i = c->begin(); n = c->end(); } inline ~QMutableListIterator() { c->setSharable(true); } inline QMutableListIterator &operator=(QList<T> &container) { c->setSharable(true); c = &container; c->setSharable(false); i = c->begin(); n = c->end(); return *this; } inline void toFront() { i = c->begin(); n = c->end(); } inline void toBack() { i = c->end(); n = i; } inline bool hasNext() const { return c->constEnd() != const_iterator(i); } inline T &next() { n = i++; return *n; } inline T &peekNext() const { return *i; } inline bool hasPrevious() const { return c->constBegin() != const_iterator(i); } inline T &previous() { n = --i; return *n; } inline T &peekPrevious() const { iterator p = i; return *--p; } inline void remove() { if (c->constEnd() != const_iterator(n)) { i = c->erase(n); n = c->end(); } } inline void setValue(const T &t) const { if (c->constEnd() != const_iterator(n)) *n = t; } inline T &value() { qt_noop(); return *n; } inline const T &value() const { qt_noop(); return *n; } inline void insert(const T &t) { n = i = c->insert(i, t); ++i; } inline bool findNext(const T &t) { while (c->constEnd() != const_iterator(n = i)) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (c->constBegin() != const_iterator(i)) if (*(n = --i) == t) return true; n = c->end(); return false; } };
+typedef QtValidLicenseForCoreModule QtCoreModule;
+namespace
+Qt {
+ enum GlobalColor {
+ color0,
+ color1,
+ black,
+ white,
+ darkGray,
+ gray,
+ lightGray,
+ red,
+ green,
+ blue,
+ cyan,
+ magenta,
+ yellow,
+ darkRed,
+ darkGreen,
+ darkBlue,
+ darkCyan,
+ darkMagenta,
+ darkYellow,
+ transparent
+ };
+ enum KeyboardModifier {
+ NoModifier = 0x00000000,
+ ShiftModifier = 0x02000000,
+ ControlModifier = 0x04000000,
+ AltModifier = 0x08000000,
+ MetaModifier = 0x10000000,
+ KeypadModifier = 0x20000000,
+ GroupSwitchModifier = 0x40000000,
+ KeyboardModifierMask = 0xfe000000
+ };
+ typedef QFlags<KeyboardModifier> KeyboardModifiers;
+ enum Modifier {
+ META = Qt::MetaModifier,
+ SHIFT = Qt::ShiftModifier,
+ CTRL = Qt::ControlModifier,
+ ALT = Qt::AltModifier,
+ MODIFIER_MASK = KeyboardModifierMask,
+ UNICODE_ACCEL = 0x00000000
+ };
+ enum MouseButton {
+ NoButton = 0x00000000,
+ LeftButton = 0x00000001,
+ RightButton = 0x00000002,
+ MidButton = 0x00000004,
+ XButton1 = 0x00000008,
+ XButton2 = 0x00000010,
+ MouseButtonMask = 0x000000ff
+ };
+ typedef QFlags<MouseButton> MouseButtons;
+ enum Orientation {
+ Horizontal = 0x1,
+ Vertical = 0x2
+ };
+ typedef QFlags<Orientation> Orientations;
+ enum FocusPolicy {
+ NoFocus = 0,
+ TabFocus = 0x1,
+ ClickFocus = 0x2,
+ StrongFocus = TabFocus | ClickFocus | 0x8,
+ WheelFocus = StrongFocus | 0x4
+ };
+ enum SortOrder {
+ AscendingOrder,
+ DescendingOrder
+ };
+ enum AlignmentFlag {
+ AlignLeft = 0x0001,
+ AlignLeading = AlignLeft,
+ AlignRight = 0x0002,
+ AlignTrailing = AlignRight,
+ AlignHCenter = 0x0004,
+ AlignJustify = 0x0008,
+ AlignAbsolute = 0x0010,
+ AlignHorizontal_Mask = AlignLeft | AlignRight | AlignHCenter | AlignJustify | AlignAbsolute,
+ AlignTop = 0x0020,
+ AlignBottom = 0x0040,
+ AlignVCenter = 0x0080,
+ AlignVertical_Mask = AlignTop | AlignBottom | AlignVCenter,
+ AlignCenter = AlignVCenter | AlignHCenter
+ };
+ typedef QFlags<AlignmentFlag> Alignment;
+ enum TextFlag {
+ TextSingleLine = 0x0100,
+ TextDontClip = 0x0200,
+ TextExpandTabs = 0x0400,
+ TextShowMnemonic = 0x0800,
+ TextWordWrap = 0x1000,
+ TextWrapAnywhere = 0x2000,
+ TextDontPrint = 0x4000,
+ TextIncludeTrailingSpaces = 0x08000000,
+ TextHideMnemonic = 0x8000,
+ TextJustificationForced = 0x10000,
+ TextForceLeftToRight = 0x20000,
+ TextForceRightToLeft = 0x40000
+ };
+ enum TextElideMode {
+ ElideLeft,
+ ElideRight,
+ ElideMiddle,
+ ElideNone
+ };
+ enum WindowType {
+ Widget = 0x00000000,
+ Window = 0x00000001,
+ Dialog = 0x00000002 | Window,
+ Sheet = 0x00000004 | Window,
+ Drawer = 0x00000006 | Window,
+ Popup = 0x00000008 | Window,
+ Tool = 0x0000000a | Window,
+ ToolTip = 0x0000000c | Window,
+ SplashScreen = 0x0000000e | Window,
+ Desktop = 0x00000010 | Window,
+ SubWindow = 0x00000012,
+ WindowType_Mask = 0x000000ff,
+ MSWindowsFixedSizeDialogHint = 0x00000100,
+ MSWindowsOwnDC = 0x00000200,
+ X11BypassWindowManagerHint = 0x00000400,
+ FramelessWindowHint = 0x00000800,
+ WindowTitleHint = 0x00001000,
+ WindowSystemMenuHint = 0x00002000,
+ WindowMinimizeButtonHint = 0x00004000,
+ WindowMaximizeButtonHint = 0x00008000,
+ WindowMinMaxButtonsHint = WindowMinimizeButtonHint | WindowMaximizeButtonHint,
+ WindowContextHelpButtonHint = 0x00010000,
+ WindowShadeButtonHint = 0x00020000,
+ WindowStaysOnTopHint = 0x00040000,
+ CustomizeWindowHint = 0x02000000,
+ WindowStaysOnBottomHint = 0x04000000,
+ WindowCloseButtonHint = 0x08000000,
+ MacWindowToolBarButtonHint = 0x10000000,
+ BypassGraphicsProxyWidget = 0x20000000,
+ WindowOkButtonHint = 0x00080000,
+ WindowCancelButtonHint = 0x00100000
+ };
+ typedef QFlags<WindowType> WindowFlags;
+ enum WindowState {
+ WindowNoState = 0x00000000,
+ WindowMinimized = 0x00000001,
+ WindowMaximized = 0x00000002,
+ WindowFullScreen = 0x00000004,
+ WindowActive = 0x00000008
+ };
+ typedef QFlags<WindowState> WindowStates;
+ enum WidgetAttribute {
+ WA_Disabled = 0,
+ WA_UnderMouse = 1,
+ WA_MouseTracking = 2,
+ WA_ContentsPropagated = 3,
+ WA_OpaquePaintEvent = 4,
+ WA_NoBackground = WA_OpaquePaintEvent,
+ WA_StaticContents = 5,
+ WA_LaidOut = 7,
+ WA_PaintOnScreen = 8,
+ WA_NoSystemBackground = 9,
+ WA_UpdatesDisabled = 10,
+ WA_Mapped = 11,
+ WA_MacNoClickThrough = 12,
+ WA_PaintOutsidePaintEvent = 13,
+ WA_InputMethodEnabled = 14,
+ WA_WState_Visible = 15,
+ WA_WState_Hidden = 16,
+ WA_ForceDisabled = 32,
+ WA_KeyCompression = 33,
+ WA_PendingMoveEvent = 34,
+ WA_PendingResizeEvent = 35,
+ WA_SetPalette = 36,
+ WA_SetFont = 37,
+ WA_SetCursor = 38,
+ WA_NoChildEventsFromChildren = 39,
+ WA_WindowModified = 41,
+ WA_Resized = 42,
+ WA_Moved = 43,
+ WA_PendingUpdate = 44,
+ WA_InvalidSize = 45,
+ WA_MacBrushedMetal = 46,
+ WA_MacMetalStyle = WA_MacBrushedMetal,
+ WA_CustomWhatsThis = 47,
+ WA_LayoutOnEntireRect = 48,
+ WA_OutsideWSRange = 49,
+ WA_GrabbedShortcut = 50,
+ WA_TransparentForMouseEvents = 51,
+ WA_PaintUnclipped = 52,
+ WA_SetWindowIcon = 53,
+ WA_NoMouseReplay = 54,
+ WA_DeleteOnClose = 55,
+ WA_RightToLeft = 56,
+ WA_SetLayoutDirection = 57,
+ WA_NoChildEventsForParent = 58,
+ WA_ForceUpdatesDisabled = 59,
+ WA_WState_Created = 60,
+ WA_WState_CompressKeys = 61,
+ WA_WState_InPaintEvent = 62,
+ WA_WState_Reparented = 63,
+ WA_WState_ConfigPending = 64,
+ WA_WState_Polished = 66,
+ WA_WState_DND = 67,
+ WA_WState_OwnSizePolicy = 68,
+ WA_WState_ExplicitShowHide = 69,
+ WA_ShowModal = 70,
+ WA_MouseNoMask = 71,
+ WA_GroupLeader = 72,
+ WA_NoMousePropagation = 73,
+ WA_Hover = 74,
+ WA_InputMethodTransparent = 75,
+ WA_QuitOnClose = 76,
+ WA_KeyboardFocusChange = 77,
+ WA_AcceptDrops = 78,
+ WA_DropSiteRegistered = 79,
+ WA_ForceAcceptDrops = WA_DropSiteRegistered,
+ WA_WindowPropagation = 80,
+ WA_NoX11EventCompression = 81,
+ WA_TintedBackground = 82,
+ WA_X11OpenGLOverlay = 83,
+ WA_AlwaysShowToolTips = 84,
+ WA_MacOpaqueSizeGrip = 85,
+ WA_SetStyle = 86,
+ WA_SetLocale = 87,
+ WA_MacShowFocusRect = 88,
+ WA_MacNormalSize = 89,
+ WA_MacSmallSize = 90,
+ WA_MacMiniSize = 91,
+ WA_LayoutUsesWidgetRect = 92,
+ WA_StyledBackground = 93,
+ WA_MSWindowsUseDirect3D = 94,
+ WA_CanHostQMdiSubWindowTitleBar = 95,
+ WA_MacAlwaysShowToolWindow = 96,
+ WA_StyleSheet = 97,
+ WA_ShowWithoutActivating = 98,
+ WA_X11BypassTransientForHint = 99,
+ WA_NativeWindow = 100,
+ WA_DontCreateNativeAncestors = 101,
+ WA_MacVariableSize = 102,
+ WA_DontShowOnScreen = 103,
+ WA_X11NetWmWindowTypeDesktop = 104,
+ WA_X11NetWmWindowTypeDock = 105,
+ WA_X11NetWmWindowTypeToolBar = 106,
+ WA_X11NetWmWindowTypeMenu = 107,
+ WA_X11NetWmWindowTypeUtility = 108,
+ WA_X11NetWmWindowTypeSplash = 109,
+ WA_X11NetWmWindowTypeDialog = 110,
+ WA_X11NetWmWindowTypeDropDownMenu = 111,
+ WA_X11NetWmWindowTypePopupMenu = 112,
+ WA_X11NetWmWindowTypeToolTip = 113,
+ WA_X11NetWmWindowTypeNotification = 114,
+ WA_X11NetWmWindowTypeCombo = 115,
+ WA_X11NetWmWindowTypeDND = 116,
+ WA_MacFrameworkScaled = 117,
+ WA_SetWindowModality = 118,
+ WA_WState_WindowOpacitySet = 119,
+ WA_TranslucentBackground = 120,
+ WA_AttributeCount
+ };
+ enum ApplicationAttribute
+ {
+ AA_ImmediateWidgetCreation = 0,
+ AA_MSWindowsUseDirect3DByDefault = 1,
+ AA_DontShowIconsInMenus = 2,
+ AA_NativeWindows = 3,
+ AA_DontCreateNativeWidgetSiblings = 4,
+ AA_MacPluginApplication = 5,
+ AA_AttributeCount
+ };
+ enum ImageConversionFlag {
+ ColorMode_Mask = 0x00000003,
+ AutoColor = 0x00000000,
+ ColorOnly = 0x00000003,
+ MonoOnly = 0x00000002,
+ AlphaDither_Mask = 0x0000000c,
+ ThresholdAlphaDither = 0x00000000,
+ OrderedAlphaDither = 0x00000004,
+ DiffuseAlphaDither = 0x00000008,
+ NoAlpha = 0x0000000c,
+ Dither_Mask = 0x00000030,
+ DiffuseDither = 0x00000000,
+ OrderedDither = 0x00000010,
+ ThresholdDither = 0x00000020,
+ DitherMode_Mask = 0x000000c0,
+ AutoDither = 0x00000000,
+ PreferDither = 0x00000040,
+ AvoidDither = 0x00000080,
+ NoOpaqueDetection = 0x00000100
+ };
+ typedef QFlags<ImageConversionFlag> ImageConversionFlags;
+ enum BGMode {
+ TransparentMode,
+ OpaqueMode
+ };
+ enum Key {
+ Key_Escape = 0x01000000,
+ Key_Tab = 0x01000001,
+ Key_Backtab = 0x01000002,
+ Key_Backspace = 0x01000003,
+ Key_Return = 0x01000004,
+ Key_Enter = 0x01000005,
+ Key_Insert = 0x01000006,
+ Key_Delete = 0x01000007,
+ Key_Pause = 0x01000008,
+ Key_Print = 0x01000009,
+ Key_SysReq = 0x0100000a,
+ Key_Clear = 0x0100000b,
+ Key_Home = 0x01000010,
+ Key_End = 0x01000011,
+ Key_Left = 0x01000012,
+ Key_Up = 0x01000013,
+ Key_Right = 0x01000014,
+ Key_Down = 0x01000015,
+ Key_PageUp = 0x01000016,
+ Key_PageDown = 0x01000017,
+ Key_Shift = 0x01000020,
+ Key_Control = 0x01000021,
+ Key_Meta = 0x01000022,
+ Key_Alt = 0x01000023,
+ Key_CapsLock = 0x01000024,
+ Key_NumLock = 0x01000025,
+ Key_ScrollLock = 0x01000026,
+ Key_F1 = 0x01000030,
+ Key_F2 = 0x01000031,
+ Key_F3 = 0x01000032,
+ Key_F4 = 0x01000033,
+ Key_F5 = 0x01000034,
+ Key_F6 = 0x01000035,
+ Key_F7 = 0x01000036,
+ Key_F8 = 0x01000037,
+ Key_F9 = 0x01000038,
+ Key_F10 = 0x01000039,
+ Key_F11 = 0x0100003a,
+ Key_F12 = 0x0100003b,
+ Key_F13 = 0x0100003c,
+ Key_F14 = 0x0100003d,
+ Key_F15 = 0x0100003e,
+ Key_F16 = 0x0100003f,
+ Key_F17 = 0x01000040,
+ Key_F18 = 0x01000041,
+ Key_F19 = 0x01000042,
+ Key_F20 = 0x01000043,
+ Key_F21 = 0x01000044,
+ Key_F22 = 0x01000045,
+ Key_F23 = 0x01000046,
+ Key_F24 = 0x01000047,
+ Key_F25 = 0x01000048,
+ Key_F26 = 0x01000049,
+ Key_F27 = 0x0100004a,
+ Key_F28 = 0x0100004b,
+ Key_F29 = 0x0100004c,
+ Key_F30 = 0x0100004d,
+ Key_F31 = 0x0100004e,
+ Key_F32 = 0x0100004f,
+ Key_F33 = 0x01000050,
+ Key_F34 = 0x01000051,
+ Key_F35 = 0x01000052,
+ Key_Super_L = 0x01000053,
+ Key_Super_R = 0x01000054,
+ Key_Menu = 0x01000055,
+ Key_Hyper_L = 0x01000056,
+ Key_Hyper_R = 0x01000057,
+ Key_Help = 0x01000058,
+ Key_Direction_L = 0x01000059,
+ Key_Direction_R = 0x01000060,
+ Key_Space = 0x20,
+ Key_Any = Key_Space,
+ Key_Exclam = 0x21,
+ Key_QuoteDbl = 0x22,
+ Key_NumberSign = 0x23,
+ Key_Dollar = 0x24,
+ Key_Percent = 0x25,
+ Key_Ampersand = 0x26,
+ Key_Apostrophe = 0x27,
+ Key_ParenLeft = 0x28,
+ Key_ParenRight = 0x29,
+ Key_Asterisk = 0x2a,
+ Key_Plus = 0x2b,
+ Key_Comma = 0x2c,
+ Key_Minus = 0x2d,
+ Key_Period = 0x2e,
+ Key_Slash = 0x2f,
+ Key_0 = 0x30,
+ Key_1 = 0x31,
+ Key_2 = 0x32,
+ Key_3 = 0x33,
+ Key_4 = 0x34,
+ Key_5 = 0x35,
+ Key_6 = 0x36,
+ Key_7 = 0x37,
+ Key_8 = 0x38,
+ Key_9 = 0x39,
+ Key_Colon = 0x3a,
+ Key_Semicolon = 0x3b,
+ Key_Less = 0x3c,
+ Key_Equal = 0x3d,
+ Key_Greater = 0x3e,
+ Key_Question = 0x3f,
+ Key_At = 0x40,
+ Key_A = 0x41,
+ Key_B = 0x42,
+ Key_C = 0x43,
+ Key_D = 0x44,
+ Key_E = 0x45,
+ Key_F = 0x46,
+ Key_G = 0x47,
+ Key_H = 0x48,
+ Key_I = 0x49,
+ Key_J = 0x4a,
+ Key_K = 0x4b,
+ Key_L = 0x4c,
+ Key_M = 0x4d,
+ Key_N = 0x4e,
+ Key_O = 0x4f,
+ Key_P = 0x50,
+ Key_Q = 0x51,
+ Key_R = 0x52,
+ Key_S = 0x53,
+ Key_T = 0x54,
+ Key_U = 0x55,
+ Key_V = 0x56,
+ Key_W = 0x57,
+ Key_X = 0x58,
+ Key_Y = 0x59,
+ Key_Z = 0x5a,
+ Key_BracketLeft = 0x5b,
+ Key_Backslash = 0x5c,
+ Key_BracketRight = 0x5d,
+ Key_AsciiCircum = 0x5e,
+ Key_Underscore = 0x5f,
+ Key_QuoteLeft = 0x60,
+ Key_BraceLeft = 0x7b,
+ Key_Bar = 0x7c,
+ Key_BraceRight = 0x7d,
+ Key_AsciiTilde = 0x7e,
+ Key_nobreakspace = 0x0a0,
+ Key_exclamdown = 0x0a1,
+ Key_cent = 0x0a2,
+ Key_sterling = 0x0a3,
+ Key_currency = 0x0a4,
+ Key_yen = 0x0a5,
+ Key_brokenbar = 0x0a6,
+ Key_section = 0x0a7,
+ Key_diaeresis = 0x0a8,
+ Key_copyright = 0x0a9,
+ Key_ordfeminine = 0x0aa,
+ Key_guillemotleft = 0x0ab,
+ Key_notsign = 0x0ac,
+ Key_hyphen = 0x0ad,
+ Key_registered = 0x0ae,
+ Key_macron = 0x0af,
+ Key_degree = 0x0b0,
+ Key_plusminus = 0x0b1,
+ Key_twosuperior = 0x0b2,
+ Key_threesuperior = 0x0b3,
+ Key_acute = 0x0b4,
+ Key_mu = 0x0b5,
+ Key_paragraph = 0x0b6,
+ Key_periodcentered = 0x0b7,
+ Key_cedilla = 0x0b8,
+ Key_onesuperior = 0x0b9,
+ Key_masculine = 0x0ba,
+ Key_guillemotright = 0x0bb,
+ Key_onequarter = 0x0bc,
+ Key_onehalf = 0x0bd,
+ Key_threequarters = 0x0be,
+ Key_questiondown = 0x0bf,
+ Key_Agrave = 0x0c0,
+ Key_Aacute = 0x0c1,
+ Key_Acircumflex = 0x0c2,
+ Key_Atilde = 0x0c3,
+ Key_Adiaeresis = 0x0c4,
+ Key_Aring = 0x0c5,
+ Key_AE = 0x0c6,
+ Key_Ccedilla = 0x0c7,
+ Key_Egrave = 0x0c8,
+ Key_Eacute = 0x0c9,
+ Key_Ecircumflex = 0x0ca,
+ Key_Ediaeresis = 0x0cb,
+ Key_Igrave = 0x0cc,
+ Key_Iacute = 0x0cd,
+ Key_Icircumflex = 0x0ce,
+ Key_Idiaeresis = 0x0cf,
+ Key_ETH = 0x0d0,
+ Key_Ntilde = 0x0d1,
+ Key_Ograve = 0x0d2,
+ Key_Oacute = 0x0d3,
+ Key_Ocircumflex = 0x0d4,
+ Key_Otilde = 0x0d5,
+ Key_Odiaeresis = 0x0d6,
+ Key_multiply = 0x0d7,
+ Key_Ooblique = 0x0d8,
+ Key_Ugrave = 0x0d9,
+ Key_Uacute = 0x0da,
+ Key_Ucircumflex = 0x0db,
+ Key_Udiaeresis = 0x0dc,
+ Key_Yacute = 0x0dd,
+ Key_THORN = 0x0de,
+ Key_ssharp = 0x0df,
+ Key_division = 0x0f7,
+ Key_ydiaeresis = 0x0ff,
+ Key_AltGr = 0x01001103,
+ Key_Multi_key = 0x01001120,
+ Key_Codeinput = 0x01001137,
+ Key_SingleCandidate = 0x0100113c,
+ Key_MultipleCandidate = 0x0100113d,
+ Key_PreviousCandidate = 0x0100113e,
+ Key_Mode_switch = 0x0100117e,
+ Key_Kanji = 0x01001121,
+ Key_Muhenkan = 0x01001122,
+ Key_Henkan = 0x01001123,
+ Key_Romaji = 0x01001124,
+ Key_Hiragana = 0x01001125,
+ Key_Katakana = 0x01001126,
+ Key_Hiragana_Katakana = 0x01001127,
+ Key_Zenkaku = 0x01001128,
+ Key_Hankaku = 0x01001129,
+ Key_Zenkaku_Hankaku = 0x0100112a,
+ Key_Touroku = 0x0100112b,
+ Key_Massyo = 0x0100112c,
+ Key_Kana_Lock = 0x0100112d,
+ Key_Kana_Shift = 0x0100112e,
+ Key_Eisu_Shift = 0x0100112f,
+ Key_Eisu_toggle = 0x01001130,
+ Key_Hangul = 0x01001131,
+ Key_Hangul_Start = 0x01001132,
+ Key_Hangul_End = 0x01001133,
+ Key_Hangul_Hanja = 0x01001134,
+ Key_Hangul_Jamo = 0x01001135,
+ Key_Hangul_Romaja = 0x01001136,
+ Key_Hangul_Jeonja = 0x01001138,
+ Key_Hangul_Banja = 0x01001139,
+ Key_Hangul_PreHanja = 0x0100113a,
+ Key_Hangul_PostHanja = 0x0100113b,
+ Key_Hangul_Special = 0x0100113f,
+ Key_Dead_Grave = 0x01001250,
+ Key_Dead_Acute = 0x01001251,
+ Key_Dead_Circumflex = 0x01001252,
+ Key_Dead_Tilde = 0x01001253,
+ Key_Dead_Macron = 0x01001254,
+ Key_Dead_Breve = 0x01001255,
+ Key_Dead_Abovedot = 0x01001256,
+ Key_Dead_Diaeresis = 0x01001257,
+ Key_Dead_Abovering = 0x01001258,
+ Key_Dead_Doubleacute = 0x01001259,
+ Key_Dead_Caron = 0x0100125a,
+ Key_Dead_Cedilla = 0x0100125b,
+ Key_Dead_Ogonek = 0x0100125c,
+ Key_Dead_Iota = 0x0100125d,
+ Key_Dead_Voiced_Sound = 0x0100125e,
+ Key_Dead_Semivoiced_Sound = 0x0100125f,
+ Key_Dead_Belowdot = 0x01001260,
+ Key_Dead_Hook = 0x01001261,
+ Key_Dead_Horn = 0x01001262,
+ Key_Back = 0x01000061,
+ Key_Forward = 0x01000062,
+ Key_Stop = 0x01000063,
+ Key_Refresh = 0x01000064,
+ Key_VolumeDown = 0x01000070,
+ Key_VolumeMute = 0x01000071,
+ Key_VolumeUp = 0x01000072,
+ Key_BassBoost = 0x01000073,
+ Key_BassUp = 0x01000074,
+ Key_BassDown = 0x01000075,
+ Key_TrebleUp = 0x01000076,
+ Key_TrebleDown = 0x01000077,
+ Key_MediaPlay = 0x01000080,
+ Key_MediaStop = 0x01000081,
+ Key_MediaPrevious = 0x01000082,
+ Key_MediaNext = 0x01000083,
+ Key_MediaRecord = 0x01000084,
+ Key_HomePage = 0x01000090,
+ Key_Favorites = 0x01000091,
+ Key_Search = 0x01000092,
+ Key_Standby = 0x01000093,
+ Key_OpenUrl = 0x01000094,
+ Key_LaunchMail = 0x010000a0,
+ Key_LaunchMedia = 0x010000a1,
+ Key_Launch0 = 0x010000a2,
+ Key_Launch1 = 0x010000a3,
+ Key_Launch2 = 0x010000a4,
+ Key_Launch3 = 0x010000a5,
+ Key_Launch4 = 0x010000a6,
+ Key_Launch5 = 0x010000a7,
+ Key_Launch6 = 0x010000a8,
+ Key_Launch7 = 0x010000a9,
+ Key_Launch8 = 0x010000aa,
+ Key_Launch9 = 0x010000ab,
+ Key_LaunchA = 0x010000ac,
+ Key_LaunchB = 0x010000ad,
+ Key_LaunchC = 0x010000ae,
+ Key_LaunchD = 0x010000af,
+ Key_LaunchE = 0x010000b0,
+ Key_LaunchF = 0x010000b1,
+ Key_MediaLast = 0x0100ffff,
+ Key_Select = 0x01010000,
+ Key_Yes = 0x01010001,
+ Key_No = 0x01010002,
+ Key_Cancel = 0x01020001,
+ Key_Printer = 0x01020002,
+ Key_Execute = 0x01020003,
+ Key_Sleep = 0x01020004,
+ Key_Play = 0x01020005,
+ Key_Zoom = 0x01020006,
+ Key_Context1 = 0x01100000,
+ Key_Context2 = 0x01100001,
+ Key_Context3 = 0x01100002,
+ Key_Context4 = 0x01100003,
+ Key_Call = 0x01100004,
+ Key_Hangup = 0x01100005,
+ Key_Flip = 0x01100006,
+ Key_unknown = 0x01ffffff
+ };
+ enum ArrowType {
+ NoArrow,
+ UpArrow,
+ DownArrow,
+ LeftArrow,
+ RightArrow
+ };
+ enum PenStyle {
+ NoPen,
+ SolidLine,
+ DashLine,
+ DotLine,
+ DashDotLine,
+ DashDotDotLine,
+ CustomDashLine
+ , MPenStyle = 0x0f
+ };
+ enum PenCapStyle {
+ FlatCap = 0x00,
+ SquareCap = 0x10,
+ RoundCap = 0x20,
+ MPenCapStyle = 0x30
+ };
+ enum PenJoinStyle {
+ MiterJoin = 0x00,
+ BevelJoin = 0x40,
+ RoundJoin = 0x80,
+ SvgMiterJoin = 0x100,
+ MPenJoinStyle = 0x1c0
+ };
+ enum BrushStyle {
+ NoBrush,
+ SolidPattern,
+ Dense1Pattern,
+ Dense2Pattern,
+ Dense3Pattern,
+ Dense4Pattern,
+ Dense5Pattern,
+ Dense6Pattern,
+ Dense7Pattern,
+ HorPattern,
+ VerPattern,
+ CrossPattern,
+ BDiagPattern,
+ FDiagPattern,
+ DiagCrossPattern,
+ LinearGradientPattern,
+ RadialGradientPattern,
+ ConicalGradientPattern,
+ TexturePattern = 24
+ };
+ enum SizeMode {
+ AbsoluteSize,
+ RelativeSize
+ };
+ enum UIEffect {
+ UI_General,
+ UI_AnimateMenu,
+ UI_FadeMenu,
+ UI_AnimateCombo,
+ UI_AnimateTooltip,
+ UI_FadeTooltip,
+ UI_AnimateToolBox
+ };
+ enum CursorShape {
+ ArrowCursor,
+ UpArrowCursor,
+ CrossCursor,
+ WaitCursor,
+ IBeamCursor,
+ SizeVerCursor,
+ SizeHorCursor,
+ SizeBDiagCursor,
+ SizeFDiagCursor,
+ SizeAllCursor,
+ BlankCursor,
+ SplitVCursor,
+ SplitHCursor,
+ PointingHandCursor,
+ ForbiddenCursor,
+ WhatsThisCursor,
+ BusyCursor,
+ OpenHandCursor,
+ ClosedHandCursor,
+ LastCursor = ClosedHandCursor,
+ BitmapCursor = 24,
+ CustomCursor = 25
+ };
+ enum TextFormat {
+ PlainText,
+ RichText,
+ AutoText,
+ LogText
+ };
+ enum AspectRatioMode {
+ IgnoreAspectRatio,
+ KeepAspectRatio,
+ KeepAspectRatioByExpanding
+ };
+ enum AnchorAttribute {
+ AnchorName,
+ AnchorHref
+ };
+ enum DockWidgetArea {
+ LeftDockWidgetArea = 0x1,
+ RightDockWidgetArea = 0x2,
+ TopDockWidgetArea = 0x4,
+ BottomDockWidgetArea = 0x8,
+ DockWidgetArea_Mask = 0xf,
+ AllDockWidgetAreas = DockWidgetArea_Mask,
+ NoDockWidgetArea = 0
+ };
+ enum DockWidgetAreaSizes {
+ NDockWidgetAreas = 4
+ };
+ typedef QFlags<DockWidgetArea> DockWidgetAreas;
+ enum ToolBarArea {
+ LeftToolBarArea = 0x1,
+ RightToolBarArea = 0x2,
+ TopToolBarArea = 0x4,
+ BottomToolBarArea = 0x8,
+ ToolBarArea_Mask = 0xf,
+ AllToolBarAreas = ToolBarArea_Mask,
+ NoToolBarArea = 0
+ };
+ enum ToolBarAreaSizes {
+ NToolBarAreas = 4
+ };
+ typedef QFlags<ToolBarArea> ToolBarAreas;
+ enum DateFormat {
+ TextDate,
+ ISODate,
+ SystemLocaleDate,
+ LocalDate = SystemLocaleDate,
+ LocaleDate,
+ SystemLocaleShortDate,
+ SystemLocaleLongDate,
+ DefaultLocaleShortDate,
+ DefaultLocaleLongDate
+ };
+ enum TimeSpec {
+ LocalTime,
+ UTC,
+ OffsetFromUTC
+ };
+ enum DayOfWeek {
+ Monday = 1,
+ Tuesday = 2,
+ Wednesday = 3,
+ Thursday = 4,
+ Friday = 5,
+ Saturday = 6,
+ Sunday = 7
+ };
+ enum ScrollBarPolicy {
+ ScrollBarAsNeeded,
+ ScrollBarAlwaysOff,
+ ScrollBarAlwaysOn
+ };
+ enum CaseSensitivity {
+ CaseInsensitive,
+ CaseSensitive
+ };
+ enum Corner {
+ TopLeftCorner = 0x00000,
+ TopRightCorner = 0x00001,
+ BottomLeftCorner = 0x00002,
+ BottomRightCorner = 0x00003
+ };
+ enum ConnectionType {
+ AutoConnection,
+ DirectConnection,
+ QueuedConnection,
+ AutoCompatConnection,
+ BlockingQueuedConnection
+ };
+ enum ShortcutContext {
+ WidgetShortcut,
+ WindowShortcut,
+ ApplicationShortcut,
+ WidgetWithChildrenShortcut
+ };
+ enum FillRule {
+ OddEvenFill,
+ WindingFill
+ };
+ enum MaskMode {
+ MaskInColor,
+ MaskOutColor
+ };
+ enum ClipOperation {
+ NoClip,
+ ReplaceClip,
+ IntersectClip,
+ UniteClip
+ };
+ enum ItemSelectionMode {
+ ContainsItemShape = 0x0,
+ IntersectsItemShape = 0x1,
+ ContainsItemBoundingRect = 0x2,
+ IntersectsItemBoundingRect = 0x3
+ };
+ enum TransformationMode {
+ FastTransformation,
+ SmoothTransformation
+ };
+ enum Axis {
+ XAxis,
+ YAxis,
+ ZAxis
+ };
+ enum FocusReason {
+ MouseFocusReason,
+ TabFocusReason,
+ BacktabFocusReason,
+ ActiveWindowFocusReason,
+ PopupFocusReason,
+ ShortcutFocusReason,
+ MenuBarFocusReason,
+ OtherFocusReason,
+ NoFocusReason
+ };
+ enum ContextMenuPolicy {
+ NoContextMenu,
+ DefaultContextMenu,
+ ActionsContextMenu,
+ CustomContextMenu,
+ PreventContextMenu
+ };
+ enum InputMethodQuery {
+ ImMicroFocus,
+ ImFont,
+ ImCursorPosition,
+ ImSurroundingText,
+ ImCurrentSelection
+ };
+ enum ToolButtonStyle {
+ ToolButtonIconOnly,
+ ToolButtonTextOnly,
+ ToolButtonTextBesideIcon,
+ ToolButtonTextUnderIcon
+ };
+ enum LayoutDirection {
+ LeftToRight,
+ RightToLeft
+ };
+ enum DropAction {
+ CopyAction = 0x1,
+ MoveAction = 0x2,
+ LinkAction = 0x4,
+ ActionMask = 0xff,
+ TargetMoveAction = 0x8002,
+ IgnoreAction = 0x0
+ };
+ typedef QFlags<DropAction> DropActions;
+ enum CheckState {
+ Unchecked,
+ PartiallyChecked,
+ Checked
+ };
+ enum ItemDataRole {
+ DisplayRole = 0,
+ DecorationRole = 1,
+ EditRole = 2,
+ ToolTipRole = 3,
+ StatusTipRole = 4,
+ WhatsThisRole = 5,
+ FontRole = 6,
+ TextAlignmentRole = 7,
+ BackgroundColorRole = 8,
+ BackgroundRole = 8,
+ TextColorRole = 9,
+ ForegroundRole = 9,
+ CheckStateRole = 10,
+ AccessibleTextRole = 11,
+ AccessibleDescriptionRole = 12,
+ SizeHintRole = 13,
+ DisplayPropertyRole = 27,
+ DecorationPropertyRole = 28,
+ ToolTipPropertyRole = 29,
+ StatusTipPropertyRole = 30,
+ WhatsThisPropertyRole = 31,
+ UserRole = 32
+ };
+ enum ItemFlag {
+ NoItemFlags = 0,
+ ItemIsSelectable = 1,
+ ItemIsEditable = 2,
+ ItemIsDragEnabled = 4,
+ ItemIsDropEnabled = 8,
+ ItemIsUserCheckable = 16,
+ ItemIsEnabled = 32,
+ ItemIsTristate = 64
+ };
+ typedef QFlags<ItemFlag> ItemFlags;
+ enum MatchFlag {
+ MatchExactly = 0,
+ MatchContains = 1,
+ MatchStartsWith = 2,
+ MatchEndsWith = 3,
+ MatchRegExp = 4,
+ MatchWildcard = 5,
+ MatchFixedString = 8,
+ MatchCaseSensitive = 16,
+ MatchWrap = 32,
+ MatchRecursive = 64
+ };
+ typedef QFlags<MatchFlag> MatchFlags;
+ typedef void * HANDLE;
+ typedef WindowFlags WFlags;
+ enum WindowModality {
+ NonModal,
+ WindowModal,
+ ApplicationModal
+ };
+ enum TextInteractionFlag {
+ NoTextInteraction = 0,
+ TextSelectableByMouse = 1,
+ TextSelectableByKeyboard = 2,
+ LinksAccessibleByMouse = 4,
+ LinksAccessibleByKeyboard = 8,
+ TextEditable = 16,
+ TextEditorInteraction = TextSelectableByMouse | TextSelectableByKeyboard | TextEditable,
+ TextBrowserInteraction = TextSelectableByMouse | LinksAccessibleByMouse | LinksAccessibleByKeyboard
+ };
+ typedef QFlags<TextInteractionFlag> TextInteractionFlags;
+ enum EventPriority {
+ HighEventPriority = 1,
+ NormalEventPriority = 0,
+ LowEventPriority = -1
+ };
+ enum SizeHint {
+ MinimumSize,
+ PreferredSize,
+ MaximumSize,
+ MinimumDescent,
+ NSizeHints
+ };
+ enum WindowFrameSection {
+ NoSection,
+ LeftSection,
+ TopLeftSection,
+ TopSection,
+ TopRightSection,
+ RightSection,
+ BottomRightSection,
+ BottomSection,
+ BottomLeftSection,
+ TitleBarArea
+ };
+}
+inline QFlags<Qt::MouseButtons::enum_type> operator|(Qt::MouseButtons::enum_type f1, Qt::MouseButtons::enum_type f2) { return QFlags<Qt::MouseButtons::enum_type>(f1) | f2; } inline QFlags<Qt::MouseButtons::enum_type> operator|(Qt::MouseButtons::enum_type f1, QFlags<Qt::MouseButtons::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::MouseButtons::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<Qt::Orientations::enum_type> operator|(Qt::Orientations::enum_type f1, Qt::Orientations::enum_type f2) { return QFlags<Qt::Orientations::enum_type>(f1) | f2; } inline QFlags<Qt::Orientations::enum_type> operator|(Qt::Orientations::enum_type f1, QFlags<Qt::Orientations::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::Orientations::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<Qt::KeyboardModifiers::enum_type> operator|(Qt::KeyboardModifiers::enum_type f1, Qt::KeyboardModifiers::enum_type f2) { return QFlags<Qt::KeyboardModifiers::enum_type>(f1) | f2; } inline QFlags<Qt::KeyboardModifiers::enum_type> operator|(Qt::KeyboardModifiers::enum_type f1, QFlags<Qt::KeyboardModifiers::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::KeyboardModifiers::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<Qt::WindowFlags::enum_type> operator|(Qt::WindowFlags::enum_type f1, Qt::WindowFlags::enum_type f2) { return QFlags<Qt::WindowFlags::enum_type>(f1) | f2; } inline QFlags<Qt::WindowFlags::enum_type> operator|(Qt::WindowFlags::enum_type f1, QFlags<Qt::WindowFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::WindowFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<Qt::Alignment::enum_type> operator|(Qt::Alignment::enum_type f1, Qt::Alignment::enum_type f2) { return QFlags<Qt::Alignment::enum_type>(f1) | f2; } inline QFlags<Qt::Alignment::enum_type> operator|(Qt::Alignment::enum_type f1, QFlags<Qt::Alignment::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::Alignment::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<Qt::ImageConversionFlags::enum_type> operator|(Qt::ImageConversionFlags::enum_type f1, Qt::ImageConversionFlags::enum_type f2) { return QFlags<Qt::ImageConversionFlags::enum_type>(f1) | f2; } inline QFlags<Qt::ImageConversionFlags::enum_type> operator|(Qt::ImageConversionFlags::enum_type f1, QFlags<Qt::ImageConversionFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::ImageConversionFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<Qt::DockWidgetAreas::enum_type> operator|(Qt::DockWidgetAreas::enum_type f1, Qt::DockWidgetAreas::enum_type f2) { return QFlags<Qt::DockWidgetAreas::enum_type>(f1) | f2; } inline QFlags<Qt::DockWidgetAreas::enum_type> operator|(Qt::DockWidgetAreas::enum_type f1, QFlags<Qt::DockWidgetAreas::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::DockWidgetAreas::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<Qt::ToolBarAreas::enum_type> operator|(Qt::ToolBarAreas::enum_type f1, Qt::ToolBarAreas::enum_type f2) { return QFlags<Qt::ToolBarAreas::enum_type>(f1) | f2; } inline QFlags<Qt::ToolBarAreas::enum_type> operator|(Qt::ToolBarAreas::enum_type f1, QFlags<Qt::ToolBarAreas::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::ToolBarAreas::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<Qt::WindowStates::enum_type> operator|(Qt::WindowStates::enum_type f1, Qt::WindowStates::enum_type f2) { return QFlags<Qt::WindowStates::enum_type>(f1) | f2; } inline QFlags<Qt::WindowStates::enum_type> operator|(Qt::WindowStates::enum_type f1, QFlags<Qt::WindowStates::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::WindowStates::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<Qt::DropActions::enum_type> operator|(Qt::DropActions::enum_type f1, Qt::DropActions::enum_type f2) { return QFlags<Qt::DropActions::enum_type>(f1) | f2; } inline QFlags<Qt::DropActions::enum_type> operator|(Qt::DropActions::enum_type f1, QFlags<Qt::DropActions::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::DropActions::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<Qt::ItemFlags::enum_type> operator|(Qt::ItemFlags::enum_type f1, Qt::ItemFlags::enum_type f2) { return QFlags<Qt::ItemFlags::enum_type>(f1) | f2; } inline QFlags<Qt::ItemFlags::enum_type> operator|(Qt::ItemFlags::enum_type f1, QFlags<Qt::ItemFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::ItemFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<Qt::MatchFlags::enum_type> operator|(Qt::MatchFlags::enum_type f1, Qt::MatchFlags::enum_type f2) { return QFlags<Qt::MatchFlags::enum_type>(f1) | f2; } inline QFlags<Qt::MatchFlags::enum_type> operator|(Qt::MatchFlags::enum_type f1, QFlags<Qt::MatchFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::MatchFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<Qt::TextInteractionFlags::enum_type> operator|(Qt::TextInteractionFlags::enum_type f1, Qt::TextInteractionFlags::enum_type f2) { return QFlags<Qt::TextInteractionFlags::enum_type>(f1) | f2; } inline QFlags<Qt::TextInteractionFlags::enum_type> operator|(Qt::TextInteractionFlags::enum_type f1, QFlags<Qt::TextInteractionFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::TextInteractionFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+typedef bool (*qInternalCallback)(void **);
+class __attribute__((visibility("default"))) QInternal {
+public:
+ enum PaintDeviceFlags {
+ UnknownDevice = 0x00,
+ Widget = 0x01,
+ Pixmap = 0x02,
+ Image = 0x03,
+ Printer = 0x04,
+ Picture = 0x05,
+ Pbuffer = 0x06,
+ FramebufferObject = 0x07,
+ CustomRaster = 0x08,
+ MacQuartz = 0x09
+ };
+ enum RelayoutType {
+ RelayoutNormal,
+ RelayoutDragging,
+ RelayoutDropped
+ };
+ enum Callback {
+ ConnectCallback,
+ DisconnectCallback,
+ AdoptCurrentThread,
+ EventNotifyCallback,
+ LastCallback
+ };
+ enum InternalFunction {
+ CreateThreadForAdoption,
+ RefAdoptedThread,
+ DerefAdoptedThread,
+ SetCurrentThreadToMainThread,
+ SetQObjectSender,
+ GetQObjectSender,
+ ResetQObjectSender,
+ LastInternalFunction
+ };
+ enum DockPosition {
+ LeftDock,
+ RightDock,
+ TopDock,
+ BottomDock,
+ DockCount
+ };
+ static bool registerCallback(Callback, qInternalCallback);
+ static bool unregisterCallback(Callback, qInternalCallback);
+ static bool activateCallbacks(Callback, void **);
+ static bool callFunction(InternalFunction func, void **);
+};
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QByteArray;
+class QString;
+template <typename T>
+inline int qYouForgotTheQ_OBJECT_Macro(T, T) { return 0; }
+template <typename T1, typename T2>
+inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {}
+__attribute__((visibility("default"))) const char *qFlagLocation(const char *method);
+class QObject;
+class QMetaMethod;
+class QMetaEnum;
+class QMetaProperty;
+class QMetaClassInfo;
+class __attribute__((visibility("default"))) QGenericArgument
+{
+public:
+ inline QGenericArgument(const char *aName = 0, const void *aData = 0)
+ : _data(aData), _name(aName) {}
+ inline void *data() const { return const_cast<void *>(_data); }
+ inline const char *name() const { return _name; }
+private:
+ const void *_data;
+ const char *_name;
+};
+class __attribute__((visibility("default"))) QGenericReturnArgument: public QGenericArgument
+{
+public:
+ inline QGenericReturnArgument(const char *aName = 0, void *aData = 0)
+ : QGenericArgument(aName, aData)
+ {}
+};
+template <class T>
+class QArgument: public QGenericArgument
+{
+public:
+ inline QArgument(const char *aName, const T &aData)
+ : QGenericArgument(aName, static_cast<const void *>(&aData))
+ {}
+};
+template <typename T>
+class QReturnArgument: public QGenericReturnArgument
+{
+public:
+ inline QReturnArgument(const char *aName, T &aData)
+ : QGenericReturnArgument(aName, static_cast<void *>(&aData))
+ {}
+};
+struct __attribute__((visibility("default"))) QMetaObject
+{
+ const char *className() const;
+ const QMetaObject *superClass() const;
+ QObject *cast(QObject *obj) const;
+ QString tr(const char *s, const char *c) const;
+ QString trUtf8(const char *s, const char *c) const;
+ QString tr(const char *s, const char *c, int n) const;
+ QString trUtf8(const char *s, const char *c, int n) const;
+ int methodOffset() const;
+ int enumeratorOffset() const;
+ int propertyOffset() const;
+ int classInfoOffset() const;
+ int constructorCount() const;
+ int methodCount() const;
+ int enumeratorCount() const;
+ int propertyCount() const;
+ int classInfoCount() const;
+ int indexOfConstructor(const char *constructor) const;
+ int indexOfMethod(const char *method) const;
+ int indexOfSignal(const char *signal) const;
+ int indexOfSlot(const char *slot) const;
+ int indexOfEnumerator(const char *name) const;
+ int indexOfProperty(const char *name) const;
+ int indexOfClassInfo(const char *name) const;
+ QMetaMethod constructor(int index) const;
+ QMetaMethod method(int index) const;
+ QMetaEnum enumerator(int index) const;
+ QMetaProperty property(int index) const;
+ QMetaClassInfo classInfo(int index) const;
+ QMetaProperty userProperty() const;
+ static bool checkConnectArgs(const char *signal, const char *method);
+ static QByteArray normalizedSignature(const char *method);
+ static QByteArray normalizedType(const char *type);
+ static bool connect(const QObject *sender, int signal_index,
+ const QObject *receiver, int method_index,
+ int type = 0, int *types = 0);
+ static bool disconnect(const QObject *sender, int signal_index,
+ const QObject *receiver, int method_index);
+ static void connectSlotsByName(QObject *o);
+ static void activate(QObject *sender, int signal_index, void **argv);
+ static void activate(QObject *sender, int from_signal_index, int to_signal_index, void **argv);
+ static void activate(QObject *sender, const QMetaObject *, int local_signal_index, void **argv);
+ static void activate(QObject *sender, const QMetaObject *, int from_local_signal_index, int to_local_signal_index, void **argv);
+ static void addGuard(QObject **ptr);
+ static void removeGuard(QObject **ptr);
+ static void changeGuard(QObject **ptr, QObject *o);
+ static bool invokeMethod(QObject *obj, const char *member,
+ Qt::ConnectionType,
+ QGenericReturnArgument ret,
+ QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val1 = QGenericArgument(),
+ QGenericArgument val2 = QGenericArgument(),
+ QGenericArgument val3 = QGenericArgument(),
+ QGenericArgument val4 = QGenericArgument(),
+ QGenericArgument val5 = QGenericArgument(),
+ QGenericArgument val6 = QGenericArgument(),
+ QGenericArgument val7 = QGenericArgument(),
+ QGenericArgument val8 = QGenericArgument(),
+ QGenericArgument val9 = QGenericArgument());
+ static inline bool invokeMethod(QObject *obj, const char *member,
+ QGenericReturnArgument ret,
+ QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val1 = QGenericArgument(),
+ QGenericArgument val2 = QGenericArgument(),
+ QGenericArgument val3 = QGenericArgument(),
+ QGenericArgument val4 = QGenericArgument(),
+ QGenericArgument val5 = QGenericArgument(),
+ QGenericArgument val6 = QGenericArgument(),
+ QGenericArgument val7 = QGenericArgument(),
+ QGenericArgument val8 = QGenericArgument(),
+ QGenericArgument val9 = QGenericArgument())
+ {
+ return invokeMethod(obj, member, Qt::AutoConnection, ret, val0, val1, val2, val3,
+ val4, val5, val6, val7, val8, val9);
+ }
+ static inline bool invokeMethod(QObject *obj, const char *member,
+ Qt::ConnectionType type,
+ QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val1 = QGenericArgument(),
+ QGenericArgument val2 = QGenericArgument(),
+ QGenericArgument val3 = QGenericArgument(),
+ QGenericArgument val4 = QGenericArgument(),
+ QGenericArgument val5 = QGenericArgument(),
+ QGenericArgument val6 = QGenericArgument(),
+ QGenericArgument val7 = QGenericArgument(),
+ QGenericArgument val8 = QGenericArgument(),
+ QGenericArgument val9 = QGenericArgument())
+ {
+ return invokeMethod(obj, member, type, QGenericReturnArgument(), val0, val1, val2,
+ val3, val4, val5, val6, val7, val8, val9);
+ }
+ static inline bool invokeMethod(QObject *obj, const char *member,
+ QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val1 = QGenericArgument(),
+ QGenericArgument val2 = QGenericArgument(),
+ QGenericArgument val3 = QGenericArgument(),
+ QGenericArgument val4 = QGenericArgument(),
+ QGenericArgument val5 = QGenericArgument(),
+ QGenericArgument val6 = QGenericArgument(),
+ QGenericArgument val7 = QGenericArgument(),
+ QGenericArgument val8 = QGenericArgument(),
+ QGenericArgument val9 = QGenericArgument())
+ {
+ return invokeMethod(obj, member, Qt::AutoConnection, QGenericReturnArgument(), val0,
+ val1, val2, val3, val4, val5, val6, val7, val8, val9);
+ }
+ QObject *newInstance(QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val1 = QGenericArgument(),
+ QGenericArgument val2 = QGenericArgument(),
+ QGenericArgument val3 = QGenericArgument(),
+ QGenericArgument val4 = QGenericArgument(),
+ QGenericArgument val5 = QGenericArgument(),
+ QGenericArgument val6 = QGenericArgument(),
+ QGenericArgument val7 = QGenericArgument(),
+ QGenericArgument val8 = QGenericArgument(),
+ QGenericArgument val9 = QGenericArgument()) const;
+ enum Call {
+ InvokeMetaMethod,
+ ReadProperty,
+ WriteProperty,
+ ResetProperty,
+ QueryPropertyDesignable,
+ QueryPropertyScriptable,
+ QueryPropertyStored,
+ QueryPropertyEditable,
+ QueryPropertyUser,
+ CreateInstance
+ };
+ int static_metacall(Call, int, void **) const;
+ struct {
+ const QMetaObject *superdata;
+ const char *stringdata;
+ const uint *data;
+ const void *extradata;
+ } d;
+};
+struct QMetaObjectExtraData
+{
+ const QMetaObject **objects;
+ int (*static_metacall)(QMetaObject::Call, int, void **);
+};
+inline const char *QMetaObject::className() const
+{ return d.stringdata; }
+inline const QMetaObject *QMetaObject::superClass() const
+{ return d.superdata; }
+extern "C" {
+extern void *memcpy (void *__restrict __dest,
+ __const void *__restrict __src, size_t __n)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern void *memmove (void *__dest, __const void *__src, size_t __n)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
+ int __c, size_t __n)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern void *memset (void *__s, int __c, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
+extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern void *memchr (__const void *__s, int __c, size_t __n)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern void *rawmemchr (__const void *__s, int __c)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern void *memrchr (__const void *__s, int __c, size_t __n)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern char *strncpy (char *__restrict __dest,
+ __const char *__restrict __src, size_t __n)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
+ size_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int strcmp (__const char *__s1, __const char *__s2)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern int strcoll (__const char *__s1, __const char *__s2)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern size_t strxfrm (char *__restrict __dest,
+ __const char *__restrict __src, size_t __n)
+ throw () __attribute__ ((__nonnull__ (2)));
+extern char *strdup (__const char *__s)
+ throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
+extern char *strndup (__const char *__string, size_t __n)
+ throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
+extern char *strchr (__const char *__s, int __c)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern char *strrchr (__const char *__s, int __c)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern char *strchrnul (__const char *__s, int __c)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern size_t strcspn (__const char *__s, __const char *__reject)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern size_t strspn (__const char *__s, __const char *__accept)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern char *strpbrk (__const char *__s, __const char *__accept)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern char *strstr (__const char *__haystack, __const char *__needle)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
+ throw () __attribute__ ((__nonnull__ (2)));
+extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
+ char **__restrict __save_ptr)
+ throw () __attribute__ ((__nonnull__ (2, 3)));
+extern char *strcasestr (__const char *__haystack, __const char *__needle)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern void *memmem (__const void *__haystack, size_t __haystacklen,
+ __const void *__needle, size_t __needlelen)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)));
+extern void *mempcpy (void *__restrict __dest,
+ __const void *__restrict __src, size_t __n)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern size_t strlen (__const char *__s)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern size_t strnlen (__const char *__string, size_t __maxlen)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern char *strerror (int __errnum) throw ();
+extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen)
+ throw () __attribute__ ((__nonnull__ (2)));
+extern char * strerror_r (int __errnum, char *__buf, size_t __buflen) throw () __asm__ ("_" "__glibc_strerror_r") __attribute__ ((__nonnull__ (2)));
+extern void bcopy (__const void *__src, void *__dest, size_t __n)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern void bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
+extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern char *index (__const char *__s, int __c)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern char *rindex (__const char *__s, int __c)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern int ffs (int __i) throw () __attribute__ ((__const__));
+extern int strcasecmp (__const char *__s1, __const char *__s2)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern char *strsep (char **__restrict __stringp,
+ __const char *__restrict __delim)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern char *strsignal (int __sig) throw ();
+extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern char *stpncpy (char *__restrict __dest,
+ __const char *__restrict __src, size_t __n)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern char *basename (__const char *__filename) throw () __attribute__ ((__nonnull__ (1)));
+extern size_t strlcat(char *__restrict dst, const char *__restrict src,
+ size_t n) throw () __attribute__ ((__nonnull__ (1, 2)));
+extern size_t strlcpy(char *__restrict dst, const char *__restrict src,
+ size_t n) throw () __attribute__ ((__nonnull__ (1, 2)));
+}
+typedef __gnuc_va_list va_list;
+typedef QtValidLicenseForCoreModule QtCoreModule;
+__attribute__((visibility("default"))) char *qstrdup(const char *);
+inline uint qstrlen(const char *str)
+{ return str ? uint(strlen(str)) : 0; }
+inline uint qstrnlen(const char *str, uint maxlen)
+{
+ uint length = 0;
+ if (str) {
+ while (length < maxlen && *str++)
+ length++;
+ }
+ return length;
+}
+__attribute__((visibility("default"))) char *qstrcpy(char *dst, const char *src);
+__attribute__((visibility("default"))) char *qstrncpy(char *dst, const char *src, uint len);
+__attribute__((visibility("default"))) int qstrcmp(const char *str1, const char *str2);
+__attribute__((visibility("default"))) int qstrcmp(const QByteArray &str1, const QByteArray &str2);
+__attribute__((visibility("default"))) int qstrcmp(const QByteArray &str1, const char *str2);
+static inline int qstrcmp(const char *str1, const QByteArray &str2)
+{ return -qstrcmp(str2, str1); }
+inline int qstrncmp(const char *str1, const char *str2, uint len)
+{
+ return (str1 && str2) ? strncmp(str1, str2, len)
+ : (str1 ? 1 : (str2 ? -1 : 0));
+}
+__attribute__((visibility("default"))) int qstricmp(const char *, const char *);
+__attribute__((visibility("default"))) int qstrnicmp(const char *, const char *, uint len);
+__attribute__((visibility("default"))) int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap);
+__attribute__((visibility("default"))) int qsnprintf(char *str, size_t n, const char *fmt, ...);
+__attribute__((visibility("default"))) quint16 qChecksum(const char *s, uint len);
+class QByteRef;
+class QString;
+class QDataStream;
+template <typename T> class QList;
+class __attribute__((visibility("default"))) QByteArray
+{
+public:
+ inline QByteArray();
+ QByteArray(const char *);
+ QByteArray(const char *, int size);
+ QByteArray(int size, char c);
+ inline QByteArray(const QByteArray &);
+ inline ~QByteArray();
+ QByteArray &operator=(const QByteArray &);
+ QByteArray &operator=(const char *str);
+ inline int size() const;
+ bool isEmpty() const;
+ void resize(int size);
+ QByteArray &fill(char c, int size = -1);
+ int capacity() const;
+ void reserve(int size);
+ void squeeze();
+ operator const char *() const;
+ operator const void *() const;
+ char *data();
+ const char *data() const;
+ inline const char *constData() const;
+ inline void detach();
+ bool isDetached() const;
+ void clear();
+ char at(int i) const;
+ char operator[](int i) const;
+ char operator[](uint i) const;
+ QByteRef operator[](int i);
+ QByteRef operator[](uint i);
+ int indexOf(char c, int from = 0) const;
+ int indexOf(const char *c, int from = 0) const;
+ int indexOf(const QByteArray &a, int from = 0) const;
+ int lastIndexOf(char c, int from = -1) const;
+ int lastIndexOf(const char *c, int from = -1) const;
+ int lastIndexOf(const QByteArray &a, int from = -1) const;
+ QBool contains(char c) const;
+ QBool contains(const char *a) const;
+ QBool contains(const QByteArray &a) const;
+ int count(char c) const;
+ int count(const char *a) const;
+ int count(const QByteArray &a) const;
+ QByteArray left(int len) const;
+ QByteArray right(int len) const;
+ QByteArray mid(int index, int len = -1) const;
+ bool startsWith(const QByteArray &a) const;
+ bool startsWith(char c) const;
+ bool startsWith(const char *c) const;
+ bool endsWith(const QByteArray &a) const;
+ bool endsWith(char c) const;
+ bool endsWith(const char *c) const;
+ void truncate(int pos);
+ void chop(int n);
+ QByteArray toLower() const;
+ QByteArray toUpper() const;
+ QByteArray trimmed() const;
+ QByteArray simplified() const;
+ QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const;
+ QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const;
+ QByteArray &prepend(char c);
+ QByteArray &prepend(const char *s);
+ QByteArray &prepend(const QByteArray &a);
+ QByteArray &append(char c);
+ QByteArray &append(const char *s);
+ QByteArray &append(const char *s, int len);
+ QByteArray &append(const QByteArray &a);
+ QByteArray &insert(int i, char c);
+ QByteArray &insert(int i, const char *s);
+ QByteArray &insert(int i, const QByteArray &a);
+ QByteArray &remove(int index, int len);
+ QByteArray &replace(int index, int len, const char *s);
+ QByteArray &replace(int index, int len, const QByteArray &s);
+ QByteArray &replace(char before, const char *after);
+ QByteArray &replace(char before, const QByteArray &after);
+ QByteArray &replace(const char *before, const char *after);
+ QByteArray &replace(const char *before, int bsize, const char *after, int asize);
+ QByteArray &replace(const QByteArray &before, const QByteArray &after);
+ QByteArray &replace(const QByteArray &before, const char *after);
+ QByteArray &replace(const char *before, const QByteArray &after);
+ QByteArray &replace(char before, char after);
+ QByteArray &operator+=(char c);
+ QByteArray &operator+=(const char *s);
+ QByteArray &operator+=(const QByteArray &a);
+ QList<QByteArray> split(char sep) const;
+ QByteArray repeated(int times) const;
+ inline __attribute__ ((__deprecated__)) bool operator==(const QString &s2) const;
+ inline __attribute__ ((__deprecated__)) bool operator!=(const QString &s2) const;
+ inline __attribute__ ((__deprecated__)) bool operator<(const QString &s2) const;
+ inline __attribute__ ((__deprecated__)) bool operator>(const QString &s2) const;
+ inline __attribute__ ((__deprecated__)) bool operator<=(const QString &s2) const;
+ inline __attribute__ ((__deprecated__)) bool operator>=(const QString &s2) const;
+ short toShort(bool *ok = 0, int base = 10) const;
+ ushort toUShort(bool *ok = 0, int base = 10) const;
+ int toInt(bool *ok = 0, int base = 10) const;
+ uint toUInt(bool *ok = 0, int base = 10) const;
+ long toLong(bool *ok = 0, int base = 10) const;
+ ulong toULong(bool *ok = 0, int base = 10) const;
+ qlonglong toLongLong(bool *ok = 0, int base = 10) const;
+ qulonglong toULongLong(bool *ok = 0, int base = 10) const;
+ float toFloat(bool *ok = 0) const;
+ double toDouble(bool *ok = 0) const;
+ QByteArray toBase64() const;
+ QByteArray toHex() const;
+ QByteArray toPercentEncoding(const QByteArray &exclude = QByteArray(),
+ const QByteArray &include = QByteArray(),
+ char percent = '%') const;
+ QByteArray &setNum(short, int base = 10);
+ QByteArray &setNum(ushort, int base = 10);
+ QByteArray &setNum(int, int base = 10);
+ QByteArray &setNum(uint, int base = 10);
+ QByteArray &setNum(qlonglong, int base = 10);
+ QByteArray &setNum(qulonglong, int base = 10);
+ QByteArray &setNum(float, char f = 'g', int prec = 6);
+ QByteArray &setNum(double, char f = 'g', int prec = 6);
+ static QByteArray number(int, int base = 10);
+ static QByteArray number(uint, int base = 10);
+ static QByteArray number(qlonglong, int base = 10);
+ static QByteArray number(qulonglong, int base = 10);
+ static QByteArray number(double, char f = 'g', int prec = 6);
+ static QByteArray fromRawData(const char *, int size);
+ static QByteArray fromBase64(const QByteArray &base64);
+ static QByteArray fromHex(const QByteArray &hexEncoded);
+ static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%');
+ typedef char *iterator;
+ typedef const char *const_iterator;
+ typedef iterator Iterator;
+ typedef const_iterator ConstIterator;
+ iterator begin();
+ const_iterator begin() const;
+ const_iterator constBegin() const;
+ iterator end();
+ const_iterator end() const;
+ const_iterator constEnd() const;
+ typedef const char & const_reference;
+ typedef char & reference;
+ void push_back(char c);
+ void push_back(const char *c);
+ void push_back(const QByteArray &a);
+ void push_front(char c);
+ void push_front(const char *c);
+ void push_front(const QByteArray &a);
+ inline int count() const { return d->size; }
+ int length() const { return d->size; }
+ bool isNull() const;
+private:
+ operator QNoImplicitBoolCast() const;
+ struct Data {
+ QBasicAtomicInt ref;
+ int alloc, size;
+ char *data;
+ char array[1];
+ };
+ static Data shared_null;
+ static Data shared_empty;
+ Data *d;
+ QByteArray(Data *dd, int , int ) : d(dd) {}
+ void realloc(int alloc);
+ void expand(int i);
+ QByteArray nulTerminated() const;
+ friend class QByteRef;
+ friend class QString;
+public:
+ typedef Data * DataPtr;
+ inline DataPtr &data_ptr() { return d; }
+};
+inline QByteArray::QByteArray(): d(&shared_null) { d->ref.ref(); }
+inline QByteArray::~QByteArray() { if (!d->ref.deref()) qFree(d); }
+inline int QByteArray::size() const
+{ return d->size; }
+inline char QByteArray::at(int i) const
+{ qt_noop(); return d->data[i]; }
+inline char QByteArray::operator[](int i) const
+{ qt_noop(); return d->data[i]; }
+inline char QByteArray::operator[](uint i) const
+{ qt_noop(); return d->data[i]; }
+inline bool QByteArray::isEmpty() const
+{ return d->size == 0; }
+inline QByteArray::operator const char *() const
+{ return d->data; }
+inline QByteArray::operator const void *() const
+{ return d->data; }
+inline char *QByteArray::data()
+{ detach(); return d->data; }
+inline const char *QByteArray::data() const
+{ return d->data; }
+inline const char *QByteArray::constData() const
+{ return d->data; }
+inline void QByteArray::detach()
+{ if (d->ref != 1 || d->data != d->array) realloc(d->size); }
+inline bool QByteArray::isDetached() const
+{ return d->ref == 1; }
+inline QByteArray::QByteArray(const QByteArray &a) : d(a.d)
+{ d->ref.ref(); }
+inline int QByteArray::capacity() const
+{ return d->alloc; }
+inline void QByteArray::reserve(int asize)
+{ if (d->ref != 1 || asize > d->alloc) realloc(asize); }
+inline void QByteArray::squeeze()
+{ if (d->size < d->alloc) realloc(d->size); }
+class __attribute__((visibility("default"))) QByteRef {
+ QByteArray &a;
+ int i;
+ inline QByteRef(QByteArray &array, int idx)
+ : a(array),i(idx) {}
+ friend class QByteArray;
+public:
+ inline operator char() const
+ { return i < a.d->size ? a.d->data[i] : 0; }
+ inline QByteRef &operator=(char c)
+ { if (i >= a.d->size) a.expand(i); else a.detach();
+ a.d->data[i] = c; return *this; }
+ inline QByteRef &operator=(const QByteRef &c)
+ { if (i >= a.d->size) a.expand(i); else a.detach();
+ a.d->data[i] = c.a.d->data[c.i]; return *this; }
+ inline bool operator==(char c) const
+ { return a.d->data[i] == c; }
+ inline bool operator!=(char c) const
+ { return a.d->data[i] != c; }
+ inline bool operator>(char c) const
+ { return a.d->data[i] > c; }
+ inline bool operator>=(char c) const
+ { return a.d->data[i] >= c; }
+ inline bool operator<(char c) const
+ { return a.d->data[i] < c; }
+ inline bool operator<=(char c) const
+ { return a.d->data[i] <= c; }
+};
+inline QByteRef QByteArray::operator[](int i)
+{ qt_noop(); return QByteRef(*this, i); }
+inline QByteRef QByteArray::operator[](uint i)
+{ return QByteRef(*this, i); }
+inline QByteArray::iterator QByteArray::begin()
+{ detach(); return d->data; }
+inline QByteArray::const_iterator QByteArray::begin() const
+{ return d->data; }
+inline QByteArray::const_iterator QByteArray::constBegin() const
+{ return d->data; }
+inline QByteArray::iterator QByteArray::end()
+{ detach(); return d->data + d->size; }
+inline QByteArray::const_iterator QByteArray::end() const
+{ return d->data + d->size; }
+inline QByteArray::const_iterator QByteArray::constEnd() const
+{ return d->data + d->size; }
+inline QByteArray &QByteArray::operator+=(char c)
+{ return append(c); }
+inline QByteArray &QByteArray::operator+=(const char *s)
+{ return append(s); }
+inline QByteArray &QByteArray::operator+=(const QByteArray &a)
+{ return append(a); }
+inline void QByteArray::push_back(char c)
+{ append(c); }
+inline void QByteArray::push_back(const char *c)
+{ append(c); }
+inline void QByteArray::push_back(const QByteArray &a)
+{ append(a); }
+inline void QByteArray::push_front(char c)
+{ prepend(c); }
+inline void QByteArray::push_front(const char *c)
+{ prepend(c); }
+inline void QByteArray::push_front(const QByteArray &a)
+{ prepend(a); }
+inline QBool QByteArray::contains(const QByteArray &a) const
+{ return QBool(indexOf(a) != -1); }
+inline QBool QByteArray::contains(char c) const
+{ return QBool(indexOf(c) != -1); }
+inline bool operator==(const QByteArray &a1, const QByteArray &a2)
+{ return (a1.size() == a2.size()) && (memcmp(a1.constData(), a2.constData(), a1.size())==0); }
+inline bool operator==(const QByteArray &a1, const char *a2)
+{ return a2 ? qstrcmp(a1,a2) == 0 : a1.isEmpty(); }
+inline bool operator==(const char *a1, const QByteArray &a2)
+{ return a1 ? qstrcmp(a1,a2) == 0 : a2.isEmpty(); }
+inline bool operator!=(const QByteArray &a1, const QByteArray &a2)
+{ return !(a1==a2); }
+inline bool operator!=(const QByteArray &a1, const char *a2)
+{ return a2 ? qstrcmp(a1,a2) != 0 : !a1.isEmpty(); }
+inline bool operator!=(const char *a1, const QByteArray &a2)
+{ return a1 ? qstrcmp(a1,a2) != 0 : !a2.isEmpty(); }
+inline bool operator<(const QByteArray &a1, const QByteArray &a2)
+{ return qstrcmp(a1, a2) < 0; }
+ inline bool operator<(const QByteArray &a1, const char *a2)
+{ return qstrcmp(a1, a2) < 0; }
+inline bool operator<(const char *a1, const QByteArray &a2)
+{ return qstrcmp(a1, a2) < 0; }
+inline bool operator<=(const QByteArray &a1, const QByteArray &a2)
+{ return qstrcmp(a1, a2) <= 0; }
+inline bool operator<=(const QByteArray &a1, const char *a2)
+{ return qstrcmp(a1, a2) <= 0; }
+inline bool operator<=(const char *a1, const QByteArray &a2)
+{ return qstrcmp(a1, a2) <= 0; }
+inline bool operator>(const QByteArray &a1, const QByteArray &a2)
+{ return qstrcmp(a1, a2) > 0; }
+inline bool operator>(const QByteArray &a1, const char *a2)
+{ return qstrcmp(a1, a2) > 0; }
+inline bool operator>(const char *a1, const QByteArray &a2)
+{ return qstrcmp(a1, a2) > 0; }
+inline bool operator>=(const QByteArray &a1, const QByteArray &a2)
+{ return qstrcmp(a1, a2) >= 0; }
+inline bool operator>=(const QByteArray &a1, const char *a2)
+{ return qstrcmp(a1, a2) >= 0; }
+inline bool operator>=(const char *a1, const QByteArray &a2)
+{ return qstrcmp(a1, a2) >= 0; }
+inline const QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
+{ return QByteArray(a1) += a2; }
+inline const QByteArray operator+(const QByteArray &a1, const char *a2)
+{ return QByteArray(a1) += a2; }
+inline const QByteArray operator+(const QByteArray &a1, char a2)
+{ return QByteArray(a1) += a2; }
+inline const QByteArray operator+(const char *a1, const QByteArray &a2)
+{ return QByteArray(a1) += a2; }
+inline const QByteArray operator+(char a1, const QByteArray &a2)
+{ return QByteArray(&a1, 1) += a2; }
+inline QBool QByteArray::contains(const char *c) const
+{ return QBool(indexOf(c) != -1); }
+inline QByteArray &QByteArray::replace(char before, const char *c)
+{ return replace(&before, 1, c, qstrlen(c)); }
+inline QByteArray &QByteArray::replace(const QByteArray &before, const char *c)
+{ return replace(before.constData(), before.size(), c, qstrlen(c)); }
+inline QByteArray &QByteArray::replace(const char *before, const char *after)
+{ return replace(before, qstrlen(before), after, qstrlen(after)); }
+inline QByteArray &QByteArray::setNum(short n, int base)
+{ return setNum(qlonglong(n), base); }
+inline QByteArray &QByteArray::setNum(ushort n, int base)
+{ return setNum(qulonglong(n), base); }
+inline QByteArray &QByteArray::setNum(int n, int base)
+{ return setNum(qlonglong(n), base); }
+inline QByteArray &QByteArray::setNum(uint n, int base)
+{ return setNum(qulonglong(n), base); }
+inline QByteArray &QByteArray::setNum(float n, char f, int prec)
+{ return setNum(double(n),f,prec); }
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QByteArray &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QByteArray &);
+__attribute__((visibility("default"))) QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel = -1);
+__attribute__((visibility("default"))) QByteArray qUncompress(const uchar* data, int nbytes);
+inline QByteArray qCompress(const QByteArray& data, int compressionLevel = -1)
+{ return qCompress(reinterpret_cast<const uchar *>(data.constData()), data.size(), compressionLevel); }
+inline QByteArray qUncompress(const QByteArray& data)
+{ return qUncompress(reinterpret_cast<const uchar*>(data.constData()), data.size()); }
+template <> class QTypeInfo<QByteArray> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QByteArray)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QByteArray"; } };
+template <> inline bool qIsDetached<QByteArray>(QByteArray &t) { return t.isDetached(); } template <typename T> inline void qSwap(T &, T &); template <> inline void qSwap<QByteArray>(QByteArray &value1, QByteArray &value2) { const QByteArray::DataPtr t = value1.data_ptr(); value1.data_ptr() = value2.data_ptr(); value2.data_ptr() = t; }
+typedef std::basic_string<wchar_t> QStdWString;
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QCharRef;
+class QRegExp;
+class QStringList;
+class QTextCodec;
+class QLatin1String;
+class QStringRef;
+template <typename T> class QVector;
+class __attribute__((visibility("default"))) QString
+{
+public:
+ inline QString();
+ QString(const QChar *unicode, int size);
+ QString(QChar c);
+ QString(int size, QChar c);
+ inline QString(const QLatin1String &latin1);
+ inline QString(const QString &);
+ inline ~QString();
+ QString &operator=(QChar c);
+ QString &operator=(const QString &);
+ inline QString &operator=(const QLatin1String &);
+ inline int size() const { return d->size; }
+ inline int count() const { return d->size; }
+ inline int length() const;
+ inline bool isEmpty() const;
+ void resize(int size);
+ QString &fill(QChar c, int size = -1);
+ void truncate(int pos);
+ void chop(int n);
+ int capacity() const;
+ inline void reserve(int size);
+ inline void squeeze() { if (d->size < d->alloc) realloc(); d->capacity = 0;}
+ inline const QChar *unicode() const;
+ inline QChar *data();
+ inline const QChar *data() const;
+ inline const QChar *constData() const;
+ inline void detach();
+ inline bool isDetached() const;
+ void clear();
+ inline const QChar at(int i) const;
+ const QChar operator[](int i) const;
+ QCharRef operator[](int i);
+ const QChar operator[](uint i) const;
+ QCharRef operator[](uint i);
+ QString arg(qlonglong a, int fieldwidth=0, int base=10,
+ const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
+ QString arg(qulonglong a, int fieldwidth=0, int base=10,
+ const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
+ QString arg(long a, int fieldwidth=0, int base=10,
+ const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
+ QString arg(ulong a, int fieldwidth=0, int base=10,
+ const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
+ QString arg(int a, int fieldWidth = 0, int base = 10,
+ const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
+ QString arg(uint a, int fieldWidth = 0, int base = 10,
+ const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
+ QString arg(short a, int fieldWidth = 0, int base = 10,
+ const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
+ QString arg(ushort a, int fieldWidth = 0, int base = 10,
+ const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
+ QString arg(double a, int fieldWidth = 0, char fmt = 'g', int prec = -1,
+ const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
+ QString arg(char a, int fieldWidth = 0,
+ const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
+ QString arg(QChar a, int fieldWidth = 0,
+ const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
+ QString arg(const QString &a, int fieldWidth = 0,
+ const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
+ QString arg(const QString &a1, const QString &a2) const __attribute__ ((warn_unused_result));
+ QString arg(const QString &a1, const QString &a2, const QString &a3) const __attribute__ ((warn_unused_result));
+ QString arg(const QString &a1, const QString &a2, const QString &a3,
+ const QString &a4) const __attribute__ ((warn_unused_result));
+ QString arg(const QString &a1, const QString &a2, const QString &a3,
+ const QString &a4, const QString &a5) const __attribute__ ((warn_unused_result));
+ QString arg(const QString &a1, const QString &a2, const QString &a3,
+ const QString &a4, const QString &a5, const QString &a6) const __attribute__ ((warn_unused_result));
+ QString arg(const QString &a1, const QString &a2, const QString &a3,
+ const QString &a4, const QString &a5, const QString &a6,
+ const QString &a7) const __attribute__ ((warn_unused_result));
+ QString arg(const QString &a1, const QString &a2, const QString &a3,
+ const QString &a4, const QString &a5, const QString &a6,
+ const QString &a7, const QString &a8) const __attribute__ ((warn_unused_result));
+ QString arg(const QString &a1, const QString &a2, const QString &a3,
+ const QString &a4, const QString &a5, const QString &a6,
+ const QString &a7, const QString &a8, const QString &a9) const __attribute__ ((warn_unused_result));
+ QString &vsprintf(const char *format, va_list ap)
+ __attribute__ ((format (printf, 2, 0)))
+ ;
+ QString &sprintf(const char *format, ...)
+ __attribute__ ((format (printf, 2, 3)))
+ ;
+ int indexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ int indexOf(const QString &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ int indexOf(const QLatin1String &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ int lastIndexOf(QChar c, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ int lastIndexOf(const QString &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ int lastIndexOf(const QLatin1String &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ inline QBool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ inline QBool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ int count(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ int indexOf(const QRegExp &, int from = 0) const;
+ int lastIndexOf(const QRegExp &, int from = -1) const;
+ inline QBool contains(const QRegExp &rx) const { return QBool(indexOf(rx) != -1); }
+ int count(const QRegExp &) const;
+ int indexOf(QRegExp &, int from = 0) const;
+ int lastIndexOf(QRegExp &, int from = -1) const;
+ inline QBool contains(QRegExp &rx) const { return QBool(indexOf(rx) != -1); }
+ enum SectionFlag {
+ SectionDefault = 0x00,
+ SectionSkipEmpty = 0x01,
+ SectionIncludeLeadingSep = 0x02,
+ SectionIncludeTrailingSep = 0x04,
+ SectionCaseInsensitiveSeps = 0x08
+ };
+ typedef QFlags<SectionFlag> SectionFlags;
+ QString section(QChar sep, int start, int end = -1, SectionFlags flags = SectionDefault) const;
+ QString section(const QString &in_sep, int start, int end = -1, SectionFlags flags = SectionDefault) const;
+ QString section(const QRegExp ®, int start, int end = -1, SectionFlags flags = SectionDefault) const;
+ QString left(int n) const __attribute__ ((warn_unused_result));
+ QString right(int n) const __attribute__ ((warn_unused_result));
+ QString mid(int position, int n = -1) const __attribute__ ((warn_unused_result));
+ QStringRef leftRef(int n) const __attribute__ ((warn_unused_result));
+ QStringRef rightRef(int n) const __attribute__ ((warn_unused_result));
+ QStringRef midRef(int position, int n = -1) const __attribute__ ((warn_unused_result));
+ bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ bool startsWith(const QLatin1String &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ bool startsWith(const QChar &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ bool endsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ bool endsWith(const QLatin1String &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ bool endsWith(const QChar &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ QString leftJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const __attribute__ ((warn_unused_result));
+ QString rightJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const __attribute__ ((warn_unused_result));
+ QString toLower() const __attribute__ ((warn_unused_result));
+ QString toUpper() const __attribute__ ((warn_unused_result));
+ QString toCaseFolded() const __attribute__ ((warn_unused_result));
+ QString trimmed() const __attribute__ ((warn_unused_result));
+ QString simplified() const __attribute__ ((warn_unused_result));
+ QString &insert(int i, QChar c);
+ QString &insert(int i, const QChar *uc, int len);
+ inline QString &insert(int i, const QString &s) { return insert(i, s.constData(), s.length()); }
+ QString &insert(int i, const QLatin1String &s);
+ QString &append(QChar c);
+ QString &append(const QString &s);
+ QString &append(const QStringRef &s);
+ QString &append(const QLatin1String &s);
+ inline QString &prepend(QChar c) { return insert(0, c); }
+ inline QString &prepend(const QString &s) { return insert(0, s); }
+ inline QString &prepend(const QLatin1String &s) { return insert(0, s); }
+ inline QString &operator+=(QChar c) {
+ if (d->ref != 1 || d->size + 1 > d->alloc)
+ realloc(grow(d->size + 1));
+ d->data[d->size++] = c.unicode();
+ d->data[d->size] = '\0';
+ return *this;
+ }
+ inline QString &operator+=(QChar::SpecialCharacter c) { return append(QChar(c)); }
+ inline QString &operator+=(const QString &s) { return append(s); }
+ inline QString &operator+=(const QStringRef &s) { return append(s); }
+ inline QString &operator+=(const QLatin1String &s) { return append(s); }
+ QString &remove(int i, int len);
+ QString &remove(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QString &remove(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QString &replace(int i, int len, QChar after);
+ QString &replace(int i, int len, const QChar *s, int slen);
+ QString &replace(int i, int len, const QString &after);
+ QString &replace(QChar before, QChar after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QString &replace(const QChar *before, int blen, const QChar *after, int alen, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QString &replace(const QLatin1String &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QString &replace(const QLatin1String &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QString &replace(const QString &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QString &replace(const QString &before, const QString &after,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QString &replace(QChar c, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QString &replace(QChar c, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QString &replace(const QRegExp &rx, const QString &after);
+ inline QString &remove(const QRegExp &rx)
+ { return replace(rx, QString()); }
+ enum SplitBehavior { KeepEmptyParts, SkipEmptyParts };
+ QStringList split(const QString &sep, SplitBehavior behavior = KeepEmptyParts,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) const __attribute__ ((warn_unused_result));
+ QStringList split(const QChar &sep, SplitBehavior behavior = KeepEmptyParts,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) const __attribute__ ((warn_unused_result));
+ QStringList split(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const __attribute__ ((warn_unused_result));
+ enum NormalizationForm {
+ NormalizationForm_D,
+ NormalizationForm_C,
+ NormalizationForm_KD,
+ NormalizationForm_KC
+ };
+ QString normalized(NormalizationForm mode) const __attribute__ ((warn_unused_result));
+ QString normalized(NormalizationForm mode, QChar::UnicodeVersion version) const __attribute__ ((warn_unused_result));
+ QString repeated(int times) const;
+ const ushort *utf16() const;
+ QByteArray toAscii() const __attribute__ ((warn_unused_result));
+ QByteArray toLatin1() const __attribute__ ((warn_unused_result));
+ QByteArray toUtf8() const __attribute__ ((warn_unused_result));
+ QByteArray toLocal8Bit() const __attribute__ ((warn_unused_result));
+ QVector<uint> toUcs4() const __attribute__ ((warn_unused_result));
+ static QString fromAscii(const char *, int size = -1);
+ static QString fromLatin1(const char *, int size = -1);
+ static QString fromUtf8(const char *, int size = -1);
+ static QString fromLocal8Bit(const char *, int size = -1);
+ static QString fromUtf16(const ushort *, int size = -1);
+ static QString fromUcs4(const uint *, int size = -1);
+ static QString fromRawData(const QChar *, int size);
+ int toWCharArray(wchar_t *array) const;
+ static QString fromWCharArray(const wchar_t *, int size = -1);
+ QString &setUnicode(const QChar *unicode, int size);
+ inline QString &setUtf16(const ushort *utf16, int size);
+ int compare(const QString &s) const;
+ int compare(const QString &s, Qt::CaseSensitivity cs) const;
+ int compare(const QLatin1String &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ static inline int compare(const QString &s1, const QString &s2)
+ { return s1.compare(s2); }
+ static inline int compare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs)
+ { return s1.compare(s2, cs); }
+ static inline int compare(const QString& s1, const QLatin1String &s2,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive)
+ { return s1.compare(s2, cs); }
+ static inline int compare(const QLatin1String& s1, const QString &s2,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive)
+ { return -s2.compare(s1, cs); }
+ int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ static int compare(const QString &s1, const QStringRef &s2,
+ Qt::CaseSensitivity = Qt::CaseSensitive);
+ int localeAwareCompare(const QString& s) const;
+ static int localeAwareCompare(const QString& s1, const QString& s2)
+ { return s1.localeAwareCompare(s2); }
+ int localeAwareCompare(const QStringRef &s) const;
+ static int localeAwareCompare(const QString& s1, const QStringRef& s2);
+ short toShort(bool *ok=0, int base=10) const;
+ ushort toUShort(bool *ok=0, int base=10) const;
+ int toInt(bool *ok=0, int base=10) const;
+ uint toUInt(bool *ok=0, int base=10) const;
+ long toLong(bool *ok=0, int base=10) const;
+ ulong toULong(bool *ok=0, int base=10) const;
+ qlonglong toLongLong(bool *ok=0, int base=10) const;
+ qulonglong toULongLong(bool *ok=0, int base=10) const;
+ float toFloat(bool *ok=0) const;
+ double toDouble(bool *ok=0) const;
+ QString &setNum(short, int base=10);
+ QString &setNum(ushort, int base=10);
+ QString &setNum(int, int base=10);
+ QString &setNum(uint, int base=10);
+ QString &setNum(long, int base=10);
+ QString &setNum(ulong, int base=10);
+ QString &setNum(qlonglong, int base=10);
+ QString &setNum(qulonglong, int base=10);
+ QString &setNum(float, char f='g', int prec=6);
+ QString &setNum(double, char f='g', int prec=6);
+ static QString number(int, int base=10);
+ static QString number(uint, int base=10);
+ static QString number(long, int base=10);
+ static QString number(ulong, int base=10);
+ static QString number(qlonglong, int base=10);
+ static QString number(qulonglong, int base=10);
+ static QString number(double, char f='g', int prec=6);
+ bool operator==(const QString &s) const;
+ bool operator<(const QString &s) const;
+ inline bool operator>(const QString &s) const { return s < *this; }
+ inline bool operator!=(const QString &s) const { return !operator==(s); }
+ inline bool operator<=(const QString &s) const { return !operator>(s); }
+ inline bool operator>=(const QString &s) const { return !operator<(s); }
+ bool operator==(const QLatin1String &s) const;
+ bool operator<(const QLatin1String &s) const;
+ bool operator>(const QLatin1String &s) const;
+ inline bool operator!=(const QLatin1String &s) const { return !operator==(s); }
+ inline bool operator<=(const QLatin1String &s) const { return !operator>(s); }
+ inline bool operator>=(const QLatin1String &s) const { return !operator<(s); }
+ inline __attribute__ ((__deprecated__)) QString(const char *ch) : d(fromAscii_helper(ch))
+ {}
+ inline __attribute__ ((__deprecated__)) QString(const QByteArray &a)
+ : d(fromAscii_helper(a.constData(), qstrnlen(a.constData(), a.size())))
+ {}
+ inline __attribute__ ((__deprecated__)) QString &operator=(const char *ch)
+ { return (*this = fromAscii(ch)); }
+ inline __attribute__ ((__deprecated__)) QString &operator=(const QByteArray &a)
+ { return (*this = fromAscii(a.constData(), qstrnlen(a.constData(), a.size()))); }
+ inline __attribute__ ((__deprecated__)) QString &operator=(char c)
+ { return (*this = QChar::fromAscii(c)); }
+ inline __attribute__ ((__deprecated__)) QString &prepend(const char *s)
+ { return prepend(QString::fromAscii(s)); }
+ inline __attribute__ ((__deprecated__)) QString &prepend(const QByteArray &s)
+ { return prepend(QString::fromAscii(s.constData(), qstrnlen(s.constData(), s.size()))); }
+ inline __attribute__ ((__deprecated__)) QString &append(const char *s)
+ { return append(QString::fromAscii(s)); }
+ inline __attribute__ ((__deprecated__)) QString &append(const QByteArray &s)
+ { return append(QString::fromAscii(s.constData(), qstrnlen(s.constData(), s.size()))); }
+ inline __attribute__ ((__deprecated__)) QString &operator+=(const char *s)
+ { return append(QString::fromAscii(s)); }
+ inline __attribute__ ((__deprecated__)) QString &operator+=(const QByteArray &s)
+ { return append(QString::fromAscii(s.constData(), qstrnlen(s.constData(), s.size()))); }
+ inline __attribute__ ((__deprecated__)) QString &operator+=(char c)
+ { return append(QChar::fromAscii(c)); }
+ inline __attribute__ ((__deprecated__)) bool operator==(const char *s) const;
+ inline __attribute__ ((__deprecated__)) bool operator!=(const char *s) const;
+ inline __attribute__ ((__deprecated__)) bool operator<(const char *s) const;
+ inline __attribute__ ((__deprecated__)) bool operator<=(const char *s2) const;
+ inline __attribute__ ((__deprecated__)) bool operator>(const char *s2) const;
+ inline __attribute__ ((__deprecated__)) bool operator>=(const char *s2) const;
+ inline __attribute__ ((__deprecated__)) bool operator==(const QByteArray &s) const;
+ inline __attribute__ ((__deprecated__)) bool operator!=(const QByteArray &s) const;
+ inline __attribute__ ((__deprecated__)) bool operator<(const QByteArray &s) const
+ { return *this < QString::fromAscii(s.constData(), s.size()); }
+ inline __attribute__ ((__deprecated__)) bool operator>(const QByteArray &s) const
+ { return *this > QString::fromAscii(s.constData(), s.size()); }
+ inline __attribute__ ((__deprecated__)) bool operator<=(const QByteArray &s) const
+ { return *this <= QString::fromAscii(s.constData(), s.size()); }
+ inline __attribute__ ((__deprecated__)) bool operator>=(const QByteArray &s) const
+ { return *this >= QString::fromAscii(s.constData(), s.size()); }
+ typedef QChar *iterator;
+ typedef const QChar *const_iterator;
+ typedef iterator Iterator;
+ typedef const_iterator ConstIterator;
+ iterator begin();
+ const_iterator begin() const;
+ const_iterator constBegin() const;
+ iterator end();
+ const_iterator end() const;
+ const_iterator constEnd() const;
+ inline void push_back(QChar c) { append(c); }
+ inline void push_back(const QString &s) { append(s); }
+ inline void push_front(QChar c) { prepend(c); }
+ inline void push_front(const QString &s) { prepend(s); }
+ static inline QString fromStdString(const std::string &s);
+ inline std::string toStdString() const;
+ static inline QString fromStdWString(const QStdWString &s);
+ inline QStdWString toStdWString() const;
+ struct Null { };
+ static const Null null;
+ inline QString(const Null &): d(&shared_null) { d->ref.ref(); }
+ inline QString &operator=(const Null &) { *this = QString(); return *this; }
+ inline bool isNull() const { return d == &shared_null; }
+ bool isSimpleText() const { if (!d->clean) updateProperties(); return d->simpletext; }
+ bool isRightToLeft() const { if (!d->clean) updateProperties(); return d->righttoleft; }
+private:
+ struct Data {
+ QBasicAtomicInt ref;
+ int alloc, size;
+ ushort *data;
+ ushort clean : 1;
+ ushort simpletext : 1;
+ ushort righttoleft : 1;
+ ushort asciiCache : 1;
+ ushort capacity : 1;
+ ushort reserved : 11;
+ ushort array[1];
+ };
+ static Data shared_null;
+ static Data shared_empty;
+ Data *d;
+ QString(Data *dd, int ) : d(dd) {}
+ static QTextCodec *codecForCStrings;
+ static int grow(int);
+ static void free(Data *);
+ void realloc();
+ void realloc(int alloc);
+ void expand(int i);
+ void updateProperties() const;
+ QString multiArg(int numArgs, const QString **args) const;
+ static int compare_helper(const QChar *data1, int length1,
+ const QChar *data2, int length2,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ static int compare_helper(const QChar *data1, int length1,
+ QLatin1String s2,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ static int localeAwareCompare_helper(const QChar *data1, int length1,
+ const QChar *data2, int length2);
+ static Data *fromLatin1_helper(const char *str, int size = -1);
+ static Data *fromAscii_helper(const char *str, int size = -1);
+ void replace_helper(uint *indices, int nIndices, int blen, const QChar *after, int alen);
+ friend class QCharRef;
+ friend class QTextCodec;
+ friend class QStringRef;
+ friend inline bool qStringComparisonHelper(const QString &s1, const char *s2);
+ friend inline bool qStringComparisonHelper(const QStringRef &s1, const char *s2);
+public:
+ typedef Data * DataPtr;
+ inline DataPtr &data_ptr() { return d; }
+};
+class __attribute__((visibility("default"))) QLatin1String
+{
+public:
+ inline explicit QLatin1String(const char *s) : chars(s) {}
+ inline QLatin1String &operator=(const QLatin1String &other)
+ { chars = other.chars; return *this; }
+ inline const char *latin1() const { return chars; }
+ inline bool operator==(const QString &s) const
+ { return s == *this; }
+ inline bool operator!=(const QString &s) const
+ { return s != *this; }
+ inline bool operator>(const QString &s) const
+ { return s < *this; }
+ inline bool operator<(const QString &s) const
+ { return s > *this; }
+ inline bool operator>=(const QString &s) const
+ { return s <= *this; }
+ inline bool operator<=(const QString &s) const
+ { return s >= *this; }
+ inline __attribute__ ((__deprecated__)) bool operator==(const char *s) const
+ { return QString::fromAscii(s) == *this; }
+ inline __attribute__ ((__deprecated__)) bool operator!=(const char *s) const
+ { return QString::fromAscii(s) != *this; }
+ inline __attribute__ ((__deprecated__)) bool operator<(const char *s) const
+ { return QString::fromAscii(s) > *this; }
+ inline __attribute__ ((__deprecated__)) bool operator>(const char *s) const
+ { return QString::fromAscii(s) < *this; }
+ inline __attribute__ ((__deprecated__)) bool operator<=(const char *s) const
+ { return QString::fromAscii(s) >= *this; }
+ inline __attribute__ ((__deprecated__)) bool operator>=(const char *s) const
+ { return QString::fromAscii(s) <= *this; }
+private:
+ const char *chars;
+};
+inline QString::QString(const QLatin1String &aLatin1) : d(fromLatin1_helper(aLatin1.latin1()))
+{ }
+inline int QString::length() const
+{ return d->size; }
+inline const QChar QString::at(int i) const
+{ qt_noop(); return d->data[i]; }
+inline const QChar QString::operator[](int i) const
+{ qt_noop(); return d->data[i]; }
+inline const QChar QString::operator[](uint i) const
+{ qt_noop(); return d->data[i]; }
+inline bool QString::isEmpty() const
+{ return d->size == 0; }
+inline const QChar *QString::unicode() const
+{ return reinterpret_cast<const QChar*>(d->data); }
+inline const QChar *QString::data() const
+{ return reinterpret_cast<const QChar*>(d->data); }
+inline QChar *QString::data()
+{ detach(); return reinterpret_cast<QChar*>(d->data); }
+inline const QChar *QString::constData() const
+{ return reinterpret_cast<const QChar*>(d->data); }
+inline void QString::detach()
+{ if (d->ref != 1 || d->data != d->array) realloc(); }
+inline bool QString::isDetached() const
+{ return d->ref == 1; }
+inline QString &QString::operator=(const QLatin1String &s)
+{
+ *this = fromLatin1(s.latin1());
+ return *this;
+}
+inline void QString::clear()
+{ if (!isNull()) *this = QString(); }
+inline QString::QString(const QString &other) : d(other.d)
+{ qt_noop(); d->ref.ref(); }
+inline int QString::capacity() const
+{ return d->alloc; }
+inline QString &QString::setNum(short n, int base)
+{ return setNum(qlonglong(n), base); }
+inline QString &QString::setNum(ushort n, int base)
+{ return setNum(qulonglong(n), base); }
+inline QString &QString::setNum(int n, int base)
+{ return setNum(qlonglong(n), base); }
+inline QString &QString::setNum(uint n, int base)
+{ return setNum(qulonglong(n), base); }
+inline QString &QString::setNum(long n, int base)
+{ return setNum(qlonglong(n), base); }
+inline QString &QString::setNum(ulong n, int base)
+{ return setNum(qulonglong(n), base); }
+inline QString &QString::setNum(float n, char f, int prec)
+{ return setNum(double(n),f,prec); }
+inline QString QString::arg(int a, int fieldWidth, int base, const QChar &fillChar) const
+{ return arg(qlonglong(a), fieldWidth, base, fillChar); }
+inline QString QString::arg(uint a, int fieldWidth, int base, const QChar &fillChar) const
+{ return arg(qulonglong(a), fieldWidth, base, fillChar); }
+inline QString QString::arg(long a, int fieldWidth, int base, const QChar &fillChar) const
+{ return arg(qlonglong(a), fieldWidth, base, fillChar); }
+inline QString QString::arg(ulong a, int fieldWidth, int base, const QChar &fillChar) const
+{ return arg(qulonglong(a), fieldWidth, base, fillChar); }
+inline QString QString::arg(short a, int fieldWidth, int base, const QChar &fillChar) const
+{ return arg(qlonglong(a), fieldWidth, base, fillChar); }
+inline QString QString::arg(ushort a, int fieldWidth, int base, const QChar &fillChar) const
+{ return arg(qulonglong(a), fieldWidth, base, fillChar); }
+inline QString QString::arg(const QString &a1, const QString &a2) const
+{ const QString *args[2] = { &a1, &a2 }; return multiArg(2, args); }
+inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3) const
+{ const QString *args[3] = { &a1, &a2, &a3 }; return multiArg(3, args); }
+inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
+ const QString &a4) const
+{ const QString *args[4] = { &a1, &a2, &a3, &a4 }; return multiArg(4, args); }
+inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
+ const QString &a4, const QString &a5) const
+{ const QString *args[5] = { &a1, &a2, &a3, &a4, &a5 }; return multiArg(5, args); }
+inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
+ const QString &a4, const QString &a5, const QString &a6) const
+{ const QString *args[6] = { &a1, &a2, &a3, &a4, &a5, &a6 }; return multiArg(6, args); }
+inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
+ const QString &a4, const QString &a5, const QString &a6,
+ const QString &a7) const
+{ const QString *args[7] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7 }; return multiArg(7, args); }
+inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
+ const QString &a4, const QString &a5, const QString &a6,
+ const QString &a7, const QString &a8) const
+{ const QString *args[8] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8 }; return multiArg(8, args); }
+inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
+ const QString &a4, const QString &a5, const QString &a6,
+ const QString &a7, const QString &a8, const QString &a9) const
+{ const QString *args[9] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9 }; return multiArg(9, args); }
+inline QString QString::section(QChar asep, int astart, int aend, SectionFlags aflags) const
+{ return section(QString(asep), astart, aend, aflags); }
+class __attribute__((visibility("default"))) QCharRef {
+ QString &s;
+ int i;
+ inline QCharRef(QString &str, int idx)
+ : s(str),i(idx) {}
+ friend class QString;
+public:
+ inline operator QChar() const
+ { return i < s.d->size ? s.d->data[i] : 0; }
+ inline QCharRef &operator=(const QChar &c)
+ { if (i >= s.d->size) s.expand(i); else s.detach();
+ s.d->data[i] = c.unicode(); return *this; }
+ inline __attribute__ ((__deprecated__)) QCharRef &operator=(char c)
+ { return operator=(QChar::fromAscii(c)); }
+ inline __attribute__ ((__deprecated__)) QCharRef &operator=(uchar c)
+ { return operator=(QChar::fromAscii(c)); }
+ inline QCharRef &operator=(const QCharRef &c) { return operator=(QChar(c)); }
+ inline QCharRef &operator=(ushort rc) { return operator=(QChar(rc)); }
+ inline QCharRef &operator=(short rc) { return operator=(QChar(rc)); }
+ inline QCharRef &operator=(uint rc) { return operator=(QChar(rc)); }
+ inline QCharRef &operator=(int rc) { return operator=(QChar(rc)); }
+ inline bool isNull() const { return QChar(*this).isNull(); }
+ inline bool isPrint() const { return QChar(*this).isPrint(); }
+ inline bool isPunct() const { return QChar(*this).isPunct(); }
+ inline bool isSpace() const { return QChar(*this).isSpace(); }
+ inline bool isMark() const { return QChar(*this).isMark(); }
+ inline bool isLetter() const { return QChar(*this).isLetter(); }
+ inline bool isNumber() const { return QChar(*this).isNumber(); }
+ inline bool isLetterOrNumber() { return QChar(*this).isLetterOrNumber(); }
+ inline bool isDigit() const { return QChar(*this).isDigit(); }
+ inline bool isLower() const { return QChar(*this).isLower(); }
+ inline bool isUpper() const { return QChar(*this).isUpper(); }
+ inline bool isTitleCase() const { return QChar(*this).isTitleCase(); }
+ inline int digitValue() const { return QChar(*this).digitValue(); }
+ QChar toLower() const { return QChar(*this).toLower(); }
+ QChar toUpper() const { return QChar(*this).toUpper(); }
+ QChar toTitleCase () const { return QChar(*this).toTitleCase(); }
+ QChar::Category category() const { return QChar(*this).category(); }
+ QChar::Direction direction() const { return QChar(*this).direction(); }
+ QChar::Joining joining() const { return QChar(*this).joining(); }
+ bool hasMirrored() const { return QChar(*this).hasMirrored(); }
+ QChar mirroredChar() const { return QChar(*this).mirroredChar(); }
+ QString decomposition() const { return QChar(*this).decomposition(); }
+ QChar::Decomposition decompositionTag() const { return QChar(*this).decompositionTag(); }
+ uchar combiningClass() const { return QChar(*this).combiningClass(); }
+ QChar::UnicodeVersion unicodeVersion() const { return QChar(*this).unicodeVersion(); }
+ inline uchar cell() const { return QChar(*this).cell(); }
+ inline uchar row() const { return QChar(*this).row(); }
+ inline void setCell(uchar cell);
+ inline void setRow(uchar row);
+ char toAscii() const { return QChar(*this).toAscii(); }
+ char toLatin1() const { return QChar(*this).toLatin1(); }
+ ushort unicode() const { return QChar(*this).unicode(); }
+ ushort& unicode() { return s.data()[i].unicode(); }
+};
+inline void QCharRef::setRow(uchar arow) { QChar(*this).setRow(arow); }
+inline void QCharRef::setCell(uchar acell) { QChar(*this).setCell(acell); }
+inline QString::QString() : d(&shared_null) { d->ref.ref(); }
+inline QString::~QString() { if (!d->ref.deref()) free(d); }
+inline void QString::reserve(int asize) { if (d->ref != 1 || asize > d->alloc) realloc(asize); d->capacity = 1;}
+inline QString &QString::setUtf16(const ushort *autf16, int asize)
+{ return setUnicode(reinterpret_cast<const QChar *>(autf16), asize); }
+inline QCharRef QString::operator[](int i)
+{ qt_noop(); return QCharRef(*this, i); }
+inline QCharRef QString::operator[](uint i)
+{ return QCharRef(*this, i); }
+inline QString::iterator QString::begin()
+{ detach(); return reinterpret_cast<QChar*>(d->data); }
+inline QString::const_iterator QString::begin() const
+{ return reinterpret_cast<const QChar*>(d->data); }
+inline QString::const_iterator QString::constBegin() const
+{ return reinterpret_cast<const QChar*>(d->data); }
+inline QString::iterator QString::end()
+{ detach(); return reinterpret_cast<QChar*>(d->data + d->size); }
+inline QString::const_iterator QString::end() const
+{ return reinterpret_cast<const QChar*>(d->data + d->size); }
+inline QString::const_iterator QString::constEnd() const
+{ return reinterpret_cast<const QChar*>(d->data + d->size); }
+inline QBool QString::contains(const QString &s, Qt::CaseSensitivity cs) const
+{ return QBool(indexOf(s, 0, cs) != -1); }
+inline QBool QString::contains(QChar c, Qt::CaseSensitivity cs) const
+{ return QBool(indexOf(c, 0, cs) != -1); }
+inline bool operator==(QString::Null, QString::Null) { return true; }
+inline bool operator==(QString::Null, const QString &s) { return s.isNull(); }
+inline bool operator==(const QString &s, QString::Null) { return s.isNull(); }
+inline bool operator!=(QString::Null, QString::Null) { return false; }
+inline bool operator!=(QString::Null, const QString &s) { return !s.isNull(); }
+inline bool operator!=(const QString &s, QString::Null) { return !s.isNull(); }
+inline bool qStringComparisonHelper(const QString &s1, const char *s2)
+{
+ if (QString::codecForCStrings) return (s1 == QString::fromAscii(s2));
+ return (s1 == QLatin1String(s2));
+}
+inline bool QString::operator==(const char *s) const
+{ return qStringComparisonHelper(*this, s); }
+inline bool QString::operator!=(const char *s) const
+{ return !qStringComparisonHelper(*this, s); }
+inline bool QString::operator<(const char *s) const
+{ return *this < QString::fromAscii(s); }
+inline bool QString::operator>(const char *s) const
+{ return *this > QString::fromAscii(s); }
+inline bool QString::operator<=(const char *s) const
+{ return *this <= QString::fromAscii(s); }
+inline bool QString::operator>=(const char *s) const
+{ return *this >= QString::fromAscii(s); }
+inline __attribute__ ((__deprecated__)) bool operator==(const char *s1, const QString &s2)
+{ return qStringComparisonHelper(s2, s1); }
+inline __attribute__ ((__deprecated__)) bool operator!=(const char *s1, const QString &s2)
+{ return !qStringComparisonHelper(s2, s1); }
+inline __attribute__ ((__deprecated__)) bool operator<(const char *s1, const QString &s2)
+{ return (QString::fromAscii(s1) < s2); }
+inline __attribute__ ((__deprecated__)) bool operator>(const char *s1, const QString &s2)
+{ return (QString::fromAscii(s1) > s2); }
+inline __attribute__ ((__deprecated__)) bool operator<=(const char *s1, const QString &s2)
+{ return (QString::fromAscii(s1) <= s2); }
+inline __attribute__ ((__deprecated__)) bool operator>=(const char *s1, const QString &s2)
+{ return (QString::fromAscii(s1) >= s2); }
+inline __attribute__ ((__deprecated__)) bool operator==(const char *s1, const QLatin1String &s2)
+{ return QString::fromAscii(s1) == s2; }
+inline __attribute__ ((__deprecated__)) bool operator!=(const char *s1, const QLatin1String &s2)
+{ return QString::fromAscii(s1) != s2; }
+inline __attribute__ ((__deprecated__)) bool operator<(const char *s1, const QLatin1String &s2)
+{ return (QString::fromAscii(s1) < s2); }
+inline __attribute__ ((__deprecated__)) bool operator>(const char *s1, const QLatin1String &s2)
+{ return (QString::fromAscii(s1) > s2); }
+inline __attribute__ ((__deprecated__)) bool operator<=(const char *s1, const QLatin1String &s2)
+{ return (QString::fromAscii(s1) <= s2); }
+inline __attribute__ ((__deprecated__)) bool operator>=(const char *s1, const QLatin1String &s2)
+{ return (QString::fromAscii(s1) >= s2); }
+inline bool operator==(const QLatin1String &s1, const QLatin1String &s2)
+{ return (qstrcmp(s1.latin1(), s2.latin1()) == 0); }
+inline bool operator!=(const QLatin1String &s1, const QLatin1String &s2)
+{ return (qstrcmp(s1.latin1(), s2.latin1()) != 0); }
+inline bool operator<(const QLatin1String &s1, const QLatin1String &s2)
+{ return (qstrcmp(s1.latin1(), s2.latin1()) < 0); }
+inline bool operator<=(const QLatin1String &s1, const QLatin1String &s2)
+{ return (qstrcmp(s1.latin1(), s2.latin1()) <= 0); }
+inline bool operator>(const QLatin1String &s1, const QLatin1String &s2)
+{ return (qstrcmp(s1.latin1(), s2.latin1()) > 0); }
+inline bool operator>=(const QLatin1String &s1, const QLatin1String &s2)
+{ return (qstrcmp(s1.latin1(), s2.latin1()) >= 0); }
+inline bool QString::operator==(const QByteArray &s) const
+{ return qStringComparisonHelper(*this, s.constData()); }
+inline bool QString::operator!=(const QByteArray &s) const
+{ return !qStringComparisonHelper(*this, s.constData()); }
+inline bool QByteArray::operator==(const QString &s) const
+{ return qStringComparisonHelper(s, constData()); }
+inline bool QByteArray::operator!=(const QString &s) const
+{ return !qStringComparisonHelper(s, constData()); }
+inline bool QByteArray::operator<(const QString &s) const
+{ return QString::fromAscii(constData(), size()) < s; }
+inline bool QByteArray::operator>(const QString &s) const
+{ return QString::fromAscii(constData(), size()) > s; }
+inline bool QByteArray::operator<=(const QString &s) const
+{ return QString::fromAscii(constData(), size()) <= s; }
+inline bool QByteArray::operator>=(const QString &s) const
+{ return QString::fromAscii(constData(), size()) >= s; }
+inline const QString operator+(const QString &s1, const QString &s2)
+{ QString t(s1); t += s2; return t; }
+inline const QString operator+(const QString &s1, QChar s2)
+{ QString t(s1); t += s2; return t; }
+inline const QString operator+(QChar s1, const QString &s2)
+{ QString t(s1); t += s2; return t; }
+inline __attribute__ ((__deprecated__)) const QString operator+(const QString &s1, const char *s2)
+{ QString t(s1); t += QString::fromAscii(s2); return t; }
+inline __attribute__ ((__deprecated__)) const QString operator+(const char *s1, const QString &s2)
+{ QString t = QString::fromAscii(s1); t += s2; return t; }
+inline __attribute__ ((__deprecated__)) const QString operator+(char c, const QString &s)
+{ QString t = s; t.prepend(QChar::fromAscii(c)); return t; }
+inline __attribute__ ((__deprecated__)) const QString operator+(const QString &s, char c)
+{ QString t = s; t += QChar::fromAscii(c); return t; }
+inline __attribute__ ((__deprecated__)) const QString operator+(const QByteArray &ba, const QString &s)
+{ QString t = QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); t += s; return t; }
+inline __attribute__ ((__deprecated__)) const QString operator+(const QString &s, const QByteArray &ba)
+{ QString t(s); t += QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); return t; }
+inline std::string QString::toStdString() const
+{ const QByteArray asc = toAscii(); return std::string(asc.constData(), asc.length()); }
+inline QString QString::fromStdString(const std::string &s)
+{ return fromAscii(s.data(), int(s.size())); }
+inline QStdWString QString::toStdWString() const
+{
+ QStdWString str;
+ str.resize(length());
+ str.resize(toWCharArray(&(*str.begin())));
+ return str;
+}
+inline QString QString::fromStdWString(const QStdWString &s)
+{ return fromWCharArray(s.data(), int(s.size())); }
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QString &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QString &);
+template <> class QTypeInfo<QString> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QString)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QString"; } };
+template <> inline bool qIsDetached<QString>(QString &t) { return t.isDetached(); } template <typename T> inline void qSwap(T &, T &); template <> inline void qSwap<QString>(QString &value1, QString &value2) { const QString::DataPtr t = value1.data_ptr(); value1.data_ptr() = value2.data_ptr(); value2.data_ptr() = t; }
+inline QFlags<QString::SectionFlags::enum_type> operator|(QString::SectionFlags::enum_type f1, QString::SectionFlags::enum_type f2) { return QFlags<QString::SectionFlags::enum_type>(f1) | f2; } inline QFlags<QString::SectionFlags::enum_type> operator|(QString::SectionFlags::enum_type f1, QFlags<QString::SectionFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QString::SectionFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+class __attribute__((visibility("default"))) QStringRef {
+ const QString *m_string;
+ int m_position;
+ int m_size;
+public:
+ inline QStringRef():m_string(0), m_position(0), m_size(0){}
+ inline QStringRef(const QString *string, int position, int size);
+ inline QStringRef(const QString *string);
+ inline QStringRef(const QStringRef &other)
+ :m_string(other.m_string), m_position(other.m_position), m_size(other.m_size)
+ {}
+ inline ~QStringRef(){}
+ inline const QString *string() const { return m_string; }
+ inline int position() const { return m_position; }
+ inline int size() const { return m_size; }
+ inline int count() const { return m_size; }
+ inline int length() const { return m_size; }
+ inline QStringRef &operator=(const QStringRef &other) {
+ m_string = other.m_string; m_position = other.m_position;
+ m_size = other.m_size; return *this;
+ }
+ inline QStringRef &operator=(const QString *string);
+ inline const QChar *unicode() const {
+ if (!m_string)
+ return reinterpret_cast<const QChar *>(QString::shared_null.data);
+ return m_string->unicode() + m_position;
+ }
+ inline const QChar *data() const { return unicode(); }
+ inline const QChar *constData() const { return unicode(); }
+ inline void clear() { m_string = 0; m_position = m_size = 0; }
+ QString toString() const;
+ inline bool isEmpty() const { return m_size == 0; }
+ inline bool isNull() const { return m_string == 0 || m_string->isNull(); }
+ QStringRef appendTo(QString *string) const;
+ inline const QChar at(int i) const
+ { qt_noop(); return m_string->at(i + m_position); }
+ int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ int compare(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ static int compare(const QStringRef &s1, const QString &s2,
+ Qt::CaseSensitivity = Qt::CaseSensitive);
+ static int compare(const QStringRef &s1, const QStringRef &s2,
+ Qt::CaseSensitivity = Qt::CaseSensitive);
+ static int compare(const QStringRef &s1, QLatin1String s2,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ int localeAwareCompare(const QString &s) const;
+ int localeAwareCompare(const QStringRef &s) const;
+ static int localeAwareCompare(const QStringRef &s1, const QString &s2);
+ static int localeAwareCompare(const QStringRef &s1, const QStringRef &s2);
+};
+inline QStringRef &QStringRef::operator=(const QString *aString)
+{ m_string = aString; m_position = 0; m_size = aString?aString->size():0; return *this; }
+inline QStringRef::QStringRef(const QString *aString, int aPosition, int aSize)
+ :m_string(aString), m_position(aPosition), m_size(aSize){}
+inline QStringRef::QStringRef(const QString *aString)
+ :m_string(aString), m_position(0), m_size(aString?aString->size() : 0){}
+__attribute__((visibility("default"))) bool operator==(const QStringRef &s1,const QStringRef &s2);
+inline bool operator!=(const QStringRef &s1,const QStringRef &s2)
+{ return !(s1 == s2); }
+__attribute__((visibility("default"))) bool operator==(const QString &s1,const QStringRef &s2);
+inline bool operator!=(const QString &s1,const QStringRef &s2)
+{ return !(s1 == s2); }
+inline bool operator==(const QStringRef &s1,const QString &s2)
+{ return s2 == s1; }
+inline bool operator!=(const QStringRef &s1,const QString &s2)
+{ return s2 != s1; }
+__attribute__((visibility("default"))) bool operator==(const QLatin1String &s1, const QStringRef &s2);
+inline bool operator!=(const QLatin1String &s1,const QStringRef &s2)
+{ return !(s1 == s2); }
+inline bool operator==(const QStringRef &s1,const QLatin1String &s2)
+{ return s2 == s1; }
+inline bool operator!=(const QStringRef &s1,const QLatin1String &s2)
+{ return s2 != s1; }
+__attribute__((visibility("default"))) bool operator<(const QStringRef &s1,const QStringRef &s2);
+inline bool operator>(const QStringRef &s1, const QStringRef &s2)
+{ return s2 < s1; }
+inline bool operator<=(const QStringRef &s1, const QStringRef &s2)
+{ return !(s1 > s2); }
+inline bool operator>=(const QStringRef &s1, const QStringRef &s2)
+{ return !(s1 < s2); }
+inline bool qStringComparisonHelper(const QStringRef &s1, const char *s2)
+{
+ if (QString::codecForCStrings) return (s1 == QString::fromAscii(s2));
+ return (s1 == QLatin1String(s2));
+}
+inline __attribute__ ((__deprecated__)) bool operator==(const char *s1, const QStringRef &s2)
+{ return qStringComparisonHelper(s2, s1); }
+inline __attribute__ ((__deprecated__)) bool operator==(const QStringRef &s1, const char *s2)
+{ return qStringComparisonHelper(s1, s2); }
+inline __attribute__ ((__deprecated__)) bool operator!=(const char *s1, const QStringRef &s2)
+{ return !qStringComparisonHelper(s2, s1); }
+inline __attribute__ ((__deprecated__)) bool operator!=(const QStringRef &s1, const char *s2)
+{ return !qStringComparisonHelper(s1, s2); }
+inline int QString::compare(const QStringRef &s, Qt::CaseSensitivity cs) const
+{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
+inline int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs)
+{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
+inline int QStringRef::compare(const QString &s, Qt::CaseSensitivity cs) const
+{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
+inline int QStringRef::compare(const QStringRef &s, Qt::CaseSensitivity cs) const
+{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
+inline int QStringRef::compare(QLatin1String s, Qt::CaseSensitivity cs) const
+{ return QString::compare_helper(constData(), length(), s, cs); }
+inline int QStringRef::compare(const QStringRef &s1, const QString &s2, Qt::CaseSensitivity cs)
+{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
+inline int QStringRef::compare(const QStringRef &s1, const QStringRef &s2, Qt::CaseSensitivity cs)
+{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
+inline int QStringRef::compare(const QStringRef &s1, QLatin1String s2, Qt::CaseSensitivity cs)
+{ return QString::compare_helper(s1.constData(), s1.length(), s2, cs); }
+inline int QString::localeAwareCompare(const QStringRef &s) const
+{ return localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
+inline int QString::localeAwareCompare(const QString& s1, const QStringRef& s2)
+{ return localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
+inline int QStringRef::localeAwareCompare(const QString &s) const
+{ return QString::localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
+inline int QStringRef::localeAwareCompare(const QStringRef &s) const
+{ return QString::localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
+inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QString &s2)
+{ return QString::localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
+inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QStringRef &s2)
+{ return QString::localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QEvent;
+class QTimerEvent;
+class QChildEvent;
+struct QMetaObject;
+class QVariant;
+class QObjectPrivate;
+class QObject;
+class QThread;
+class QWidget;
+class QRegExp;
+class QObjectUserData;
+typedef QList<QObject*> QObjectList;
+template<typename T> inline T qFindChild(const QObject *, const QString & = QString());
+template<typename T> inline QList<T> qFindChildren(const QObject *, const QString & = QString());
+template<typename T> inline QList<T> qFindChildren(const QObject *, const QRegExp &);
+class QObjectData {
+public:
+ virtual ~QObjectData() = 0;
+ QObject *q_ptr;
+ QObject *parent;
+ QObjectList children;
+ uint isWidget : 1;
+ uint pendTimer : 1;
+ uint blockSig : 1;
+ uint wasDeleted : 1;
+ uint ownObjectName : 1;
+ uint sendChildEvents : 1;
+ uint receiveChildEvents : 1;
+ uint inEventHandler : 1;
+ uint inThreadChangeEvent : 1;
+ uint unused : 23;
+ int postedEvents;
+};
+class __attribute__((visibility("default"))) QObject
+{
+ public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
+ inline QObjectPrivate* d_func() { return reinterpret_cast<QObjectPrivate *>(d_ptr); } inline const QObjectPrivate* d_func() const { return reinterpret_cast<const QObjectPrivate *>(d_ptr); } friend class QObjectPrivate;
+public:
+ explicit QObject(QObject *parent=0);
+ virtual ~QObject();
+ virtual bool event(QEvent *);
+ virtual bool eventFilter(QObject *, QEvent *);
+ QString objectName() const;
+ void setObjectName(const QString &name);
+ inline bool isWidgetType() const { return d_ptr->isWidget; }
+ inline bool signalsBlocked() const { return d_ptr->blockSig; }
+ bool blockSignals(bool b);
+ QThread *thread() const;
+ void moveToThread(QThread *thread);
+ int startTimer(int interval);
+ void killTimer(int id);
+ template<typename T>
+ inline T findChild(const QString &aName = QString()) const
+ { return qFindChild<T>(this, aName); }
+ template<typename T>
+ inline QList<T> findChildren(const QString &aName = QString()) const
+ { return qFindChildren<T>(this, aName); }
+ template<typename T>
+ inline QList<T> findChildren(const QRegExp &re) const
+ { return qFindChildren<T>(this, re); }
+ inline const QObjectList &children() const { return d_ptr->children; }
+ void setParent(QObject *);
+ void installEventFilter(QObject *);
+ void removeEventFilter(QObject *);
+ static bool connect(const QObject *sender, const char *signal,
+ const QObject *receiver, const char *member, Qt::ConnectionType =
+ Qt::AutoConnection
+ );
+ inline bool connect(const QObject *sender, const char *signal,
+ const char *member, Qt::ConnectionType type =
+ Qt::AutoConnection
+ ) const;
+ static bool disconnect(const QObject *sender, const char *signal,
+ const QObject *receiver, const char *member);
+ inline bool disconnect(const char *signal = 0,
+ const QObject *receiver = 0, const char *member = 0)
+ { return disconnect(this, signal, receiver, member); }
+ inline bool disconnect(const QObject *receiver, const char *member = 0)
+ { return disconnect(this, 0, receiver, member); }
+ void dumpObjectTree();
+ void dumpObjectInfo();
+ bool setProperty(const char *name, const QVariant &value);
+ QVariant property(const char *name) const;
+ QList<QByteArray> dynamicPropertyNames() const;
+ static uint registerUserData();
+ void setUserData(uint id, QObjectUserData* data);
+ QObjectUserData* userData(uint id) const;
+protected:
+ void destroyed(QObject * = 0);
+public:
+ inline QObject *parent() const { return d_ptr->parent; }
+ inline bool inherits(const char *classname) const
+ { return const_cast<QObject *>(this)->qt_metacast(classname) != 0; }
+public :
+ void deleteLater();
+protected:
+ QObject *sender() const;
+ int receivers(const char* signal) const;
+ virtual void timerEvent(QTimerEvent *);
+ virtual void childEvent(QChildEvent *);
+ virtual void customEvent(QEvent *);
+ virtual void connectNotify(const char *signal);
+ virtual void disconnectNotify(const char *signal);
+protected:
+ QObject(QObjectPrivate &dd, QObject *parent = 0);
+protected:
+ QObjectData *d_ptr;
+ static const QMetaObject staticQtMetaObject;
+ friend struct QMetaObject;
+ friend class QApplication;
+ friend class QApplicationPrivate;
+ friend class QCoreApplication;
+ friend class QCoreApplicationPrivate;
+ friend class QWidget;
+ friend class QThreadData;
+private:
+ QObject(const QObject &); QObject &operator=(const QObject &);
+};
+inline bool QObject::connect(const QObject *asender, const char *asignal,
+ const char *amember, Qt::ConnectionType atype) const
+{ return connect(asender, asignal, this, amember, atype); }
+class __attribute__((visibility("default"))) QObjectUserData {
+public:
+ virtual ~QObjectUserData();
+};
+__attribute__((visibility("default"))) void qt_qFindChildren_helper(const QObject *parent, const QString &name, const QRegExp *re,
+ const QMetaObject &mo, QList<void *> *list);
+__attribute__((visibility("default"))) QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo);
+template<typename T>
+inline T qFindChild(const QObject *o, const QString &name)
+{ return static_cast<T>(qt_qFindChild_helper(o, name, reinterpret_cast<T>(0)->staticMetaObject)); }
+template<typename T>
+inline QList<T> qFindChildren(const QObject *o, const QString &name)
+{
+ QList<T> list;
+ union {
+ QList<T> *typedList;
+ QList<void *> *voidList;
+ } u;
+ u.typedList = &list;
+ qt_qFindChildren_helper(o, name, 0, reinterpret_cast<T>(0)->staticMetaObject, u.voidList);
+ return list;
+}
+template<typename T>
+inline QList<T> qFindChildren(const QObject *o, const QRegExp &re)
+{
+ QList<T> list;
+ union {
+ QList<T> *typedList;
+ QList<void *> *voidList;
+ } u;
+ u.typedList = &list;
+ qt_qFindChildren_helper(o, QString(), &re, reinterpret_cast<T>(0)->staticMetaObject, u.voidList);
+ return list;
+}
+template <class T>
+inline T qobject_cast(QObject *object)
+{
+ reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(object));
+ return static_cast<T>(reinterpret_cast<T>(0)->staticMetaObject.cast(object));
+}
+template <class T>
+inline T qobject_cast(const QObject *object)
+{
+ register T ptr = static_cast<T>(object);
+ (void)ptr;;
+ reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(const_cast<QObject *>(object)));
+ return static_cast<T>(const_cast<QObject *>(reinterpret_cast<T>(0)->staticMetaObject.cast(const_cast<QObject *>(object))));
+}
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QObject *);
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QByteArray;
+class QIODevicePrivate;
+class __attribute__((visibility("default"))) QIODevice
+ : public QObject
+{
+ public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
+public:
+ enum OpenModeFlag {
+ NotOpen = 0x0000,
+ ReadOnly = 0x0001,
+ WriteOnly = 0x0002,
+ ReadWrite = ReadOnly | WriteOnly,
+ Append = 0x0004,
+ Truncate = 0x0008,
+ Text = 0x0010,
+ Unbuffered = 0x0020
+ };
+ typedef QFlags<OpenModeFlag> OpenMode;
+ QIODevice();
+ explicit QIODevice(QObject *parent);
+ virtual ~QIODevice();
+ OpenMode openMode() const;
+ void setTextModeEnabled(bool enabled);
+ bool isTextModeEnabled() const;
+ bool isOpen() const;
+ bool isReadable() const;
+ bool isWritable() const;
+ virtual bool isSequential() const;
+ virtual bool open(OpenMode mode);
+ virtual void close();
+ virtual qint64 pos() const;
+ virtual qint64 size() const;
+ virtual bool seek(qint64 pos);
+ virtual bool atEnd() const;
+ virtual bool reset();
+ virtual qint64 bytesAvailable() const;
+ virtual qint64 bytesToWrite() const;
+ qint64 read(char *data, qint64 maxlen);
+ QByteArray read(qint64 maxlen);
+ QByteArray readAll();
+ qint64 readLine(char *data, qint64 maxlen);
+ QByteArray readLine(qint64 maxlen = 0);
+ virtual bool canReadLine() const;
+ qint64 write(const char *data, qint64 len);
+ qint64 write(const char *data);
+ inline qint64 write(const QByteArray &data)
+ { return write(data.constData(), data.size()); }
+ qint64 peek(char *data, qint64 maxlen);
+ QByteArray peek(qint64 maxlen);
+ virtual bool waitForReadyRead(int msecs);
+ virtual bool waitForBytesWritten(int msecs);
+ void ungetChar(char c);
+ bool putChar(char c);
+ bool getChar(char *c);
+ QString errorString() const;
+protected:
+ void readyRead();
+ void bytesWritten(qint64 bytes);
+ void aboutToClose();
+ void readChannelFinished();
+protected:
+ QIODevice(QIODevicePrivate &dd, QObject *parent = 0);
+ virtual qint64 readData(char *data, qint64 maxlen) = 0;
+ virtual qint64 readLineData(char *data, qint64 maxlen);
+ virtual qint64 writeData(const char *data, qint64 len) = 0;
+ void setOpenMode(OpenMode openMode);
+ void setErrorString(const QString &errorString);
+private:
+ inline QIODevicePrivate* d_func() { return reinterpret_cast<QIODevicePrivate *>(d_ptr); } inline const QIODevicePrivate* d_func() const { return reinterpret_cast<const QIODevicePrivate *>(d_ptr); } friend class QIODevicePrivate;
+ QIODevice(const QIODevice &); QIODevice &operator=(const QIODevice &);
+};
+inline QFlags<QIODevice::OpenMode::enum_type> operator|(QIODevice::OpenMode::enum_type f1, QIODevice::OpenMode::enum_type f2) { return QFlags<QIODevice::OpenMode::enum_type>(f1) | f2; } inline QFlags<QIODevice::OpenMode::enum_type> operator|(QIODevice::OpenMode::enum_type f1, QFlags<QIODevice::OpenMode::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QIODevice::OpenMode::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+class QDebug;
+__attribute__((visibility("default"))) QDebug operator<<(QDebug debug, QIODevice::OpenMode modes);
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QByteArray;
+class QIODevice;
+template <typename T> class QList;
+template <typename T> class QLinkedList;
+template <typename T> class QVector;
+template <typename T> class QSet;
+template <class Key, class T> class QHash;
+template <class Key, class T> class QMap;
+class QDataStreamPrivate;
+class __attribute__((visibility("default"))) QDataStream
+{
+public:
+ enum Version {
+ Qt_1_0 = 1,
+ Qt_2_0 = 2,
+ Qt_2_1 = 3,
+ Qt_3_0 = 4,
+ Qt_3_1 = 5,
+ Qt_3_3 = 6,
+ Qt_4_0 = 7,
+ Qt_4_1 = Qt_4_0,
+ Qt_4_2 = 8,
+ Qt_4_3 = 9,
+ Qt_4_4 = 10,
+ Qt_4_5 = 11
+ };
+ enum ByteOrder {
+ BigEndian = QSysInfo::BigEndian,
+ LittleEndian = QSysInfo::LittleEndian
+ };
+ enum Status {
+ Ok,
+ ReadPastEnd,
+ ReadCorruptData
+ };
+ QDataStream();
+ explicit QDataStream(QIODevice *);
+ QDataStream(QByteArray *, QIODevice::OpenMode flags);
+ QDataStream(const QByteArray &);
+ virtual ~QDataStream();
+ QIODevice *device() const;
+ void setDevice(QIODevice *);
+ void unsetDevice();
+ bool atEnd() const;
+ Status status() const;
+ void setStatus(Status status);
+ void resetStatus();
+ ByteOrder byteOrder() const;
+ void setByteOrder(ByteOrder);
+ int version() const;
+ void setVersion(int);
+ QDataStream &operator>>(qint8 &i);
+ QDataStream &operator>>(quint8 &i);
+ QDataStream &operator>>(qint16 &i);
+ QDataStream &operator>>(quint16 &i);
+ QDataStream &operator>>(qint32 &i);
+ QDataStream &operator>>(quint32 &i);
+ QDataStream &operator>>(qint64 &i);
+ QDataStream &operator>>(quint64 &i);
+ QDataStream &operator>>(bool &i);
+ QDataStream &operator>>(float &f);
+ QDataStream &operator>>(double &f);
+ QDataStream &operator>>(char *&str);
+ QDataStream &operator<<(qint8 i);
+ QDataStream &operator<<(quint8 i);
+ QDataStream &operator<<(qint16 i);
+ QDataStream &operator<<(quint16 i);
+ QDataStream &operator<<(qint32 i);
+ QDataStream &operator<<(quint32 i);
+ QDataStream &operator<<(qint64 i);
+ QDataStream &operator<<(quint64 i);
+ QDataStream &operator<<(bool i);
+ QDataStream &operator<<(float f);
+ QDataStream &operator<<(double f);
+ QDataStream &operator<<(const char *str);
+ QDataStream &readBytes(char *&, uint &len);
+ int readRawData(char *, int len);
+ QDataStream &writeBytes(const char *, uint len);
+ int writeRawData(const char *, int len);
+ int skipRawData(int len);
+private:
+ QDataStream(const QDataStream &); QDataStream &operator=(const QDataStream &);
+ QDataStreamPrivate *d;
+ QIODevice *dev;
+ bool owndev;
+ bool noswap;
+ ByteOrder byteorder;
+ int ver;
+ Status q_status;
+};
+inline QIODevice *QDataStream::device() const
+{ return dev; }
+inline QDataStream::ByteOrder QDataStream::byteOrder() const
+{ return byteorder; }
+inline int QDataStream::version() const
+{ return ver; }
+inline void QDataStream::setVersion(int v)
+{ ver = v; }
+inline QDataStream &QDataStream::operator>>(quint8 &i)
+{ return *this >> reinterpret_cast<qint8&>(i); }
+inline QDataStream &QDataStream::operator>>(quint16 &i)
+{ return *this >> reinterpret_cast<qint16&>(i); }
+inline QDataStream &QDataStream::operator>>(quint32 &i)
+{ return *this >> reinterpret_cast<qint32&>(i); }
+inline QDataStream &QDataStream::operator>>(quint64 &i)
+{ return *this >> reinterpret_cast<qint64&>(i); }
+inline QDataStream &QDataStream::operator<<(quint8 i)
+{ return *this << qint8(i); }
+inline QDataStream &QDataStream::operator<<(quint16 i)
+{ return *this << qint16(i); }
+inline QDataStream &QDataStream::operator<<(quint32 i)
+{ return *this << qint32(i); }
+inline QDataStream &QDataStream::operator<<(quint64 i)
+{ return *this << qint64(i); }
+template <typename T>
+QDataStream& operator>>(QDataStream& s, QList<T>& l)
+{
+ l.clear();
+ quint32 c;
+ s >> c;
+ for(quint32 i = 0; i < c; ++i)
+ {
+ T t;
+ s >> t;
+ l.append(t);
+ if (s.atEnd())
+ break;
+ }
+ return s;
+}
+template <typename T>
+QDataStream& operator<<(QDataStream& s, const QList<T>& l)
+{
+ s << quint32(l.size());
+ for (int i = 0; i < l.size(); ++i)
+ s << l.at(i);
+ return s;
+}
+template <typename T>
+QDataStream& operator>>(QDataStream& s, QLinkedList<T>& l)
+{
+ l.clear();
+ quint32 c;
+ s >> c;
+ for(quint32 i = 0; i < c; ++i)
+ {
+ T t;
+ s >> t;
+ l.append(t);
+ if (s.atEnd())
+ break;
+ }
+ return s;
+}
+template <typename T>
+QDataStream& operator<<(QDataStream& s, const QLinkedList<T>& l)
+{
+ s << quint32(l.size());
+ typename QLinkedList<T>::ConstIterator it = l.constBegin();
+ for(; it != l.constEnd(); ++it)
+ s << *it;
+ return s;
+}
+template<typename T>
+QDataStream& operator>>(QDataStream& s, QVector<T>& v)
+{
+ v.clear();
+ quint32 c;
+ s >> c;
+ v.resize(c);
+ for(quint32 i = 0; i < c; ++i) {
+ T t;
+ s >> t;
+ v[i] = t;
+ }
+ return s;
+}
+template<typename T>
+QDataStream& operator<<(QDataStream& s, const QVector<T>& v)
+{
+ s << quint32(v.size());
+ for (typename QVector<T>::const_iterator it = v.begin(); it != v.end(); ++it)
+ s << *it;
+ return s;
+}
+template <typename T>
+QDataStream &operator>>(QDataStream &in, QSet<T> &set)
+{
+ set.clear();
+ quint32 c;
+ in >> c;
+ for (quint32 i = 0; i < c; ++i) {
+ T t;
+ in >> t;
+ set << t;
+ if (in.atEnd())
+ break;
+ }
+ return in;
+}
+template <typename T>
+QDataStream& operator<<(QDataStream &out, const QSet<T> &set)
+{
+ out << quint32(set.size());
+ typename QSet<T>::const_iterator i = set.constBegin();
+ while (i != set.constEnd()) {
+ out << *i;
+ ++i;
+ }
+ return out;
+}
+template <class Key, class T>
+ QDataStream &operator>>(QDataStream &in, QHash<Key, T> &hash)
+{
+ QDataStream::Status oldStatus = in.status();
+ in.resetStatus();
+ hash.clear();
+ quint32 n;
+ in >> n;
+ for (quint32 i = 0; i < n; ++i) {
+ if (in.status() != QDataStream::Ok)
+ break;
+ Key k;
+ T t;
+ in >> k >> t;
+ hash.insertMulti(k, t);
+ }
+ if (in.status() != QDataStream::Ok)
+ hash.clear();
+ if (oldStatus != QDataStream::Ok)
+ in.setStatus(oldStatus);
+ return in;
+}
+template <class Key, class T>
+ QDataStream &operator<<(QDataStream &out, const QHash<Key, T>& hash)
+{
+ out << quint32(hash.size());
+ typename QHash<Key, T>::ConstIterator it = hash.end();
+ typename QHash<Key, T>::ConstIterator begin = hash.begin();
+ while (it != begin) {
+ --it;
+ out << it.key() << it.value();
+ }
+ return out;
+}
+template <class aKey, class aT>
+ QDataStream &operator>>(QDataStream &in, QMap<aKey, aT> &map)
+{
+ QDataStream::Status oldStatus = in.status();
+ in.resetStatus();
+ map.clear();
+ quint32 n;
+ in >> n;
+ map.detach();
+ map.setInsertInOrder(true);
+ for (quint32 i = 0; i < n; ++i) {
+ if (in.status() != QDataStream::Ok)
+ break;
+ aKey key;
+ aT value;
+ in >> key >> value;
+ map.insertMulti(key, value);
+ }
+ map.setInsertInOrder(false);
+ if (in.status() != QDataStream::Ok)
+ map.clear();
+ if (oldStatus != QDataStream::Ok)
+ in.setStatus(oldStatus);
+ return in;
+}
+template <class Key, class T>
+ QDataStream &operator<<(QDataStream &out, const QMap<Key, T> &map)
+{
+ out << quint32(map.size());
+ typename QMap<Key, T>::ConstIterator it = map.end();
+ typename QMap<Key, T>::ConstIterator begin = map.begin();
+ while (it != begin) {
+ --it;
+ out << it.key() << it.value();
+ }
+ return out;
+}
+typedef QtValidLicenseForCoreModule QtCoreModule;
+template <class T1, class T2>
+struct QPair
+{
+ typedef T1 first_type;
+ typedef T2 second_type;
+ QPair() : first(T1()), second(T2()) {}
+ QPair(const T1 &t1, const T2 &t2) : first(t1), second(t2) {}
+ QPair<T1, T2> &operator=(const QPair<T1, T2> &other)
+ { first = other.first; second = other.second; return *this; }
+ T1 first;
+ T2 second;
+};
+template <class T1, class T2>
+inline bool operator==(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
+{ return p1.first == p2.first && p1.second == p2.second; }
+template <class T1, class T2>
+inline bool operator!=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
+{ return !(p1 == p2); }
+template <class T1, class T2>
+inline bool operator<(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
+{
+ return p1.first < p2.first || (!(p2.first < p1.first) && p1.second < p2.second);
+}
+template <class T1, class T2>
+inline bool operator>(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
+{
+ return p2 < p1;
+}
+template <class T1, class T2>
+inline bool operator<=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
+{
+ return !(p2 < p1);
+}
+template <class T1, class T2>
+inline bool operator>=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
+{
+ return !(p1 < p2);
+}
+template <class T1, class T2>
+ QPair<T1, T2> qMakePair(const T1 &x, const T2 &y)
+{
+ return QPair<T1, T2>(x, y);
+}
+template <class T1, class T2>
+inline QDataStream& operator>>(QDataStream& s, QPair<T1, T2>& p)
+{
+ s >> p.first >> p.second;
+ return s;
+}
+template <class T1, class T2>
+inline QDataStream& operator<<(QDataStream& s, const QPair<T1, T2>& p)
+{
+ s << p.first << p.second;
+ return s;
+}
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QBitArray;
+class QByteArray;
+class QString;
+class QStringRef;
+inline uint qHash(char key) { return uint(key); }
+inline uint qHash(uchar key) { return uint(key); }
+inline uint qHash(signed char key) { return uint(key); }
+inline uint qHash(ushort key) { return uint(key); }
+inline uint qHash(short key) { return uint(key); }
+inline uint qHash(uint key) { return key; }
+inline uint qHash(int key) { return uint(key); }
+inline uint qHash(ulong key)
+{
+ if (sizeof(ulong) > sizeof(uint)) {
+ return uint((key >> (8 * sizeof(uint) - 1)) ^ key);
+ } else {
+ return uint(key);
+ }
+}
+inline uint qHash(long key) { return qHash(ulong(key)); }
+inline uint qHash(quint64 key)
+{
+ if (sizeof(quint64) > sizeof(uint)) {
+ return uint((key >> (8 * sizeof(uint) - 1)) ^ key);
+ } else {
+ return uint(key);
+ }
+}
+inline uint qHash(qint64 key) { return qHash(quint64(key)); }
+inline uint qHash(QChar key) { return qHash(key.unicode()); }
+__attribute__((visibility("default"))) uint qHash(const QByteArray &key);
+__attribute__((visibility("default"))) uint qHash(const QString &key);
+__attribute__((visibility("default"))) uint qHash(const QStringRef &key);
+__attribute__((visibility("default"))) uint qHash(const QBitArray &key);
+template <class T> inline uint qHash(const T *key)
+{
+ if (sizeof(const T *) > sizeof(uint))
+ return qHash(reinterpret_cast<quint64>(key));
+ else
+ return uint(reinterpret_cast<ulong>(key));
+}
+template <typename T1, typename T2> inline uint qHash(const QPair<T1, T2> &key)
+{
+ uint h1 = qHash(key.first);
+ uint h2 = qHash(key.second);
+ return ((h1 << 16) | (h1 >> 16)) ^ h2;
+}
+struct __attribute__((visibility("default"))) QHashData
+{
+ struct Node {
+ Node *next;
+ uint h;
+ };
+ Node *fakeNext;
+ Node **buckets;
+ QBasicAtomicInt ref;
+ int size;
+ int nodeSize;
+ short userNumBits;
+ short numBits;
+ int numBuckets;
+ uint sharable : 1;
+ void *allocateNode();
+ void freeNode(void *node);
+ QHashData *detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize);
+ void mightGrow();
+ bool willGrow();
+ void hasShrunk();
+ void rehash(int hint);
+ void destroyAndFree();
+ Node *firstNode();
+ static Node *nextNode(Node *node);
+ static Node *previousNode(Node *node);
+ static QHashData shared_null;
+};
+inline void QHashData::mightGrow()
+{
+ if (size >= numBuckets)
+ rehash(numBits + 1);
+}
+inline bool QHashData::willGrow()
+{
+ if (size >= numBuckets) {
+ rehash(numBits + 1);
+ return true;
+ } else {
+ return false;
+ }
+}
+inline void QHashData::hasShrunk()
+{
+ if (size <= (numBuckets >> 3) && numBits > userNumBits)
+ rehash(qMax(int(numBits) - 2, int(userNumBits)));
+}
+inline QHashData::Node *QHashData::firstNode()
+{
+ Node *e = reinterpret_cast<Node *>(this);
+ Node **bucket = buckets;
+ int n = numBuckets;
+ while (n--) {
+ if (*bucket != e)
+ return *bucket;
+ ++bucket;
+ }
+ return e;
+}
+struct QHashDummyValue
+{
+};
+inline bool operator==(const QHashDummyValue & , const QHashDummyValue & )
+{
+ return true;
+}
+template <> class QTypeInfo<QHashDummyValue> { public: enum { isComplex = (((Q_MOVABLE_TYPE | Q_DUMMY_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE | Q_DUMMY_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QHashDummyValue)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE | Q_DUMMY_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QHashDummyValue"; } };
+template <class Key, class T>
+struct QHashDummyNode
+{
+ QHashDummyNode *next;
+ uint h;
+ Key key;
+ inline QHashDummyNode(const Key &key0) : key(key0) {}
+};
+template <class Key, class T>
+struct QHashNode
+{
+ QHashNode *next;
+ uint h;
+ Key key;
+ T value;
+ inline QHashNode(const Key &key0) : key(key0) {}
+ inline QHashNode(const Key &key0, const T &value0) : key(key0), value(value0) {}
+ inline bool same_key(uint h0, const Key &key0) { return h0 == h && key0 == key; }
+};
+template <class T> struct QHashDummyNode<short, T> { QHashDummyNode *next; union { uint h; short key; }; inline QHashDummyNode(short ) {} }; template <class T> struct QHashNode<short, T> { QHashNode *next; union { uint h; short key; }; T value; inline QHashNode(short ) {} inline QHashNode(short , const T &value0) : value(value0) {} inline bool same_key(uint h0, short) { return h0 == h; } };
+template <class T> struct QHashDummyNode<ushort, T> { QHashDummyNode *next; union { uint h; ushort key; }; inline QHashDummyNode(ushort ) {} }; template <class T> struct QHashNode<ushort, T> { QHashNode *next; union { uint h; ushort key; }; T value; inline QHashNode(ushort ) {} inline QHashNode(ushort , const T &value0) : value(value0) {} inline bool same_key(uint h0, ushort) { return h0 == h; } };
+template <class T> struct QHashDummyNode<int, T> { QHashDummyNode *next; union { uint h; int key; }; inline QHashDummyNode(int ) {} }; template <class T> struct QHashNode<int, T> { QHashNode *next; union { uint h; int key; }; T value; inline QHashNode(int ) {} inline QHashNode(int , const T &value0) : value(value0) {} inline bool same_key(uint h0, int) { return h0 == h; } };
+template <class T> struct QHashDummyNode<uint, T> { QHashDummyNode *next; union { uint h; uint key; }; inline QHashDummyNode(uint ) {} }; template <class T> struct QHashNode<uint, T> { QHashNode *next; union { uint h; uint key; }; T value; inline QHashNode(uint ) {} inline QHashNode(uint , const T &value0) : value(value0) {} inline bool same_key(uint h0, uint) { return h0 == h; } };
+template <class Key, class T>
+class QHash
+{
+ typedef QHashDummyNode<Key, T> DummyNode;
+ typedef QHashNode<Key, T> Node;
+ union {
+ QHashData *d;
+ QHashNode<Key, T> *e;
+ };
+ static inline Node *concrete(QHashData::Node *node) {
+ return reinterpret_cast<Node *>(node);
+ }
+public:
+ inline QHash() : d(&QHashData::shared_null) { d->ref.ref(); }
+ inline QHash(const QHash<Key, T> &other) : d(other.d) { d->ref.ref(); if (!d->sharable) detach(); }
+ inline ~QHash() { if (!d->ref.deref()) freeData(d); }
+ QHash<Key, T> &operator=(const QHash<Key, T> &other);
+ bool operator==(const QHash<Key, T> &other) const;
+ inline bool operator!=(const QHash<Key, T> &other) const { return !(*this == other); }
+ inline int size() const { return d->size; }
+ inline bool isEmpty() const { return d->size == 0; }
+ inline int capacity() const { return d->numBuckets; }
+ void reserve(int size);
+ inline void squeeze() { reserve(1); }
+ inline void detach() { if (d->ref != 1) detach_helper(); }
+ inline bool isDetached() const { return d->ref == 1; }
+ inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
+ void clear();
+ int remove(const Key &key);
+ T take(const Key &key);
+ bool contains(const Key &key) const;
+ const Key key(const T &value) const;
+ const Key key(const T &value, const Key &defaultKey) const;
+ const T value(const Key &key) const;
+ const T value(const Key &key, const T &defaultValue) const;
+ T &operator[](const Key &key);
+ const T operator[](const Key &key) const;
+ QList<Key> uniqueKeys() const;
+ QList<Key> keys() const;
+ QList<Key> keys(const T &value) const;
+ QList<T> values() const;
+ QList<T> values(const Key &key) const;
+ int count(const Key &key) const;
+ class const_iterator;
+ class iterator
+ {
+ friend class const_iterator;
+ QHashData::Node *i;
+ public:
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef T *pointer;
+ typedef T &reference;
+ inline operator Node *() const { return concrete(i); }
+ inline iterator() : i(0) { }
+ explicit inline iterator(void *node) : i(reinterpret_cast<QHashData::Node *>(node)) { }
+ inline const Key &key() const { return concrete(i)->key; }
+ inline T &value() const { return concrete(i)->value; }
+ inline T &operator*() const { return concrete(i)->value; }
+ inline T *operator->() const { return &concrete(i)->value; }
+ inline bool operator==(const iterator &o) const { return i == o.i; }
+ inline bool operator!=(const iterator &o) const { return i != o.i; }
+ inline iterator &operator++() {
+ i = QHashData::nextNode(i);
+ return *this;
+ }
+ inline iterator operator++(int) {
+ iterator r = *this;
+ i = QHashData::nextNode(i);
+ return r;
+ }
+ inline iterator &operator--() {
+ i = QHashData::previousNode(i);
+ return *this;
+ }
+ inline iterator operator--(int) {
+ iterator r = *this;
+ i = QHashData::previousNode(i);
+ return r;
+ }
+ inline iterator operator+(int j) const
+ { iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
+ inline iterator operator-(int j) const { return operator+(-j); }
+ inline iterator &operator+=(int j) { return *this = *this + j; }
+ inline iterator &operator-=(int j) { return *this = *this - j; }
+ public:
+ inline bool operator==(const const_iterator &o) const
+ { return i == o.i; }
+ inline bool operator!=(const const_iterator &o) const
+ { return i != o.i; }
+ private:
+ inline operator bool() const { return false; }
+ };
+ friend class iterator;
+ class const_iterator
+ {
+ friend class iterator;
+ QHashData::Node *i;
+ public:
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef const T *pointer;
+ typedef const T &reference;
+ inline operator Node *() const { return concrete(i); }
+ inline const_iterator() : i(0) { }
+ explicit inline const_iterator(void *node)
+ : i(reinterpret_cast<QHashData::Node *>(node)) { }
+ inline const_iterator(const iterator &o)
+ { i = o.i; }
+ inline const Key &key() const { return concrete(i)->key; }
+ inline const T &value() const { return concrete(i)->value; }
+ inline const T &operator*() const { return concrete(i)->value; }
+ inline const T *operator->() const { return &concrete(i)->value; }
+ inline bool operator==(const const_iterator &o) const { return i == o.i; }
+ inline bool operator!=(const const_iterator &o) const { return i != o.i; }
+ inline const_iterator &operator++() {
+ i = QHashData::nextNode(i);
+ return *this;
+ }
+ inline const_iterator operator++(int) {
+ const_iterator r = *this;
+ i = QHashData::nextNode(i);
+ return r;
+ }
+ inline const_iterator &operator--() {
+ i = QHashData::previousNode(i);
+ return *this;
+ }
+ inline const_iterator operator--(int) {
+ const_iterator r = *this;
+ i = QHashData::previousNode(i);
+ return r;
+ }
+ inline const_iterator operator+(int j) const
+ { const_iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
+ inline const_iterator operator-(int j) const { return operator+(-j); }
+ inline const_iterator &operator+=(int j) { return *this = *this + j; }
+ inline const_iterator &operator-=(int j) { return *this = *this - j; }
+ private:
+ inline operator bool() const { return false; }
+ };
+ friend class const_iterator;
+ inline iterator begin() { detach(); return iterator(d->firstNode()); }
+ inline const_iterator begin() const { return const_iterator(d->firstNode()); }
+ inline const_iterator constBegin() const { return const_iterator(d->firstNode()); }
+ inline iterator end() { detach(); return iterator(e); }
+ inline const_iterator end() const { return const_iterator(e); }
+ inline const_iterator constEnd() const { return const_iterator(e); }
+ iterator erase(iterator it);
+ typedef iterator Iterator;
+ typedef const_iterator ConstIterator;
+ inline int count() const { return d->size; }
+ iterator find(const Key &key);
+ const_iterator find(const Key &key) const;
+ const_iterator constFind(const Key &key) const;
+ iterator insert(const Key &key, const T &value);
+ iterator insertMulti(const Key &key, const T &value);
+ QHash<Key, T> &unite(const QHash<Key, T> &other);
+ typedef T mapped_type;
+ typedef Key key_type;
+ typedef ptrdiff_t difference_type;
+ typedef int size_type;
+ inline bool empty() const { return isEmpty(); }
+private:
+ void detach_helper();
+ void freeData(QHashData *d);
+ Node **findNode(const Key &key, uint *hp = 0) const;
+ Node *createNode(uint h, const Key &key, const T &value, Node **nextNode);
+ void deleteNode(Node *node);
+ static void duplicateNode(QHashData::Node *originalNode, void *newNode);
+};
+template <class Key, class T>
+inline void QHash<Key, T>::deleteNode(Node *node)
+{
+ node->~Node();
+ d->freeNode(node);
+}
+template <class Key, class T>
+inline void QHash<Key, T>::duplicateNode(QHashData::Node *node, void *newNode)
+{
+ Node *concreteNode = concrete(node);
+ if (QTypeInfo<T>::isDummy) {
+ (void) new (newNode) DummyNode(concreteNode->key);
+ } else {
+ (void) new (newNode) Node(concreteNode->key, concreteNode->value);
+ }
+}
+template <class Key, class T>
+inline typename QHash<Key, T>::Node *
+QHash<Key, T>::createNode(uint ah, const Key &akey, const T &avalue, Node **anextNode)
+{
+ Node *node;
+ if (QTypeInfo<T>::isDummy) {
+ node = reinterpret_cast<Node *>(new (d->allocateNode()) DummyNode(akey));
+ } else {
+ node = new (d->allocateNode()) Node(akey, avalue);
+ }
+ node->h = ah;
+ node->next = *anextNode;
+ *anextNode = node;
+ ++d->size;
+ return node;
+}
+template <class Key, class T>
+inline QHash<Key, T> &QHash<Key, T>::unite(const QHash<Key, T> &other)
+{
+ QHash<Key, T> copy(other);
+ const_iterator it = copy.constEnd();
+ while (it != copy.constBegin()) {
+ --it;
+ insertMulti(it.key(), it.value());
+ }
+ return *this;
+}
+template <class Key, class T>
+ void QHash<Key, T>::freeData(QHashData *x)
+{
+ Node *e_for_x = reinterpret_cast<Node *>(x);
+ Node **bucket = reinterpret_cast<Node **>(x->buckets);
+ int n = x->numBuckets;
+ while (n--) {
+ Node *cur = *bucket++;
+ while (cur != e_for_x) {
+ Node *next = cur->next;
+ deleteNode(cur);
+ cur = next;
+ }
+ }
+ x->destroyAndFree();
+}
+template <class Key, class T>
+inline void QHash<Key, T>::clear()
+{
+ *this = QHash<Key,T>();
+}
+template <class Key, class T>
+ void QHash<Key, T>::detach_helper()
+{
+ QHashData *x = d->detach_helper(duplicateNode,
+ QTypeInfo<T>::isDummy ? sizeof(DummyNode) : sizeof(Node));
+ if (!d->ref.deref())
+ freeData(d);
+ d = x;
+}
+template <class Key, class T>
+inline QHash<Key, T> &QHash<Key, T>::operator=(const QHash<Key, T> &other)
+{
+ if (d != other.d) {
+ other.d->ref.ref();
+ if (!d->ref.deref())
+ freeData(d);
+ d = other.d;
+ if (!d->sharable)
+ detach_helper();
+ }
+ return *this;
+}
+template <class Key, class T>
+inline const T QHash<Key, T>::value(const Key &akey) const
+{
+ Node *node;
+ if (d->size == 0 || (node = *findNode(akey)) == e) {
+ return T();
+ } else {
+ return node->value;
+ }
+}
+template <class Key, class T>
+inline const T QHash<Key, T>::value(const Key &akey, const T &adefaultValue) const
+{
+ Node *node;
+ if (d->size == 0 || (node = *findNode(akey)) == e) {
+ return adefaultValue;
+ } else {
+ return node->value;
+ }
+}
+template <class Key, class T>
+ QList<Key> QHash<Key, T>::uniqueKeys() const
+{
+ QList<Key> res;
+ const_iterator i = begin();
+ if (i != end()) {
+ for (;;) {
+ const Key &aKey = i.key();
+ res.append(aKey);
+ do {
+ if (++i == end())
+ goto break_out_of_outer_loop;
+ } while (aKey == i.key());
+ }
+ }
+break_out_of_outer_loop:
+ return res;
+}
+template <class Key, class T>
+ QList<Key> QHash<Key, T>::keys() const
+{
+ QList<Key> res;
+ const_iterator i = begin();
+ while (i != end()) {
+ res.append(i.key());
+ ++i;
+ }
+ return res;
+}
+template <class Key, class T>
+ QList<Key> QHash<Key, T>::keys(const T &avalue) const
+{
+ QList<Key> res;
+ const_iterator i = begin();
+ while (i != end()) {
+ if (i.value() == avalue)
+ res.append(i.key());
+ ++i;
+ }
+ return res;
+}
+template <class Key, class T>
+ const Key QHash<Key, T>::key(const T &avalue) const
+{
+ return key(avalue, Key());
+}
+template <class Key, class T>
+ const Key QHash<Key, T>::key(const T &avalue, const Key &defaultValue) const
+{
+ const_iterator i = begin();
+ while (i != end()) {
+ if (i.value() == avalue)
+ return i.key();
+ ++i;
+ }
+ return defaultValue;
+}
+template <class Key, class T>
+ QList<T> QHash<Key, T>::values() const
+{
+ QList<T> res;
+ const_iterator i = begin();
+ while (i != end()) {
+ res.append(i.value());
+ ++i;
+ }
+ return res;
+}
+template <class Key, class T>
+ QList<T> QHash<Key, T>::values(const Key &akey) const
+{
+ QList<T> res;
+ Node *node = *findNode(akey);
+ if (node != e) {
+ do {
+ res.append(node->value);
+ } while ((node = node->next) != e && node->key == akey);
+ }
+ return res;
+}
+template <class Key, class T>
+ int QHash<Key, T>::count(const Key &akey) const
+{
+ int cnt = 0;
+ Node *node = *findNode(akey);
+ if (node != e) {
+ do {
+ ++cnt;
+ } while ((node = node->next) != e && node->key == akey);
+ }
+ return cnt;
+}
+template <class Key, class T>
+inline const T QHash<Key, T>::operator[](const Key &akey) const
+{
+ return value(akey);
+}
+template <class Key, class T>
+inline T &QHash<Key, T>::operator[](const Key &akey)
+{
+ detach();
+ uint h;
+ Node **node = findNode(akey, &h);
+ if (*node == e) {
+ if (d->willGrow())
+ node = findNode(akey, &h);
+ return createNode(h, akey, T(), node)->value;
+ }
+ return (*node)->value;
+}
+template <class Key, class T>
+inline typename QHash<Key, T>::iterator QHash<Key, T>::insert(const Key &akey,
+ const T &avalue)
+{
+ detach();
+ uint h;
+ Node **node = findNode(akey, &h);
+ if (*node == e) {
+ if (d->willGrow())
+ node = findNode(akey, &h);
+ return iterator(createNode(h, akey, avalue, node));
+ }
+ if (!QTypeInfo<T>::isDummy)
+ (*node)->value = avalue;
+ return iterator(*node);
+}
+template <class Key, class T>
+inline typename QHash<Key, T>::iterator QHash<Key, T>::insertMulti(const Key &akey,
+ const T &avalue)
+{
+ detach();
+ d->willGrow();
+ uint h;
+ Node **nextNode = findNode(akey, &h);
+ return iterator(createNode(h, akey, avalue, nextNode));
+}
+template <class Key, class T>
+ int QHash<Key, T>::remove(const Key &akey)
+{
+ detach();
+ int oldSize = d->size;
+ Node **node = findNode(akey);
+ if (*node != e) {
+ bool deleteNext = true;
+ do {
+ Node *next = (*node)->next;
+ deleteNext = (next != e && next->key == (*node)->key);
+ deleteNode(*node);
+ *node = next;
+ --d->size;
+ } while (deleteNext);
+ d->hasShrunk();
+ }
+ return oldSize - d->size;
+}
+template <class Key, class T>
+ T QHash<Key, T>::take(const Key &akey)
+{
+ detach();
+ Node **node = findNode(akey);
+ if (*node != e) {
+ T t = (*node)->value;
+ Node *next = (*node)->next;
+ deleteNode(*node);
+ *node = next;
+ --d->size;
+ d->hasShrunk();
+ return t;
+ }
+ return T();
+}
+template <class Key, class T>
+ typename QHash<Key, T>::iterator QHash<Key, T>::erase(iterator it)
+{
+ if (it == iterator(e))
+ return it;
+ iterator ret = it;
+ ++ret;
+ Node *node = it;
+ Node **node_ptr = reinterpret_cast<Node **>(&d->buckets[node->h % d->numBuckets]);
+ while (*node_ptr != node)
+ node_ptr = &(*node_ptr)->next;
+ *node_ptr = node->next;
+ deleteNode(node);
+ --d->size;
+ return ret;
+}
+template <class Key, class T>
+inline void QHash<Key, T>::reserve(int asize)
+{
+ detach();
+ d->rehash(-qMax(asize, 1));
+}
+template <class Key, class T>
+inline typename QHash<Key, T>::const_iterator QHash<Key, T>::find(const Key &akey) const
+{
+ return const_iterator(*findNode(akey));
+}
+template <class Key, class T>
+inline typename QHash<Key, T>::const_iterator QHash<Key, T>::constFind(const Key &akey) const
+{
+ return const_iterator(*findNode(akey));
+}
+template <class Key, class T>
+inline typename QHash<Key, T>::iterator QHash<Key, T>::find(const Key &akey)
+{
+ detach();
+ return iterator(*findNode(akey));
+}
+template <class Key, class T>
+inline bool QHash<Key, T>::contains(const Key &akey) const
+{
+ return *findNode(akey) != e;
+}
+template <class Key, class T>
+ typename QHash<Key, T>::Node **QHash<Key, T>::findNode(const Key &akey,
+ uint *ahp) const
+{
+ Node **node;
+ uint h = qHash(akey);
+ if (d->numBuckets) {
+ node = reinterpret_cast<Node **>(&d->buckets[h % d->numBuckets]);
+ qt_noop();
+ while (*node != e && !(*node)->same_key(h, akey))
+ node = &(*node)->next;
+ } else {
+ node = const_cast<Node **>(reinterpret_cast<const Node * const *>(&e));
+ }
+ if (ahp)
+ *ahp = h;
+ return node;
+}
+template <class Key, class T>
+ bool QHash<Key, T>::operator==(const QHash<Key, T> &other) const
+{
+ if (size() != other.size())
+ return false;
+ if (d == other.d)
+ return true;
+ const_iterator it = begin();
+ while (it != end()) {
+ const Key &akey = it.key();
+ const_iterator it2 = other.find(akey);
+ do {
+ if (it2 == other.end() || !(it2.key() == akey))
+ return false;
+ if (!QTypeInfo<T>::isDummy && !(it.value() == it2.value()))
+ return false;
+ ++it;
+ ++it2;
+ } while (it != end() && it.key() == akey);
+ }
+ return true;
+}
+template <class Key, class T>
+class QMultiHash : public QHash<Key, T>
+{
+public:
+ QMultiHash() {}
+ QMultiHash(const QHash<Key, T> &other) : QHash<Key, T>(other) {}
+ inline typename QHash<Key, T>::iterator replace(const Key &key, const T &value)
+ { return QHash<Key, T>::insert(key, value); }
+ inline typename QHash<Key, T>::iterator insert(const Key &key, const T &value)
+ { return QHash<Key, T>::insertMulti(key, value); }
+ inline QMultiHash &operator+=(const QMultiHash &other)
+ { unite(other); return *this; }
+ inline QMultiHash operator+(const QMultiHash &other) const
+ { QMultiHash result = *this; result += other; return result; }
+ using QHash<Key, T>::contains;
+ using QHash<Key, T>::remove;
+ using QHash<Key, T>::count;
+ using QHash<Key, T>::find;
+ using QHash<Key, T>::constFind;
+ bool contains(const Key &key, const T &value) const;
+ int remove(const Key &key, const T &value);
+ int count(const Key &key, const T &value) const;
+ typename QHash<Key, T>::iterator find(const Key &key, const T &value) {
+ typename QHash<Key, T>::iterator i(find(key));
+ typename QHash<Key, T>::iterator end(this->end());
+ while (i != end && i.key() == key) {
+ if (i.value() == value)
+ return i;
+ ++i;
+ }
+ return end;
+ }
+ typename QHash<Key, T>::const_iterator find(const Key &key, const T &value) const {
+ typename QHash<Key, T>::const_iterator i(constFind(key));
+ typename QHash<Key, T>::const_iterator end(QHash<Key, T>::constEnd());
+ while (i != end && i.key() == key) {
+ if (i.value() == value)
+ return i;
+ ++i;
+ }
+ return end;
+ }
+ typename QHash<Key, T>::const_iterator constFind(const Key &key, const T &value) const
+ { return find(key, value); }
+private:
+ T &operator[](const Key &key);
+ const T operator[](const Key &key) const;
+};
+template <class Key, class T>
+inline bool QMultiHash<Key, T>::contains(const Key &key, const T &value) const
+{
+ return constFind(key, value) != QHash<Key, T>::constEnd();
+}
+template <class Key, class T>
+inline int QMultiHash<Key, T>::remove(const Key &key, const T &value)
+{
+ int n = 0;
+ typename QHash<Key, T>::iterator i(find(key));
+ typename QHash<Key, T>::iterator end(QHash<Key, T>::end());
+ while (i != end && i.key() == key) {
+ if (i.value() == value) {
+ i = erase(i);
+ ++n;
+ } else {
+ ++i;
+ }
+ }
+ return n;
+}
+template <class Key, class T>
+inline int QMultiHash<Key, T>::count(const Key &key, const T &value) const
+{
+ int n = 0;
+ typename QHash<Key, T>::const_iterator i(constFind(key));
+ typename QHash<Key, T>::const_iterator end(QHash<Key, T>::constEnd());
+ while (i != end && i.key() == key) {
+ if (i.value() == value)
+ ++n;
+ ++i;
+ }
+ return n;
+}
+template <class Key, class T> class QHashIterator { typedef typename QHash<Key,T>::const_iterator const_iterator; typedef const_iterator Item; QHash<Key,T> c; const_iterator i, n; inline bool item_exists() const { return n != c.constEnd(); } public: inline QHashIterator(const QHash<Key,T> &container) : c(container), i(c.constBegin()), n(c.constEnd()) {} inline QHashIterator &operator=(const QHash<Key,T> &container) { c = container; i = c.constBegin(); n = c.constEnd(); return *this; } inline void toFront() { i = c.constBegin(); n = c.constEnd(); } inline void toBack() { i = c.constEnd(); n = c.constEnd(); } inline bool hasNext() const { return i != c.constEnd(); } inline Item next() { n = i++; return n; } inline Item peekNext() const { return i; } inline bool hasPrevious() const { return i != c.constBegin(); } inline Item previous() { n = --i; return n; } inline Item peekPrevious() const { const_iterator p = i; return --p; } inline const T &value() const { qt_noop(); return *n; } inline const Key &key() const { qt_noop(); return n.key(); } inline bool findNext(const T &t) { while ((n = i) != c.constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (i != c.constBegin()) if (*(n = --i) == t) return true; n = c.constEnd(); return false; } };
+template <class Key, class T> class QMutableHashIterator { typedef typename QHash<Key,T>::iterator iterator; typedef typename QHash<Key,T>::const_iterator const_iterator; typedef iterator Item; QHash<Key,T> *c; iterator i, n; inline bool item_exists() const { return const_iterator(n) != c->constEnd(); } public: inline QMutableHashIterator(QHash<Key,T> &container) : c(&container) { c->setSharable(false); i = c->begin(); n = c->end(); } inline ~QMutableHashIterator() { c->setSharable(true); } inline QMutableHashIterator &operator=(QHash<Key,T> &container) { c->setSharable(true); c = &container; c->setSharable(false); i = c->begin(); n = c->end(); return *this; } inline void toFront() { i = c->begin(); n = c->end(); } inline void toBack() { i = c->end(); n = c->end(); } inline bool hasNext() const { return const_iterator(i) != c->constEnd(); } inline Item next() { n = i++; return n; } inline Item peekNext() const { return i; } inline bool hasPrevious() const { return const_iterator(i) != c->constBegin(); } inline Item previous() { n = --i; return n; } inline Item peekPrevious() const { iterator p = i; return --p; } inline void remove() { if (const_iterator(n) != c->constEnd()) { i = c->erase(n); n = c->end(); } } inline void setValue(const T &t) { if (const_iterator(n) != c->constEnd()) *n = t; } inline T &value() { qt_noop(); return *n; } inline const T &value() const { qt_noop(); return *n; } inline const Key &key() const { qt_noop(); return n.key(); } inline bool findNext(const T &t) { while (const_iterator(n = i) != c->constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (const_iterator(i) != c->constBegin()) if (*(n = --i) == t) return true; n = c->end(); return false; } };
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ enum _Rb_tree_color { _S_red = false, _S_black = true };
+ struct _Rb_tree_node_base
+ {
+ typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
+ _Rb_tree_color _M_color;
+ _Base_ptr _M_parent;
+ _Base_ptr _M_left;
+ _Base_ptr _M_right;
+ static _Base_ptr
+ _S_minimum(_Base_ptr __x)
+ {
+ while (__x->_M_left != 0) __x = __x->_M_left;
+ return __x;
+ }
+ static _Const_Base_ptr
+ _S_minimum(_Const_Base_ptr __x)
+ {
+ while (__x->_M_left != 0) __x = __x->_M_left;
+ return __x;
+ }
+ static _Base_ptr
+ _S_maximum(_Base_ptr __x)
+ {
+ while (__x->_M_right != 0) __x = __x->_M_right;
+ return __x;
+ }
+ static _Const_Base_ptr
+ _S_maximum(_Const_Base_ptr __x)
+ {
+ while (__x->_M_right != 0) __x = __x->_M_right;
+ return __x;
+ }
+ };
+ template<typename _Val>
+ struct _Rb_tree_node : public _Rb_tree_node_base
+ {
+ typedef _Rb_tree_node<_Val>* _Link_type;
+ _Val _M_value_field;
+ };
+ _Rb_tree_node_base*
+ _Rb_tree_increment(_Rb_tree_node_base* __x);
+ const _Rb_tree_node_base*
+ _Rb_tree_increment(const _Rb_tree_node_base* __x);
+ _Rb_tree_node_base*
+ _Rb_tree_decrement(_Rb_tree_node_base* __x);
+ const _Rb_tree_node_base*
+ _Rb_tree_decrement(const _Rb_tree_node_base* __x);
+ template<typename _Tp>
+ struct _Rb_tree_iterator
+ {
+ typedef _Tp value_type;
+ typedef _Tp& reference;
+ typedef _Tp* pointer;
+ typedef bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+ typedef _Rb_tree_iterator<_Tp> _Self;
+ typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
+ typedef _Rb_tree_node<_Tp>* _Link_type;
+ _Rb_tree_iterator()
+ : _M_node() { }
+ explicit
+ _Rb_tree_iterator(_Link_type __x)
+ : _M_node(__x) { }
+ reference
+ operator*() const
+ { return static_cast<_Link_type>(_M_node)->_M_value_field; }
+ pointer
+ operator->() const
+ { return &static_cast<_Link_type>(_M_node)->_M_value_field; }
+ _Self&
+ operator++()
+ {
+ _M_node = _Rb_tree_increment(_M_node);
+ return *this;
+ }
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_increment(_M_node);
+ return __tmp;
+ }
+ _Self&
+ operator--()
+ {
+ _M_node = _Rb_tree_decrement(_M_node);
+ return *this;
+ }
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_decrement(_M_node);
+ return __tmp;
+ }
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+ _Base_ptr _M_node;
+ };
+ template<typename _Tp>
+ struct _Rb_tree_const_iterator
+ {
+ typedef _Tp value_type;
+ typedef const _Tp& reference;
+ typedef const _Tp* pointer;
+ typedef _Rb_tree_iterator<_Tp> iterator;
+ typedef bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+ typedef _Rb_tree_const_iterator<_Tp> _Self;
+ typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr;
+ typedef const _Rb_tree_node<_Tp>* _Link_type;
+ _Rb_tree_const_iterator()
+ : _M_node() { }
+ explicit
+ _Rb_tree_const_iterator(_Link_type __x)
+ : _M_node(__x) { }
+ _Rb_tree_const_iterator(const iterator& __it)
+ : _M_node(__it._M_node) { }
+ reference
+ operator*() const
+ { return static_cast<_Link_type>(_M_node)->_M_value_field; }
+ pointer
+ operator->() const
+ { return &static_cast<_Link_type>(_M_node)->_M_value_field; }
+ _Self&
+ operator++()
+ {
+ _M_node = _Rb_tree_increment(_M_node);
+ return *this;
+ }
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_increment(_M_node);
+ return __tmp;
+ }
+ _Self&
+ operator--()
+ {
+ _M_node = _Rb_tree_decrement(_M_node);
+ return *this;
+ }
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_decrement(_M_node);
+ return __tmp;
+ }
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+ _Base_ptr _M_node;
+ };
+ template<typename _Val>
+ inline bool
+ operator==(const _Rb_tree_iterator<_Val>& __x,
+ const _Rb_tree_const_iterator<_Val>& __y)
+ { return __x._M_node == __y._M_node; }
+ template<typename _Val>
+ inline bool
+ operator!=(const _Rb_tree_iterator<_Val>& __x,
+ const _Rb_tree_const_iterator<_Val>& __y)
+ { return __x._M_node != __y._M_node; }
+ void
+ _Rb_tree_insert_and_rebalance(const bool __insert_left,
+ _Rb_tree_node_base* __x,
+ _Rb_tree_node_base* __p,
+ _Rb_tree_node_base& __header);
+ _Rb_tree_node_base*
+ _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
+ _Rb_tree_node_base& __header);
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc = allocator<_Val> >
+ class _Rb_tree
+ {
+ typedef typename _Alloc::template rebind<_Rb_tree_node<_Val> >::other
+ _Node_allocator;
+ protected:
+ typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
+ public:
+ typedef _Key key_type;
+ typedef _Val value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef _Rb_tree_node<_Val>* _Link_type;
+ typedef const _Rb_tree_node<_Val>* _Const_Link_type;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+ _Node_allocator&
+ _M_get_Node_allocator()
+ { return *static_cast<_Node_allocator*>(&this->_M_impl); }
+ const _Node_allocator&
+ _M_get_Node_allocator() const
+ { return *static_cast<const _Node_allocator*>(&this->_M_impl); }
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Node_allocator()); }
+ protected:
+ _Link_type
+ _M_get_node()
+ { return _M_impl._Node_allocator::allocate(1); }
+ void
+ _M_put_node(_Link_type __p)
+ { _M_impl._Node_allocator::deallocate(__p, 1); }
+ _Link_type
+ _M_create_node(const value_type& __x)
+ {
+ _Link_type __tmp = _M_get_node();
+ try
+ { get_allocator().construct(&__tmp->_M_value_field, __x); }
+ catch(...)
+ {
+ _M_put_node(__tmp);
+ throw;
+ }
+ return __tmp;
+ }
+ _Link_type
+ _M_clone_node(_Const_Link_type __x)
+ {
+ _Link_type __tmp = _M_create_node(__x->_M_value_field);
+ __tmp->_M_color = __x->_M_color;
+ __tmp->_M_left = 0;
+ __tmp->_M_right = 0;
+ return __tmp;
+ }
+ void
+ _M_destroy_node(_Link_type __p)
+ {
+ get_allocator().destroy(&__p->_M_value_field);
+ _M_put_node(__p);
+ }
+ protected:
+ template<typename _Key_compare,
+ bool _Is_pod_comparator = __is_pod(_Key_compare)>
+ struct _Rb_tree_impl : public _Node_allocator
+ {
+ _Key_compare _M_key_compare;
+ _Rb_tree_node_base _M_header;
+ size_type _M_node_count;
+ _Rb_tree_impl()
+ : _Node_allocator(), _M_key_compare(), _M_header(),
+ _M_node_count(0)
+ { _M_initialize(); }
+ _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
+ : _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
+ _M_node_count(0)
+ { _M_initialize(); }
+ private:
+ void
+ _M_initialize()
+ {
+ this->_M_header._M_color = _S_red;
+ this->_M_header._M_parent = 0;
+ this->_M_header._M_left = &this->_M_header;
+ this->_M_header._M_right = &this->_M_header;
+ }
+ };
+ _Rb_tree_impl<_Compare> _M_impl;
+ protected:
+ _Base_ptr&
+ _M_root()
+ { return this->_M_impl._M_header._M_parent; }
+ _Const_Base_ptr
+ _M_root() const
+ { return this->_M_impl._M_header._M_parent; }
+ _Base_ptr&
+ _M_leftmost()
+ { return this->_M_impl._M_header._M_left; }
+ _Const_Base_ptr
+ _M_leftmost() const
+ { return this->_M_impl._M_header._M_left; }
+ _Base_ptr&
+ _M_rightmost()
+ { return this->_M_impl._M_header._M_right; }
+ _Const_Base_ptr
+ _M_rightmost() const
+ { return this->_M_impl._M_header._M_right; }
+ _Link_type
+ _M_begin()
+ { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); }
+ _Const_Link_type
+ _M_begin() const
+ {
+ return static_cast<_Const_Link_type>
+ (this->_M_impl._M_header._M_parent);
+ }
+ _Link_type
+ _M_end()
+ { return static_cast<_Link_type>(&this->_M_impl._M_header); }
+ _Const_Link_type
+ _M_end() const
+ { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }
+ static const_reference
+ _S_value(_Const_Link_type __x)
+ { return __x->_M_value_field; }
+ static const _Key&
+ _S_key(_Const_Link_type __x)
+ { return _KeyOfValue()(_S_value(__x)); }
+ static _Link_type
+ _S_left(_Base_ptr __x)
+ { return static_cast<_Link_type>(__x->_M_left); }
+ static _Const_Link_type
+ _S_left(_Const_Base_ptr __x)
+ { return static_cast<_Const_Link_type>(__x->_M_left); }
+ static _Link_type
+ _S_right(_Base_ptr __x)
+ { return static_cast<_Link_type>(__x->_M_right); }
+ static _Const_Link_type
+ _S_right(_Const_Base_ptr __x)
+ { return static_cast<_Const_Link_type>(__x->_M_right); }
+ static const_reference
+ _S_value(_Const_Base_ptr __x)
+ { return static_cast<_Const_Link_type>(__x)->_M_value_field; }
+ static const _Key&
+ _S_key(_Const_Base_ptr __x)
+ { return _KeyOfValue()(_S_value(__x)); }
+ static _Base_ptr
+ _S_minimum(_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_minimum(__x); }
+ static _Const_Base_ptr
+ _S_minimum(_Const_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_minimum(__x); }
+ static _Base_ptr
+ _S_maximum(_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_maximum(__x); }
+ static _Const_Base_ptr
+ _S_maximum(_Const_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_maximum(__x); }
+ public:
+ typedef _Rb_tree_iterator<value_type> iterator;
+ typedef _Rb_tree_const_iterator<value_type> const_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ private:
+ iterator
+ _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __y,
+ const value_type& __v);
+ iterator
+ _M_insert_lower(_Base_ptr __x, _Base_ptr __y, const value_type& __v);
+ iterator
+ _M_insert_equal_lower(const value_type& __x);
+ _Link_type
+ _M_copy(_Const_Link_type __x, _Link_type __p);
+ void
+ _M_erase(_Link_type __x);
+ iterator
+ _M_lower_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k);
+ const_iterator
+ _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const;
+ iterator
+ _M_upper_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k);
+ const_iterator
+ _M_upper_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const;
+ public:
+ _Rb_tree() { }
+ _Rb_tree(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_impl(__comp, __a) { }
+ _Rb_tree(const _Rb_tree& __x)
+ : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator())
+ {
+ if (__x._M_root() != 0)
+ {
+ _M_root() = _M_copy(__x._M_begin(), _M_end());
+ _M_leftmost() = _S_minimum(_M_root());
+ _M_rightmost() = _S_maximum(_M_root());
+ _M_impl._M_node_count = __x._M_impl._M_node_count;
+ }
+ }
+ ~_Rb_tree()
+ { _M_erase(_M_begin()); }
+ _Rb_tree&
+ operator=(const _Rb_tree& __x);
+ _Compare
+ key_comp() const
+ { return _M_impl._M_key_compare; }
+ iterator
+ begin()
+ {
+ return iterator(static_cast<_Link_type>
+ (this->_M_impl._M_header._M_left));
+ }
+ const_iterator
+ begin() const
+ {
+ return const_iterator(static_cast<_Const_Link_type>
+ (this->_M_impl._M_header._M_left));
+ }
+ iterator
+ end()
+ { return iterator(static_cast<_Link_type>(&this->_M_impl._M_header)); }
+ const_iterator
+ end() const
+ {
+ return const_iterator(static_cast<_Const_Link_type>
+ (&this->_M_impl._M_header));
+ }
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+ bool
+ empty() const
+ { return _M_impl._M_node_count == 0; }
+ size_type
+ size() const
+ { return _M_impl._M_node_count; }
+ size_type
+ max_size() const
+ { return get_allocator().max_size(); }
+ void
+ swap(_Rb_tree& __t);
+ pair<iterator, bool>
+ _M_insert_unique(const value_type& __x);
+ iterator
+ _M_insert_equal(const value_type& __x);
+ iterator
+ _M_insert_unique_(const_iterator __position, const value_type& __x);
+ iterator
+ _M_insert_equal_(const_iterator __position, const value_type& __x);
+ template<typename _InputIterator>
+ void
+ _M_insert_unique(_InputIterator __first, _InputIterator __last);
+ template<typename _InputIterator>
+ void
+ _M_insert_equal(_InputIterator __first, _InputIterator __last);
+ void
+ erase(iterator __position);
+ void
+ erase(const_iterator __position);
+ size_type
+ erase(const key_type& __x);
+ void
+ erase(iterator __first, iterator __last);
+ void
+ erase(const_iterator __first, const_iterator __last);
+ void
+ erase(const key_type* __first, const key_type* __last);
+ void
+ clear()
+ {
+ _M_erase(_M_begin());
+ _M_leftmost() = _M_end();
+ _M_root() = 0;
+ _M_rightmost() = _M_end();
+ _M_impl._M_node_count = 0;
+ }
+ iterator
+ find(const key_type& __k);
+ const_iterator
+ find(const key_type& __k) const;
+ size_type
+ count(const key_type& __k) const;
+ iterator
+ lower_bound(const key_type& __k)
+ { return _M_lower_bound(_M_begin(), _M_end(), __k); }
+ const_iterator
+ lower_bound(const key_type& __k) const
+ { return _M_lower_bound(_M_begin(), _M_end(), __k); }
+ iterator
+ upper_bound(const key_type& __k)
+ { return _M_upper_bound(_M_begin(), _M_end(), __k); }
+ const_iterator
+ upper_bound(const key_type& __k) const
+ { return _M_upper_bound(_M_begin(), _M_end(), __k); }
+ pair<iterator, iterator>
+ equal_range(const key_type& __k);
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __k) const;
+ bool
+ __rb_verify() const;
+ };
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ {
+ return __x.size() == __y.size()
+ && std::equal(__x.begin(), __x.end(), __y.begin());
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ {
+ return std::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end());
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { return __y < __x; }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline void
+ swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ operator=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x)
+ {
+ if (this != &__x)
+ {
+ clear();
+ _M_impl._M_key_compare = __x._M_impl._M_key_compare;
+ if (__x._M_root() != 0)
+ {
+ _M_root() = _M_copy(__x._M_begin(), _M_end());
+ _M_leftmost() = _S_minimum(_M_root());
+ _M_rightmost() = _S_maximum(_M_root());
+ _M_impl._M_node_count = __x._M_impl._M_node_count;
+ }
+ }
+ return *this;
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __p, const _Val& __v)
+ {
+ bool __insert_left = (__x != 0 || __p == _M_end()
+ || _M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key(__p)));
+ _Link_type __z = _M_create_node(__v);
+ _Rb_tree_insert_and_rebalance(__insert_left, __z,
+ const_cast<_Base_ptr>(__p),
+ this->_M_impl._M_header);
+ ++_M_impl._M_node_count;
+ return iterator(__z);
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_lower(_Base_ptr __x, _Base_ptr __p, const _Val& __v)
+ {
+ bool __insert_left = (__x != 0 || __p == _M_end()
+ || !_M_impl._M_key_compare(_S_key(__p),
+ _KeyOfValue()(__v)));
+ _Link_type __z = _M_create_node(__v);
+ _Rb_tree_insert_and_rebalance(__insert_left, __z, __p,
+ this->_M_impl._M_header);
+ ++_M_impl._M_node_count;
+ return iterator(__z);
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_equal_lower(const _Val& __v)
+ {
+ _Link_type __x = _M_begin();
+ _Link_type __y = _M_end();
+ while (__x != 0)
+ {
+ __y = __x;
+ __x = !_M_impl._M_key_compare(_S_key(__x), _KeyOfValue()(__v)) ?
+ _S_left(__x) : _S_right(__x);
+ }
+ return _M_insert_lower(__x, __y, __v);
+ }
+ template<typename _Key, typename _Val, typename _KoV,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type
+ _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::
+ _M_copy(_Const_Link_type __x, _Link_type __p)
+ {
+ _Link_type __top = _M_clone_node(__x);
+ __top->_M_parent = __p;
+ try
+ {
+ if (__x->_M_right)
+ __top->_M_right = _M_copy(_S_right(__x), __top);
+ __p = __top;
+ __x = _S_left(__x);
+ while (__x != 0)
+ {
+ _Link_type __y = _M_clone_node(__x);
+ __p->_M_left = __y;
+ __y->_M_parent = __p;
+ if (__x->_M_right)
+ __y->_M_right = _M_copy(_S_right(__x), __y);
+ __p = __y;
+ __x = _S_left(__x);
+ }
+ }
+ catch(...)
+ {
+ _M_erase(__top);
+ throw;
+ }
+ return __top;
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_erase(_Link_type __x)
+ {
+ while (__x != 0)
+ {
+ _M_erase(_S_right(__x));
+ _Link_type __y = _S_left(__x);
+ _M_destroy_node(__x);
+ __x = __y;
+ }
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_lower_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k)
+ {
+ while (__x != 0)
+ if (!_M_impl._M_key_compare(_S_key(__x), __k))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return iterator(__y);
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const
+ {
+ while (__x != 0)
+ if (!_M_impl._M_key_compare(_S_key(__x), __k))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return const_iterator(__y);
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_upper_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k)
+ {
+ while (__x != 0)
+ if (_M_impl._M_key_compare(__k, _S_key(__x)))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return iterator(__y);
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_upper_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const
+ {
+ while (__x != 0)
+ if (_M_impl._M_key_compare(__k, _S_key(__x)))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return const_iterator(__y);
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator,
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ equal_range(const _Key& __k)
+ {
+ _Link_type __x = _M_begin();
+ _Link_type __y = _M_end();
+ while (__x != 0)
+ {
+ if (_M_impl._M_key_compare(_S_key(__x), __k))
+ __x = _S_right(__x);
+ else if (_M_impl._M_key_compare(__k, _S_key(__x)))
+ __y = __x, __x = _S_left(__x);
+ else
+ {
+ _Link_type __xu(__x), __yu(__y);
+ __y = __x, __x = _S_left(__x);
+ __xu = _S_right(__xu);
+ return pair<iterator,
+ iterator>(_M_lower_bound(__x, __y, __k),
+ _M_upper_bound(__xu, __yu, __k));
+ }
+ }
+ return pair<iterator, iterator>(iterator(__y),
+ iterator(__y));
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator,
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ equal_range(const _Key& __k) const
+ {
+ _Const_Link_type __x = _M_begin();
+ _Const_Link_type __y = _M_end();
+ while (__x != 0)
+ {
+ if (_M_impl._M_key_compare(_S_key(__x), __k))
+ __x = _S_right(__x);
+ else if (_M_impl._M_key_compare(__k, _S_key(__x)))
+ __y = __x, __x = _S_left(__x);
+ else
+ {
+ _Const_Link_type __xu(__x), __yu(__y);
+ __y = __x, __x = _S_left(__x);
+ __xu = _S_right(__xu);
+ return pair<const_iterator,
+ const_iterator>(_M_lower_bound(__x, __y, __k),
+ _M_upper_bound(__xu, __yu, __k));
+ }
+ }
+ return pair<const_iterator, const_iterator>(const_iterator(__y),
+ const_iterator(__y));
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t)
+ {
+ if (_M_root() == 0)
+ {
+ if (__t._M_root() != 0)
+ {
+ _M_root() = __t._M_root();
+ _M_leftmost() = __t._M_leftmost();
+ _M_rightmost() = __t._M_rightmost();
+ _M_root()->_M_parent = _M_end();
+ __t._M_root() = 0;
+ __t._M_leftmost() = __t._M_end();
+ __t._M_rightmost() = __t._M_end();
+ }
+ }
+ else if (__t._M_root() == 0)
+ {
+ __t._M_root() = _M_root();
+ __t._M_leftmost() = _M_leftmost();
+ __t._M_rightmost() = _M_rightmost();
+ __t._M_root()->_M_parent = __t._M_end();
+ _M_root() = 0;
+ _M_leftmost() = _M_end();
+ _M_rightmost() = _M_end();
+ }
+ else
+ {
+ std::swap(_M_root(),__t._M_root());
+ std::swap(_M_leftmost(),__t._M_leftmost());
+ std::swap(_M_rightmost(),__t._M_rightmost());
+ _M_root()->_M_parent = _M_end();
+ __t._M_root()->_M_parent = __t._M_end();
+ }
+ std::swap(this->_M_impl._M_node_count, __t._M_impl._M_node_count);
+ std::swap(this->_M_impl._M_key_compare, __t._M_impl._M_key_compare);
+ std::__alloc_swap<_Node_allocator>::
+ _S_do_it(_M_get_Node_allocator(), __t._M_get_Node_allocator());
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator, bool>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_unique(const _Val& __v)
+ {
+ _Link_type __x = _M_begin();
+ _Link_type __y = _M_end();
+ bool __comp = true;
+ while (__x != 0)
+ {
+ __y = __x;
+ __comp = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x));
+ __x = __comp ? _S_left(__x) : _S_right(__x);
+ }
+ iterator __j = iterator(__y);
+ if (__comp)
+ {
+ if (__j == begin())
+ return pair<iterator, bool>(_M_insert_(__x, __y, __v), true);
+ else
+ --__j;
+ }
+ if (_M_impl._M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v)))
+ return pair<iterator, bool>(_M_insert_(__x, __y, __v), true);
+ return pair<iterator, bool>(__j, false);
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_equal(const _Val& __v)
+ {
+ _Link_type __x = _M_begin();
+ _Link_type __y = _M_end();
+ while (__x != 0)
+ {
+ __y = __x;
+ __x = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x)) ?
+ _S_left(__x) : _S_right(__x);
+ }
+ return _M_insert_(__x, __y, __v);
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_unique_(const_iterator __position, const _Val& __v)
+ {
+ if (__position._M_node == _M_end())
+ {
+ if (size() > 0
+ && _M_impl._M_key_compare(_S_key(_M_rightmost()),
+ _KeyOfValue()(__v)))
+ return _M_insert_(0, _M_rightmost(), __v);
+ else
+ return _M_insert_unique(__v).first;
+ }
+ else if (_M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key(__position._M_node)))
+ {
+ const_iterator __before = __position;
+ if (__position._M_node == _M_leftmost())
+ return _M_insert_(_M_leftmost(), _M_leftmost(), __v);
+ else if (_M_impl._M_key_compare(_S_key((--__before)._M_node),
+ _KeyOfValue()(__v)))
+ {
+ if (_S_right(__before._M_node) == 0)
+ return _M_insert_(0, __before._M_node, __v);
+ else
+ return _M_insert_(__position._M_node,
+ __position._M_node, __v);
+ }
+ else
+ return _M_insert_unique(__v).first;
+ }
+ else if (_M_impl._M_key_compare(_S_key(__position._M_node),
+ _KeyOfValue()(__v)))
+ {
+ const_iterator __after = __position;
+ if (__position._M_node == _M_rightmost())
+ return _M_insert_(0, _M_rightmost(), __v);
+ else if (_M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key((++__after)._M_node)))
+ {
+ if (_S_right(__position._M_node) == 0)
+ return _M_insert_(0, __position._M_node, __v);
+ else
+ return _M_insert_(__after._M_node, __after._M_node, __v);
+ }
+ else
+ return _M_insert_unique(__v).first;
+ }
+ else
+ return iterator(static_cast<_Link_type>
+ (const_cast<_Base_ptr>(__position._M_node)));
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_equal_(const_iterator __position, const _Val& __v)
+ {
+ if (__position._M_node == _M_end())
+ {
+ if (size() > 0
+ && !_M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key(_M_rightmost())))
+ return _M_insert_(0, _M_rightmost(), __v);
+ else
+ return _M_insert_equal(__v);
+ }
+ else if (!_M_impl._M_key_compare(_S_key(__position._M_node),
+ _KeyOfValue()(__v)))
+ {
+ const_iterator __before = __position;
+ if (__position._M_node == _M_leftmost())
+ return _M_insert_(_M_leftmost(), _M_leftmost(), __v);
+ else if (!_M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key((--__before)._M_node)))
+ {
+ if (_S_right(__before._M_node) == 0)
+ return _M_insert_(0, __before._M_node, __v);
+ else
+ return _M_insert_(__position._M_node,
+ __position._M_node, __v);
+ }
+ else
+ return _M_insert_equal(__v);
+ }
+ else
+ {
+ const_iterator __after = __position;
+ if (__position._M_node == _M_rightmost())
+ return _M_insert_(0, _M_rightmost(), __v);
+ else if (!_M_impl._M_key_compare(_S_key((++__after)._M_node),
+ _KeyOfValue()(__v)))
+ {
+ if (_S_right(__position._M_node) == 0)
+ return _M_insert_(0, __position._M_node, __v);
+ else
+ return _M_insert_(__after._M_node, __after._M_node, __v);
+ }
+ else
+ return _M_insert_equal_lower(__v);
+ }
+ }
+ template<typename _Key, typename _Val, typename _KoV,
+ typename _Cmp, typename _Alloc>
+ template<class _II>
+ void
+ _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
+ _M_insert_unique(_II __first, _II __last)
+ {
+ for (; __first != __last; ++__first)
+ _M_insert_unique_(end(), *__first);
+ }
+ template<typename _Key, typename _Val, typename _KoV,
+ typename _Cmp, typename _Alloc>
+ template<class _II>
+ void
+ _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
+ _M_insert_equal(_II __first, _II __last)
+ {
+ for (; __first != __last; ++__first)
+ _M_insert_equal_(end(), *__first);
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(iterator __position)
+ {
+ _Link_type __y =
+ static_cast<_Link_type>(_Rb_tree_rebalance_for_erase
+ (__position._M_node,
+ this->_M_impl._M_header));
+ _M_destroy_node(__y);
+ --_M_impl._M_node_count;
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(const_iterator __position)
+ {
+ _Link_type __y =
+ static_cast<_Link_type>(_Rb_tree_rebalance_for_erase
+ (const_cast<_Base_ptr>(__position._M_node),
+ this->_M_impl._M_header));
+ _M_destroy_node(__y);
+ --_M_impl._M_node_count;
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(const _Key& __x)
+ {
+ pair<iterator, iterator> __p = equal_range(__x);
+ const size_type __old_size = size();
+ erase(__p.first, __p.second);
+ return __old_size - size();
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(iterator __first, iterator __last)
+ {
+ if (__first == begin() && __last == end())
+ clear();
+ else
+ while (__first != __last)
+ erase(__first++);
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(const_iterator __first, const_iterator __last)
+ {
+ if (__first == begin() && __last == end())
+ clear();
+ else
+ while (__first != __last)
+ erase(__first++);
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(const _Key* __first, const _Key* __last)
+ {
+ while (__first != __last)
+ erase(*__first++);
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ find(const _Key& __k)
+ {
+ iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
+ return (__j == end()
+ || _M_impl._M_key_compare(__k,
+ _S_key(__j._M_node))) ? end() : __j;
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ find(const _Key& __k) const
+ {
+ const_iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
+ return (__j == end()
+ || _M_impl._M_key_compare(__k,
+ _S_key(__j._M_node))) ? end() : __j;
+ }
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ count(const _Key& __k) const
+ {
+ pair<const_iterator, const_iterator> __p = equal_range(__k);
+ const size_type __n = std::distance(__p.first, __p.second);
+ return __n;
+ }
+ unsigned int
+ _Rb_tree_black_count(const _Rb_tree_node_base* __node,
+ const _Rb_tree_node_base* __root);
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ bool
+ _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const
+ {
+ if (_M_impl._M_node_count == 0 || begin() == end())
+ return _M_impl._M_node_count == 0 && begin() == end()
+ && this->_M_impl._M_header._M_left == _M_end()
+ && this->_M_impl._M_header._M_right == _M_end();
+ unsigned int __len = _Rb_tree_black_count(_M_leftmost(), _M_root());
+ for (const_iterator __it = begin(); __it != end(); ++__it)
+ {
+ _Const_Link_type __x = static_cast<_Const_Link_type>(__it._M_node);
+ _Const_Link_type __L = _S_left(__x);
+ _Const_Link_type __R = _S_right(__x);
+ if (__x->_M_color == _S_red)
+ if ((__L && __L->_M_color == _S_red)
+ || (__R && __R->_M_color == _S_red))
+ return false;
+ if (__L && _M_impl._M_key_compare(_S_key(__x), _S_key(__L)))
+ return false;
+ if (__R && _M_impl._M_key_compare(_S_key(__R), _S_key(__x)))
+ return false;
+ if (!__L && !__R && _Rb_tree_black_count(__x, _M_root()) != __len)
+ return false;
+ }
+ if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root()))
+ return false;
+ if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root()))
+ return false;
+ return true;
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
+ typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+ class map
+ {
+ public:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Alloc allocator_type;
+ private:
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ public:
+ class value_compare
+ : public std::binary_function<value_type, value_type, bool>
+ {
+ friend class map<_Key, _Tp, _Compare, _Alloc>;
+ protected:
+ _Compare comp;
+ value_compare(_Compare __c)
+ : comp(__c) { }
+ public:
+ bool operator()(const value_type& __x, const value_type& __y) const
+ { return comp(__x.first, __y.first); }
+ };
+ private:
+ typedef typename _Alloc::template rebind<value_type>::other
+ _Pair_alloc_type;
+ typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
+ key_compare, _Pair_alloc_type> _Rep_type;
+ _Rep_type _M_t;
+ public:
+ typedef typename _Pair_alloc_type::pointer pointer;
+ typedef typename _Pair_alloc_type::const_pointer const_pointer;
+ typedef typename _Pair_alloc_type::reference reference;
+ typedef typename _Pair_alloc_type::const_reference const_reference;
+ typedef typename _Rep_type::iterator iterator;
+ typedef typename _Rep_type::const_iterator const_iterator;
+ typedef typename _Rep_type::size_type size_type;
+ typedef typename _Rep_type::difference_type difference_type;
+ typedef typename _Rep_type::reverse_iterator reverse_iterator;
+ typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
+ map()
+ : _M_t() { }
+ explicit
+ map(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a) { }
+ map(const map& __x)
+ : _M_t(__x._M_t) { }
+ template<typename _InputIterator>
+ map(_InputIterator __first, _InputIterator __last)
+ : _M_t()
+ { _M_t._M_insert_unique(__first, __last); }
+ template<typename _InputIterator>
+ map(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_unique(__first, __last); }
+ map&
+ operator=(const map& __x)
+ {
+ _M_t = __x._M_t;
+ return *this;
+ }
+ allocator_type
+ get_allocator() const
+ { return _M_t.get_allocator(); }
+ iterator
+ begin()
+ { return _M_t.begin(); }
+ const_iterator
+ begin() const
+ { return _M_t.begin(); }
+ iterator
+ end()
+ { return _M_t.end(); }
+ const_iterator
+ end() const
+ { return _M_t.end(); }
+ reverse_iterator
+ rbegin()
+ { return _M_t.rbegin(); }
+ const_reverse_iterator
+ rbegin() const
+ { return _M_t.rbegin(); }
+ reverse_iterator
+ rend()
+ { return _M_t.rend(); }
+ const_reverse_iterator
+ rend() const
+ { return _M_t.rend(); }
+ bool
+ empty() const
+ { return _M_t.empty(); }
+ size_type
+ size() const
+ { return _M_t.size(); }
+ size_type
+ max_size() const
+ { return _M_t.max_size(); }
+ mapped_type&
+ operator[](const key_type& __k)
+ {
+ iterator __i = lower_bound(__k);
+ if (__i == end() || key_comp()(__k, (*__i).first))
+ __i = insert(__i, value_type(__k, mapped_type()));
+ return (*__i).second;
+ }
+ mapped_type&
+ at(const key_type& __k)
+ {
+ iterator __i = lower_bound(__k);
+ if (__i == end() || key_comp()(__k, (*__i).first))
+ __throw_out_of_range(("map::at"));
+ return (*__i).second;
+ }
+ const mapped_type&
+ at(const key_type& __k) const
+ {
+ const_iterator __i = lower_bound(__k);
+ if (__i == end() || key_comp()(__k, (*__i).first))
+ __throw_out_of_range(("map::at"));
+ return (*__i).second;
+ }
+ std::pair<iterator, bool>
+ insert(const value_type& __x)
+ { return _M_t._M_insert_unique(__x); }
+ iterator
+ insert(iterator __position, const value_type& __x)
+ { return _M_t._M_insert_unique_(__position, __x); }
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_t._M_insert_unique(__first, __last); }
+ void
+ erase(iterator __position)
+ { _M_t.erase(__position); }
+ size_type
+ erase(const key_type& __x)
+ { return _M_t.erase(__x); }
+ void
+ erase(iterator __first, iterator __last)
+ { _M_t.erase(__first, __last); }
+ void
+ swap(map& __x)
+ { _M_t.swap(__x._M_t); }
+ void
+ clear()
+ { _M_t.clear(); }
+ key_compare
+ key_comp() const
+ { return _M_t.key_comp(); }
+ value_compare
+ value_comp() const
+ { return value_compare(_M_t.key_comp()); }
+ iterator
+ find(const key_type& __x)
+ { return _M_t.find(__x); }
+ const_iterator
+ find(const key_type& __x) const
+ { return _M_t.find(__x); }
+ size_type
+ count(const key_type& __x) const
+ { return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
+ iterator
+ lower_bound(const key_type& __x)
+ { return _M_t.lower_bound(__x); }
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return _M_t.lower_bound(__x); }
+ iterator
+ upper_bound(const key_type& __x)
+ { return _M_t.upper_bound(__x); }
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return _M_t.upper_bound(__x); }
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __x)
+ { return _M_t.equal_range(__x); }
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __x) const
+ { return _M_t.equal_range(__x); }
+ template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator==(const map<_K1, _T1, _C1, _A1>&,
+ const map<_K1, _T1, _C1, _A1>&);
+ template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator<(const map<_K1, _T1, _C1, _A1>&,
+ const map<_K1, _T1, _C1, _A1>&);
+ };
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __x._M_t == __y._M_t; }
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __x._M_t < __y._M_t; }
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __y < __x; }
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
+ map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template <typename _Key, typename _Tp,
+ typename _Compare = std::less<_Key>,
+ typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+ class multimap
+ {
+ public:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Alloc allocator_type;
+ private:
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ public:
+ class value_compare
+ : public std::binary_function<value_type, value_type, bool>
+ {
+ friend class multimap<_Key, _Tp, _Compare, _Alloc>;
+ protected:
+ _Compare comp;
+ value_compare(_Compare __c)
+ : comp(__c) { }
+ public:
+ bool operator()(const value_type& __x, const value_type& __y) const
+ { return comp(__x.first, __y.first); }
+ };
+ private:
+ typedef typename _Alloc::template rebind<value_type>::other
+ _Pair_alloc_type;
+ typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
+ key_compare, _Pair_alloc_type> _Rep_type;
+ _Rep_type _M_t;
+ public:
+ typedef typename _Pair_alloc_type::pointer pointer;
+ typedef typename _Pair_alloc_type::const_pointer const_pointer;
+ typedef typename _Pair_alloc_type::reference reference;
+ typedef typename _Pair_alloc_type::const_reference const_reference;
+ typedef typename _Rep_type::iterator iterator;
+ typedef typename _Rep_type::const_iterator const_iterator;
+ typedef typename _Rep_type::size_type size_type;
+ typedef typename _Rep_type::difference_type difference_type;
+ typedef typename _Rep_type::reverse_iterator reverse_iterator;
+ typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
+ multimap()
+ : _M_t() { }
+ explicit
+ multimap(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a) { }
+ multimap(const multimap& __x)
+ : _M_t(__x._M_t) { }
+ template<typename _InputIterator>
+ multimap(_InputIterator __first, _InputIterator __last)
+ : _M_t()
+ { _M_t._M_insert_equal(__first, __last); }
+ template<typename _InputIterator>
+ multimap(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__first, __last); }
+ multimap&
+ operator=(const multimap& __x)
+ {
+ _M_t = __x._M_t;
+ return *this;
+ }
+ allocator_type
+ get_allocator() const
+ { return _M_t.get_allocator(); }
+ iterator
+ begin()
+ { return _M_t.begin(); }
+ const_iterator
+ begin() const
+ { return _M_t.begin(); }
+ iterator
+ end()
+ { return _M_t.end(); }
+ const_iterator
+ end() const
+ { return _M_t.end(); }
+ reverse_iterator
+ rbegin()
+ { return _M_t.rbegin(); }
+ const_reverse_iterator
+ rbegin() const
+ { return _M_t.rbegin(); }
+ reverse_iterator
+ rend()
+ { return _M_t.rend(); }
+ const_reverse_iterator
+ rend() const
+ { return _M_t.rend(); }
+ bool
+ empty() const
+ { return _M_t.empty(); }
+ size_type
+ size() const
+ { return _M_t.size(); }
+ size_type
+ max_size() const
+ { return _M_t.max_size(); }
+ iterator
+ insert(const value_type& __x)
+ { return _M_t._M_insert_equal(__x); }
+ iterator
+ insert(iterator __position, const value_type& __x)
+ { return _M_t._M_insert_equal_(__position, __x); }
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_t._M_insert_equal(__first, __last); }
+ void
+ erase(iterator __position)
+ { _M_t.erase(__position); }
+ size_type
+ erase(const key_type& __x)
+ { return _M_t.erase(__x); }
+ void
+ erase(iterator __first, iterator __last)
+ { _M_t.erase(__first, __last); }
+ void
+ swap(multimap& __x)
+ { _M_t.swap(__x._M_t); }
+ void
+ clear()
+ { _M_t.clear(); }
+ key_compare
+ key_comp() const
+ { return _M_t.key_comp(); }
+ value_compare
+ value_comp() const
+ { return value_compare(_M_t.key_comp()); }
+ iterator
+ find(const key_type& __x)
+ { return _M_t.find(__x); }
+ const_iterator
+ find(const key_type& __x) const
+ { return _M_t.find(__x); }
+ size_type
+ count(const key_type& __x) const
+ { return _M_t.count(__x); }
+ iterator
+ lower_bound(const key_type& __x)
+ { return _M_t.lower_bound(__x); }
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return _M_t.lower_bound(__x); }
+ iterator
+ upper_bound(const key_type& __x)
+ { return _M_t.upper_bound(__x); }
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return _M_t.upper_bound(__x); }
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __x)
+ { return _M_t.equal_range(__x); }
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __x) const
+ { return _M_t.equal_range(__x); }
+ template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator==(const multimap<_K1, _T1, _C1, _A1>&,
+ const multimap<_K1, _T1, _C1, _A1>&);
+ template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator<(const multimap<_K1, _T1, _C1, _A1>&,
+ const multimap<_K1, _T1, _C1, _A1>&);
+ };
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __x._M_t == __y._M_t; }
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __x._M_t < __y._M_t; }
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __y < __x; }
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+}
+typedef QtValidLicenseForCoreModule QtCoreModule;
+struct __attribute__((visibility("default"))) QMapData
+{
+ struct Node {
+ Node *backward;
+ Node *forward[1];
+ };
+ enum { LastLevel = 11, Sparseness = 3 };
+ QMapData *backward;
+ QMapData *forward[QMapData::LastLevel + 1];
+ QBasicAtomicInt ref;
+ int topLevel;
+ int size;
+ uint randomBits;
+ uint insertInOrder : 1;
+ uint sharable : 1;
+ static QMapData *createData();
+ void continueFreeData(int offset);
+ Node *node_create(Node *update[], int offset);
+ void node_delete(Node *update[], int offset, Node *node);
+ static QMapData shared_null;
+};
+template <class Key> inline bool qMapLessThanKey(const Key &key1, const Key &key2)
+{
+ return key1 < key2;
+}
+template <class Ptr> inline bool qMapLessThanKey(Ptr *key1, Ptr *key2)
+{
+ qt_noop();
+ return quintptr(key1) < quintptr(key2);
+}
+template <class Ptr> inline bool qMapLessThanKey(const Ptr *key1, const Ptr *key2)
+{
+ qt_noop();
+ return quintptr(key1) < quintptr(key2);
+}
+template <class Key, class T>
+struct QMapNode {
+ Key key;
+ T value;
+ QMapData::Node *backward;
+ QMapData::Node *forward[1];
+};
+template <class Key, class T>
+struct QMapPayloadNode
+{
+ Key key;
+ T value;
+ QMapData::Node *backward;
+};
+template <class Key, class T>
+class QMap
+{
+ typedef QMapNode<Key, T> Node;
+ typedef QMapPayloadNode<Key, T> PayloadNode;
+ union {
+ QMapData *d;
+ QMapData::Node *e;
+ };
+ static inline int payload() { return sizeof(PayloadNode) - sizeof(QMapData::Node *); }
+ static inline Node *concrete(QMapData::Node *node) {
+ return reinterpret_cast<Node *>(reinterpret_cast<char *>(node) - payload());
+ }
+public:
+ inline QMap() : d(&QMapData::shared_null) { d->ref.ref(); }
+ inline QMap(const QMap<Key, T> &other) : d(other.d)
+ { d->ref.ref(); if (!d->sharable) detach(); }
+ inline ~QMap() { if (!d) return; if (!d->ref.deref()) freeData(d); }
+ QMap<Key, T> &operator=(const QMap<Key, T> &other);
+ explicit QMap(const typename std::map<Key, T> &other);
+ std::map<Key, T> toStdMap() const;
+ bool operator==(const QMap<Key, T> &other) const;
+ inline bool operator!=(const QMap<Key, T> &other) const { return !(*this == other); }
+ inline int size() const { return d->size; }
+ inline bool isEmpty() const { return d->size == 0; }
+ inline void detach() { if (d->ref != 1) detach_helper(); }
+ inline bool isDetached() const { return d->ref == 1; }
+ inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
+ inline void setInsertInOrder(bool ordered) { d->insertInOrder = ordered; }
+ void clear();
+ int remove(const Key &key);
+ T take(const Key &key);
+ bool contains(const Key &key) const;
+ const Key key(const T &value) const;
+ const Key key(const T &value, const Key &defaultKey) const;
+ const T value(const Key &key) const;
+ const T value(const Key &key, const T &defaultValue) const;
+ T &operator[](const Key &key);
+ const T operator[](const Key &key) const;
+ QList<Key> uniqueKeys() const;
+ QList<Key> keys() const;
+ QList<Key> keys(const T &value) const;
+ QList<T> values() const;
+ QList<T> values(const Key &key) const;
+ int count(const Key &key) const;
+ class const_iterator;
+ class iterator
+ {
+ friend class const_iterator;
+ QMapData::Node *i;
+ public:
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef T *pointer;
+ typedef T &reference;
+ inline operator QMapData::Node *() const { return i; }
+ inline iterator() : i(0) { }
+ inline iterator(QMapData::Node *node) : i(node) { }
+ inline const Key &key() const { return concrete(i)->key; }
+ inline T &value() const { return concrete(i)->value; }
+ inline T &operator*() const { return concrete(i)->value; }
+ inline T *operator->() const { return &concrete(i)->value; }
+ inline bool operator==(const iterator &o) const { return i == o.i; }
+ inline bool operator!=(const iterator &o) const { return i != o.i; }
+ inline iterator &operator++() {
+ i = i->forward[0];
+ return *this;
+ }
+ inline iterator operator++(int) {
+ iterator r = *this;
+ i = i->forward[0];
+ return r;
+ }
+ inline iterator &operator--() {
+ i = i->backward;
+ return *this;
+ }
+ inline iterator operator--(int) {
+ iterator r = *this;
+ i = i->backward;
+ return r;
+ }
+ inline iterator operator+(int j) const
+ { iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
+ inline iterator operator-(int j) const { return operator+(-j); }
+ inline iterator &operator+=(int j) { return *this = *this + j; }
+ inline iterator &operator-=(int j) { return *this = *this - j; }
+ public:
+ inline bool operator==(const const_iterator &o) const
+ { return i == o.i; }
+ inline bool operator!=(const const_iterator &o) const
+ { return i != o.i; }
+ private:
+ inline operator bool() const { return false; }
+ };
+ friend class iterator;
+ class const_iterator
+ {
+ friend class iterator;
+ QMapData::Node *i;
+ public:
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef const T *pointer;
+ typedef const T &reference;
+ inline operator QMapData::Node *() const { return i; }
+ inline const_iterator() : i(0) { }
+ inline const_iterator(QMapData::Node *node) : i(node) { }
+ inline const_iterator(const iterator &o)
+ { i = o.i; }
+ inline const Key &key() const { return concrete(i)->key; }
+ inline const T &value() const { return concrete(i)->value; }
+ inline const T &operator*() const { return concrete(i)->value; }
+ inline const T *operator->() const { return &concrete(i)->value; }
+ inline bool operator==(const const_iterator &o) const { return i == o.i; }
+ inline bool operator!=(const const_iterator &o) const { return i != o.i; }
+ inline const_iterator &operator++() {
+ i = i->forward[0];
+ return *this;
+ }
+ inline const_iterator operator++(int) {
+ const_iterator r = *this;
+ i = i->forward[0];
+ return r;
+ }
+ inline const_iterator &operator--() {
+ i = i->backward;
+ return *this;
+ }
+ inline const_iterator operator--(int) {
+ const_iterator r = *this;
+ i = i->backward;
+ return r;
+ }
+ inline const_iterator operator+(int j) const
+ { const_iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
+ inline const_iterator operator-(int j) const { return operator+(-j); }
+ inline const_iterator &operator+=(int j) { return *this = *this + j; }
+ inline const_iterator &operator-=(int j) { return *this = *this - j; }
+ private:
+ inline operator bool() const { return false; }
+ };
+ friend class const_iterator;
+ inline iterator begin() { detach(); return iterator(e->forward[0]); }
+ inline const_iterator begin() const { return const_iterator(e->forward[0]); }
+ inline const_iterator constBegin() const { return const_iterator(e->forward[0]); }
+ inline iterator end() {
+ detach();
+ return iterator(e);
+ }
+ inline const_iterator end() const { return const_iterator(e); }
+ inline const_iterator constEnd() const { return const_iterator(e); }
+ iterator erase(iterator it);
+ typedef iterator Iterator;
+ typedef const_iterator ConstIterator;
+ inline int count() const { return d->size; }
+ iterator find(const Key &key);
+ const_iterator find(const Key &key) const;
+ const_iterator constFind(const Key &key) const;
+ iterator lowerBound(const Key &key);
+ const_iterator lowerBound(const Key &key) const;
+ iterator upperBound(const Key &key);
+ const_iterator upperBound(const Key &key) const;
+ iterator insert(const Key &key, const T &value);
+ iterator insertMulti(const Key &key, const T &value);
+ QMap<Key, T> &unite(const QMap<Key, T> &other);
+ typedef Key key_type;
+ typedef T mapped_type;
+ typedef ptrdiff_t difference_type;
+ typedef int size_type;
+ inline bool empty() const { return isEmpty(); }
+private:
+ void detach_helper();
+ void freeData(QMapData *d);
+ QMapData::Node *findNode(const Key &key) const;
+ QMapData::Node *mutableFindNode(QMapData::Node *update[], const Key &key) const;
+ QMapData::Node *node_create(QMapData *d, QMapData::Node *update[], const Key &key,
+ const T &value);
+};
+template <class Key, class T>
+inline QMap<Key, T> &QMap<Key, T>::operator=(const QMap<Key, T> &other)
+{
+ if (d != other.d) {
+ other.d->ref.ref();
+ if (!d->ref.deref())
+ freeData(d);
+ d = other.d;
+ if (!d->sharable)
+ detach_helper();
+ }
+ return *this;
+}
+template <class Key, class T>
+inline void QMap<Key, T>::clear()
+{
+ *this = QMap<Key, T>();
+}
+template <class Key, class T>
+inline typename QMapData::Node *
+QMap<Key, T>::node_create(QMapData *adt, QMapData::Node *aupdate[], const Key &akey, const T &avalue)
+{
+ QMapData::Node *abstractNode = adt->node_create(aupdate, payload());
+ Node *concreteNode = concrete(abstractNode);
+ new (&concreteNode->key) Key(akey);
+ new (&concreteNode->value) T(avalue);
+ return abstractNode;
+}
+template <class Key, class T>
+inline QMapData::Node *QMap<Key, T>::findNode(const Key &akey) const
+{
+ QMapData::Node *cur = e;
+ QMapData::Node *next = e;
+ for (int i = d->topLevel; i >= 0; i--) {
+ while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, akey))
+ cur = next;
+ }
+ if (next != e && !qMapLessThanKey<Key>(akey, concrete(next)->key)) {
+ return next;
+ } else {
+ return e;
+ }
+}
+template <class Key, class T>
+inline const T QMap<Key, T>::value(const Key &akey) const
+{
+ QMapData::Node *node;
+ if (d->size == 0 || (node = findNode(akey)) == e) {
+ return T();
+ } else {
+ return concrete(node)->value;
+ }
+}
+template <class Key, class T>
+inline const T QMap<Key, T>::value(const Key &akey, const T &adefaultValue) const
+{
+ QMapData::Node *node;
+ if (d->size == 0 || (node = findNode(akey)) == e) {
+ return adefaultValue;
+ } else {
+ return concrete(node)->value;
+ }
+}
+template <class Key, class T>
+inline const T QMap<Key, T>::operator[](const Key &akey) const
+{
+ return value(akey);
+}
+template <class Key, class T>
+inline T &QMap<Key, T>::operator[](const Key &akey)
+{
+ detach();
+ QMapData::Node *update[QMapData::LastLevel + 1];
+ QMapData::Node *node = mutableFindNode(update, akey);
+ if (node == e)
+ node = node_create(d, update, akey, T());
+ return concrete(node)->value;
+}
+template <class Key, class T>
+inline int QMap<Key, T>::count(const Key &akey) const
+{
+ int cnt = 0;
+ QMapData::Node *node = findNode(akey);
+ if (node != e) {
+ do {
+ ++cnt;
+ node = node->forward[0];
+ } while (node != e && !qMapLessThanKey<Key>(akey, concrete(node)->key));
+ }
+ return cnt;
+}
+template <class Key, class T>
+inline bool QMap<Key, T>::contains(const Key &akey) const
+{
+ return findNode(akey) != e;
+}
+template <class Key, class T>
+inline typename QMap<Key, T>::iterator QMap<Key, T>::insert(const Key &akey,
+ const T &avalue)
+{
+ detach();
+ QMapData::Node *update[QMapData::LastLevel + 1];
+ QMapData::Node *node = mutableFindNode(update, akey);
+ if (node == e) {
+ node = node_create(d, update, akey, avalue);
+ } else {
+ concrete(node)->value = avalue;
+ }
+ return iterator(node);
+}
+template <class Key, class T>
+inline typename QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const Key &akey,
+ const T &avalue)
+{
+ detach();
+ QMapData::Node *update[QMapData::LastLevel + 1];
+ mutableFindNode(update, akey);
+ return iterator(node_create(d, update, akey, avalue));
+}
+template <class Key, class T>
+inline typename QMap<Key, T>::const_iterator QMap<Key, T>::find(const Key &akey) const
+{
+ return const_iterator(findNode(akey));
+}
+template <class Key, class T>
+inline typename QMap<Key, T>::const_iterator QMap<Key, T>::constFind(const Key &akey) const
+{
+ return const_iterator(findNode(akey));
+}
+template <class Key, class T>
+inline typename QMap<Key, T>::iterator QMap<Key, T>::find(const Key &akey)
+{
+ detach();
+ return iterator(findNode(akey));
+}
+template <class Key, class T>
+inline QMap<Key, T> &QMap<Key, T>::unite(const QMap<Key, T> &other)
+{
+ QMap<Key, T> copy(other);
+ const_iterator it = copy.constEnd();
+ const const_iterator b = copy.constBegin();
+ while (it != b) {
+ --it;
+ insertMulti(it.key(), it.value());
+ }
+ return *this;
+}
+template <class Key, class T>
+ void QMap<Key, T>::freeData(QMapData *x)
+{
+ if (QTypeInfo<Key>::isComplex || QTypeInfo<T>::isComplex) {
+ QMapData::Node *y = reinterpret_cast<QMapData::Node *>(x);
+ QMapData::Node *cur = y;
+ QMapData::Node *next = cur->forward[0];
+ while (next != y) {
+ cur = next;
+ next = cur->forward[0];
+ Node *concreteNode = concrete(cur);
+ concreteNode->key.~Key();
+ concreteNode->value.~T();
+ }
+ }
+ x->continueFreeData(payload());
+}
+template <class Key, class T>
+ int QMap<Key, T>::remove(const Key &akey)
+{
+ detach();
+ QMapData::Node *update[QMapData::LastLevel + 1];
+ QMapData::Node *cur = e;
+ QMapData::Node *next = e;
+ int oldSize = d->size;
+ for (int i = d->topLevel; i >= 0; i--) {
+ while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, akey))
+ cur = next;
+ update[i] = cur;
+ }
+ if (next != e && !qMapLessThanKey<Key>(akey, concrete(next)->key)) {
+ bool deleteNext = true;
+ do {
+ cur = next;
+ next = cur->forward[0];
+ deleteNext = (next != e && !qMapLessThanKey<Key>(concrete(cur)->key, concrete(next)->key));
+ concrete(cur)->key.~Key();
+ concrete(cur)->value.~T();
+ d->node_delete(update, payload(), cur);
+ } while (deleteNext);
+ }
+ return oldSize - d->size;
+}
+template <class Key, class T>
+ T QMap<Key, T>::take(const Key &akey)
+{
+ detach();
+ QMapData::Node *update[QMapData::LastLevel + 1];
+ QMapData::Node *cur = e;
+ QMapData::Node *next = e;
+ for (int i = d->topLevel; i >= 0; i--) {
+ while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, akey))
+ cur = next;
+ update[i] = cur;
+ }
+ if (next != e && !qMapLessThanKey<Key>(akey, concrete(next)->key)) {
+ T t = concrete(next)->value;
+ concrete(next)->key.~Key();
+ concrete(next)->value.~T();
+ d->node_delete(update, payload(), next);
+ return t;
+ }
+ return T();
+}
+template <class Key, class T>
+ typename QMap<Key, T>::iterator QMap<Key, T>::erase(iterator it)
+{
+ QMapData::Node *update[QMapData::LastLevel + 1];
+ QMapData::Node *cur = e;
+ QMapData::Node *next = e;
+ if (it == iterator(e))
+ return it;
+ for (int i = d->topLevel; i >= 0; i--) {
+ while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, it.key()))
+ cur = next;
+ update[i] = cur;
+ }
+ while (next != e) {
+ cur = next;
+ next = cur->forward[0];
+ if (cur == it) {
+ concrete(cur)->key.~Key();
+ concrete(cur)->value.~T();
+ d->node_delete(update, payload(), cur);
+ return iterator(next);
+ }
+ for (int i = 0; i <= d->topLevel; ++i) {
+ if (update[i]->forward[i] != cur)
+ break;
+ update[i] = cur;
+ }
+ }
+ return end();
+}
+template <class Key, class T>
+ void QMap<Key, T>::detach_helper()
+{
+ union { QMapData *d; QMapData::Node *e; } x;
+ x.d = QMapData::createData();
+ if (d->size) {
+ x.d->insertInOrder = true;
+ QMapData::Node *update[QMapData::LastLevel + 1];
+ QMapData::Node *cur = e->forward[0];
+ update[0] = x.e;
+ while (cur != e) {
+ Node *concreteNode = concrete(cur);
+ node_create(x.d, update, concreteNode->key, concreteNode->value);
+ cur = cur->forward[0];
+ }
+ x.d->insertInOrder = false;
+ }
+ if (!d->ref.deref())
+ freeData(d);
+ d = x.d;
+}
+template <class Key, class T>
+ QMapData::Node *QMap<Key, T>::mutableFindNode(QMapData::Node *aupdate[],
+ const Key &akey) const
+{
+ QMapData::Node *cur = e;
+ QMapData::Node *next = e;
+ for (int i = d->topLevel; i >= 0; i--) {
+ while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, akey))
+ cur = next;
+ aupdate[i] = cur;
+ }
+ if (next != e && !qMapLessThanKey<Key>(akey, concrete(next)->key)) {
+ return next;
+ } else {
+ return e;
+ }
+}
+template <class Key, class T>
+ QList<Key> QMap<Key, T>::uniqueKeys() const
+{
+ QList<Key> res;
+ const_iterator i = begin();
+ if (i != end()) {
+ for (;;) {
+ const Key &aKey = i.key();
+ res.append(aKey);
+ do {
+ if (++i == end())
+ goto break_out_of_outer_loop;
+ } while (!(aKey < i.key()));
+ }
+ }
+break_out_of_outer_loop:
+ return res;
+}
+template <class Key, class T>
+ QList<Key> QMap<Key, T>::keys() const
+{
+ QList<Key> res;
+ const_iterator i = begin();
+ while (i != end()) {
+ res.append(i.key());
+ ++i;
+ }
+ return res;
+}
+template <class Key, class T>
+ QList<Key> QMap<Key, T>::keys(const T &avalue) const
+{
+ QList<Key> res;
+ const_iterator i = begin();
+ while (i != end()) {
+ if (i.value() == avalue)
+ res.append(i.key());
+ ++i;
+ }
+ return res;
+}
+template <class Key, class T>
+ const Key QMap<Key, T>::key(const T &avalue) const
+{
+ return key(avalue, Key());
+}
+template <class Key, class T>
+ const Key QMap<Key, T>::key(const T &avalue, const Key &defaultKey) const
+{
+ const_iterator i = begin();
+ while (i != end()) {
+ if (i.value() == avalue)
+ return i.key();
+ ++i;
+ }
+ return defaultKey;
+}
+template <class Key, class T>
+ QList<T> QMap<Key, T>::values() const
+{
+ QList<T> res;
+ const_iterator i = begin();
+ while (i != end()) {
+ res.append(i.value());
+ ++i;
+ }
+ return res;
+}
+template <class Key, class T>
+ QList<T> QMap<Key, T>::values(const Key &akey) const
+{
+ QList<T> res;
+ QMapData::Node *node = findNode(akey);
+ if (node != e) {
+ do {
+ res.append(concrete(node)->value);
+ node = node->forward[0];
+ } while (node != e && !qMapLessThanKey<Key>(akey, concrete(node)->key));
+ }
+ return res;
+}
+template <class Key, class T>
+inline typename QMap<Key, T>::const_iterator
+QMap<Key, T>::lowerBound(const Key &akey) const
+{
+ QMapData::Node *update[QMapData::LastLevel + 1];
+ mutableFindNode(update, akey);
+ return const_iterator(update[0]->forward[0]);
+}
+template <class Key, class T>
+inline typename QMap<Key, T>::iterator QMap<Key, T>::lowerBound(const Key &akey)
+{
+ detach();
+ return static_cast<QMapData::Node *>(const_cast<const QMap *>(this)->lowerBound(akey));
+}
+template <class Key, class T>
+inline typename QMap<Key, T>::const_iterator
+QMap<Key, T>::upperBound(const Key &akey) const
+{
+ QMapData::Node *update[QMapData::LastLevel + 1];
+ mutableFindNode(update, akey);
+ QMapData::Node *node = update[0]->forward[0];
+ while (node != e && !qMapLessThanKey<Key>(akey, concrete(node)->key))
+ node = node->forward[0];
+ return const_iterator(node);
+}
+template <class Key, class T>
+inline typename QMap<Key, T>::iterator QMap<Key, T>::upperBound(const Key &akey)
+{
+ detach();
+ return static_cast<QMapData::Node *>(const_cast<const QMap *>(this)->upperBound(akey));
+}
+template <class Key, class T>
+ bool QMap<Key, T>::operator==(const QMap<Key, T> &other) const
+{
+ if (size() != other.size())
+ return false;
+ if (d == other.d)
+ return true;
+ const_iterator it1 = begin();
+ const_iterator it2 = other.begin();
+ while (it1 != end()) {
+ if (!(it1.value() == it2.value()) || qMapLessThanKey(it1.key(), it2.key()) || qMapLessThanKey(it2.key(), it1.key()))
+ return false;
+ ++it2;
+ ++it1;
+ }
+ return true;
+}
+template <class Key, class T>
+ QMap<Key, T>::QMap(const std::map<Key, T> &other)
+{
+ d = QMapData::createData();
+ d->insertInOrder = true;
+ typename std::map<Key,T>::const_iterator it = other.end();
+ while (it != other.begin()) {
+ --it;
+ insert((*it).first, (*it).second);
+ }
+ d->insertInOrder = false;
+}
+template <class Key, class T>
+ std::map<Key, T> QMap<Key, T>::toStdMap() const
+{
+ std::map<Key, T> map;
+ const_iterator it = end();
+ while (it != begin()) {
+ --it;
+ map.insert(std::pair<Key, T>(it.key(), it.value()));
+ }
+ return map;
+}
+template <class Key, class T>
+class QMultiMap : public QMap<Key, T>
+{
+public:
+ QMultiMap() {}
+ QMultiMap(const QMap<Key, T> &other) : QMap<Key, T>(other) {}
+ inline typename QMap<Key, T>::iterator replace(const Key &key, const T &value)
+ { return QMap<Key, T>::insert(key, value); }
+ inline typename QMap<Key, T>::iterator insert(const Key &key, const T &value)
+ { return QMap<Key, T>::insertMulti(key, value); }
+ inline QMultiMap &operator+=(const QMultiMap &other)
+ { unite(other); return *this; }
+ inline QMultiMap operator+(const QMultiMap &other) const
+ { QMultiMap result = *this; result += other; return result; }
+ using QMap<Key, T>::contains;
+ using QMap<Key, T>::remove;
+ using QMap<Key, T>::count;
+ using QMap<Key, T>::find;
+ using QMap<Key, T>::constFind;
+ bool contains(const Key &key, const T &value) const;
+ int remove(const Key &key, const T &value);
+ int count(const Key &key, const T &value) const;
+ typename QMap<Key, T>::iterator find(const Key &key, const T &value) {
+ typename QMap<Key, T>::iterator i(find(key));
+ typename QMap<Key, T>::iterator end(this->end());
+ while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
+ if (i.value() == value)
+ return i;
+ ++i;
+ }
+ return end;
+ }
+ typename QMap<Key, T>::const_iterator find(const Key &key, const T &value) const {
+ typename QMap<Key, T>::const_iterator i(constFind(key));
+ typename QMap<Key, T>::const_iterator end(QMap<Key, T>::constEnd());
+ while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
+ if (i.value() == value)
+ return i;
+ ++i;
+ }
+ return end;
+ }
+ typename QMap<Key, T>::const_iterator constFind(const Key &key, const T &value) const
+ { return find(key, value); }
+private:
+ T &operator[](const Key &key);
+ const T operator[](const Key &key) const;
+};
+template <class Key, class T>
+inline bool QMultiMap<Key, T>::contains(const Key &key, const T &value) const
+{
+ return constFind(key, value) != QMap<Key, T>::constEnd();
+}
+template <class Key, class T>
+inline int QMultiMap<Key, T>::remove(const Key &key, const T &value)
+{
+ int n = 0;
+ typename QMap<Key, T>::iterator i(find(key));
+ typename QMap<Key, T>::const_iterator end(QMap<Key, T>::constEnd());
+ while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
+ if (i.value() == value) {
+ i = erase(i);
+ ++n;
+ } else {
+ ++i;
+ }
+ }
+ return n;
+}
+template <class Key, class T>
+inline int QMultiMap<Key, T>::count(const Key &key, const T &value) const
+{
+ int n = 0;
+ typename QMap<Key, T>::const_iterator i(constFind(key));
+ typename QMap<Key, T>::const_iterator end(QMap<Key, T>::constEnd());
+ while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
+ if (i.value() == value)
+ ++n;
+ ++i;
+ }
+ return n;
+}
+template <class Key, class T> class QMapIterator { typedef typename QMap<Key,T>::const_iterator const_iterator; typedef const_iterator Item; QMap<Key,T> c; const_iterator i, n; inline bool item_exists() const { return n != c.constEnd(); } public: inline QMapIterator(const QMap<Key,T> &container) : c(container), i(c.constBegin()), n(c.constEnd()) {} inline QMapIterator &operator=(const QMap<Key,T> &container) { c = container; i = c.constBegin(); n = c.constEnd(); return *this; } inline void toFront() { i = c.constBegin(); n = c.constEnd(); } inline void toBack() { i = c.constEnd(); n = c.constEnd(); } inline bool hasNext() const { return i != c.constEnd(); } inline Item next() { n = i++; return n; } inline Item peekNext() const { return i; } inline bool hasPrevious() const { return i != c.constBegin(); } inline Item previous() { n = --i; return n; } inline Item peekPrevious() const { const_iterator p = i; return --p; } inline const T &value() const { qt_noop(); return *n; } inline const Key &key() const { qt_noop(); return n.key(); } inline bool findNext(const T &t) { while ((n = i) != c.constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (i != c.constBegin()) if (*(n = --i) == t) return true; n = c.constEnd(); return false; } };
+template <class Key, class T> class QMutableMapIterator { typedef typename QMap<Key,T>::iterator iterator; typedef typename QMap<Key,T>::const_iterator const_iterator; typedef iterator Item; QMap<Key,T> *c; iterator i, n; inline bool item_exists() const { return const_iterator(n) != c->constEnd(); } public: inline QMutableMapIterator(QMap<Key,T> &container) : c(&container) { c->setSharable(false); i = c->begin(); n = c->end(); } inline ~QMutableMapIterator() { c->setSharable(true); } inline QMutableMapIterator &operator=(QMap<Key,T> &container) { c->setSharable(true); c = &container; c->setSharable(false); i = c->begin(); n = c->end(); return *this; } inline void toFront() { i = c->begin(); n = c->end(); } inline void toBack() { i = c->end(); n = c->end(); } inline bool hasNext() const { return const_iterator(i) != c->constEnd(); } inline Item next() { n = i++; return n; } inline Item peekNext() const { return i; } inline bool hasPrevious() const { return const_iterator(i) != c->constBegin(); } inline Item previous() { n = --i; return n; } inline Item peekPrevious() const { iterator p = i; return --p; } inline void remove() { if (const_iterator(n) != c->constEnd()) { i = c->erase(n); n = c->end(); } } inline void setValue(const T &t) { if (const_iterator(n) != c->constEnd()) *n = t; } inline T &value() { qt_noop(); return *n; } inline const T &value() const { qt_noop(); return *n; } inline const Key &key() const { qt_noop(); return n.key(); } inline bool findNext(const T &t) { while (const_iterator(n = i) != c->constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (const_iterator(i) != c->constBegin()) if (*(n = --i) == t) return true; n = c->end(); return false; } };
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QDataStream;
+class QDate;
+class QDateTime;
+class QTime;
+class QVariant;
+class QTextStream;
+class QTextStreamPrivate;
+class QLocale;
+class __attribute__((visibility("default"))) QSystemLocale
+{
+public:
+ QSystemLocale();
+ virtual ~QSystemLocale();
+ enum QueryType {
+ LanguageId,
+ CountryId,
+ DecimalPoint,
+ GroupSeparator,
+ ZeroDigit,
+ NegativeSign,
+ DateFormatLong,
+ DateFormatShort,
+ TimeFormatLong,
+ TimeFormatShort,
+ DayNameLong,
+ DayNameShort,
+ MonthNameLong,
+ MonthNameShort,
+ DateToStringLong,
+ DateToStringShort,
+ TimeToStringLong,
+ TimeToStringShort,
+ DateTimeFormatLong,
+ DateTimeFormatShort,
+ DateTimeToStringLong,
+ DateTimeToStringShort,
+ MeasurementSystem,
+ PositiveSign,
+ AMText,
+ PMText
+ };
+ virtual QVariant query(QueryType type, QVariant in) const;
+ virtual QLocale fallbackLocale() const;
+};
+struct QLocalePrivate;
+class __attribute__((visibility("default"))) QLocale
+{
+ public: static const QMetaObject staticMetaObject; private:
+ friend class QString;
+ friend class QByteArray;
+ friend class QIntValidator;
+ friend class QDoubleValidator;
+ friend class QTextStream;
+ friend class QTextStreamPrivate;
+public:
+ enum Language {
+ C = 1,
+ Abkhazian = 2,
+ Afan = 3,
+ Afar = 4,
+ Afrikaans = 5,
+ Albanian = 6,
+ Amharic = 7,
+ Arabic = 8,
+ Armenian = 9,
+ Assamese = 10,
+ Aymara = 11,
+ Azerbaijani = 12,
+ Bashkir = 13,
+ Basque = 14,
+ Bengali = 15,
+ Bhutani = 16,
+ Bihari = 17,
+ Bislama = 18,
+ Breton = 19,
+ Bulgarian = 20,
+ Burmese = 21,
+ Byelorussian = 22,
+ Cambodian = 23,
+ Catalan = 24,
+ Chinese = 25,
+ Corsican = 26,
+ Croatian = 27,
+ Czech = 28,
+ Danish = 29,
+ Dutch = 30,
+ English = 31,
+ Esperanto = 32,
+ Estonian = 33,
+ Faroese = 34,
+ FijiLanguage = 35,
+ Finnish = 36,
+ French = 37,
+ Frisian = 38,
+ Gaelic = 39,
+ Galician = 40,
+ Georgian = 41,
+ German = 42,
+ Greek = 43,
+ Greenlandic = 44,
+ Guarani = 45,
+ Gujarati = 46,
+ Hausa = 47,
+ Hebrew = 48,
+ Hindi = 49,
+ Hungarian = 50,
+ Icelandic = 51,
+ Indonesian = 52,
+ Interlingua = 53,
+ Interlingue = 54,
+ Inuktitut = 55,
+ Inupiak = 56,
+ Irish = 57,
+ Italian = 58,
+ Japanese = 59,
+ Javanese = 60,
+ Kannada = 61,
+ Kashmiri = 62,
+ Kazakh = 63,
+ Kinyarwanda = 64,
+ Kirghiz = 65,
+ Korean = 66,
+ Kurdish = 67,
+ Kurundi = 68,
+ Laothian = 69,
+ Latin = 70,
+ Latvian = 71,
+ Lingala = 72,
+ Lithuanian = 73,
+ Macedonian = 74,
+ Malagasy = 75,
+ Malay = 76,
+ Malayalam = 77,
+ Maltese = 78,
+ Maori = 79,
+ Marathi = 80,
+ Moldavian = 81,
+ Mongolian = 82,
+ NauruLanguage = 83,
+ Nepali = 84,
+ Norwegian = 85,
+ NorwegianBokmal = Norwegian,
+ Occitan = 86,
+ Oriya = 87,
+ Pashto = 88,
+ Persian = 89,
+ Polish = 90,
+ Portuguese = 91,
+ Punjabi = 92,
+ Quechua = 93,
+ RhaetoRomance = 94,
+ Romanian = 95,
+ Russian = 96,
+ Samoan = 97,
+ Sangho = 98,
+ Sanskrit = 99,
+ Serbian = 100,
+ SerboCroatian = 101,
+ Sesotho = 102,
+ Setswana = 103,
+ Shona = 104,
+ Sindhi = 105,
+ Singhalese = 106,
+ Siswati = 107,
+ Slovak = 108,
+ Slovenian = 109,
+ Somali = 110,
+ Spanish = 111,
+ Sundanese = 112,
+ Swahili = 113,
+ Swedish = 114,
+ Tagalog = 115,
+ Tajik = 116,
+ Tamil = 117,
+ Tatar = 118,
+ Telugu = 119,
+ Thai = 120,
+ Tibetan = 121,
+ Tigrinya = 122,
+ TongaLanguage = 123,
+ Tsonga = 124,
+ Turkish = 125,
+ Turkmen = 126,
+ Twi = 127,
+ Uigur = 128,
+ Ukrainian = 129,
+ Urdu = 130,
+ Uzbek = 131,
+ Vietnamese = 132,
+ Volapuk = 133,
+ Welsh = 134,
+ Wolof = 135,
+ Xhosa = 136,
+ Yiddish = 137,
+ Yoruba = 138,
+ Zhuang = 139,
+ Zulu = 140,
+ NorwegianNynorsk = 141,
+ Nynorsk = NorwegianNynorsk,
+ Bosnian = 142,
+ Divehi = 143,
+ Manx = 144,
+ Cornish = 145,
+ Akan = 146,
+ Konkani = 147,
+ Ga = 148,
+ Igbo = 149,
+ Kamba = 150,
+ Syriac = 151,
+ Blin = 152,
+ Geez = 153,
+ Koro = 154,
+ Sidamo = 155,
+ Atsam = 156,
+ Tigre = 157,
+ Jju = 158,
+ Friulian = 159,
+ Venda = 160,
+ Ewe = 161,
+ Walamo = 162,
+ Hawaiian = 163,
+ Tyap = 164,
+ Chewa = 165,
+ LastLanguage = Chewa
+ };
+ enum Country {
+ AnyCountry = 0,
+ Afghanistan = 1,
+ Albania = 2,
+ Algeria = 3,
+ AmericanSamoa = 4,
+ Andorra = 5,
+ Angola = 6,
+ Anguilla = 7,
+ Antarctica = 8,
+ AntiguaAndBarbuda = 9,
+ Argentina = 10,
+ Armenia = 11,
+ Aruba = 12,
+ Australia = 13,
+ Austria = 14,
+ Azerbaijan = 15,
+ Bahamas = 16,
+ Bahrain = 17,
+ Bangladesh = 18,
+ Barbados = 19,
+ Belarus = 20,
+ Belgium = 21,
+ Belize = 22,
+ Benin = 23,
+ Bermuda = 24,
+ Bhutan = 25,
+ Bolivia = 26,
+ BosniaAndHerzegowina = 27,
+ Botswana = 28,
+ BouvetIsland = 29,
+ Brazil = 30,
+ BritishIndianOceanTerritory = 31,
+ BruneiDarussalam = 32,
+ Bulgaria = 33,
+ BurkinaFaso = 34,
+ Burundi = 35,
+ Cambodia = 36,
+ Cameroon = 37,
+ Canada = 38,
+ CapeVerde = 39,
+ CaymanIslands = 40,
+ CentralAfricanRepublic = 41,
+ Chad = 42,
+ Chile = 43,
+ China = 44,
+ ChristmasIsland = 45,
+ CocosIslands = 46,
+ Colombia = 47,
+ Comoros = 48,
+ DemocraticRepublicOfCongo = 49,
+ PeoplesRepublicOfCongo = 50,
+ CookIslands = 51,
+ CostaRica = 52,
+ IvoryCoast = 53,
+ Croatia = 54,
+ Cuba = 55,
+ Cyprus = 56,
+ CzechRepublic = 57,
+ Denmark = 58,
+ Djibouti = 59,
+ Dominica = 60,
+ DominicanRepublic = 61,
+ EastTimor = 62,
+ Ecuador = 63,
+ Egypt = 64,
+ ElSalvador = 65,
+ EquatorialGuinea = 66,
+ Eritrea = 67,
+ Estonia = 68,
+ Ethiopia = 69,
+ FalklandIslands = 70,
+ FaroeIslands = 71,
+ FijiCountry = 72,
+ Finland = 73,
+ France = 74,
+ MetropolitanFrance = 75,
+ FrenchGuiana = 76,
+ FrenchPolynesia = 77,
+ FrenchSouthernTerritories = 78,
+ Gabon = 79,
+ Gambia = 80,
+ Georgia = 81,
+ Germany = 82,
+ Ghana = 83,
+ Gibraltar = 84,
+ Greece = 85,
+ Greenland = 86,
+ Grenada = 87,
+ Guadeloupe = 88,
+ Guam = 89,
+ Guatemala = 90,
+ Guinea = 91,
+ GuineaBissau = 92,
+ Guyana = 93,
+ Haiti = 94,
+ HeardAndMcDonaldIslands = 95,
+ Honduras = 96,
+ HongKong = 97,
+ Hungary = 98,
+ Iceland = 99,
+ India = 100,
+ Indonesia = 101,
+ Iran = 102,
+ Iraq = 103,
+ Ireland = 104,
+ Israel = 105,
+ Italy = 106,
+ Jamaica = 107,
+ Japan = 108,
+ Jordan = 109,
+ Kazakhstan = 110,
+ Kenya = 111,
+ Kiribati = 112,
+ DemocraticRepublicOfKorea = 113,
+ RepublicOfKorea = 114,
+ Kuwait = 115,
+ Kyrgyzstan = 116,
+ Lao = 117,
+ Latvia = 118,
+ Lebanon = 119,
+ Lesotho = 120,
+ Liberia = 121,
+ LibyanArabJamahiriya = 122,
+ Liechtenstein = 123,
+ Lithuania = 124,
+ Luxembourg = 125,
+ Macau = 126,
+ Macedonia = 127,
+ Madagascar = 128,
+ Malawi = 129,
+ Malaysia = 130,
+ Maldives = 131,
+ Mali = 132,
+ Malta = 133,
+ MarshallIslands = 134,
+ Martinique = 135,
+ Mauritania = 136,
+ Mauritius = 137,
+ Mayotte = 138,
+ Mexico = 139,
+ Micronesia = 140,
+ Moldova = 141,
+ Monaco = 142,
+ Mongolia = 143,
+ Montserrat = 144,
+ Morocco = 145,
+ Mozambique = 146,
+ Myanmar = 147,
+ Namibia = 148,
+ NauruCountry = 149,
+ Nepal = 150,
+ Netherlands = 151,
+ NetherlandsAntilles = 152,
+ NewCaledonia = 153,
+ NewZealand = 154,
+ Nicaragua = 155,
+ Niger = 156,
+ Nigeria = 157,
+ Niue = 158,
+ NorfolkIsland = 159,
+ NorthernMarianaIslands = 160,
+ Norway = 161,
+ Oman = 162,
+ Pakistan = 163,
+ Palau = 164,
+ PalestinianTerritory = 165,
+ Panama = 166,
+ PapuaNewGuinea = 167,
+ Paraguay = 168,
+ Peru = 169,
+ Philippines = 170,
+ Pitcairn = 171,
+ Poland = 172,
+ Portugal = 173,
+ PuertoRico = 174,
+ Qatar = 175,
+ Reunion = 176,
+ Romania = 177,
+ RussianFederation = 178,
+ Rwanda = 179,
+ SaintKittsAndNevis = 180,
+ StLucia = 181,
+ StVincentAndTheGrenadines = 182,
+ Samoa = 183,
+ SanMarino = 184,
+ SaoTomeAndPrincipe = 185,
+ SaudiArabia = 186,
+ Senegal = 187,
+ Seychelles = 188,
+ SierraLeone = 189,
+ Singapore = 190,
+ Slovakia = 191,
+ Slovenia = 192,
+ SolomonIslands = 193,
+ Somalia = 194,
+ SouthAfrica = 195,
+ SouthGeorgiaAndTheSouthSandwichIslands = 196,
+ Spain = 197,
+ SriLanka = 198,
+ StHelena = 199,
+ StPierreAndMiquelon = 200,
+ Sudan = 201,
+ Suriname = 202,
+ SvalbardAndJanMayenIslands = 203,
+ Swaziland = 204,
+ Sweden = 205,
+ Switzerland = 206,
+ SyrianArabRepublic = 207,
+ Taiwan = 208,
+ Tajikistan = 209,
+ Tanzania = 210,
+ Thailand = 211,
+ Togo = 212,
+ Tokelau = 213,
+ TongaCountry = 214,
+ TrinidadAndTobago = 215,
+ Tunisia = 216,
+ Turkey = 217,
+ Turkmenistan = 218,
+ TurksAndCaicosIslands = 219,
+ Tuvalu = 220,
+ Uganda = 221,
+ Ukraine = 222,
+ UnitedArabEmirates = 223,
+ UnitedKingdom = 224,
+ UnitedStates = 225,
+ UnitedStatesMinorOutlyingIslands = 226,
+ Uruguay = 227,
+ Uzbekistan = 228,
+ Vanuatu = 229,
+ VaticanCityState = 230,
+ Venezuela = 231,
+ VietNam = 232,
+ BritishVirginIslands = 233,
+ USVirginIslands = 234,
+ WallisAndFutunaIslands = 235,
+ WesternSahara = 236,
+ Yemen = 237,
+ Yugoslavia = 238,
+ Zambia = 239,
+ Zimbabwe = 240,
+ SerbiaAndMontenegro = 241,
+ LastCountry = SerbiaAndMontenegro
+ };
+ enum MeasurementSystem { MetricSystem, ImperialSystem };
+ enum FormatType { LongFormat, ShortFormat, NarrowFormat };
+ enum NumberOption {
+ OmitGroupSeparator = 0x01,
+ RejectGroupSeparator = 0x02
+ };
+ typedef QFlags<NumberOption> NumberOptions;
+ QLocale();
+ QLocale(const QString &name);
+ QLocale(Language language, Country country = AnyCountry);
+ QLocale(const QLocale &other);
+ QLocale &operator=(const QLocale &other);
+ Language language() const;
+ Country country() const;
+ QString name() const;
+ short toShort(const QString &s, bool *ok = 0, int base = 0) const;
+ ushort toUShort(const QString &s, bool *ok = 0, int base = 0) const;
+ int toInt(const QString &s, bool *ok = 0, int base = 0) const;
+ uint toUInt(const QString &s, bool *ok = 0, int base = 0) const;
+ qlonglong toLongLong(const QString &s, bool *ok = 0, int base = 0) const;
+ qlonglong toULongLong(const QString &s, bool *ok = 0, int base = 0) const;
+ float toFloat(const QString &s, bool *ok = 0) const;
+ double toDouble(const QString &s, bool *ok = 0) const;
+ QString toString(qlonglong i) const;
+ QString toString(qulonglong i) const;
+ inline QString toString(short i) const;
+ inline QString toString(ushort i) const;
+ inline QString toString(int i) const;
+ inline QString toString(uint i) const;
+ QString toString(double i, char f = 'g', int prec = 6) const;
+ inline QString toString(float i, char f = 'g', int prec = 6) const;
+ QString toString(const QDate &date, const QString &formatStr) const;
+ QString toString(const QDate &date, FormatType format = LongFormat) const;
+ QString toString(const QTime &time, const QString &formatStr) const;
+ QString toString(const QTime &time, FormatType format = LongFormat) const;
+ QString toString(const QDateTime &dateTime, FormatType format = LongFormat) const;
+ QString toString(const QDateTime &dateTime, const QString &format) const;
+ QString dateFormat(FormatType format = LongFormat) const;
+ QString timeFormat(FormatType format = LongFormat) const;
+ QString dateTimeFormat(FormatType format = LongFormat) const;
+ QDate toDate(const QString &string, FormatType = LongFormat) const;
+ QTime toTime(const QString &string, FormatType = LongFormat) const;
+ QDateTime toDateTime(const QString &string, FormatType format = LongFormat) const;
+ QDate toDate(const QString &string, const QString &format) const;
+ QTime toTime(const QString &string, const QString &format) const;
+ QDateTime toDateTime(const QString &string, const QString &format) const;
+ QChar decimalPoint() const;
+ QChar groupSeparator() const;
+ QChar percent() const;
+ QChar zeroDigit() const;
+ QChar negativeSign() const;
+ QChar positiveSign() const;
+ QChar exponential() const;
+ QString monthName(int, FormatType format = LongFormat) const;
+ QString standaloneMonthName(int, FormatType format = LongFormat) const;
+ QString dayName(int, FormatType format = LongFormat) const;
+ QString standaloneDayName(int, FormatType format = LongFormat) const;
+ QString amText() const;
+ QString pmText() const;
+ MeasurementSystem measurementSystem() const;
+ inline bool operator==(const QLocale &other) const;
+ inline bool operator!=(const QLocale &other) const;
+ static QString languageToString(Language language);
+ static QString countryToString(Country country);
+ static void setDefault(const QLocale &locale);
+ static QLocale c() { return QLocale(C); }
+ static QLocale system();
+ static QList<Country> countriesForLanguage(Language lang);
+ void setNumberOptions(NumberOptions options);
+ NumberOptions numberOptions() const;
+ struct Data {
+ quint16 index;
+ quint16 numberOptions;
+ }
+ ;
+private:
+ friend struct QLocalePrivate;
+ union {
+ void *v;
+ Data p;
+ };
+ const QLocalePrivate *d() const;
+};
+template <> class QTypeInfo<QLocale> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QLocale)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QLocale"; } };
+inline QFlags<QLocale::NumberOptions::enum_type> operator|(QLocale::NumberOptions::enum_type f1, QLocale::NumberOptions::enum_type f2) { return QFlags<QLocale::NumberOptions::enum_type>(f1) | f2; } inline QFlags<QLocale::NumberOptions::enum_type> operator|(QLocale::NumberOptions::enum_type f1, QFlags<QLocale::NumberOptions::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QLocale::NumberOptions::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QString QLocale::toString(short i) const
+ { return toString(qlonglong(i)); }
+inline QString QLocale::toString(ushort i) const
+ { return toString(qulonglong(i)); }
+inline QString QLocale::toString(int i) const
+ { return toString(qlonglong(i)); }
+inline QString QLocale::toString(uint i) const
+ { return toString(qulonglong(i)); }
+inline QString QLocale::toString(float i, char f, int prec) const
+ { return toString(double(i), f, prec); }
+inline bool QLocale::operator==(const QLocale &other) const
+ { return d() == other.d() && numberOptions() == other.numberOptions(); }
+inline bool QLocale::operator!=(const QLocale &other) const
+ { return d() != other.d() || numberOptions() != other.numberOptions(); }
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QLocale &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QLocale &);
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QTextCodec;
+class QTextDecoder;
+class QTextStreamPrivate;
+class __attribute__((visibility("default"))) QTextStream
+{
+ inline QTextStreamPrivate* d_func() { return reinterpret_cast<QTextStreamPrivate *>(d_ptr); } inline const QTextStreamPrivate* d_func() const { return reinterpret_cast<const QTextStreamPrivate *>(d_ptr); } friend class QTextStreamPrivate;
+public:
+ enum RealNumberNotation {
+ SmartNotation,
+ FixedNotation,
+ ScientificNotation
+ };
+ enum FieldAlignment {
+ AlignLeft,
+ AlignRight,
+ AlignCenter,
+ AlignAccountingStyle
+ };
+ enum Status {
+ Ok,
+ ReadPastEnd,
+ ReadCorruptData
+ };
+ enum NumberFlag {
+ ShowBase = 0x1,
+ ForcePoint = 0x2,
+ ForceSign = 0x4,
+ UppercaseBase = 0x8,
+ UppercaseDigits = 0x10
+ };
+ typedef QFlags<NumberFlag> NumberFlags;
+ QTextStream();
+ explicit QTextStream(QIODevice *device);
+ explicit QTextStream(FILE *fileHandle, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
+ explicit QTextStream(QString *string, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
+ explicit QTextStream(QByteArray *array, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
+ explicit QTextStream(const QByteArray &array, QIODevice::OpenMode openMode = QIODevice::ReadOnly);
+ virtual ~QTextStream();
+ void setCodec(QTextCodec *codec);
+ void setCodec(const char *codecName);
+ QTextCodec *codec() const;
+ void setAutoDetectUnicode(bool enabled);
+ bool autoDetectUnicode() const;
+ void setGenerateByteOrderMark(bool generate);
+ bool generateByteOrderMark() const;
+ void setLocale(const QLocale &locale);
+ QLocale locale() const;
+ void setDevice(QIODevice *device);
+ QIODevice *device() const;
+ void setString(QString *string, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
+ QString *string() const;
+ Status status() const;
+ void setStatus(Status status);
+ void resetStatus();
+ bool atEnd() const;
+ void reset();
+ void flush();
+ bool seek(qint64 pos);
+ qint64 pos() const;
+ void skipWhiteSpace();
+ QString readLine(qint64 maxlen = 0);
+ QString readAll();
+ QString read(qint64 maxlen);
+ void setFieldAlignment(FieldAlignment alignment);
+ FieldAlignment fieldAlignment() const;
+ void setPadChar(QChar ch);
+ QChar padChar() const;
+ void setFieldWidth(int width);
+ int fieldWidth() const;
+ void setNumberFlags(NumberFlags flags);
+ NumberFlags numberFlags() const;
+ void setIntegerBase(int base);
+ int integerBase() const;
+ void setRealNumberNotation(RealNumberNotation notation);
+ RealNumberNotation realNumberNotation() const;
+ void setRealNumberPrecision(int precision);
+ int realNumberPrecision() const;
+ QTextStream &operator>>(QChar &ch);
+ QTextStream &operator>>(char &ch);
+ QTextStream &operator>>(signed short &i);
+ QTextStream &operator>>(unsigned short &i);
+ QTextStream &operator>>(signed int &i);
+ QTextStream &operator>>(unsigned int &i);
+ QTextStream &operator>>(signed long &i);
+ QTextStream &operator>>(unsigned long &i);
+ QTextStream &operator>>(qlonglong &i);
+ QTextStream &operator>>(qulonglong &i);
+ QTextStream &operator>>(float &f);
+ QTextStream &operator>>(double &f);
+ QTextStream &operator>>(QString &s);
+ QTextStream &operator>>(QByteArray &array);
+ QTextStream &operator>>(char *c);
+ QTextStream &operator<<(QBool b);
+ QTextStream &operator<<(QChar ch);
+ QTextStream &operator<<(char ch);
+ QTextStream &operator<<(signed short i);
+ QTextStream &operator<<(unsigned short i);
+ QTextStream &operator<<(signed int i);
+ QTextStream &operator<<(unsigned int i);
+ QTextStream &operator<<(signed long i);
+ QTextStream &operator<<(unsigned long i);
+ QTextStream &operator<<(qlonglong i);
+ QTextStream &operator<<(qulonglong i);
+ QTextStream &operator<<(float f);
+ QTextStream &operator<<(double f);
+ QTextStream &operator<<(const QString &s);
+ QTextStream &operator<<(const QByteArray &array);
+ QTextStream &operator<<(const char *c);
+ QTextStream &operator<<(const void *ptr);
+private:
+ QTextStream(const QTextStream &); QTextStream &operator=(const QTextStream &);
+ QTextStreamPrivate *d_ptr;
+};
+inline QFlags<QTextStream::NumberFlags::enum_type> operator|(QTextStream::NumberFlags::enum_type f1, QTextStream::NumberFlags::enum_type f2) { return QFlags<QTextStream::NumberFlags::enum_type>(f1) | f2; } inline QFlags<QTextStream::NumberFlags::enum_type> operator|(QTextStream::NumberFlags::enum_type f1, QFlags<QTextStream::NumberFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QTextStream::NumberFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+typedef QTextStream & (*QTextStreamFunction)(QTextStream &);
+typedef void (QTextStream::*QTSMFI)(int);
+typedef void (QTextStream::*QTSMFC)(QChar);
+class __attribute__((visibility("default"))) QTextStreamManipulator
+{
+public:
+ QTextStreamManipulator(QTSMFI m, int a) { mf = m; mc = 0; arg = a; }
+ QTextStreamManipulator(QTSMFC m, QChar c) { mf = 0; mc = m; ch = c; }
+ void exec(QTextStream &s) { if (mf) { (s.*mf)(arg); } else { (s.*mc)(ch); } }
+private:
+ QTSMFI mf;
+ QTSMFC mc;
+ int arg;
+ QChar ch;
+};
+inline QTextStream &operator>>(QTextStream &s, QTextStreamFunction f)
+{ return (*f)(s); }
+inline QTextStream &operator<<(QTextStream &s, QTextStreamFunction f)
+{ return (*f)(s); }
+inline QTextStream &operator<<(QTextStream &s, QTextStreamManipulator m)
+{ m.exec(s); return s; }
+__attribute__((visibility("default"))) QTextStream &bin(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &oct(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &dec(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &hex(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &showbase(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &forcesign(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &forcepoint(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &noshowbase(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &noforcesign(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &noforcepoint(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &uppercasebase(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &uppercasedigits(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &lowercasebase(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &lowercasedigits(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &fixed(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &scientific(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &left(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &right(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream ¢er(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &endl(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &flush(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &reset(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &bom(QTextStream &s);
+__attribute__((visibility("default"))) QTextStream &ws(QTextStream &s);
+inline QTextStreamManipulator qSetFieldWidth(int width)
+{
+ QTSMFI func = &QTextStream::setFieldWidth;
+ return QTextStreamManipulator(func,width);
+}
+inline QTextStreamManipulator qSetPadChar(QChar ch)
+{
+ QTSMFC func = &QTextStream::setPadChar;
+ return QTextStreamManipulator(func, ch);
+}
+inline QTextStreamManipulator qSetRealNumberPrecision(int precision)
+{
+ QTSMFI func = &QTextStream::setRealNumberPrecision;
+ return QTextStreamManipulator(func, precision);
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _T1, typename _T2>
+ inline void
+ _Construct(_T1* __p, const _T2& __value)
+ {
+ ::new(static_cast<void*>(__p)) _T1(__value);
+ }
+ template<typename _Tp>
+ inline void
+ _Destroy(_Tp* __pointer)
+ { __pointer->~_Tp(); }
+ template<typename _ForwardIterator>
+ inline void
+ _Destroy(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _Value_type;
+ if (!__has_trivial_destructor(_Value_type))
+ for (; __first != __last; ++__first)
+ std::_Destroy(&*__first);
+ }
+ template <typename _Tp> class allocator;
+ template<typename _ForwardIterator, typename _Allocator>
+ void
+ _Destroy(_ForwardIterator __first, _ForwardIterator __last,
+ _Allocator& __alloc)
+ {
+ for (; __first != __last; ++__first)
+ __alloc.destroy(&*__first);
+ }
+ template<typename _ForwardIterator, typename _Tp>
+ inline void
+ _Destroy(_ForwardIterator __first, _ForwardIterator __last,
+ allocator<_Tp>&)
+ {
+ _Destroy(__first, __last);
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<bool>
+ struct __uninitialized_copy
+ {
+ template<typename _InputIterator, typename _ForwardIterator>
+ static _ForwardIterator
+ uninitialized_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result)
+ {
+ _ForwardIterator __cur = __result;
+ try
+ {
+ for (; __first != __last; ++__first, ++__cur)
+ ::new(static_cast<void*>(&*__cur)) typename
+ iterator_traits<_ForwardIterator>::value_type(*__first);
+ return __cur;
+ }
+ catch(...)
+ {
+ std::_Destroy(__result, __cur);
+ throw;
+ }
+ }
+ };
+ template<>
+ struct __uninitialized_copy<true>
+ {
+ template<typename _InputIterator, typename _ForwardIterator>
+ static _ForwardIterator
+ uninitialized_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result)
+ { return std::copy(__first, __last, __result); }
+ };
+ template<typename _InputIterator, typename _ForwardIterator>
+ inline _ForwardIterator
+ uninitialized_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType2;
+ return std::__uninitialized_copy<(__is_pod(_ValueType1)
+ && __is_pod(_ValueType2))>::
+ uninitialized_copy(__first, __last, __result);
+ }
+ template<bool>
+ struct __uninitialized_fill
+ {
+ template<typename _ForwardIterator, typename _Tp>
+ static void
+ uninitialized_fill(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __x)
+ {
+ _ForwardIterator __cur = __first;
+ try
+ {
+ for (; __cur != __last; ++__cur)
+ std::_Construct(&*__cur, __x);
+ }
+ catch(...)
+ {
+ std::_Destroy(__first, __cur);
+ throw;
+ }
+ }
+ };
+ template<>
+ struct __uninitialized_fill<true>
+ {
+ template<typename _ForwardIterator, typename _Tp>
+ static void
+ uninitialized_fill(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __x)
+ { std::fill(__first, __last, __x); }
+ };
+ template<typename _ForwardIterator, typename _Tp>
+ inline void
+ uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __x)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ std::__uninitialized_fill<__is_pod(_ValueType)>::
+ uninitialized_fill(__first, __last, __x);
+ }
+ template<bool>
+ struct __uninitialized_fill_n
+ {
+ template<typename _ForwardIterator, typename _Size, typename _Tp>
+ static void
+ uninitialized_fill_n(_ForwardIterator __first, _Size __n,
+ const _Tp& __x)
+ {
+ _ForwardIterator __cur = __first;
+ try
+ {
+ for (; __n > 0; --__n, ++__cur)
+ std::_Construct(&*__cur, __x);
+ }
+ catch(...)
+ {
+ std::_Destroy(__first, __cur);
+ throw;
+ }
+ }
+ };
+ template<>
+ struct __uninitialized_fill_n<true>
+ {
+ template<typename _ForwardIterator, typename _Size, typename _Tp>
+ static void
+ uninitialized_fill_n(_ForwardIterator __first, _Size __n,
+ const _Tp& __x)
+ { std::fill_n(__first, __n, __x); }
+ };
+ template<typename _ForwardIterator, typename _Size, typename _Tp>
+ inline void
+ uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ std::__uninitialized_fill_n<__is_pod(_ValueType)>::
+ uninitialized_fill_n(__first, __n, __x);
+ }
+ template<typename _InputIterator, typename _ForwardIterator,
+ typename _Allocator>
+ _ForwardIterator
+ __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result, _Allocator& __alloc)
+ {
+ _ForwardIterator __cur = __result;
+ try
+ {
+ for (; __first != __last; ++__first, ++__cur)
+ __alloc.construct(&*__cur, *__first);
+ return __cur;
+ }
+ catch(...)
+ {
+ std::_Destroy(__result, __cur, __alloc);
+ throw;
+ }
+ }
+ template<typename _InputIterator, typename _ForwardIterator, typename _Tp>
+ inline _ForwardIterator
+ __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result, allocator<_Tp>&)
+ { return std::uninitialized_copy(__first, __last, __result); }
+ template<typename _InputIterator, typename _ForwardIterator,
+ typename _Allocator>
+ inline _ForwardIterator
+ __uninitialized_move_a(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result, _Allocator& __alloc)
+ {
+ return std::__uninitialized_copy_a((__first),
+ (__last),
+ __result, __alloc);
+ }
+ template<typename _ForwardIterator, typename _Tp, typename _Allocator>
+ void
+ __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __x, _Allocator& __alloc)
+ {
+ _ForwardIterator __cur = __first;
+ try
+ {
+ for (; __cur != __last; ++__cur)
+ __alloc.construct(&*__cur, __x);
+ }
+ catch(...)
+ {
+ std::_Destroy(__first, __cur, __alloc);
+ throw;
+ }
+ }
+ template<typename _ForwardIterator, typename _Tp, typename _Tp2>
+ inline void
+ __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __x, allocator<_Tp2>&)
+ { std::uninitialized_fill(__first, __last, __x); }
+ template<typename _ForwardIterator, typename _Size, typename _Tp,
+ typename _Allocator>
+ void
+ __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
+ const _Tp& __x, _Allocator& __alloc)
+ {
+ _ForwardIterator __cur = __first;
+ try
+ {
+ for (; __n > 0; --__n, ++__cur)
+ __alloc.construct(&*__cur, __x);
+ }
+ catch(...)
+ {
+ std::_Destroy(__first, __cur, __alloc);
+ throw;
+ }
+ }
+ template<typename _ForwardIterator, typename _Size, typename _Tp,
+ typename _Tp2>
+ inline void
+ __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
+ const _Tp& __x, allocator<_Tp2>&)
+ { std::uninitialized_fill_n(__first, __n, __x); }
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _ForwardIterator, typename _Allocator>
+ inline _ForwardIterator
+ __uninitialized_copy_move(_InputIterator1 __first1,
+ _InputIterator1 __last1,
+ _InputIterator2 __first2,
+ _InputIterator2 __last2,
+ _ForwardIterator __result,
+ _Allocator& __alloc)
+ {
+ _ForwardIterator __mid = std::__uninitialized_copy_a(__first1, __last1,
+ __result,
+ __alloc);
+ try
+ {
+ return std::__uninitialized_move_a(__first2, __last2, __mid, __alloc);
+ }
+ catch(...)
+ {
+ std::_Destroy(__result, __mid, __alloc);
+ throw;
+ }
+ }
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _ForwardIterator, typename _Allocator>
+ inline _ForwardIterator
+ __uninitialized_move_copy(_InputIterator1 __first1,
+ _InputIterator1 __last1,
+ _InputIterator2 __first2,
+ _InputIterator2 __last2,
+ _ForwardIterator __result,
+ _Allocator& __alloc)
+ {
+ _ForwardIterator __mid = std::__uninitialized_move_a(__first1, __last1,
+ __result,
+ __alloc);
+ try
+ {
+ return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc);
+ }
+ catch(...)
+ {
+ std::_Destroy(__result, __mid, __alloc);
+ throw;
+ }
+ }
+ template<typename _ForwardIterator, typename _Tp, typename _InputIterator,
+ typename _Allocator>
+ inline _ForwardIterator
+ __uninitialized_fill_move(_ForwardIterator __result, _ForwardIterator __mid,
+ const _Tp& __x, _InputIterator __first,
+ _InputIterator __last, _Allocator& __alloc)
+ {
+ std::__uninitialized_fill_a(__result, __mid, __x, __alloc);
+ try
+ {
+ return std::__uninitialized_move_a(__first, __last, __mid, __alloc);
+ }
+ catch(...)
+ {
+ std::_Destroy(__result, __mid, __alloc);
+ throw;
+ }
+ }
+ template<typename _InputIterator, typename _ForwardIterator, typename _Tp,
+ typename _Allocator>
+ inline void
+ __uninitialized_move_fill(_InputIterator __first1, _InputIterator __last1,
+ _ForwardIterator __first2,
+ _ForwardIterator __last2, const _Tp& __x,
+ _Allocator& __alloc)
+ {
+ _ForwardIterator __mid2 = std::__uninitialized_move_a(__first1, __last1,
+ __first2,
+ __alloc);
+ try
+ {
+ std::__uninitialized_fill_a(__mid2, __last2, __x, __alloc);
+ }
+ catch(...)
+ {
+ std::_Destroy(__first2, __mid2, __alloc);
+ throw;
+ }
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Tp, typename _Alloc>
+ struct _Vector_base
+ {
+ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+ struct _Vector_impl
+ : public _Tp_alloc_type
+ {
+ _Tp* _M_start;
+ _Tp* _M_finish;
+ _Tp* _M_end_of_storage;
+ _Vector_impl()
+ : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
+ { }
+ _Vector_impl(_Tp_alloc_type const& __a)
+ : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
+ { }
+ };
+ public:
+ typedef _Alloc allocator_type;
+ _Tp_alloc_type&
+ _M_get_Tp_allocator()
+ { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); }
+ const _Tp_alloc_type&
+ _M_get_Tp_allocator() const
+ { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); }
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Tp_allocator()); }
+ _Vector_base()
+ : _M_impl() { }
+ _Vector_base(const allocator_type& __a)
+ : _M_impl(__a) { }
+ _Vector_base(size_t __n, const allocator_type& __a)
+ : _M_impl(__a)
+ {
+ this->_M_impl._M_start = this->_M_allocate(__n);
+ this->_M_impl._M_finish = this->_M_impl._M_start;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ }
+ ~_Vector_base()
+ { _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start); }
+ public:
+ _Vector_impl _M_impl;
+ _Tp*
+ _M_allocate(size_t __n)
+ { return __n != 0 ? _M_impl.allocate(__n) : 0; }
+ void
+ _M_deallocate(_Tp* __p, size_t __n)
+ {
+ if (__p)
+ _M_impl.deallocate(__p, __n);
+ }
+ };
+ template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
+ class vector : protected _Vector_base<_Tp, _Alloc>
+ {
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ typedef _Vector_base<_Tp, _Alloc> _Base;
+ typedef vector<_Tp, _Alloc> vector_type;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+ public:
+ typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef typename _Tp_alloc_type::const_pointer const_pointer;
+ typedef typename _Tp_alloc_type::reference reference;
+ typedef typename _Tp_alloc_type::const_reference const_reference;
+ typedef __gnu_cxx::__normal_iterator<pointer, vector_type> iterator;
+ typedef __gnu_cxx::__normal_iterator<const_pointer, vector_type>
+ const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+ protected:
+ using _Base::_M_allocate;
+ using _Base::_M_deallocate;
+ using _Base::_M_impl;
+ using _Base::_M_get_Tp_allocator;
+ public:
+ vector()
+ : _Base() { }
+ explicit
+ vector(const allocator_type& __a)
+ : _Base(__a) { }
+ explicit
+ vector(size_type __n, const value_type& __value = value_type(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __a)
+ { _M_fill_initialize(__n, __value); }
+ vector(const vector& __x)
+ : _Base(__x.size(), __x._M_get_Tp_allocator())
+ { this->_M_impl._M_finish =
+ std::__uninitialized_copy_a(__x.begin(), __x.end(),
+ this->_M_impl._M_start,
+ _M_get_Tp_allocator());
+ }
+ template<typename _InputIterator>
+ vector(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+ ~vector()
+ { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator()); }
+ vector&
+ operator=(const vector& __x);
+ void
+ assign(size_type __n, const value_type& __val)
+ { _M_fill_assign(__n, __val); }
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+ using _Base::get_allocator;
+ iterator
+ begin()
+ { return iterator(this->_M_impl._M_start); }
+ const_iterator
+ begin() const
+ { return const_iterator(this->_M_impl._M_start); }
+ iterator
+ end()
+ { return iterator(this->_M_impl._M_finish); }
+ const_iterator
+ end() const
+ { return const_iterator(this->_M_impl._M_finish); }
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+ size_type
+ size() const
+ { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
+ size_type
+ max_size() const
+ { return _M_get_Tp_allocator().max_size(); }
+ void
+ resize(size_type __new_size, value_type __x = value_type())
+ {
+ if (__new_size < size())
+ _M_erase_at_end(this->_M_impl._M_start + __new_size);
+ else
+ insert(end(), __new_size - size(), __x);
+ }
+ size_type
+ capacity() const
+ { return size_type(this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start); }
+ bool
+ empty() const
+ { return begin() == end(); }
+ void
+ reserve(size_type __n);
+ reference
+ operator[](size_type __n)
+ { return *(this->_M_impl._M_start + __n); }
+ const_reference
+ operator[](size_type __n) const
+ { return *(this->_M_impl._M_start + __n); }
+ protected:
+ void
+ _M_range_check(size_type __n) const
+ {
+ if (__n >= this->size())
+ __throw_out_of_range(("vector::_M_range_check"));
+ }
+ public:
+ reference
+ at(size_type __n)
+ {
+ _M_range_check(__n);
+ return (*this)[__n];
+ }
+ const_reference
+ at(size_type __n) const
+ {
+ _M_range_check(__n);
+ return (*this)[__n];
+ }
+ reference
+ front()
+ { return *begin(); }
+ const_reference
+ front() const
+ { return *begin(); }
+ reference
+ back()
+ { return *(end() - 1); }
+ const_reference
+ back() const
+ { return *(end() - 1); }
+ pointer
+ data()
+ { return pointer(this->_M_impl._M_start); }
+ const_pointer
+ data() const
+ { return const_pointer(this->_M_impl._M_start); }
+ void
+ push_back(const value_type& __x)
+ {
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish, __x);
+ ++this->_M_impl._M_finish;
+ }
+ else
+ _M_insert_aux(end(), __x);
+ }
+ void
+ pop_back()
+ {
+ --this->_M_impl._M_finish;
+ this->_M_impl.destroy(this->_M_impl._M_finish);
+ }
+ iterator
+ insert(iterator __position, const value_type& __x);
+ void
+ insert(iterator __position, size_type __n, const value_type& __x)
+ { _M_fill_insert(__position, __n, __x); }
+ template<typename _InputIterator>
+ void
+ insert(iterator __position, _InputIterator __first,
+ _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_insert_dispatch(__position, __first, __last, _Integral());
+ }
+ iterator
+ erase(iterator __position);
+ iterator
+ erase(iterator __first, iterator __last);
+ void
+ swap(vector& __x)
+ {
+ std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
+ std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
+ std::swap(this->_M_impl._M_end_of_storage,
+ __x._M_impl._M_end_of_storage);
+ std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
+ __x._M_get_Tp_allocator());
+ }
+ void
+ clear()
+ { _M_erase_at_end(this->_M_impl._M_start); }
+ protected:
+ template<typename _ForwardIterator>
+ pointer
+ _M_allocate_and_copy(size_type __n,
+ _ForwardIterator __first, _ForwardIterator __last)
+ {
+ pointer __result = this->_M_allocate(__n);
+ try
+ {
+ std::__uninitialized_copy_a(__first, __last, __result,
+ _M_get_Tp_allocator());
+ return __result;
+ }
+ catch(...)
+ {
+ _M_deallocate(__result, __n);
+ throw;
+ }
+ }
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
+ {
+ this->_M_impl._M_start = _M_allocate(static_cast<size_type>(__n));
+ this->_M_impl._M_end_of_storage =
+ this->_M_impl._M_start + static_cast<size_type>(__n);
+ _M_fill_initialize(static_cast<size_type>(__n), __value);
+ }
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_range_initialize(__first, __last, _IterCategory());
+ }
+ template<typename _InputIterator>
+ void
+ _M_range_initialize(_InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag)
+ {
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+ template<typename _ForwardIterator>
+ void
+ _M_range_initialize(_ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag)
+ {
+ const size_type __n = std::distance(__first, __last);
+ this->_M_impl._M_start = this->_M_allocate(__n);
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ this->_M_impl._M_finish =
+ std::__uninitialized_copy_a(__first, __last,
+ this->_M_impl._M_start,
+ _M_get_Tp_allocator());
+ }
+ void
+ _M_fill_initialize(size_type __n, const value_type& __value)
+ {
+ std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
+ }
+ template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+ template<typename _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_assign_aux(__first, __last, _IterCategory());
+ }
+ template<typename _InputIterator>
+ void
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag);
+ template<typename _ForwardIterator>
+ void
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag);
+ void
+ _M_fill_assign(size_type __n, const value_type& __val);
+ template<typename _Integer>
+ void
+ _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
+ __true_type)
+ { _M_fill_insert(__pos, __n, __val); }
+ template<typename _InputIterator>
+ void
+ _M_insert_dispatch(iterator __pos, _InputIterator __first,
+ _InputIterator __last, __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_range_insert(__pos, __first, __last, _IterCategory());
+ }
+ template<typename _InputIterator>
+ void
+ _M_range_insert(iterator __pos, _InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag);
+ template<typename _ForwardIterator>
+ void
+ _M_range_insert(iterator __pos, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag);
+ void
+ _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
+ void
+ _M_insert_aux(iterator __position, const value_type& __x);
+ size_type
+ _M_check_len(size_type __n, const char* __s) const
+ {
+ if (max_size() - size() < __n)
+ __throw_length_error((__s));
+ const size_type __len = size() + std::max(size(), __n);
+ return (__len < size() || __len > max_size()) ? max_size() : __len;
+ }
+ void
+ _M_erase_at_end(pointer __pos)
+ {
+ std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __pos;
+ }
+ };
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return (__x.size() == __y.size()
+ && std::equal(__x.begin(), __x.end(), __y.begin())); }
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return std::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end()); }
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return !(__x == __y); }
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return __y < __x; }
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return !(__y < __x); }
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return !(__x < __y); }
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
+ { __x.swap(__y); }
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ typedef unsigned long _Bit_type;
+ enum { _S_word_bit = int(8 * sizeof(_Bit_type)) };
+ struct _Bit_reference
+ {
+ _Bit_type * _M_p;
+ _Bit_type _M_mask;
+ _Bit_reference(_Bit_type * __x, _Bit_type __y)
+ : _M_p(__x), _M_mask(__y) { }
+ _Bit_reference() : _M_p(0), _M_mask(0) { }
+ operator bool() const
+ { return !!(*_M_p & _M_mask); }
+ _Bit_reference&
+ operator=(bool __x)
+ {
+ if (__x)
+ *_M_p |= _M_mask;
+ else
+ *_M_p &= ~_M_mask;
+ return *this;
+ }
+ _Bit_reference&
+ operator=(const _Bit_reference& __x)
+ { return *this = bool(__x); }
+ bool
+ operator==(const _Bit_reference& __x) const
+ { return bool(*this) == bool(__x); }
+ bool
+ operator<(const _Bit_reference& __x) const
+ { return !bool(*this) && bool(__x); }
+ void
+ flip()
+ { *_M_p ^= _M_mask; }
+ };
+ struct _Bit_iterator_base
+ : public std::iterator<std::random_access_iterator_tag, bool>
+ {
+ _Bit_type * _M_p;
+ unsigned int _M_offset;
+ _Bit_iterator_base(_Bit_type * __x, unsigned int __y)
+ : _M_p(__x), _M_offset(__y) { }
+ void
+ _M_bump_up()
+ {
+ if (_M_offset++ == int(_S_word_bit) - 1)
+ {
+ _M_offset = 0;
+ ++_M_p;
+ }
+ }
+ void
+ _M_bump_down()
+ {
+ if (_M_offset-- == 0)
+ {
+ _M_offset = int(_S_word_bit) - 1;
+ --_M_p;
+ }
+ }
+ void
+ _M_incr(ptrdiff_t __i)
+ {
+ difference_type __n = __i + _M_offset;
+ _M_p += __n / int(_S_word_bit);
+ __n = __n % int(_S_word_bit);
+ if (__n < 0)
+ {
+ __n += int(_S_word_bit);
+ --_M_p;
+ }
+ _M_offset = static_cast<unsigned int>(__n);
+ }
+ bool
+ operator==(const _Bit_iterator_base& __i) const
+ { return _M_p == __i._M_p && _M_offset == __i._M_offset; }
+ bool
+ operator<(const _Bit_iterator_base& __i) const
+ {
+ return _M_p < __i._M_p
+ || (_M_p == __i._M_p && _M_offset < __i._M_offset);
+ }
+ bool
+ operator!=(const _Bit_iterator_base& __i) const
+ { return !(*this == __i); }
+ bool
+ operator>(const _Bit_iterator_base& __i) const
+ { return __i < *this; }
+ bool
+ operator<=(const _Bit_iterator_base& __i) const
+ { return !(__i < *this); }
+ bool
+ operator>=(const _Bit_iterator_base& __i) const
+ { return !(*this < __i); }
+ };
+ inline ptrdiff_t
+ operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y)
+ {
+ return (int(_S_word_bit) * (__x._M_p - __y._M_p)
+ + __x._M_offset - __y._M_offset);
+ }
+ struct _Bit_iterator : public _Bit_iterator_base
+ {
+ typedef _Bit_reference reference;
+ typedef _Bit_reference* pointer;
+ typedef _Bit_iterator iterator;
+ _Bit_iterator() : _Bit_iterator_base(0, 0) { }
+ _Bit_iterator(_Bit_type * __x, unsigned int __y)
+ : _Bit_iterator_base(__x, __y) { }
+ reference
+ operator*() const
+ { return reference(_M_p, 1UL << _M_offset); }
+ iterator&
+ operator++()
+ {
+ _M_bump_up();
+ return *this;
+ }
+ iterator
+ operator++(int)
+ {
+ iterator __tmp = *this;
+ _M_bump_up();
+ return __tmp;
+ }
+ iterator&
+ operator--()
+ {
+ _M_bump_down();
+ return *this;
+ }
+ iterator
+ operator--(int)
+ {
+ iterator __tmp = *this;
+ _M_bump_down();
+ return __tmp;
+ }
+ iterator&
+ operator+=(difference_type __i)
+ {
+ _M_incr(__i);
+ return *this;
+ }
+ iterator&
+ operator-=(difference_type __i)
+ {
+ *this += -__i;
+ return *this;
+ }
+ iterator
+ operator+(difference_type __i) const
+ {
+ iterator __tmp = *this;
+ return __tmp += __i;
+ }
+ iterator
+ operator-(difference_type __i) const
+ {
+ iterator __tmp = *this;
+ return __tmp -= __i;
+ }
+ reference
+ operator[](difference_type __i) const
+ { return *(*this + __i); }
+ };
+ inline _Bit_iterator
+ operator+(ptrdiff_t __n, const _Bit_iterator& __x)
+ { return __x + __n; }
+ struct _Bit_const_iterator : public _Bit_iterator_base
+ {
+ typedef bool reference;
+ typedef bool const_reference;
+ typedef const bool* pointer;
+ typedef _Bit_const_iterator const_iterator;
+ _Bit_const_iterator() : _Bit_iterator_base(0, 0) { }
+ _Bit_const_iterator(_Bit_type * __x, unsigned int __y)
+ : _Bit_iterator_base(__x, __y) { }
+ _Bit_const_iterator(const _Bit_iterator& __x)
+ : _Bit_iterator_base(__x._M_p, __x._M_offset) { }
+ const_reference
+ operator*() const
+ { return _Bit_reference(_M_p, 1UL << _M_offset); }
+ const_iterator&
+ operator++()
+ {
+ _M_bump_up();
+ return *this;
+ }
+ const_iterator
+ operator++(int)
+ {
+ const_iterator __tmp = *this;
+ _M_bump_up();
+ return __tmp;
+ }
+ const_iterator&
+ operator--()
+ {
+ _M_bump_down();
+ return *this;
+ }
+ const_iterator
+ operator--(int)
+ {
+ const_iterator __tmp = *this;
+ _M_bump_down();
+ return __tmp;
+ }
+ const_iterator&
+ operator+=(difference_type __i)
+ {
+ _M_incr(__i);
+ return *this;
+ }
+ const_iterator&
+ operator-=(difference_type __i)
+ {
+ *this += -__i;
+ return *this;
+ }
+ const_iterator
+ operator+(difference_type __i) const
+ {
+ const_iterator __tmp = *this;
+ return __tmp += __i;
+ }
+ const_iterator
+ operator-(difference_type __i) const
+ {
+ const_iterator __tmp = *this;
+ return __tmp -= __i;
+ }
+ const_reference
+ operator[](difference_type __i) const
+ { return *(*this + __i); }
+ };
+ inline _Bit_const_iterator
+ operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
+ { return __x + __n; }
+ inline void
+ __fill_bvector(_Bit_iterator __first, _Bit_iterator __last, bool __x)
+ {
+ for (; __first != __last; ++__first)
+ *__first = __x;
+ }
+ inline void
+ fill(_Bit_iterator __first, _Bit_iterator __last, const bool& __x)
+ {
+ if (__first._M_p != __last._M_p)
+ {
+ std::fill(__first._M_p + 1, __last._M_p, __x ? ~0 : 0);
+ __fill_bvector(__first, _Bit_iterator(__first._M_p + 1, 0), __x);
+ __fill_bvector(_Bit_iterator(__last._M_p, 0), __last, __x);
+ }
+ else
+ __fill_bvector(__first, __last, __x);
+ }
+ template<typename _Alloc>
+ struct _Bvector_base
+ {
+ typedef typename _Alloc::template rebind<_Bit_type>::other
+ _Bit_alloc_type;
+ struct _Bvector_impl
+ : public _Bit_alloc_type
+ {
+ _Bit_iterator _M_start;
+ _Bit_iterator _M_finish;
+ _Bit_type* _M_end_of_storage;
+ _Bvector_impl()
+ : _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage(0)
+ { }
+ _Bvector_impl(const _Bit_alloc_type& __a)
+ : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0)
+ { }
+ };
+ public:
+ typedef _Alloc allocator_type;
+ _Bit_alloc_type&
+ _M_get_Bit_allocator()
+ { return *static_cast<_Bit_alloc_type*>(&this->_M_impl); }
+ const _Bit_alloc_type&
+ _M_get_Bit_allocator() const
+ { return *static_cast<const _Bit_alloc_type*>(&this->_M_impl); }
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Bit_allocator()); }
+ _Bvector_base()
+ : _M_impl() { }
+ _Bvector_base(const allocator_type& __a)
+ : _M_impl(__a) { }
+ ~_Bvector_base()
+ { this->_M_deallocate(); }
+ protected:
+ _Bvector_impl _M_impl;
+ _Bit_type*
+ _M_allocate(size_t __n)
+ { return _M_impl.allocate((__n + int(_S_word_bit) - 1)
+ / int(_S_word_bit)); }
+ void
+ _M_deallocate()
+ {
+ if (_M_impl._M_start._M_p)
+ _M_impl.deallocate(_M_impl._M_start._M_p,
+ _M_impl._M_end_of_storage - _M_impl._M_start._M_p);
+ }
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+template<typename _Alloc>
+ class vector<bool, _Alloc> : protected _Bvector_base<_Alloc>
+ {
+ typedef _Bvector_base<_Alloc> _Base;
+ public:
+ typedef bool value_type;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Bit_reference reference;
+ typedef bool const_reference;
+ typedef _Bit_reference* pointer;
+ typedef const bool* const_pointer;
+ typedef _Bit_iterator iterator;
+ typedef _Bit_const_iterator const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef _Alloc allocator_type;
+ allocator_type get_allocator() const
+ { return _Base::get_allocator(); }
+ protected:
+ using _Base::_M_allocate;
+ using _Base::_M_deallocate;
+ using _Base::_M_get_Bit_allocator;
+ public:
+ vector()
+ : _Base() { }
+ explicit
+ vector(const allocator_type& __a)
+ : _Base(__a) { }
+ explicit
+ vector(size_type __n, const bool& __value = bool(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_initialize(__n);
+ std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage,
+ __value ? ~0 : 0);
+ }
+ vector(const vector& __x)
+ : _Base(__x._M_get_Bit_allocator())
+ {
+ _M_initialize(__x.size());
+ _M_copy_aligned(__x.begin(), __x.end(), this->_M_impl._M_start);
+ }
+ template<typename _InputIterator>
+ vector(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+ ~vector() { }
+ vector&
+ operator=(const vector& __x)
+ {
+ if (&__x == this)
+ return *this;
+ if (__x.size() > capacity())
+ {
+ this->_M_deallocate();
+ _M_initialize(__x.size());
+ }
+ this->_M_impl._M_finish = _M_copy_aligned(__x.begin(), __x.end(),
+ begin());
+ return *this;
+ }
+ void
+ assign(size_type __n, const bool& __x)
+ { _M_fill_assign(__n, __x); }
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+ iterator
+ begin()
+ { return this->_M_impl._M_start; }
+ const_iterator
+ begin() const
+ { return this->_M_impl._M_start; }
+ iterator
+ end()
+ { return this->_M_impl._M_finish; }
+ const_iterator
+ end() const
+ { return this->_M_impl._M_finish; }
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+ size_type
+ size() const
+ { return size_type(end() - begin()); }
+ size_type
+ max_size() const
+ {
+ const size_type __isize =
+ __gnu_cxx::__numeric_traits<difference_type>::__max
+ - int(_S_word_bit) + 1;
+ const size_type __asize = _M_get_Bit_allocator().max_size();
+ return (__asize <= __isize / int(_S_word_bit)
+ ? __asize * int(_S_word_bit) : __isize);
+ }
+ size_type
+ capacity() const
+ { return size_type(const_iterator(this->_M_impl._M_end_of_storage, 0)
+ - begin()); }
+ bool
+ empty() const
+ { return begin() == end(); }
+ reference
+ operator[](size_type __n)
+ {
+ return *iterator(this->_M_impl._M_start._M_p
+ + __n / int(_S_word_bit), __n % int(_S_word_bit));
+ }
+ const_reference
+ operator[](size_type __n) const
+ {
+ return *const_iterator(this->_M_impl._M_start._M_p
+ + __n / int(_S_word_bit), __n % int(_S_word_bit));
+ }
+ protected:
+ void
+ _M_range_check(size_type __n) const
+ {
+ if (__n >= this->size())
+ __throw_out_of_range(("vector<bool>::_M_range_check"));
+ }
+ public:
+ reference
+ at(size_type __n)
+ { _M_range_check(__n); return (*this)[__n]; }
+ const_reference
+ at(size_type __n) const
+ { _M_range_check(__n); return (*this)[__n]; }
+ void
+ reserve(size_type __n);
+ reference
+ front()
+ { return *begin(); }
+ const_reference
+ front() const
+ { return *begin(); }
+ reference
+ back()
+ { return *(end() - 1); }
+ const_reference
+ back() const
+ { return *(end() - 1); }
+ void
+ data() { }
+ void
+ push_back(bool __x)
+ {
+ if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
+ *this->_M_impl._M_finish++ = __x;
+ else
+ _M_insert_aux(end(), __x);
+ }
+ void
+ swap(vector& __x)
+ {
+ std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
+ std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
+ std::swap(this->_M_impl._M_end_of_storage,
+ __x._M_impl._M_end_of_storage);
+ std::__alloc_swap<typename _Base::_Bit_alloc_type>::
+ _S_do_it(_M_get_Bit_allocator(), __x._M_get_Bit_allocator());
+ }
+ static void
+ swap(reference __x, reference __y)
+ {
+ bool __tmp = __x;
+ __x = __y;
+ __y = __tmp;
+ }
+ iterator
+ insert(iterator __position, const bool& __x = bool())
+ {
+ const difference_type __n = __position - begin();
+ if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage
+ && __position == end())
+ *this->_M_impl._M_finish++ = __x;
+ else
+ _M_insert_aux(__position, __x);
+ return begin() + __n;
+ }
+ template<typename _InputIterator>
+ void
+ insert(iterator __position,
+ _InputIterator __first, _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_insert_dispatch(__position, __first, __last, _Integral());
+ }
+ void
+ insert(iterator __position, size_type __n, const bool& __x)
+ { _M_fill_insert(__position, __n, __x); }
+ void
+ pop_back()
+ { --this->_M_impl._M_finish; }
+ iterator
+ erase(iterator __position)
+ {
+ if (__position + 1 != end())
+ std::copy(__position + 1, end(), __position);
+ --this->_M_impl._M_finish;
+ return __position;
+ }
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ _M_erase_at_end(std::copy(__last, end(), __first));
+ return __first;
+ }
+ void
+ resize(size_type __new_size, bool __x = bool())
+ {
+ if (__new_size < size())
+ _M_erase_at_end(begin() + difference_type(__new_size));
+ else
+ insert(end(), __new_size - size(), __x);
+ }
+ void
+ flip()
+ {
+ for (_Bit_type * __p = this->_M_impl._M_start._M_p;
+ __p != this->_M_impl._M_end_of_storage; ++__p)
+ *__p = ~*__p;
+ }
+ void
+ clear()
+ { _M_erase_at_end(begin()); }
+ protected:
+ iterator
+ _M_copy_aligned(const_iterator __first, const_iterator __last,
+ iterator __result)
+ {
+ _Bit_type* __q = std::copy(__first._M_p, __last._M_p, __result._M_p);
+ return std::copy(const_iterator(__last._M_p, 0), __last,
+ iterator(__q, 0));
+ }
+ void
+ _M_initialize(size_type __n)
+ {
+ _Bit_type* __q = this->_M_allocate(__n);
+ this->_M_impl._M_end_of_storage = (__q
+ + ((__n + int(_S_word_bit) - 1)
+ / int(_S_word_bit)));
+ this->_M_impl._M_start = iterator(__q, 0);
+ this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n);
+ }
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
+ {
+ _M_initialize(static_cast<size_type>(__n));
+ std::fill(this->_M_impl._M_start._M_p,
+ this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
+ }
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ { _M_initialize_range(__first, __last,
+ std::__iterator_category(__first)); }
+ template<typename _InputIterator>
+ void
+ _M_initialize_range(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+ template<typename _ForwardIterator>
+ void
+ _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __n = std::distance(__first, __last);
+ _M_initialize(__n);
+ std::copy(__first, __last, this->_M_impl._M_start);
+ }
+ template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+ template<class _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
+ void
+ _M_fill_assign(size_t __n, bool __x)
+ {
+ if (__n > size())
+ {
+ std::fill(this->_M_impl._M_start._M_p,
+ this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
+ insert(end(), __n - size(), __x);
+ }
+ else
+ {
+ _M_erase_at_end(begin() + __n);
+ std::fill(this->_M_impl._M_start._M_p,
+ this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
+ }
+ }
+ template<typename _InputIterator>
+ void
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ iterator __cur = begin();
+ for (; __first != __last && __cur != end(); ++__cur, ++__first)
+ *__cur = *__first;
+ if (__first == __last)
+ _M_erase_at_end(__cur);
+ else
+ insert(end(), __first, __last);
+ }
+ template<typename _ForwardIterator>
+ void
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __len = std::distance(__first, __last);
+ if (__len < size())
+ _M_erase_at_end(std::copy(__first, __last, begin()));
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, size());
+ std::copy(__first, __mid, begin());
+ insert(end(), __mid, __last);
+ }
+ }
+ template<typename _Integer>
+ void
+ _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
+ __true_type)
+ { _M_fill_insert(__pos, __n, __x); }
+ template<typename _InputIterator>
+ void
+ _M_insert_dispatch(iterator __pos,
+ _InputIterator __first, _InputIterator __last,
+ __false_type)
+ { _M_insert_range(__pos, __first, __last,
+ std::__iterator_category(__first)); }
+ void
+ _M_fill_insert(iterator __position, size_type __n, bool __x);
+ template<typename _InputIterator>
+ void
+ _M_insert_range(iterator __pos, _InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag)
+ {
+ for (; __first != __last; ++__first)
+ {
+ __pos = insert(__pos, *__first);
+ ++__pos;
+ }
+ }
+ template<typename _ForwardIterator>
+ void
+ _M_insert_range(iterator __position, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag);
+ void
+ _M_insert_aux(iterator __position, bool __x);
+ size_type
+ _M_check_len(size_type __n, const char* __s) const
+ {
+ if (max_size() - size() < __n)
+ __throw_length_error((__s));
+ const size_type __len = size() + std::max(size(), __n);
+ return (__len < size() || __len > max_size()) ? max_size() : __len;
+ }
+ void
+ _M_erase_at_end(iterator __pos)
+ { this->_M_impl._M_finish = __pos; }
+ };
+}
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Tp, typename _Alloc>
+ void
+ vector<_Tp, _Alloc>::
+ reserve(size_type __n)
+ {
+ if (__n > this->max_size())
+ __throw_length_error(("vector::reserve"));
+ if (this->capacity() < __n)
+ {
+ const size_type __old_size = size();
+ pointer __tmp = _M_allocate_and_copy(__n,
+ (this->_M_impl._M_start),
+ (this->_M_impl._M_finish));
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __tmp;
+ this->_M_impl._M_finish = __tmp + __old_size;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ }
+ }
+ template<typename _Tp, typename _Alloc>
+ typename vector<_Tp, _Alloc>::iterator
+ vector<_Tp, _Alloc>::
+ insert(iterator __position, const value_type& __x)
+ {
+ const size_type __n = __position - begin();
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
+ && __position == end())
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish, __x);
+ ++this->_M_impl._M_finish;
+ }
+ else
+ {
+ _M_insert_aux(__position, __x);
+ }
+ return iterator(this->_M_impl._M_start + __n);
+ }
+ template<typename _Tp, typename _Alloc>
+ typename vector<_Tp, _Alloc>::iterator
+ vector<_Tp, _Alloc>::
+ erase(iterator __position)
+ {
+ if (__position + 1 != end())
+ std::copy(__position + 1, end(), __position);
+ --this->_M_impl._M_finish;
+ this->_M_impl.destroy(this->_M_impl._M_finish);
+ return __position;
+ }
+ template<typename _Tp, typename _Alloc>
+ typename vector<_Tp, _Alloc>::iterator
+ vector<_Tp, _Alloc>::
+ erase(iterator __first, iterator __last)
+ {
+ if (__last != end())
+ std::copy(__last, end(), __first);
+ _M_erase_at_end(__first.base() + (end() - __last));
+ return __first;
+ }
+ template<typename _Tp, typename _Alloc>
+ vector<_Tp, _Alloc>&
+ vector<_Tp, _Alloc>::
+ operator=(const vector<_Tp, _Alloc>& __x)
+ {
+ if (&__x != this)
+ {
+ const size_type __xlen = __x.size();
+ if (__xlen > capacity())
+ {
+ pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(),
+ __x.end());
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __tmp;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __xlen;
+ }
+ else if (size() >= __xlen)
+ {
+ std::_Destroy(std::copy(__x.begin(), __x.end(), begin()),
+ end(), _M_get_Tp_allocator());
+ }
+ else
+ {
+ std::copy(__x._M_impl._M_start, __x._M_impl._M_start + size(),
+ this->_M_impl._M_start);
+ std::__uninitialized_copy_a(__x._M_impl._M_start + size(),
+ __x._M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ }
+ this->_M_impl._M_finish = this->_M_impl._M_start + __xlen;
+ }
+ return *this;
+ }
+ template<typename _Tp, typename _Alloc>
+ void
+ vector<_Tp, _Alloc>::
+ _M_fill_assign(size_t __n, const value_type& __val)
+ {
+ if (__n > capacity())
+ {
+ vector __tmp(__n, __val, _M_get_Tp_allocator());
+ __tmp.swap(*this);
+ }
+ else if (__n > size())
+ {
+ std::fill(begin(), end(), __val);
+ std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
+ __n - size(), __val,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n - size();
+ }
+ else
+ _M_erase_at_end(std::fill_n(this->_M_impl._M_start, __n, __val));
+ }
+ template<typename _Tp, typename _Alloc>
+ template<typename _InputIterator>
+ void
+ vector<_Tp, _Alloc>::
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ pointer __cur(this->_M_impl._M_start);
+ for (; __first != __last && __cur != this->_M_impl._M_finish;
+ ++__cur, ++__first)
+ *__cur = *__first;
+ if (__first == __last)
+ _M_erase_at_end(__cur);
+ else
+ insert(end(), __first, __last);
+ }
+ template<typename _Tp, typename _Alloc>
+ template<typename _ForwardIterator>
+ void
+ vector<_Tp, _Alloc>::
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __len = std::distance(__first, __last);
+ if (__len > capacity())
+ {
+ pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __tmp;
+ this->_M_impl._M_finish = this->_M_impl._M_start + __len;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_finish;
+ }
+ else if (size() >= __len)
+ _M_erase_at_end(std::copy(__first, __last, this->_M_impl._M_start));
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, size());
+ std::copy(__first, __mid, this->_M_impl._M_start);
+ this->_M_impl._M_finish =
+ std::__uninitialized_copy_a(__mid, __last,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ }
+ }
+ template<typename _Tp, typename _Alloc>
+ void
+ vector<_Tp, _Alloc>::
+ _M_insert_aux(iterator __position, const _Tp& __x)
+ {
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish,
+ (*(this->_M_impl._M_finish - 1)));
+ ++this->_M_impl._M_finish;
+ _Tp __x_copy = __x;
+ std::copy_backward(__position.base(), this->_M_impl._M_finish - 2, this->_M_impl._M_finish - 1);
+ *__position = __x_copy;
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(size_type(1), "vector::_M_insert_aux");
+ pointer __new_start(this->_M_allocate(__len));
+ pointer __new_finish(__new_start);
+ try
+ {
+ __new_finish =
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __position.base(), __new_start,
+ _M_get_Tp_allocator());
+ this->_M_impl.construct(__new_finish, __x);
+ ++__new_finish;
+ __new_finish =
+ std::__uninitialized_move_a(__position.base(),
+ this->_M_impl._M_finish,
+ __new_finish,
+ _M_get_Tp_allocator());
+ }
+ catch(...)
+ {
+ std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator());
+ _M_deallocate(__new_start, __len);
+ throw;
+ }
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __new_start;
+ this->_M_impl._M_finish = __new_finish;
+ this->_M_impl._M_end_of_storage = __new_start + __len;
+ }
+ }
+ template<typename _Tp, typename _Alloc>
+ void
+ vector<_Tp, _Alloc>::
+ _M_fill_insert(iterator __position, size_type __n, const value_type& __x)
+ {
+ if (__n != 0)
+ {
+ if (size_type(this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_finish) >= __n)
+ {
+ value_type __x_copy = __x;
+ const size_type __elems_after = end() - __position;
+ pointer __old_finish(this->_M_impl._M_finish);
+ if (__elems_after > __n)
+ {
+ std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
+ this->_M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n;
+ std::copy_backward(__position.base(), __old_finish - __n, __old_finish);
+ std::fill(__position.base(), __position.base() + __n,
+ __x_copy);
+ }
+ else
+ {
+ std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
+ __n - __elems_after,
+ __x_copy,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n - __elems_after;
+ std::__uninitialized_move_a(__position.base(), __old_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __elems_after;
+ std::fill(__position.base(), __old_finish, __x_copy);
+ }
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(__n, "vector::_M_fill_insert");
+ pointer __new_start(this->_M_allocate(__len));
+ pointer __new_finish(__new_start);
+ try
+ {
+ __new_finish =
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __position.base(),
+ __new_start,
+ _M_get_Tp_allocator());
+ std::__uninitialized_fill_n_a(__new_finish, __n, __x,
+ _M_get_Tp_allocator());
+ __new_finish += __n;
+ __new_finish =
+ std::__uninitialized_move_a(__position.base(),
+ this->_M_impl._M_finish,
+ __new_finish,
+ _M_get_Tp_allocator());
+ }
+ catch(...)
+ {
+ std::_Destroy(__new_start, __new_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(__new_start, __len);
+ throw;
+ }
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __new_start;
+ this->_M_impl._M_finish = __new_finish;
+ this->_M_impl._M_end_of_storage = __new_start + __len;
+ }
+ }
+ }
+ template<typename _Tp, typename _Alloc>
+ template<typename _InputIterator>
+ void
+ vector<_Tp, _Alloc>::
+ _M_range_insert(iterator __pos, _InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag)
+ {
+ for (; __first != __last; ++__first)
+ {
+ __pos = insert(__pos, *__first);
+ ++__pos;
+ }
+ }
+ template<typename _Tp, typename _Alloc>
+ template<typename _ForwardIterator>
+ void
+ vector<_Tp, _Alloc>::
+ _M_range_insert(iterator __position, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag)
+ {
+ if (__first != __last)
+ {
+ const size_type __n = std::distance(__first, __last);
+ if (size_type(this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_finish) >= __n)
+ {
+ const size_type __elems_after = end() - __position;
+ pointer __old_finish(this->_M_impl._M_finish);
+ if (__elems_after > __n)
+ {
+ std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
+ this->_M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n;
+ std::copy_backward(__position.base(), __old_finish - __n, __old_finish);
+ std::copy(__first, __last, __position);
+ }
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, __elems_after);
+ std::__uninitialized_copy_a(__mid, __last,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n - __elems_after;
+ std::__uninitialized_move_a(__position.base(),
+ __old_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __elems_after;
+ std::copy(__first, __mid, __position);
+ }
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(__n, "vector::_M_range_insert");
+ pointer __new_start(this->_M_allocate(__len));
+ pointer __new_finish(__new_start);
+ try
+ {
+ __new_finish =
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __position.base(),
+ __new_start,
+ _M_get_Tp_allocator());
+ __new_finish =
+ std::__uninitialized_copy_a(__first, __last,
+ __new_finish,
+ _M_get_Tp_allocator());
+ __new_finish =
+ std::__uninitialized_move_a(__position.base(),
+ this->_M_impl._M_finish,
+ __new_finish,
+ _M_get_Tp_allocator());
+ }
+ catch(...)
+ {
+ std::_Destroy(__new_start, __new_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(__new_start, __len);
+ throw;
+ }
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __new_start;
+ this->_M_impl._M_finish = __new_finish;
+ this->_M_impl._M_end_of_storage = __new_start + __len;
+ }
+ }
+ }
+ template<typename _Alloc>
+ void
+ vector<bool, _Alloc>::
+ reserve(size_type __n)
+ {
+ if (__n > this->max_size())
+ __throw_length_error(("vector::reserve"));
+ if (this->capacity() < __n)
+ {
+ _Bit_type* __q = this->_M_allocate(__n);
+ this->_M_impl._M_finish = _M_copy_aligned(begin(), end(),
+ iterator(__q, 0));
+ this->_M_deallocate();
+ this->_M_impl._M_start = iterator(__q, 0);
+ this->_M_impl._M_end_of_storage = (__q + (__n + int(_S_word_bit) - 1)
+ / int(_S_word_bit));
+ }
+ }
+ template<typename _Alloc>
+ void
+ vector<bool, _Alloc>::
+ _M_fill_insert(iterator __position, size_type __n, bool __x)
+ {
+ if (__n == 0)
+ return;
+ if (capacity() - size() >= __n)
+ {
+ std::copy_backward(__position, end(),
+ this->_M_impl._M_finish + difference_type(__n));
+ std::fill(__position, __position + difference_type(__n), __x);
+ this->_M_impl._M_finish += difference_type(__n);
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(__n, "vector<bool>::_M_fill_insert");
+ _Bit_type * __q = this->_M_allocate(__len);
+ iterator __i = _M_copy_aligned(begin(), __position,
+ iterator(__q, 0));
+ std::fill(__i, __i + difference_type(__n), __x);
+ this->_M_impl._M_finish = std::copy(__position, end(),
+ __i + difference_type(__n));
+ this->_M_deallocate();
+ this->_M_impl._M_end_of_storage = (__q + ((__len
+ + int(_S_word_bit) - 1)
+ / int(_S_word_bit)));
+ this->_M_impl._M_start = iterator(__q, 0);
+ }
+ }
+ template<typename _Alloc>
+ template<typename _ForwardIterator>
+ void
+ vector<bool, _Alloc>::
+ _M_insert_range(iterator __position, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag)
+ {
+ if (__first != __last)
+ {
+ size_type __n = std::distance(__first, __last);
+ if (capacity() - size() >= __n)
+ {
+ std::copy_backward(__position, end(),
+ this->_M_impl._M_finish
+ + difference_type(__n));
+ std::copy(__first, __last, __position);
+ this->_M_impl._M_finish += difference_type(__n);
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(__n, "vector<bool>::_M_insert_range");
+ _Bit_type * __q = this->_M_allocate(__len);
+ iterator __i = _M_copy_aligned(begin(), __position,
+ iterator(__q, 0));
+ __i = std::copy(__first, __last, __i);
+ this->_M_impl._M_finish = std::copy(__position, end(), __i);
+ this->_M_deallocate();
+ this->_M_impl._M_end_of_storage = (__q
+ + ((__len
+ + int(_S_word_bit) - 1)
+ / int(_S_word_bit)));
+ this->_M_impl._M_start = iterator(__q, 0);
+ }
+ }
+ }
+ template<typename _Alloc>
+ void
+ vector<bool, _Alloc>::
+ _M_insert_aux(iterator __position, bool __x)
+ {
+ if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
+ {
+ std::copy_backward(__position, this->_M_impl._M_finish,
+ this->_M_impl._M_finish + 1);
+ *__position = __x;
+ ++this->_M_impl._M_finish;
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(size_type(1), "vector<bool>::_M_insert_aux");
+ _Bit_type * __q = this->_M_allocate(__len);
+ iterator __i = _M_copy_aligned(begin(), __position,
+ iterator(__q, 0));
+ *__i++ = __x;
+ this->_M_impl._M_finish = std::copy(__position, end(), __i);
+ this->_M_deallocate();
+ this->_M_impl._M_end_of_storage = (__q + ((__len
+ + int(_S_word_bit) - 1)
+ / int(_S_word_bit)));
+ this->_M_impl._M_start = iterator(__q, 0);
+ }
+ }
+}
+extern "C" {
+union wait
+ {
+ int w_status;
+ struct
+ {
+ unsigned int __w_termsig:7;
+ unsigned int __w_coredump:1;
+ unsigned int __w_retcode:8;
+ unsigned int:16;
+ } __wait_terminated;
+ struct
+ {
+ unsigned int __w_stopval:8;
+ unsigned int __w_stopsig:8;
+ unsigned int:16;
+ } __wait_stopped;
+ };
+typedef struct
+ {
+ int quot;
+ int rem;
+ } div_t;
+typedef struct
+ {
+ long int quot;
+ long int rem;
+ } ldiv_t;
+__extension__ typedef struct
+ {
+ long long int quot;
+ long long int rem;
+ } lldiv_t;
+extern double atof (__const char *__nptr)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+extern int atoi (__const char *__nptr)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+extern long int atol (__const char *__nptr)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+__extension__ extern long long int atoll (__const char *__nptr)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+extern double strtod (__const char *__restrict __nptr,
+ char **__restrict __endptr)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern float strtof (__const char *__restrict __nptr,
+ char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))) ;
+extern long double strtold (__const char *__restrict __nptr,
+ char **__restrict __endptr)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern long int strtol (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern unsigned long int strtoul (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+__extension__
+extern long long int strtoq (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+__extension__
+extern unsigned long long int strtouq (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+__extension__
+extern long long int strtoll (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+__extension__
+extern unsigned long long int strtoull (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern char *l64a (long int __n) throw () ;
+extern long int a64l (__const char *__s)
+ throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+extern "C" {
+typedef __u_char u_char;
+typedef __u_short u_short;
+typedef __u_int u_int;
+typedef __u_long u_long;
+typedef __quad_t quad_t;
+typedef __u_quad_t u_quad_t;
+typedef __fsid_t fsid_t;
+typedef __loff_t loff_t;
+typedef __ino_t ino_t;
+typedef __ino64_t ino64_t;
+typedef __dev_t dev_t;
+typedef __mode_t mode_t;
+typedef __nlink_t nlink_t;
+typedef __id_t id_t;
+typedef __daddr_t daddr_t;
+typedef __caddr_t caddr_t;
+typedef __key_t key_t;
+typedef __suseconds_t suseconds_t;
+typedef unsigned long int ulong;
+typedef unsigned short int ushort;
+typedef unsigned int uint;
+typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
+typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
+typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
+typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
+typedef int register_t __attribute__ ((__mode__ (__word__)));
+struct timeval
+ {
+ __time_t tv_sec;
+ __suseconds_t tv_usec;
+ };
+typedef long int __fd_mask;
+typedef struct
+ {
+ __fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask))];
+ } fd_set;
+typedef __fd_mask fd_mask;
+extern "C" {
+extern int select (int __nfds, fd_set *__restrict __readfds,
+ fd_set *__restrict __writefds,
+ fd_set *__restrict __exceptfds,
+ struct timeval *__restrict __timeout);
+extern int pselect (int __nfds, fd_set *__restrict __readfds,
+ fd_set *__restrict __writefds,
+ fd_set *__restrict __exceptfds,
+ const struct timespec *__restrict __timeout,
+ const __sigset_t *__restrict __sigmask);
+}
+__extension__
+static __inline unsigned int gnu_dev_major (unsigned long long int __dev)
+ throw ();
+__extension__
+static __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
+ throw ();
+__extension__
+static __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
+ unsigned int __minor)
+ throw ();
+__extension__ static __inline unsigned int
+gnu_dev_major (unsigned long long int __dev) throw ()
+{
+ return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
+}
+__extension__ static __inline unsigned int
+gnu_dev_minor (unsigned long long int __dev) throw ()
+{
+ return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
+}
+__extension__ static __inline unsigned long long int
+gnu_dev_makedev (unsigned int __major, unsigned int __minor) throw ()
+{
+ return ((__minor & 0xff) | ((__major & 0xfff) << 8)
+ | (((unsigned long long int) (__minor & ~0xff)) << 12)
+ | (((unsigned long long int) (__major & ~0xfff)) << 32));
+}
+typedef __blksize_t blksize_t;
+typedef __blkcnt_t blkcnt_t;
+typedef __fsblkcnt_t fsblkcnt_t;
+typedef __fsfilcnt_t fsfilcnt_t;
+typedef __blkcnt64_t blkcnt64_t;
+typedef __fsblkcnt64_t fsblkcnt64_t;
+typedef __fsfilcnt64_t fsfilcnt64_t;
+}
+extern long int random (void) throw ();
+extern void srandom (unsigned int __seed) throw ();
+extern char *initstate (unsigned int __seed, char *__statebuf,
+ size_t __statelen) throw () __attribute__ ((__nonnull__ (2)));
+extern char *setstate (char *__statebuf) throw () __attribute__ ((__nonnull__ (1)));
+struct random_data
+ {
+ int32_t *fptr;
+ int32_t *rptr;
+ int32_t *state;
+ int rand_type;
+ int rand_deg;
+ int rand_sep;
+ int32_t *end_ptr;
+ };
+extern int random_r (struct random_data *__restrict __buf,
+ int32_t *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int srandom_r (unsigned int __seed, struct random_data *__buf)
+ throw () __attribute__ ((__nonnull__ (2)));
+extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
+ size_t __statelen,
+ struct random_data *__restrict __buf)
+ throw () __attribute__ ((__nonnull__ (2, 4)));
+extern int setstate_r (char *__restrict __statebuf,
+ struct random_data *__restrict __buf)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int rand (void) throw ();
+extern void srand (unsigned int __seed) throw ();
+extern int rand_r (unsigned int *__seed) throw ();
+extern double drand48 (void) throw ();
+extern double erand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1)));
+extern long int lrand48 (void) throw ();
+extern long int nrand48 (unsigned short int __xsubi[3])
+ throw () __attribute__ ((__nonnull__ (1)));
+extern long int mrand48 (void) throw ();
+extern long int jrand48 (unsigned short int __xsubi[3])
+ throw () __attribute__ ((__nonnull__ (1)));
+extern void srand48 (long int __seedval) throw ();
+extern unsigned short int *seed48 (unsigned short int __seed16v[3])
+ throw () __attribute__ ((__nonnull__ (1)));
+extern void lcong48 (unsigned short int __param[7]) throw () __attribute__ ((__nonnull__ (1)));
+struct drand48_data
+ {
+ unsigned short int __x[3];
+ unsigned short int __old_x[3];
+ unsigned short int __c;
+ unsigned short int __init;
+ unsigned long long int __a;
+ };
+extern int drand48_r (struct drand48_data *__restrict __buffer,
+ double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int erand48_r (unsigned short int __xsubi[3],
+ struct drand48_data *__restrict __buffer,
+ double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int lrand48_r (struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int nrand48_r (unsigned short int __xsubi[3],
+ struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int mrand48_r (struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int jrand48_r (unsigned short int __xsubi[3],
+ struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
+ throw () __attribute__ ((__nonnull__ (2)));
+extern int seed48_r (unsigned short int __seed16v[3],
+ struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int lcong48_r (unsigned short int __param[7],
+ struct drand48_data *__buffer)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__)) ;
+extern void *calloc (size_t __nmemb, size_t __size)
+ throw () __attribute__ ((__malloc__)) ;
+extern void *realloc (void *__ptr, size_t __size)
+ throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
+extern void free (void *__ptr) throw ();
+extern void cfree (void *__ptr) throw ();
+extern "C" {
+extern void *alloca (size_t __size) throw ();
+}
+extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__)) ;
+extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern void abort (void) throw () __attribute__ ((__noreturn__));
+extern int atexit (void (*__func) (void)) throw () __attribute__ ((__nonnull__ (1)));
+extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
+ throw () __attribute__ ((__nonnull__ (1)));
+extern void exit (int __status) throw () __attribute__ ((__noreturn__));
+extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));
+extern char *getenv (__const char *__name) throw () __attribute__ ((__nonnull__ (1))) ;
+extern char *__secure_getenv (__const char *__name)
+ throw () __attribute__ ((__nonnull__ (1))) ;
+extern int putenv (char *__string) throw () __attribute__ ((__nonnull__ (1)));
+extern int setenv (__const char *__name, __const char *__value, int __replace)
+ throw () __attribute__ ((__nonnull__ (2)));
+extern int unsetenv (__const char *__name) throw ();
+extern int clearenv (void) throw ();
+extern char *mktemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) ;
+extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
+extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
+extern char *mkdtemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) ;
+extern int system (__const char *__command) ;
+extern char *realpath (__const char *__restrict __name,
+ char *__restrict __resolved) throw () __attribute__ ((__nonnull__ (2)));
+typedef int (*__compar_fn_t) (__const void *, __const void *);
+typedef __compar_fn_t comparison_fn_t;
+extern void *bsearch (__const void *__key, __const void *__base,
+ size_t __nmemb, size_t __size, __compar_fn_t __compar)
+ __attribute__ ((__nonnull__ (1, 2, 5))) ;
+extern void qsort (void *__base, size_t __nmemb, size_t __size,
+ __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
+extern int abs (int __x) throw () __attribute__ ((__const__)) ;
+extern long int labs (long int __x) throw () __attribute__ ((__const__)) ;
+__extension__ extern long long int llabs (long long int __x)
+ throw () __attribute__ ((__const__)) ;
+extern div_t div (int __numer, int __denom)
+ throw () __attribute__ ((__const__)) ;
+extern ldiv_t ldiv (long int __numer, long int __denom)
+ throw () __attribute__ ((__const__)) ;
+__extension__ extern lldiv_t lldiv (long long int __numer,
+ long long int __denom)
+ throw () __attribute__ ((__const__)) ;
+extern char *gcvt (double __value, int __ndigit, char *__buf)
+ throw () __attribute__ ((__nonnull__ (3))) ;
+extern int rpmatch (__const char *__response) throw () __attribute__ ((__nonnull__ (1))) ;
+extern int getsubopt (char **__restrict __optionp,
+ char *__const *__restrict __tokens,
+ char **__restrict __valuep)
+ throw () __attribute__ ((__nonnull__ (1, 2, 3))) ;
+extern void setkey (__const char *__key) throw () __attribute__ ((__nonnull__ (1)));
+extern int posix_openpt (int __oflag) ;
+extern int grantpt (int __fd) throw ();
+extern int unlockpt (int __fd) throw ();
+extern char *ptsname (int __fd) throw () ;
+extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
+ throw () __attribute__ ((__nonnull__ (2)));
+}
+typedef QtValidLicenseForCoreModule QtCoreModule;
+struct __attribute__((visibility("default"))) QVectorData
+{
+ QBasicAtomicInt ref;
+ int alloc;
+ int size;
+ uint sharable : 1;
+ uint capacity : 1;
+ static QVectorData shared_null;
+ static QVectorData *malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init);
+ static int grow(int sizeofTypedData, int size, int sizeofT, bool excessive);
+};
+template <typename T>
+struct QVectorTypedData
+{
+ QBasicAtomicInt ref;
+ int alloc;
+ int size;
+ uint sharable : 1;
+ uint capacity : 1;
+ T array[1];
+};
+class QRegion;
+template <typename T>
+class QVector
+{
+ typedef QVectorTypedData<T> Data;
+ union { QVectorData *p; QVectorTypedData<T> *d; };
+public:
+ inline QVector() : p(&QVectorData::shared_null) { d->ref.ref(); }
+ explicit QVector(int size);
+ QVector(int size, const T &t);
+ inline QVector(const QVector<T> &v) : d(v.d) { d->ref.ref(); if (!d->sharable) detach_helper(); }
+ inline ~QVector() { if (!d) return; if (!d->ref.deref()) free(d); }
+ QVector<T> &operator=(const QVector<T> &v);
+ bool operator==(const QVector<T> &v) const;
+ inline bool operator!=(const QVector<T> &v) const { return !(*this == v); }
+ inline int size() const { return d->size; }
+ inline bool isEmpty() const { return d->size == 0; }
+ void resize(int size);
+ inline int capacity() const { return d->alloc; }
+ void reserve(int size);
+ inline void squeeze() { realloc(d->size, d->size); d->capacity = 0; }
+ inline void detach() { if (d->ref != 1) detach_helper(); }
+ inline bool isDetached() const { return d->ref == 1; }
+ inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
+ inline T *data() { detach(); return d->array; }
+ inline const T *data() const { return d->array; }
+ inline const T *constData() const { return d->array; }
+ void clear();
+ const T &at(int i) const;
+ T &operator[](int i);
+ const T &operator[](int i) const;
+ void append(const T &t);
+ void prepend(const T &t);
+ void insert(int i, const T &t);
+ void insert(int i, int n, const T &t);
+ void replace(int i, const T &t);
+ void remove(int i);
+ void remove(int i, int n);
+ QVector<T> &fill(const T &t, int size = -1);
+ int indexOf(const T &t, int from = 0) const;
+ int lastIndexOf(const T &t, int from = -1) const;
+ bool contains(const T &t) const;
+ int count(const T &t) const;
+ typedef T* iterator;
+ typedef const T* const_iterator;
+ inline iterator begin() { detach(); return d->array; }
+ inline const_iterator begin() const { return d->array; }
+ inline const_iterator constBegin() const { return d->array; }
+ inline iterator end() { detach(); return d->array + d->size; }
+ inline const_iterator end() const { return d->array + d->size; }
+ inline const_iterator constEnd() const { return d->array + d->size; }
+ iterator insert(iterator before, int n, const T &x);
+ inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); }
+ iterator erase(iterator begin, iterator end);
+ inline iterator erase(iterator pos) { return erase(pos, pos+1); }
+ inline int count() const { return d->size; }
+ inline T& first() { qt_noop(); return *begin(); }
+ inline const T &first() const { qt_noop(); return *begin(); }
+ inline T& last() { qt_noop(); return *(end()-1); }
+ inline const T &last() const { qt_noop(); return *(end()-1); }
+ inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; }
+ inline bool endsWith(const T &t) const { return !isEmpty() && last() == t; }
+ QVector<T> mid(int pos, int length = -1) const;
+ T value(int i) const;
+ T value(int i, const T &defaultValue) const;
+ typedef T value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef ptrdiff_t difference_type;
+ typedef iterator Iterator;
+ typedef const_iterator ConstIterator;
+ typedef int size_type;
+ inline void push_back(const T &t) { append(t); }
+ inline void push_front(const T &t) { prepend(t); }
+ void pop_back() { qt_noop(); erase(end()-1); }
+ void pop_front() { qt_noop(); erase(begin()); }
+ inline bool empty() const
+ { return d->size == 0; }
+ inline T& front() { return first(); }
+ inline const_reference front() const { return first(); }
+ inline reference back() { return last(); }
+ inline const_reference back() const { return last(); }
+ QVector<T> &operator+=(const QVector<T> &l);
+ inline QVector<T> operator+(const QVector<T> &l) const
+ { QVector n = *this; n += l; return n; }
+ inline QVector<T> &operator+=(const T &t)
+ { append(t); return *this; }
+ inline QVector<T> &operator<< (const T &t)
+ { append(t); return *this; }
+ inline QVector<T> &operator<<(const QVector<T> &l)
+ { *this += l; return *this; }
+ QList<T> toList() const;
+ static QVector<T> fromList(const QList<T> &list);
+ static inline QVector<T> fromStdVector(const std::vector<T> &vector)
+ { QVector<T> tmp; qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; }
+ inline std::vector<T> toStdVector() const
+ { std::vector<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
+private:
+ friend class QRegion;
+ void detach_helper();
+ QVectorData *malloc(int alloc);
+ void realloc(int size, int alloc);
+ void free(Data *d);
+ int sizeOfTypedData() {
+ return reinterpret_cast<const char *>(&(reinterpret_cast<const Data *>(this))->array[1]) - reinterpret_cast<const char *>(this);
+ }
+};
+template <typename T>
+void QVector<T>::detach_helper()
+{ realloc(d->size, d->alloc); }
+template <typename T>
+void QVector<T>::reserve(int asize)
+{ if (asize > d->alloc) realloc(d->size, asize); d->capacity = 1; }
+template <typename T>
+void QVector<T>::resize(int asize)
+{ realloc(asize, (asize > d->alloc || (!d->capacity && asize < d->size && asize < (d->alloc >> 1))) ?
+ QVectorData::grow(sizeOfTypedData(), asize, sizeof(T), QTypeInfo<T>::isStatic)
+ : d->alloc); }
+template <typename T>
+inline void QVector<T>::clear()
+{ *this = QVector<T>(); }
+template <typename T>
+inline const T &QVector<T>::at(int i) const
+{ qt_noop();
+ return d->array[i]; }
+template <typename T>
+inline const T &QVector<T>::operator[](int i) const
+{ qt_noop();
+ return d->array[i]; }
+template <typename T>
+inline T &QVector<T>::operator[](int i)
+{ qt_noop();
+ return data()[i]; }
+template <typename T>
+inline void QVector<T>::insert(int i, const T &t)
+{ qt_noop();
+ insert(begin() + i, 1, t); }
+template <typename T>
+inline void QVector<T>::insert(int i, int n, const T &t)
+{ qt_noop();
+ insert(begin() + i, n, t); }
+template <typename T>
+inline void QVector<T>::remove(int i, int n)
+{ qt_noop();
+ erase(begin() + i, begin() + i + n); }
+template <typename T>
+inline void QVector<T>::remove(int i)
+{ qt_noop();
+ erase(begin() + i, begin() + i + 1); }
+template <typename T>
+inline void QVector<T>::prepend(const T &t)
+{ insert(begin(), 1, t); }
+template <typename T>
+inline void QVector<T>::replace(int i, const T &t)
+{
+ qt_noop();
+ const T copy(t);
+ data()[i] = copy;
+}
+template <typename T>
+QVector<T> &QVector<T>::operator=(const QVector<T> &v)
+{
+ v.d->ref.ref();
+ if (!d->ref.deref())
+ free(d);
+ d = v.d;
+ if (!d->sharable)
+ detach_helper();
+ return *this;
+}
+template <typename T>
+inline QVectorData *QVector<T>::malloc(int aalloc)
+{
+ return static_cast<QVectorData *>(qMalloc(sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
+}
+template <typename T>
+QVector<T>::QVector(int asize)
+{
+ p = malloc(asize);
+ d->ref = 1;
+ d->alloc = d->size = asize;
+ d->sharable = true;
+ d->capacity = false;
+ if (QTypeInfo<T>::isComplex) {
+ T* b = d->array;
+ T* i = d->array + d->size;
+ while (i != b)
+ new (--i) T;
+ } else {
+ qMemSet(d->array, 0, asize * sizeof(T));
+ }
+}
+template <typename T>
+QVector<T>::QVector(int asize, const T &t)
+{
+ p = malloc(asize);
+ d->ref = 1;
+ d->alloc = d->size = asize;
+ d->sharable = true;
+ d->capacity = false;
+ T* i = d->array + d->size;
+ while (i != d->array)
+ new (--i) T(t);
+}
+template <typename T>
+void QVector<T>::free(Data *x)
+{
+ if (QTypeInfo<T>::isComplex) {
+ T* b = x->array;
+ T* i = b + x->size;
+ while (i-- != b)
+ i->~T();
+ }
+ qFree(x);
+}
+template <typename T>
+void QVector<T>::realloc(int asize, int aalloc)
+{
+ T *j, *i, *b;
+ union { QVectorData *p; Data *d; } x;
+ x.d = d;
+ if (QTypeInfo<T>::isComplex && aalloc == d->alloc && d->ref == 1) {
+ i = d->array + d->size;
+ j = d->array + asize;
+ if (i > j) {
+ while (i-- != j)
+ i->~T();
+ } else {
+ while (j-- != i)
+ new (j) T;
+ }
+ d->size = asize;
+ return;
+ }
+ if (aalloc != d->alloc || d->ref != 1) {
+ if (QTypeInfo<T>::isStatic) {
+ x.p = malloc(aalloc);
+ } else if (d->ref != 1) {
+ x.p = QVectorData::malloc(sizeOfTypedData(), aalloc, sizeof(T), p);
+ } else {
+ if (QTypeInfo<T>::isComplex) {
+ if (asize < d->size) {
+ j = d->array + asize;
+ i = d->array + d->size;
+ while (i-- != j)
+ i->~T();
+ i = d->array + asize;
+ }
+ }
+ x.p = p = static_cast<QVectorData *>(qRealloc(p, sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
+ }
+ x.d->ref = 1;
+ x.d->sharable = true;
+ x.d->capacity = d->capacity;
+ }
+ if (QTypeInfo<T>::isComplex) {
+ if (asize < d->size) {
+ j = d->array + asize;
+ i = x.d->array + asize;
+ } else {
+ i = x.d->array + asize;
+ j = x.d->array + d->size;
+ while (i != j)
+ new (--i) T;
+ j = d->array + d->size;
+ }
+ if (i != j) {
+ b = x.d->array;
+ while (i != b)
+ new (--i) T(*--j);
+ }
+ } else if (asize > d->size) {
+ qMemSet(x.d->array + d->size, 0, (asize - d->size) * sizeof(T));
+ }
+ x.d->size = asize;
+ x.d->alloc = aalloc;
+ if (d != x.d) {
+ if (!d->ref.deref())
+ free(d);
+ d = x.d;
+ }
+}
+template<typename T>
+ T QVector<T>::value(int i) const
+{
+ if (i < 0 || i >= p->size) {
+ return T();
+ }
+ return d->array[i];
+}
+template<typename T>
+ T QVector<T>::value(int i, const T &defaultValue) const
+{
+ return ((i < 0 || i >= p->size) ? defaultValue : d->array[i]);
+}
+template <typename T>
+void QVector<T>::append(const T &t)
+{
+ if (d->ref != 1 || d->size + 1 > d->alloc) {
+ const T copy(t);
+ realloc(d->size, QVectorData::grow(sizeOfTypedData(), d->size + 1, sizeof(T),
+ QTypeInfo<T>::isStatic));
+ if (QTypeInfo<T>::isComplex)
+ new (d->array + d->size) T(copy);
+ else
+ d->array[d->size] = copy;
+ } else {
+ if (QTypeInfo<T>::isComplex)
+ new (d->array + d->size) T(t);
+ else
+ d->array[d->size] = t;
+ }
+ ++d->size;
+}
+template <typename T>
+typename QVector<T>::iterator QVector<T>::insert(iterator before, size_type n, const T &t)
+{
+ int offset = before - d->array;
+ if (n != 0) {
+ const T copy(t);
+ if (d->ref != 1 || d->size + n > d->alloc)
+ realloc(d->size, QVectorData::grow(sizeOfTypedData(), d->size + n, sizeof(T),
+ QTypeInfo<T>::isStatic));
+ if (QTypeInfo<T>::isStatic) {
+ T *b = d->array + d->size;
+ T *i = d->array + d->size + n;
+ while (i != b)
+ new (--i) T;
+ i = d->array + d->size;
+ T *j = i + n;
+ b = d->array + offset;
+ while (i != b)
+ *--j = *--i;
+ i = b+n;
+ while (i != b)
+ *--i = copy;
+ } else {
+ T *b = d->array + offset;
+ T *i = b + n;
+ memmove(i, b, (d->size - offset) * sizeof(T));
+ while (i != b)
+ new (--i) T(copy);
+ }
+ d->size += n;
+ }
+ return d->array + offset;
+}
+template <typename T>
+typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
+{
+ int f = abegin - d->array;
+ int l = aend - d->array;
+ int n = l - f;
+ detach();
+ if (QTypeInfo<T>::isComplex) {
+ qCopy(d->array+l, d->array+d->size, d->array+f);
+ T *i = d->array+d->size;
+ T* b = d->array+d->size-n;
+ while (i != b) {
+ --i;
+ i->~T();
+ }
+ } else {
+ memmove(d->array + f, d->array + l, (d->size-l)*sizeof(T));
+ }
+ d->size -= n;
+ return d->array + f;
+}
+template <typename T>
+bool QVector<T>::operator==(const QVector<T> &v) const
+{
+ if (d->size != v.d->size)
+ return false;
+ if (d == v.d)
+ return true;
+ T* b = d->array;
+ T* i = b + d->size;
+ T* j = v.d->array + d->size;
+ while (i != b)
+ if (!(*--i == *--j))
+ return false;
+ return true;
+}
+template <typename T>
+QVector<T> &QVector<T>::fill(const T &from, int asize)
+{
+ const T copy(from);
+ resize(asize < 0 ? d->size : asize);
+ if (d->size) {
+ T *i = d->array + d->size;
+ T *b = d->array;
+ while (i != b)
+ *--i = copy;
+ }
+ return *this;
+}
+template <typename T>
+QVector<T> &QVector<T>::operator+=(const QVector &l)
+{
+ int newSize = d->size + l.d->size;
+ realloc(d->size, newSize);
+ T *w = d->array + newSize;
+ T *i = l.d->array + l.d->size;
+ T *b = l.d->array;
+ while (i != b) {
+ if (QTypeInfo<T>::isComplex)
+ new (--w) T(*--i);
+ else
+ *--w = *--i;
+ }
+ d->size = newSize;
+ return *this;
+}
+template <typename T>
+int QVector<T>::indexOf(const T &t, int from) const
+{
+ if (from < 0)
+ from = qMax(from + d->size, 0);
+ if (from < d->size) {
+ T* n = d->array + from - 1;
+ T* e = d->array + d->size;
+ while (++n != e)
+ if (*n == t)
+ return n - d->array;
+ }
+ return -1;
+}
+template <typename T>
+int QVector<T>::lastIndexOf(const T &t, int from) const
+{
+ if (from < 0)
+ from += d->size;
+ else if (from >= d->size)
+ from = d->size-1;
+ if (from >= 0) {
+ T* b = d->array;
+ T* n = d->array + from + 1;
+ while (n != b) {
+ if (*--n == t)
+ return n - b;
+ }
+ }
+ return -1;
+}
+template <typename T>
+bool QVector<T>::contains(const T &t) const
+{
+ T* b = d->array;
+ T* i = d->array + d->size;
+ while (i != b)
+ if (*--i == t)
+ return true;
+ return false;
+}
+template <typename T>
+int QVector<T>::count(const T &t) const
+{
+ int c = 0;
+ T* b = d->array;
+ T* i = d->array + d->size;
+ while (i != b)
+ if (*--i == t)
+ ++c;
+ return c;
+}
+template <typename T>
+ QVector<T> QVector<T>::mid(int pos, int length) const
+{
+ if (length < 0)
+ length = size() - pos;
+ if (pos == 0 && length == size())
+ return *this;
+ QVector<T> copy;
+ if (pos + length > size())
+ length = size() - pos;
+ for (int i = pos; i < pos + length; ++i)
+ copy += at(i);
+ return copy;
+}
+template <typename T>
+ QList<T> QVector<T>::toList() const
+{
+ QList<T> result;
+ for (int i = 0; i < size(); ++i)
+ result.append(at(i));
+ return result;
+}
+template <typename T>
+ QVector<T> QList<T>::toVector() const
+{
+ QVector<T> result(size());
+ for (int i = 0; i < size(); ++i)
+ result[i] = at(i);
+ return result;
+}
+template <typename T>
+QVector<T> QVector<T>::fromList(const QList<T> &list)
+{
+ return list.toVector();
+}
+template <typename T>
+QList<T> QList<T>::fromVector(const QVector<T> &vector)
+{
+ return vector.toList();
+}
+template <class T> class QVectorIterator { typedef typename QVector<T>::const_iterator const_iterator; QVector<T> c; const_iterator i; public: inline QVectorIterator(const QVector<T> &container) : c(container), i(c.constBegin()) {} inline QVectorIterator &operator=(const QVector<T> &container) { c = container; i = c.constBegin(); return *this; } inline void toFront() { i = c.constBegin(); } inline void toBack() { i = c.constEnd(); } inline bool hasNext() const { return i != c.constEnd(); } inline const T &next() { return *i++; } inline const T &peekNext() const { return *i; } inline bool hasPrevious() const { return i != c.constBegin(); } inline const T &previous() { return *--i; } inline const T &peekPrevious() const { const_iterator p = i; return *--p; } inline bool findNext(const T &t) { while (i != c.constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (i != c.constBegin()) if (*(--i) == t) return true; return false; } };
+template <class T> class QMutableVectorIterator { typedef typename QVector<T>::iterator iterator; typedef typename QVector<T>::const_iterator const_iterator; QVector<T> *c; iterator i, n; inline bool item_exists() const { return const_iterator(n) != c->constEnd(); } public: inline QMutableVectorIterator(QVector<T> &container) : c(&container) { c->setSharable(false); i = c->begin(); n = c->end(); } inline ~QMutableVectorIterator() { c->setSharable(true); } inline QMutableVectorIterator &operator=(QVector<T> &container) { c->setSharable(true); c = &container; c->setSharable(false); i = c->begin(); n = c->end(); return *this; } inline void toFront() { i = c->begin(); n = c->end(); } inline void toBack() { i = c->end(); n = i; } inline bool hasNext() const { return c->constEnd() != const_iterator(i); } inline T &next() { n = i++; return *n; } inline T &peekNext() const { return *i; } inline bool hasPrevious() const { return c->constBegin() != const_iterator(i); } inline T &previous() { n = --i; return *n; } inline T &peekPrevious() const { iterator p = i; return *--p; } inline void remove() { if (c->constEnd() != const_iterator(n)) { i = c->erase(n); n = c->end(); } } inline void setValue(const T &t) const { if (c->constEnd() != const_iterator(n)) *n = t; } inline T &value() { qt_noop(); return *n; } inline const T &value() const { qt_noop(); return *n; } inline void insert(const T &t) { n = i = c->insert(i, t); ++i; } inline bool findNext(const T &t) { while (c->constEnd() != const_iterator(n = i)) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (c->constBegin() != const_iterator(i)) if (*(n = --i) == t) return true; n = c->end(); return false; } };
+typedef QtValidLicenseForCoreModule QtCoreModule;
+template <class T>
+class QSet
+{
+ typedef QHash<T, QHashDummyValue> Hash;
+public:
+ inline QSet() {}
+ inline QSet(const QSet<T> &other) : q_hash(other.q_hash) {}
+ inline QSet<T> &operator=(const QSet<T> &other)
+ { q_hash = other.q_hash; return *this; }
+ inline bool operator==(const QSet<T> &other) const
+ { return q_hash == other.q_hash; }
+ inline bool operator!=(const QSet<T> &other) const
+ { return q_hash != other.q_hash; }
+ inline int size() const { return q_hash.size(); }
+ inline bool isEmpty() const { return q_hash.isEmpty(); }
+ inline int capacity() const { return q_hash.capacity(); }
+ inline void reserve(int size);
+ inline void squeeze() { q_hash.squeeze(); }
+ inline void detach() { q_hash.detach(); }
+ inline bool isDetached() const { return q_hash.isDetached(); }
+ inline void setSharable(bool sharable) { q_hash.setSharable(sharable); }
+ inline void clear() { q_hash.clear(); }
+ inline bool remove(const T &value) { return q_hash.remove(value) != 0; }
+ inline bool contains(const T &value) const { return q_hash.contains(value); }
+ class const_iterator;
+ class iterator
+ {
+ typedef QHash<T, QHashDummyValue> Hash;
+ typename Hash::iterator i;
+ friend class const_iterator;
+ public:
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef const T *pointer;
+ typedef const T &reference;
+ inline iterator() {}
+ inline iterator(typename Hash::iterator o) : i(o) {}
+ inline iterator(const iterator &o) : i(o.i) {}
+ inline iterator &operator=(const iterator &o) { i = o.i; return *this; }
+ inline const T &operator*() const { return i.key(); }
+ inline const T *operator->() const { return &i.key(); }
+ inline bool operator==(const iterator &o) const { return i == o.i; }
+ inline bool operator!=(const iterator &o) const { return i != o.i; }
+ inline bool operator==(const const_iterator &o) const
+ { return i == o.i; }
+ inline bool operator!=(const const_iterator &o) const
+ { return i != o.i; }
+ inline iterator &operator++() { ++i; return *this; }
+ inline iterator operator++(int) { iterator r = *this; ++i; return r; }
+ inline iterator &operator--() { --i; return *this; }
+ inline iterator operator--(int) { iterator r = *this; --i; return r; }
+ inline iterator operator+(int j) const { return i + j; }
+ inline iterator operator-(int j) const { return i - j; }
+ inline iterator &operator+=(int j) { i += j; return *this; }
+ inline iterator &operator-=(int j) { i -= j; return *this; }
+ };
+ class const_iterator
+ {
+ typedef QHash<T, QHashDummyValue> Hash;
+ typename Hash::const_iterator i;
+ friend class iterator;
+ public:
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef const T *pointer;
+ typedef const T &reference;
+ inline const_iterator() {}
+ inline const_iterator(typename Hash::const_iterator o) : i(o) {}
+ inline const_iterator(const const_iterator &o) : i(o.i) {}
+ inline const_iterator(const iterator &o)
+ : i(o.i) {}
+ inline const_iterator &operator=(const const_iterator &o) { i = o.i; return *this; }
+ inline const T &operator*() const { return i.key(); }
+ inline const T *operator->() const { return &i.key(); }
+ inline bool operator==(const const_iterator &o) const { return i == o.i; }
+ inline bool operator!=(const const_iterator &o) const { return i != o.i; }
+ inline const_iterator &operator++() { ++i; return *this; }
+ inline const_iterator operator++(int) { const_iterator r = *this; ++i; return r; }
+ inline const_iterator &operator--() { --i; return *this; }
+ inline const_iterator operator--(int) { const_iterator r = *this; --i; return r; }
+ inline const_iterator operator+(int j) const { return i + j; }
+ inline const_iterator operator-(int j) const { return i - j; }
+ inline const_iterator &operator+=(int j) { i += j; return *this; }
+ inline const_iterator &operator-=(int j) { i -= j; return *this; }
+ };
+ inline iterator begin() { return q_hash.begin(); }
+ inline const_iterator begin() const { return q_hash.begin(); }
+ inline const_iterator constBegin() const { return q_hash.constBegin(); }
+ inline iterator end() { return q_hash.end(); }
+ inline const_iterator end() const { return q_hash.end(); }
+ inline const_iterator constEnd() const { return q_hash.constEnd(); }
+ iterator erase(iterator i)
+ { return q_hash.erase(reinterpret_cast<typename Hash::iterator &>(i)); }
+ typedef iterator Iterator;
+ typedef const_iterator ConstIterator;
+ inline int count() const { return q_hash.count(); }
+ inline const_iterator insert(const T &value)
+ { return static_cast<typename Hash::const_iterator>(q_hash.insert(value,
+ QHashDummyValue())); }
+ iterator find(const T &value) { return q_hash.find(value); }
+ const_iterator find(const T &value) const { return q_hash.find(value); }
+ inline const_iterator constFind(const T &value) const { return find(value); }
+ QSet<T> &unite(const QSet<T> &other);
+ QSet<T> &intersect(const QSet<T> &other);
+ QSet<T> &subtract(const QSet<T> &other);
+ typedef T key_type;
+ typedef T value_type;
+ typedef value_type *pointer;
+ typedef const value_type *const_pointer;
+ typedef value_type &reference;
+ typedef const value_type &const_reference;
+ typedef ptrdiff_t difference_type;
+ typedef int size_type;
+ inline bool empty() const { return isEmpty(); }
+ inline QSet<T> &operator<<(const T &value) { insert(value); return *this; }
+ inline QSet<T> &operator|=(const QSet<T> &other) { unite(other); return *this; }
+ inline QSet<T> &operator|=(const T &value) { insert(value); return *this; }
+ inline QSet<T> &operator&=(const QSet<T> &other) { intersect(other); return *this; }
+ inline QSet<T> &operator&=(const T &value)
+ { QSet<T> result; if (contains(value)) result.insert(value); return (*this = result); }
+ inline QSet<T> &operator+=(const QSet<T> &other) { unite(other); return *this; }
+ inline QSet<T> &operator+=(const T &value) { insert(value); return *this; }
+ inline QSet<T> &operator-=(const QSet<T> &other) { subtract(other); return *this; }
+ inline QSet<T> &operator-=(const T &value) { remove(value); return *this; }
+ inline QSet<T> operator|(const QSet<T> &other) const
+ { QSet<T> result = *this; result |= other; return result; }
+ inline QSet<T> operator&(const QSet<T> &other) const
+ { QSet<T> result = *this; result &= other; return result; }
+ inline QSet<T> operator+(const QSet<T> &other) const
+ { QSet<T> result = *this; result += other; return result; }
+ inline QSet<T> operator-(const QSet<T> &other) const
+ { QSet<T> result = *this; result -= other; return result; }
+ inline QSet<T> operator|(const QSet<T> &other)
+ { QSet<T> result = *this; result |= other; return result; }
+ inline QSet<T> operator&(const QSet<T> &other)
+ { QSet<T> result = *this; result &= other; return result; }
+ inline QSet<T> operator+(const QSet<T> &other)
+ { QSet<T> result = *this; result += other; return result; }
+ inline QSet<T> operator-(const QSet<T> &other)
+ { QSet<T> result = *this; result -= other; return result; }
+ QList<T> toList() const;
+ inline QList<T> values() const { return toList(); }
+ static QSet<T> fromList(const QList<T> &list);
+private:
+ Hash q_hash;
+};
+template <class T>
+inline void QSet<T>::reserve(int asize) { q_hash.reserve(asize); }
+template <class T>
+inline QSet<T> &QSet<T>::unite(const QSet<T> &other)
+{
+ QSet<T> copy(other);
+ typename QSet<T>::const_iterator i = copy.constEnd();
+ while (i != copy.constBegin()) {
+ --i;
+ insert(*i);
+ }
+ return *this;
+}
+template <class T>
+inline QSet<T> &QSet<T>::intersect(const QSet<T> &other)
+{
+ QSet<T> copy1(*this);
+ QSet<T> copy2(other);
+ typename QSet<T>::const_iterator i = copy1.constEnd();
+ while (i != copy1.constBegin()) {
+ --i;
+ if (!copy2.contains(*i))
+ remove(*i);
+ }
+ return *this;
+}
+template <class T>
+inline QSet<T> &QSet<T>::subtract(const QSet<T> &other)
+{
+ QSet<T> copy1(*this);
+ QSet<T> copy2(other);
+ typename QSet<T>::const_iterator i = copy1.constEnd();
+ while (i != copy1.constBegin()) {
+ --i;
+ if (copy2.contains(*i))
+ remove(*i);
+ }
+ return *this;
+}
+template <typename T>
+ QList<T> QSet<T>::toList() const
+{
+ QList<T> result;
+ typename QSet<T>::const_iterator i = constBegin();
+ while (i != constEnd()) {
+ result.append(*i);
+ ++i;
+ }
+ return result;
+}
+template <typename T>
+ QSet<T> QList<T>::toSet() const
+{
+ QSet<T> result;
+ result.reserve(size());
+ for (int i = 0; i < size(); ++i)
+ result.insert(at(i));
+ return result;
+}
+template <typename T>
+QSet<T> QSet<T>::fromList(const QList<T> &list)
+{
+ return list.toSet();
+}
+template <typename T>
+QList<T> QList<T>::fromSet(const QSet<T> &set)
+{
+ return set.toList();
+}
+template <class T> class QSetIterator { typedef typename QSet<T>::const_iterator const_iterator; QSet<T> c; const_iterator i; public: inline QSetIterator(const QSet<T> &container) : c(container), i(c.constBegin()) {} inline QSetIterator &operator=(const QSet<T> &container) { c = container; i = c.constBegin(); return *this; } inline void toFront() { i = c.constBegin(); } inline void toBack() { i = c.constEnd(); } inline bool hasNext() const { return i != c.constEnd(); } inline const T &next() { return *i++; } inline const T &peekNext() const { return *i; } inline bool hasPrevious() const { return i != c.constBegin(); } inline const T &previous() { return *--i; } inline const T &peekPrevious() const { const_iterator p = i; return *--p; } inline bool findNext(const T &t) { while (i != c.constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (i != c.constBegin()) if (*(--i) == t) return true; return false; } };
+template <typename T>
+class QMutableSetIterator
+{
+ typedef typename QSet<T>::iterator iterator;
+ QSet<T> *c;
+ iterator i, n;
+ inline bool item_exists() const { return n != c->constEnd(); }
+public:
+ inline QMutableSetIterator(QSet<T> &container)
+ : c(&container)
+ { c->setSharable(false); i = c->begin(); n = c->end(); }
+ inline ~QMutableSetIterator()
+ { c->setSharable(true); }
+ inline QMutableSetIterator &operator=(QSet<T> &container)
+ { c->setSharable(true); c = &container; c->setSharable(false);
+ i = c->begin(); n = c->end(); return *this; }
+ inline void toFront() { i = c->begin(); n = c->end(); }
+ inline void toBack() { i = c->end(); n = i; }
+ inline bool hasNext() const { return c->constEnd() != i; }
+ inline const T &next() { n = i++; return *n; }
+ inline const T &peekNext() const { return *i; }
+ inline bool hasPrevious() const { return c->constBegin() != i; }
+ inline const T &previous() { n = --i; return *n; }
+ inline const T &peekPrevious() const { iterator p = i; return *--p; }
+ inline void remove()
+ { if (c->constEnd() != n) { i = c->erase(n); n = c->end(); } }
+ inline const T &value() const { qt_noop(); return *n; }
+ inline bool findNext(const T &t)
+ { while (c->constEnd() != (n = i)) if (*i++ == t) return true; return false; }
+ inline bool findPrevious(const T &t)
+ { while (c->constBegin() != i) if (*(n = --i) == t) return true;
+ n = c->end(); return false; }
+};
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class __attribute__((visibility("default"))) QDebug
+{
+ struct Stream {
+ Stream(QIODevice *device) : ts(device), ref(1), type(QtDebugMsg), space(true), message_output(false) {}
+ Stream(QString *string) : ts(string, QIODevice::WriteOnly), ref(1), type(QtDebugMsg), space(true), message_output(false) {}
+ Stream(QtMsgType t) : ts(&buffer, QIODevice::WriteOnly), ref(1), type(t), space(true), message_output(true) {}
+ QTextStream ts;
+ QString buffer;
+ int ref;
+ QtMsgType type;
+ bool space;
+ bool message_output;
+ } *stream;
+public:
+ inline QDebug(QIODevice *device) : stream(new Stream(device)) {}
+ inline QDebug(QString *string) : stream(new Stream(string)) {}
+ inline QDebug(QtMsgType t) : stream(new Stream(t)) {}
+ inline QDebug(const QDebug &o):stream(o.stream) { ++stream->ref; }
+ inline QDebug &operator=(const QDebug &other);
+ inline ~QDebug() {
+ if (!--stream->ref) {
+ if(stream->message_output)
+ qt_message_output(stream->type, stream->buffer.toLocal8Bit().data());
+ delete stream;
+ }
+ }
+ inline QDebug &space() { stream->space = true; stream->ts << " "; return *this; }
+ inline QDebug &nospace() { stream->space = false; return *this; }
+ inline QDebug &maybeSpace() { if (stream->space) stream->ts << " "; return *this; }
+ inline QDebug &operator<<(QChar t) { stream->ts << "\'" << t << "\'"; return maybeSpace(); }
+ inline QDebug &operator<<(QBool t) { stream->ts << (bool(t) ? "true" : "false"); return maybeSpace(); }
+ inline QDebug &operator<<(bool t) { stream->ts << (t ? "true" : "false"); return maybeSpace(); }
+ inline QDebug &operator<<(char t) { stream->ts << t; return maybeSpace(); }
+ inline QDebug &operator<<(signed short t) { stream->ts << t; return maybeSpace(); }
+ inline QDebug &operator<<(unsigned short t) { stream->ts << t; return maybeSpace(); }
+ inline QDebug &operator<<(signed int t) { stream->ts << t; return maybeSpace(); }
+ inline QDebug &operator<<(unsigned int t) { stream->ts << t; return maybeSpace(); }
+ inline QDebug &operator<<(signed long t) { stream->ts << t; return maybeSpace(); }
+ inline QDebug &operator<<(unsigned long t) { stream->ts << t; return maybeSpace(); }
+ inline QDebug &operator<<(qint64 t)
+ { stream->ts << QString::number(t); return maybeSpace(); }
+ inline QDebug &operator<<(quint64 t)
+ { stream->ts << QString::number(t); return maybeSpace(); }
+ inline QDebug &operator<<(float t) { stream->ts << t; return maybeSpace(); }
+ inline QDebug &operator<<(double t) { stream->ts << t; return maybeSpace(); }
+ inline QDebug &operator<<(const char* t) { stream->ts << QString::fromAscii(t); return maybeSpace(); }
+ inline QDebug &operator<<(const QString & t) { stream->ts << "\"" << t << "\""; return maybeSpace(); }
+ inline QDebug &operator<<(const QStringRef & t) { return operator<<(t.toString()); }
+ inline QDebug &operator<<(const QLatin1String &t) { stream->ts << "\"" << t.latin1() << "\""; return maybeSpace(); }
+ inline QDebug &operator<<(const QByteArray & t) { stream->ts << "\"" << t << "\""; return maybeSpace(); }
+ inline QDebug &operator<<(const void * t) { stream->ts << t; return maybeSpace(); }
+ inline QDebug &operator<<(QTextStreamFunction f) {
+ stream->ts << f;
+ return *this;
+ }
+ inline QDebug &operator<<(QTextStreamManipulator m)
+ { stream->ts << m; return *this; }
+};
+class QNoDebug
+{
+public:
+ inline QNoDebug(){}
+ inline QNoDebug(const QDebug &){}
+ inline ~QNoDebug(){}
+ inline QNoDebug &operator<<(QTextStreamFunction) { return *this; }
+ inline QNoDebug &operator<<(QTextStreamManipulator) { return *this; }
+ inline QNoDebug &space() { return *this; }
+ inline QNoDebug &nospace() { return *this; }
+ inline QNoDebug &maybeSpace() { return *this; }
+ template<typename T>
+ inline QNoDebug &operator<<(const T &) { return *this; }
+};
+__attribute__((visibility("default"))) inline QDebug qCritical() { return QDebug(QtCriticalMsg); }
+inline QDebug &QDebug::operator=(const QDebug &other)
+{
+ if (this != &other) {
+ QDebug copy(other);
+ qSwap(stream, copy.stream);
+ }
+ return *this;
+}
+template <class T>
+inline QDebug operator<<(QDebug debug, const QList<T> &list)
+{
+ debug.nospace() << "(";
+ for (typename QList<T>::size_type i = 0; i < list.count(); ++i) {
+ if (i)
+ debug << ", ";
+ debug << list.at(i);
+ }
+ debug << ")";
+ return debug.space();
+}
+template <typename T>
+inline QDebug operator<<(QDebug debug, const QVector<T> &vec)
+{
+ debug.nospace() << "QVector";
+ return operator<<(debug, vec.toList());
+}
+template <class aKey, class aT>
+inline QDebug operator<<(QDebug debug, const QMap<aKey, aT> &map)
+{
+ debug.nospace() << "QMap(";
+ for (typename QMap<aKey, aT>::const_iterator it = map.constBegin();
+ it != map.constEnd(); ++it) {
+ debug << "(" << it.key() << ", " << it.value() << ")";
+ }
+ debug << ")";
+ return debug.space();
+}
+template <class aKey, class aT>
+inline QDebug operator<<(QDebug debug, const QHash<aKey, aT> &hash)
+{
+ debug.nospace() << "QHash(";
+ for (typename QHash<aKey, aT>::const_iterator it = hash.constBegin();
+ it != hash.constEnd(); ++it)
+ debug << "(" << it.key() << ", " << it.value() << ")";
+ debug << ")";
+ return debug.space();
+}
+template <class T1, class T2>
+inline QDebug operator<<(QDebug debug, const QPair<T1, T2> &pair)
+{
+ debug.nospace() << "QPair(" << pair.first << "," << pair.second << ")";
+ return debug.space();
+}
+template <typename T>
+inline QDebug operator<<(QDebug debug, const QSet<T> &set)
+{
+ debug.nospace() << "QSet";
+ return operator<<(debug, set.toList());
+}
+__attribute__((visibility("default"))) inline QDebug qDebug() { return QDebug(QtDebugMsg); }
+__attribute__((visibility("default"))) inline QDebug qWarning() { return QDebug(QtWarningMsg); }
+typedef QtValidLicenseForCoreModule QtCoreModule;
+template <class Key, class T> class QCache;
+template <class Key, class T> class QHash;
+template <class T> class QLinkedList;
+template <class T> class QList;
+template <class Key, class T> class QMap;
+template <class Key, class T> class QMultiHash;
+template <class Key, class T> class QMultiMap;
+template <class T1, class T2> struct QPair;
+template <class T> class QQueue;
+template <class T> class QSet;
+template <class T> class QStack;
+template<class T, int Prealloc = 256> class QVarLengthArray;
+template <class T> class QVector;
+typedef QtValidLicenseForCoreModule QtCoreModule;
+template<class T, int Prealloc>
+class QVarLengthArray
+{
+public:
+ inline explicit QVarLengthArray(int size = 0);
+ inline QVarLengthArray(const QVarLengthArray<T, Prealloc> &other)
+ : a(Prealloc), s(0), ptr(reinterpret_cast<T *>(array))
+ {
+ append(other.constData(), other.size());
+ }
+ inline ~QVarLengthArray() {
+ if (QTypeInfo<T>::isComplex) {
+ T *i = ptr + s;
+ while (i-- != ptr)
+ i->~T();
+ }
+ if (ptr != reinterpret_cast<T *>(array))
+ qFree(ptr);
+ }
+ inline QVarLengthArray<T, Prealloc> &operator=(const QVarLengthArray<T, Prealloc> &other)
+ {
+ if (this != &other) {
+ clear();
+ append(other.constData(), other.size());
+ }
+ return *this;
+ }
+ inline void removeLast() {
+ qt_noop();
+ realloc(s - 1, a);
+ }
+ inline int size() const { return s; }
+ inline int count() const { return s; }
+ inline bool isEmpty() const { return (s == 0); }
+ inline void resize(int size);
+ inline void clear() { resize(0); }
+ inline int capacity() const { return a; }
+ inline void reserve(int size);
+ inline T &operator[](int idx) {
+ qt_noop();
+ return ptr[idx];
+ }
+ inline const T &operator[](int idx) const {
+ qt_noop();
+ return ptr[idx];
+ }
+ inline void append(const T &t) {
+ if (s == a)
+ realloc(s, s<<1);
+ const int idx = s++;
+ if (QTypeInfo<T>::isComplex) {
+ new (ptr + idx) T(t);
+ } else {
+ ptr[idx] = t;
+ }
+ }
+ void append(const T *buf, int size);
+ inline T *data() { return ptr; }
+ inline const T *data() const { return ptr; }
+ inline const T * constData() const { return ptr; }
+private:
+ void realloc(int size, int alloc);
+ int a;
+ int s;
+ T *ptr;
+ union {
+ char array[sizeof(qint64) * (((Prealloc * sizeof(T)) / sizeof(qint64)) + 1)];
+ qint64 q_for_alignment_1;
+ double q_for_alignment_2;
+ };
+};
+template <class T, int Prealloc>
+inline QVarLengthArray<T, Prealloc>::QVarLengthArray(int asize)
+ : s(asize) {
+ if (s > Prealloc) {
+ ptr = reinterpret_cast<T *>(qMalloc(s * sizeof(T)));
+ a = s;
+ } else {
+ ptr = reinterpret_cast<T *>(array);
+ a = Prealloc;
+ }
+ if (QTypeInfo<T>::isComplex) {
+ T *i = ptr + s;
+ while (i != ptr)
+ new (--i) T;
+ }
+}
+template <class T, int Prealloc>
+inline void QVarLengthArray<T, Prealloc>::resize(int asize)
+{ realloc(asize, qMax(asize, a)); }
+template <class T, int Prealloc>
+inline void QVarLengthArray<T, Prealloc>::reserve(int asize)
+{ if (asize > a) realloc(s, asize); }
+template <class T, int Prealloc>
+ void QVarLengthArray<T, Prealloc>::append(const T *abuf, int asize)
+{
+ qt_noop();
+ if (asize <= 0)
+ return;
+ const int idx = s;
+ const int news = s + asize;
+ if (news >= a)
+ realloc(s, qMax(s<<1, news));
+ s = news;
+ if (QTypeInfo<T>::isComplex) {
+ T *i = ptr + idx;
+ T *j = i + asize;
+ while (i < j)
+ new (i++) T(*abuf++);
+ } else {
+ qMemCopy(&ptr[idx], abuf, asize * sizeof(T));
+ }
+}
+template <class T, int Prealloc>
+ void QVarLengthArray<T, Prealloc>::realloc(int asize, int aalloc)
+{
+ qt_noop();
+ T *oldPtr = ptr;
+ int osize = s;
+ s = asize;
+ if (aalloc != a) {
+ ptr = reinterpret_cast<T *>(qMalloc(aalloc * sizeof(T)));
+ if (ptr) {
+ a = aalloc;
+ if (QTypeInfo<T>::isStatic) {
+ T *i = ptr + osize;
+ T *j = oldPtr + osize;
+ while (i != ptr) {
+ new (--i) T(*--j);
+ j->~T();
+ }
+ } else {
+ qMemCopy(ptr, oldPtr, osize * sizeof(T));
+ }
+ } else {
+ ptr = oldPtr;
+ s = 0;
+ asize = 0;
+ }
+ }
+ if (QTypeInfo<T>::isComplex) {
+ if (asize < osize) {
+ T *i = oldPtr + osize;
+ T *j = oldPtr + asize;
+ while (i-- != j)
+ i->~T();
+ } else {
+ T *i = ptr + asize;
+ T *j = ptr + osize;
+ while (i != j)
+ new (--i) T;
+ }
+ }
+ if (oldPtr != reinterpret_cast<T *>(array) && oldPtr != ptr)
+ qFree(oldPtr);
+}
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class __attribute__((visibility("default"))) QSize
+{
+public:
+ QSize();
+ QSize(int w, int h);
+ bool isNull() const;
+ bool isEmpty() const;
+ bool isValid() const;
+ int width() const;
+ int height() const;
+ void setWidth(int w);
+ void setHeight(int h);
+ void transpose();
+ void scale(int w, int h, Qt::AspectRatioMode mode);
+ void scale(const QSize &s, Qt::AspectRatioMode mode);
+ QSize expandedTo(const QSize &) const;
+ QSize boundedTo(const QSize &) const;
+ int &rwidth();
+ int &rheight();
+ QSize &operator+=(const QSize &);
+ QSize &operator-=(const QSize &);
+ QSize &operator*=(qreal c);
+ QSize &operator/=(qreal c);
+ friend inline bool operator==(const QSize &, const QSize &);
+ friend inline bool operator!=(const QSize &, const QSize &);
+ friend inline const QSize operator+(const QSize &, const QSize &);
+ friend inline const QSize operator-(const QSize &, const QSize &);
+ friend inline const QSize operator*(const QSize &, qreal);
+ friend inline const QSize operator*(qreal, const QSize &);
+ friend inline const QSize operator/(const QSize &, qreal);
+private:
+ int wd;
+ int ht;
+};
+template <> class QTypeInfo<QSize> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QSize)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QSize"; } };
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QSize &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QSize &);
+inline QSize::QSize()
+{ wd = ht = -1; }
+inline QSize::QSize(int w, int h)
+{ wd = w; ht = h; }
+inline bool QSize::isNull() const
+{ return wd==0 && ht==0; }
+inline bool QSize::isEmpty() const
+{ return wd<1 || ht<1; }
+inline bool QSize::isValid() const
+{ return wd>=0 && ht>=0; }
+inline int QSize::width() const
+{ return wd; }
+inline int QSize::height() const
+{ return ht; }
+inline void QSize::setWidth(int w)
+{ wd = w; }
+inline void QSize::setHeight(int h)
+{ ht = h; }
+inline void QSize::scale(int w, int h, Qt::AspectRatioMode mode)
+{ scale(QSize(w, h), mode); }
+inline int &QSize::rwidth()
+{ return wd; }
+inline int &QSize::rheight()
+{ return ht; }
+inline QSize &QSize::operator+=(const QSize &s)
+{ wd+=s.wd; ht+=s.ht; return *this; }
+inline QSize &QSize::operator-=(const QSize &s)
+{ wd-=s.wd; ht-=s.ht; return *this; }
+inline QSize &QSize::operator*=(qreal c)
+{ wd = qRound(wd*c); ht = qRound(ht*c); return *this; }
+inline bool operator==(const QSize &s1, const QSize &s2)
+{ return s1.wd == s2.wd && s1.ht == s2.ht; }
+inline bool operator!=(const QSize &s1, const QSize &s2)
+{ return s1.wd != s2.wd || s1.ht != s2.ht; }
+inline const QSize operator+(const QSize & s1, const QSize & s2)
+{ return QSize(s1.wd+s2.wd, s1.ht+s2.ht); }
+inline const QSize operator-(const QSize &s1, const QSize &s2)
+{ return QSize(s1.wd-s2.wd, s1.ht-s2.ht); }
+inline const QSize operator*(const QSize &s, qreal c)
+{ return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
+inline const QSize operator*(qreal c, const QSize &s)
+{ return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
+inline QSize &QSize::operator/=(qreal c)
+{
+ qt_noop();
+ wd = qRound(wd/c); ht = qRound(ht/c);
+ return *this;
+}
+inline const QSize operator/(const QSize &s, qreal c)
+{
+ qt_noop();
+ return QSize(qRound(s.wd/c), qRound(s.ht/c));
+}
+inline QSize QSize::expandedTo(const QSize & otherSize) const
+{
+ return QSize(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
+}
+inline QSize QSize::boundedTo(const QSize & otherSize) const
+{
+ return QSize(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
+}
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QSize &);
+class __attribute__((visibility("default"))) QSizeF
+{
+public:
+ QSizeF();
+ QSizeF(const QSize &sz);
+ QSizeF(qreal w, qreal h);
+ bool isNull() const;
+ bool isEmpty() const;
+ bool isValid() const;
+ qreal width() const;
+ qreal height() const;
+ void setWidth(qreal w);
+ void setHeight(qreal h);
+ void transpose();
+ void scale(qreal w, qreal h, Qt::AspectRatioMode mode);
+ void scale(const QSizeF &s, Qt::AspectRatioMode mode);
+ QSizeF expandedTo(const QSizeF &) const;
+ QSizeF boundedTo(const QSizeF &) const;
+ qreal &rwidth();
+ qreal &rheight();
+ QSizeF &operator+=(const QSizeF &);
+ QSizeF &operator-=(const QSizeF &);
+ QSizeF &operator*=(qreal c);
+ QSizeF &operator/=(qreal c);
+ friend inline bool operator==(const QSizeF &, const QSizeF &);
+ friend inline bool operator!=(const QSizeF &, const QSizeF &);
+ friend inline const QSizeF operator+(const QSizeF &, const QSizeF &);
+ friend inline const QSizeF operator-(const QSizeF &, const QSizeF &);
+ friend inline const QSizeF operator*(const QSizeF &, qreal);
+ friend inline const QSizeF operator*(qreal, const QSizeF &);
+ friend inline const QSizeF operator/(const QSizeF &, qreal);
+ inline QSize toSize() const;
+private:
+ qreal wd;
+ qreal ht;
+};
+template <> class QTypeInfo<QSizeF> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QSizeF)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QSizeF"; } };
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QSizeF &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QSizeF &);
+inline QSizeF::QSizeF()
+{ wd = ht = -1.; }
+inline QSizeF::QSizeF(const QSize &sz)
+ : wd(sz.width()), ht(sz.height())
+{
+}
+inline QSizeF::QSizeF(qreal w, qreal h)
+{ wd = w; ht = h; }
+inline bool QSizeF::isNull() const
+{ return qIsNull(wd) && qIsNull(ht); }
+inline bool QSizeF::isEmpty() const
+{ return wd <= 0. || ht <= 0.; }
+inline bool QSizeF::isValid() const
+{ return wd >= 0. && ht >= 0.; }
+inline qreal QSizeF::width() const
+{ return wd; }
+inline qreal QSizeF::height() const
+{ return ht; }
+inline void QSizeF::setWidth(qreal w)
+{ wd = w; }
+inline void QSizeF::setHeight(qreal h)
+{ ht = h; }
+inline void QSizeF::scale(qreal w, qreal h, Qt::AspectRatioMode mode)
+{ scale(QSizeF(w, h), mode); }
+inline qreal &QSizeF::rwidth()
+{ return wd; }
+inline qreal &QSizeF::rheight()
+{ return ht; }
+inline QSizeF &QSizeF::operator+=(const QSizeF &s)
+{ wd += s.wd; ht += s.ht; return *this; }
+inline QSizeF &QSizeF::operator-=(const QSizeF &s)
+{ wd -= s.wd; ht -= s.ht; return *this; }
+inline QSizeF &QSizeF::operator*=(qreal c)
+{ wd *= c; ht *= c; return *this; }
+inline bool operator==(const QSizeF &s1, const QSizeF &s2)
+{ return qFuzzyCompare(s1.wd, s2.wd) && qFuzzyCompare(s1.ht, s2.ht); }
+inline bool operator!=(const QSizeF &s1, const QSizeF &s2)
+{ return !qFuzzyCompare(s1.wd, s2.wd) || !qFuzzyCompare(s1.ht, s2.ht); }
+inline const QSizeF operator+(const QSizeF & s1, const QSizeF & s2)
+{ return QSizeF(s1.wd+s2.wd, s1.ht+s2.ht); }
+inline const QSizeF operator-(const QSizeF &s1, const QSizeF &s2)
+{ return QSizeF(s1.wd-s2.wd, s1.ht-s2.ht); }
+inline const QSizeF operator*(const QSizeF &s, qreal c)
+{ return QSizeF(s.wd*c, s.ht*c); }
+inline const QSizeF operator*(qreal c, const QSizeF &s)
+{ return QSizeF(s.wd*c, s.ht*c); }
+inline QSizeF &QSizeF::operator/=(qreal c)
+{
+ qt_noop();
+ wd = wd/c; ht = ht/c;
+ return *this;
+}
+inline const QSizeF operator/(const QSizeF &s, qreal c)
+{
+ qt_noop();
+ return QSizeF(s.wd/c, s.ht/c);
+}
+inline QSizeF QSizeF::expandedTo(const QSizeF & otherSize) const
+{
+ return QSizeF(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
+}
+inline QSizeF QSizeF::boundedTo(const QSizeF & otherSize) const
+{
+ return QSizeF(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
+}
+inline QSize QSizeF::toSize() const
+{
+ return QSize(qRound(wd), qRound(ht));
+}
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QSizeF &);
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class __attribute__((visibility("default"))) QPoint
+{
+public:
+ QPoint();
+ QPoint(int xpos, int ypos);
+ bool isNull() const;
+ int x() const;
+ int y() const;
+ void setX(int x);
+ void setY(int y);
+ int manhattanLength() const;
+ int &rx();
+ int &ry();
+ QPoint &operator+=(const QPoint &p);
+ QPoint &operator-=(const QPoint &p);
+ QPoint &operator*=(qreal c);
+ QPoint &operator/=(qreal c);
+ friend inline bool operator==(const QPoint &, const QPoint &);
+ friend inline bool operator!=(const QPoint &, const QPoint &);
+ friend inline const QPoint operator+(const QPoint &, const QPoint &);
+ friend inline const QPoint operator-(const QPoint &, const QPoint &);
+ friend inline const QPoint operator*(const QPoint &, qreal);
+ friend inline const QPoint operator*(qreal, const QPoint &);
+ friend inline const QPoint operator-(const QPoint &);
+ friend inline const QPoint operator/(const QPoint &, qreal);
+private:
+ friend class QTransform;
+ int xp;
+ int yp;
+};
+template <> class QTypeInfo<QPoint> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QPoint)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QPoint"; } };
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPoint &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPoint &);
+inline QPoint::QPoint()
+{ xp=0; yp=0; }
+inline QPoint::QPoint(int xpos, int ypos)
+{ xp = xpos; yp = ypos; }
+inline bool QPoint::isNull() const
+{ return xp == 0 && yp == 0; }
+inline int QPoint::x() const
+{ return xp; }
+inline int QPoint::y() const
+{ return yp; }
+inline void QPoint::setX(int xpos)
+{ xp = xpos; }
+inline void QPoint::setY(int ypos)
+{ yp = ypos; }
+inline int &QPoint::rx()
+{ return xp; }
+inline int &QPoint::ry()
+{ return yp; }
+inline QPoint &QPoint::operator+=(const QPoint &p)
+{ xp+=p.xp; yp+=p.yp; return *this; }
+inline QPoint &QPoint::operator-=(const QPoint &p)
+{ xp-=p.xp; yp-=p.yp; return *this; }
+inline QPoint &QPoint::operator*=(qreal c)
+{ xp = qRound(xp*c); yp = qRound(yp*c); return *this; }
+inline bool operator==(const QPoint &p1, const QPoint &p2)
+{ return p1.xp == p2.xp && p1.yp == p2.yp; }
+inline bool operator!=(const QPoint &p1, const QPoint &p2)
+{ return p1.xp != p2.xp || p1.yp != p2.yp; }
+inline const QPoint operator+(const QPoint &p1, const QPoint &p2)
+{ return QPoint(p1.xp+p2.xp, p1.yp+p2.yp); }
+inline const QPoint operator-(const QPoint &p1, const QPoint &p2)
+{ return QPoint(p1.xp-p2.xp, p1.yp-p2.yp); }
+inline const QPoint operator*(const QPoint &p, qreal c)
+{ return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
+inline const QPoint operator*(qreal c, const QPoint &p)
+{ return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
+inline const QPoint operator-(const QPoint &p)
+{ return QPoint(-p.xp, -p.yp); }
+inline QPoint &QPoint::operator/=(qreal c)
+{
+ xp = qRound(xp/c);
+ yp = qRound(yp/c);
+ return *this;
+}
+inline const QPoint operator/(const QPoint &p, qreal c)
+{
+ return QPoint(qRound(p.xp/c), qRound(p.yp/c));
+}
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QPoint &);
+class __attribute__((visibility("default"))) QPointF
+{
+public:
+ QPointF();
+ QPointF(const QPoint &p);
+ QPointF(qreal xpos, qreal ypos);
+ bool isNull() const;
+ qreal x() const;
+ qreal y() const;
+ void setX(qreal x);
+ void setY(qreal y);
+ qreal &rx();
+ qreal &ry();
+ QPointF &operator+=(const QPointF &p);
+ QPointF &operator-=(const QPointF &p);
+ QPointF &operator*=(qreal c);
+ QPointF &operator/=(qreal c);
+ friend inline bool operator==(const QPointF &, const QPointF &);
+ friend inline bool operator!=(const QPointF &, const QPointF &);
+ friend inline const QPointF operator+(const QPointF &, const QPointF &);
+ friend inline const QPointF operator-(const QPointF &, const QPointF &);
+ friend inline const QPointF operator*(qreal, const QPointF &);
+ friend inline const QPointF operator*(const QPointF &, qreal);
+ friend inline const QPointF operator-(const QPointF &);
+ friend inline const QPointF operator/(const QPointF &, qreal);
+ QPoint toPoint() const;
+private:
+ friend class QMatrix;
+ friend class QTransform;
+ qreal xp;
+ qreal yp;
+};
+template <> class QTypeInfo<QPointF> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QPointF)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QPointF"; } };
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPointF &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPointF &);
+inline QPointF::QPointF() : xp(0), yp(0) { }
+inline QPointF::QPointF(qreal xpos, qreal ypos) : xp(xpos), yp(ypos) { }
+inline QPointF::QPointF(const QPoint &p) : xp(p.x()), yp(p.y()) { }
+inline bool QPointF::isNull() const
+{
+ return qIsNull(xp) && qIsNull(yp);
+}
+inline qreal QPointF::x() const
+{
+ return xp;
+}
+inline qreal QPointF::y() const
+{
+ return yp;
+}
+inline void QPointF::setX(qreal xpos)
+{
+ xp = xpos;
+}
+inline void QPointF::setY(qreal ypos)
+{
+ yp = ypos;
+}
+inline qreal &QPointF::rx()
+{
+ return xp;
+}
+inline qreal &QPointF::ry()
+{
+ return yp;
+}
+inline QPointF &QPointF::operator+=(const QPointF &p)
+{
+ xp+=p.xp;
+ yp+=p.yp;
+ return *this;
+}
+inline QPointF &QPointF::operator-=(const QPointF &p)
+{
+ xp-=p.xp; yp-=p.yp; return *this;
+}
+inline QPointF &QPointF::operator*=(qreal c)
+{
+ xp*=c; yp*=c; return *this;
+}
+inline bool operator==(const QPointF &p1, const QPointF &p2)
+{
+ return qFuzzyCompare(p1.xp, p2.xp) && qFuzzyCompare(p1.yp, p2.yp);
+}
+inline bool operator!=(const QPointF &p1, const QPointF &p2)
+{
+ return !qFuzzyCompare(p1.xp, p2.xp) || !qFuzzyCompare(p1.yp, p2.yp);
+}
+inline const QPointF operator+(const QPointF &p1, const QPointF &p2)
+{
+ return QPointF(p1.xp+p2.xp, p1.yp+p2.yp);
+}
+inline const QPointF operator-(const QPointF &p1, const QPointF &p2)
+{
+ return QPointF(p1.xp-p2.xp, p1.yp-p2.yp);
+}
+inline const QPointF operator*(const QPointF &p, qreal c)
+{
+ return QPointF(p.xp*c, p.yp*c);
+}
+inline const QPointF operator*(qreal c, const QPointF &p)
+{
+ return QPointF(p.xp*c, p.yp*c);
+}
+inline const QPointF operator-(const QPointF &p)
+{
+ return QPointF(-p.xp, -p.yp);
+}
+inline QPointF &QPointF::operator/=(qreal c)
+{
+ xp/=c;
+ yp/=c;
+ return *this;
+}
+inline const QPointF operator/(const QPointF &p, qreal c)
+{
+ return QPointF(p.xp/c, p.yp/c);
+}
+inline QPoint QPointF::toPoint() const
+{
+ return QPoint(qRound(xp), qRound(yp));
+}
+__attribute__((visibility("default"))) QDebug operator<<(QDebug d, const QPointF &p);
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class __attribute__((visibility("default"))) QRect
+{
+public:
+ QRect() { x1 = y1 = 0; x2 = y2 = -1; }
+ QRect(const QPoint &topleft, const QPoint &bottomright);
+ QRect(const QPoint &topleft, const QSize &size);
+ QRect(int left, int top, int width, int height);
+ bool isNull() const;
+ bool isEmpty() const;
+ bool isValid() const;
+ int left() const;
+ int top() const;
+ int right() const;
+ int bottom() const;
+ QRect normalized() const;
+ int x() const;
+ int y() const;
+ void setLeft(int pos);
+ void setTop(int pos);
+ void setRight(int pos);
+ void setBottom(int pos);
+ void setX(int x);
+ void setY(int y);
+ void setTopLeft(const QPoint &p);
+ void setBottomRight(const QPoint &p);
+ void setTopRight(const QPoint &p);
+ void setBottomLeft(const QPoint &p);
+ QPoint topLeft() const;
+ QPoint bottomRight() const;
+ QPoint topRight() const;
+ QPoint bottomLeft() const;
+ QPoint center() const;
+ void moveLeft(int pos);
+ void moveTop(int pos);
+ void moveRight(int pos);
+ void moveBottom(int pos);
+ void moveTopLeft(const QPoint &p);
+ void moveBottomRight(const QPoint &p);
+ void moveTopRight(const QPoint &p);
+ void moveBottomLeft(const QPoint &p);
+ void moveCenter(const QPoint &p);
+ inline void translate(int dx, int dy);
+ inline void translate(const QPoint &p);
+ inline QRect translated(int dx, int dy) const;
+ inline QRect translated(const QPoint &p) const;
+ void moveTo(int x, int t);
+ void moveTo(const QPoint &p);
+ void setRect(int x, int y, int w, int h);
+ inline void getRect(int *x, int *y, int *w, int *h) const;
+ void setCoords(int x1, int y1, int x2, int y2);
+ inline void getCoords(int *x1, int *y1, int *x2, int *y2) const;
+ inline void adjust(int x1, int y1, int x2, int y2);
+ inline QRect adjusted(int x1, int y1, int x2, int y2) const;
+ QSize size() const;
+ int width() const;
+ int height() const;
+ void setWidth(int w);
+ void setHeight(int h);
+ void setSize(const QSize &s);
+ QRect operator|(const QRect &r) const;
+ QRect operator&(const QRect &r) const;
+ QRect& operator|=(const QRect &r);
+ QRect& operator&=(const QRect &r);
+ bool contains(const QPoint &p, bool proper=false) const;
+ bool contains(int x, int y) const;
+ bool contains(int x, int y, bool proper) const;
+ bool contains(const QRect &r, bool proper = false) const;
+ QRect unite(const QRect &r) const;
+ QRect united(const QRect &other) const;
+ QRect intersect(const QRect &r) const;
+ QRect intersected(const QRect &other) const;
+ bool intersects(const QRect &r) const;
+ friend __attribute__((visibility("default"))) inline bool operator==(const QRect &, const QRect &);
+ friend __attribute__((visibility("default"))) inline bool operator!=(const QRect &, const QRect &);
+private:
+ int x1;
+ int y1;
+ int x2;
+ int y2;
+};
+template <> class QTypeInfo<QRect> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QRect)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QRect"; } };
+__attribute__((visibility("default"))) inline bool operator==(const QRect &, const QRect &);
+__attribute__((visibility("default"))) inline bool operator!=(const QRect &, const QRect &);
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QRect &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QRect &);
+inline QRect::QRect(int aleft, int atop, int awidth, int aheight)
+{
+ x1 = aleft;
+ y1 = atop;
+ x2 = (aleft + awidth - 1);
+ y2 = (atop + aheight - 1);
+}
+inline QRect::QRect(const QPoint &atopLeft, const QPoint &abottomRight)
+{
+ x1 = atopLeft.x();
+ y1 = atopLeft.y();
+ x2 = abottomRight.x();
+ y2 = abottomRight.y();
+}
+inline QRect::QRect(const QPoint &atopLeft, const QSize &asize)
+{
+ x1 = atopLeft.x();
+ y1 = atopLeft.y();
+ x2 = (x1+asize.width() - 1);
+ y2 = (y1+asize.height() - 1);
+}
+inline bool QRect::isNull() const
+{ return x2 == x1 - 1 && y2 == y1 - 1; }
+inline bool QRect::isEmpty() const
+{ return x1 > x2 || y1 > y2; }
+inline bool QRect::isValid() const
+{ return x1 <= x2 && y1 <= y2; }
+inline int QRect::left() const
+{ return x1; }
+inline int QRect::top() const
+{ return y1; }
+inline int QRect::right() const
+{ return x2; }
+inline int QRect::bottom() const
+{ return y2; }
+inline int QRect::x() const
+{ return x1; }
+inline int QRect::y() const
+{ return y1; }
+inline void QRect::setLeft(int pos)
+{ x1 = pos; }
+inline void QRect::setTop(int pos)
+{ y1 = pos; }
+inline void QRect::setRight(int pos)
+{ x2 = pos; }
+inline void QRect::setBottom(int pos)
+{ y2 = pos; }
+inline void QRect::setTopLeft(const QPoint &p)
+{ x1 = p.x(); y1 = p.y(); }
+inline void QRect::setBottomRight(const QPoint &p)
+{ x2 = p.x(); y2 = p.y(); }
+inline void QRect::setTopRight(const QPoint &p)
+{ x2 = p.x(); y1 = p.y(); }
+inline void QRect::setBottomLeft(const QPoint &p)
+{ x1 = p.x(); y2 = p.y(); }
+inline void QRect::setX(int ax)
+{ x1 = ax; }
+inline void QRect::setY(int ay)
+{ y1 = ay; }
+inline QPoint QRect::topLeft() const
+{ return QPoint(x1, y1); }
+inline QPoint QRect::bottomRight() const
+{ return QPoint(x2, y2); }
+inline QPoint QRect::topRight() const
+{ return QPoint(x2, y1); }
+inline QPoint QRect::bottomLeft() const
+{ return QPoint(x1, y2); }
+inline QPoint QRect::center() const
+{ return QPoint((x1+x2)/2, (y1+y2)/2); }
+inline int QRect::width() const
+{ return x2 - x1 + 1; }
+inline int QRect::height() const
+{ return y2 - y1 + 1; }
+inline QSize QRect::size() const
+{ return QSize(width(), height()); }
+inline void QRect::translate(int dx, int dy)
+{
+ x1 += dx;
+ y1 += dy;
+ x2 += dx;
+ y2 += dy;
+}
+inline void QRect::translate(const QPoint &p)
+{
+ x1 += p.x();
+ y1 += p.y();
+ x2 += p.x();
+ y2 += p.y();
+}
+inline QRect QRect::translated(int dx, int dy) const
+{ return QRect(QPoint(x1 + dx, y1 + dy), QPoint(x2 + dx, y2 + dy)); }
+inline QRect QRect::translated(const QPoint &p) const
+{ return QRect(QPoint(x1 + p.x(), y1 + p.y()), QPoint(x2 + p.x(), y2 + p.y())); }
+inline void QRect::moveTo(int ax, int ay)
+{
+ x2 += ax - x1;
+ y2 += ay - y1;
+ x1 = ax;
+ y1 = ay;
+}
+inline void QRect::moveTo(const QPoint &p)
+{
+ x2 += p.x() - x1;
+ y2 += p.y() - y1;
+ x1 = p.x();
+ y1 = p.y();
+}
+inline void QRect::moveLeft(int pos)
+{ x2 += (pos - x1); x1 = pos; }
+inline void QRect::moveTop(int pos)
+{ y2 += (pos - y1); y1 = pos; }
+inline void QRect::moveRight(int pos)
+{
+ x1 += (pos - x2);
+ x2 = pos;
+}
+inline void QRect::moveBottom(int pos)
+{
+ y1 += (pos - y2);
+ y2 = pos;
+}
+inline void QRect::moveTopLeft(const QPoint &p)
+{
+ moveLeft(p.x());
+ moveTop(p.y());
+}
+inline void QRect::moveBottomRight(const QPoint &p)
+{
+ moveRight(p.x());
+ moveBottom(p.y());
+}
+inline void QRect::moveTopRight(const QPoint &p)
+{
+ moveRight(p.x());
+ moveTop(p.y());
+}
+inline void QRect::moveBottomLeft(const QPoint &p)
+{
+ moveLeft(p.x());
+ moveBottom(p.y());
+}
+inline void QRect::getRect(int *ax, int *ay, int *aw, int *ah) const
+{
+ *ax = x1;
+ *ay = y1;
+ *aw = x2 - x1 + 1;
+ *ah = y2 - y1 + 1;
+}
+inline void QRect::setRect(int ax, int ay, int aw, int ah)
+{
+ x1 = ax;
+ y1 = ay;
+ x2 = (ax + aw - 1);
+ y2 = (ay + ah - 1);
+}
+inline void QRect::getCoords(int *xp1, int *yp1, int *xp2, int *yp2) const
+{
+ *xp1 = x1;
+ *yp1 = y1;
+ *xp2 = x2;
+ *yp2 = y2;
+}
+inline void QRect::setCoords(int xp1, int yp1, int xp2, int yp2)
+{
+ x1 = xp1;
+ y1 = yp1;
+ x2 = xp2;
+ y2 = yp2;
+}
+inline QRect QRect::adjusted(int xp1, int yp1, int xp2, int yp2) const
+{ return QRect(QPoint(x1 + xp1, y1 + yp1), QPoint(x2 + xp2, y2 + yp2)); }
+inline void QRect::adjust(int dx1, int dy1, int dx2, int dy2)
+{
+ x1 += dx1;
+ y1 += dy1;
+ x2 += dx2;
+ y2 += dy2;
+}
+inline void QRect::setWidth(int w)
+{ x2 = (x1 + w - 1); }
+inline void QRect::setHeight(int h)
+{ y2 = (y1 + h - 1); }
+inline void QRect::setSize(const QSize &s)
+{
+ x2 = (s.width() + x1 - 1);
+ y2 = (s.height() + y1 - 1);
+}
+inline bool QRect::contains(int ax, int ay, bool aproper) const
+{
+ return contains(QPoint(ax, ay), aproper);
+}
+inline bool QRect::contains(int ax, int ay) const
+{
+ return contains(QPoint(ax, ay), false);
+}
+inline QRect& QRect::operator|=(const QRect &r)
+{
+ *this = *this | r;
+ return *this;
+}
+inline QRect& QRect::operator&=(const QRect &r)
+{
+ *this = *this & r;
+ return *this;
+}
+inline QRect QRect::intersect(const QRect &r) const
+{
+ return *this & r;
+}
+inline QRect QRect::intersected(const QRect &other) const
+{
+ return intersect(other);
+}
+inline QRect QRect::unite(const QRect &r) const
+{
+ return *this | r;
+}
+inline QRect QRect::united(const QRect &r) const
+{
+ return unite(r);
+}
+inline bool operator==(const QRect &r1, const QRect &r2)
+{
+ return r1.x1==r2.x1 && r1.x2==r2.x2 && r1.y1==r2.y1 && r1.y2==r2.y2;
+}
+inline bool operator!=(const QRect &r1, const QRect &r2)
+{
+ return r1.x1!=r2.x1 || r1.x2!=r2.x2 || r1.y1!=r2.y1 || r1.y2!=r2.y2;
+}
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QRect &);
+class __attribute__((visibility("default"))) QRectF
+{
+public:
+ QRectF() { xp = yp = 0.; w = h = 0.; }
+ QRectF(const QPointF &topleft, const QSizeF &size);
+ QRectF(const QPointF &topleft, const QPointF &bottomRight);
+ QRectF(qreal left, qreal top, qreal width, qreal height);
+ QRectF(const QRect &rect);
+ bool isNull() const;
+ bool isEmpty() const;
+ bool isValid() const;
+ QRectF normalized() const;
+ inline qreal left() const { return xp; }
+ inline qreal top() const { return yp; }
+ inline qreal right() const { return xp + w; }
+ inline qreal bottom() const { return yp + h; }
+ inline qreal x() const;
+ inline qreal y() const;
+ inline void setLeft(qreal pos);
+ inline void setTop(qreal pos);
+ inline void setRight(qreal pos);
+ inline void setBottom(qreal pos);
+ inline void setX(qreal pos) { setLeft(pos); }
+ inline void setY(qreal pos) { setTop(pos); }
+ inline QPointF topLeft() const { return QPointF(xp, yp); }
+ inline QPointF bottomRight() const { return QPointF(xp+w, yp+h); }
+ inline QPointF topRight() const { return QPointF(xp+w, yp); }
+ inline QPointF bottomLeft() const { return QPointF(xp, yp+h); }
+ inline QPointF center() const;
+ void setTopLeft(const QPointF &p);
+ void setBottomRight(const QPointF &p);
+ void setTopRight(const QPointF &p);
+ void setBottomLeft(const QPointF &p);
+ void moveLeft(qreal pos);
+ void moveTop(qreal pos);
+ void moveRight(qreal pos);
+ void moveBottom(qreal pos);
+ void moveTopLeft(const QPointF &p);
+ void moveBottomRight(const QPointF &p);
+ void moveTopRight(const QPointF &p);
+ void moveBottomLeft(const QPointF &p);
+ void moveCenter(const QPointF &p);
+ void translate(qreal dx, qreal dy);
+ void translate(const QPointF &p);
+ QRectF translated(qreal dx, qreal dy) const;
+ QRectF translated(const QPointF &p) const;
+ void moveTo(qreal x, qreal t);
+ void moveTo(const QPointF &p);
+ void setRect(qreal x, qreal y, qreal w, qreal h);
+ void getRect(qreal *x, qreal *y, qreal *w, qreal *h) const;
+ void setCoords(qreal x1, qreal y1, qreal x2, qreal y2);
+ void getCoords(qreal *x1, qreal *y1, qreal *x2, qreal *y2) const;
+ inline void adjust(qreal x1, qreal y1, qreal x2, qreal y2);
+ inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const;
+ QSizeF size() const;
+ qreal width() const;
+ qreal height() const;
+ void setWidth(qreal w);
+ void setHeight(qreal h);
+ void setSize(const QSizeF &s);
+ QRectF operator|(const QRectF &r) const;
+ QRectF operator&(const QRectF &r) const;
+ QRectF& operator|=(const QRectF &r);
+ QRectF& operator&=(const QRectF &r);
+ bool contains(const QPointF &p) const;
+ bool contains(qreal x, qreal y) const;
+ bool contains(const QRectF &r) const;
+ QRectF unite(const QRectF &r) const;
+ QRectF united(const QRectF &other) const;
+ QRectF intersect(const QRectF &r) const;
+ QRectF intersected(const QRectF &other) const;
+ bool intersects(const QRectF &r) const;
+ friend __attribute__((visibility("default"))) inline bool operator==(const QRectF &, const QRectF &);
+ friend __attribute__((visibility("default"))) inline bool operator!=(const QRectF &, const QRectF &);
+ QRect toRect() const;
+ QRect toAlignedRect() const;
+private:
+ qreal xp;
+ qreal yp;
+ qreal w;
+ qreal h;
+};
+template <> class QTypeInfo<QRectF> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QRectF)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QRectF"; } };
+__attribute__((visibility("default"))) inline bool operator==(const QRectF &, const QRectF &);
+__attribute__((visibility("default"))) inline bool operator!=(const QRectF &, const QRectF &);
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QRectF &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QRectF &);
+inline QRectF::QRectF(qreal aleft, qreal atop, qreal awidth, qreal aheight)
+ : xp(aleft), yp(atop), w(awidth), h(aheight)
+{
+}
+inline QRectF::QRectF(const QPointF &atopLeft, const QSizeF &asize)
+{
+ xp = atopLeft.x();
+ yp = atopLeft.y();
+ w = asize.width();
+ h = asize.height();
+}
+inline QRectF::QRectF(const QPointF &atopLeft, const QPointF &abottomRight)
+{
+ xp = atopLeft.x();
+ yp = atopLeft.y();
+ w = abottomRight.x() - xp;
+ h = abottomRight.y() - yp;
+}
+inline QRectF::QRectF(const QRect &r)
+ : xp(r.x()), yp(r.y()), w(r.width()), h(r.height())
+{
+}
+inline bool QRectF::isNull() const
+{ return qIsNull(w) && qIsNull(h); }
+inline bool QRectF::isEmpty() const
+{ return w <= 0. || h <= 0.; }
+inline bool QRectF::isValid() const
+{ return w > 0. && h > 0.; }
+inline qreal QRectF::x() const
+{ return xp; }
+inline qreal QRectF::y() const
+{ return yp; }
+inline void QRectF::setLeft(qreal pos) { qreal diff = pos - xp; xp += diff; w -= diff; }
+inline void QRectF::setRight(qreal pos) { w = pos - xp; }
+inline void QRectF::setTop(qreal pos) { qreal diff = pos - yp; yp += diff; h -= diff; }
+inline void QRectF::setBottom(qreal pos) { h = pos - yp; }
+inline void QRectF::setTopLeft(const QPointF &p) { setLeft(p.x()); setTop(p.y()); }
+inline void QRectF::setTopRight(const QPointF &p) { setRight(p.x()); setTop(p.y()); }
+inline void QRectF::setBottomLeft(const QPointF &p) { setLeft(p.x()); setBottom(p.y()); }
+inline void QRectF::setBottomRight(const QPointF &p) { setRight(p.x()); setBottom(p.y()); }
+inline QPointF QRectF::center() const
+{ return QPointF(xp + w/2, yp + h/2); }
+inline void QRectF::moveLeft(qreal pos) { xp = pos; }
+inline void QRectF::moveTop(qreal pos) { yp = pos; }
+inline void QRectF::moveRight(qreal pos) { xp = pos - w; }
+inline void QRectF::moveBottom(qreal pos) { yp = pos - h; }
+inline void QRectF::moveTopLeft(const QPointF &p) { moveLeft(p.x()); moveTop(p.y()); }
+inline void QRectF::moveTopRight(const QPointF &p) { moveRight(p.x()); moveTop(p.y()); }
+inline void QRectF::moveBottomLeft(const QPointF &p) { moveLeft(p.x()); moveBottom(p.y()); }
+inline void QRectF::moveBottomRight(const QPointF &p) { moveRight(p.x()); moveBottom(p.y()); }
+inline void QRectF::moveCenter(const QPointF &p) { xp = p.x() - w/2; yp = p.y() - h/2; }
+inline qreal QRectF::width() const
+{ return w; }
+inline qreal QRectF::height() const
+{ return h; }
+inline QSizeF QRectF::size() const
+{ return QSizeF(w, h); }
+inline void QRectF::translate(qreal dx, qreal dy)
+{
+ xp += dx;
+ yp += dy;
+}
+inline void QRectF::translate(const QPointF &p)
+{
+ xp += p.x();
+ yp += p.y();
+}
+inline void QRectF::moveTo(qreal ax, qreal ay)
+{
+ xp = ax;
+ yp = ay;
+}
+inline void QRectF::moveTo(const QPointF &p)
+{
+ xp = p.x();
+ yp = p.y();
+}
+inline QRectF QRectF::translated(qreal dx, qreal dy) const
+{ return QRectF(xp + dx, yp + dy, w, h); }
+inline QRectF QRectF::translated(const QPointF &p) const
+{ return QRectF(xp + p.x(), yp + p.y(), w, h); }
+inline void QRectF::getRect(qreal *ax, qreal *ay, qreal *aaw, qreal *aah) const
+{
+ *ax = this->xp;
+ *ay = this->yp;
+ *aaw = this->w;
+ *aah = this->h;
+}
+inline void QRectF::setRect(qreal ax, qreal ay, qreal aaw, qreal aah)
+{
+ this->xp = ax;
+ this->yp = ay;
+ this->w = aaw;
+ this->h = aah;
+}
+inline void QRectF::getCoords(qreal *xp1, qreal *yp1, qreal *xp2, qreal *yp2) const
+{
+ *xp1 = xp;
+ *yp1 = yp;
+ *xp2 = xp + w;
+ *yp2 = yp + h;
+}
+inline void QRectF::setCoords(qreal xp1, qreal yp1, qreal xp2, qreal yp2)
+{
+ xp = xp1;
+ yp = yp1;
+ w = xp2 - xp1;
+ h = yp2 - yp1;
+}
+inline void QRectF::adjust(qreal xp1, qreal yp1, qreal xp2, qreal yp2)
+{ xp += xp1; yp += yp1; w += xp2 - xp1; h += yp2 - yp1; }
+inline QRectF QRectF::adjusted(qreal xp1, qreal yp1, qreal xp2, qreal yp2) const
+{ return QRectF(xp + xp1, yp + yp1, w + xp2 - xp1, h + yp2 - yp1); }
+inline void QRectF::setWidth(qreal aw)
+{ this->w = aw; }
+inline void QRectF::setHeight(qreal ah)
+{ this->h = ah; }
+inline void QRectF::setSize(const QSizeF &s)
+{
+ w = s.width();
+ h = s.height();
+}
+inline bool QRectF::contains(qreal ax, qreal ay) const
+{
+ return contains(QPointF(ax, ay));
+}
+inline QRectF& QRectF::operator|=(const QRectF &r)
+{
+ *this = *this | r;
+ return *this;
+}
+inline QRectF& QRectF::operator&=(const QRectF &r)
+{
+ *this = *this & r;
+ return *this;
+}
+inline QRectF QRectF::intersect(const QRectF &r) const
+{
+ return *this & r;
+}
+inline QRectF QRectF::intersected(const QRectF &r) const
+{
+ return intersect(r);
+}
+inline QRectF QRectF::unite(const QRectF &r) const
+{
+ return *this | r;
+}
+inline QRectF QRectF::united(const QRectF &r) const
+{
+ return unite(r);
+}
+inline bool operator==(const QRectF &r1, const QRectF &r2)
+{
+ return qFuzzyCompare(r1.xp, r2.xp) && qFuzzyCompare(r1.yp, r2.yp)
+ && qFuzzyCompare(r1.w, r2.w) && qFuzzyCompare(r1.h, r2.h);
+}
+inline bool operator!=(const QRectF &r1, const QRectF &r2)
+{
+ return !qFuzzyCompare(r1.xp, r2.xp) || !qFuzzyCompare(r1.yp, r2.yp)
+ || !qFuzzyCompare(r1.w, r2.w) || !qFuzzyCompare(r1.h, r2.h);
+}
+inline QRect QRectF::toRect() const
+{
+ return QRect(qRound(xp), qRound(yp), qRound(w), qRound(h));
+}
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QRectF &);
+typedef QtValidLicenseForGuiModule QtGuiModule;
+typedef unsigned int QRgb;
+const QRgb RGB_MASK = 0x00ffffff;
+__attribute__((visibility("default"))) inline int qRed(QRgb rgb)
+{ return ((rgb >> 16) & 0xff); }
+__attribute__((visibility("default"))) inline int qGreen(QRgb rgb)
+{ return ((rgb >> 8) & 0xff); }
+__attribute__((visibility("default"))) inline int qBlue(QRgb rgb)
+{ return (rgb & 0xff); }
+__attribute__((visibility("default"))) inline int qAlpha(QRgb rgb)
+{ return ((rgb >> 24) & 0xff); }
+__attribute__((visibility("default"))) inline QRgb qRgb(int r, int g, int b)
+{ return (0xffu << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
+__attribute__((visibility("default"))) inline QRgb qRgba(int r, int g, int b, int a)
+{ return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
+__attribute__((visibility("default"))) inline int qGray(int r, int g, int b)
+{ return (r*11+g*16+b*5)/32; }
+__attribute__((visibility("default"))) inline int qGray(QRgb rgb)
+{ return qGray(qRed(rgb), qGreen(rgb), qBlue(rgb)); }
+__attribute__((visibility("default"))) inline bool qIsGray(QRgb rgb)
+{ return qRed(rgb) == qGreen(rgb) && qRed(rgb) == qBlue(rgb); }
+typedef QtValidLicenseForCoreModule QtCoreModule;
+struct QRegExpPrivate;
+class QStringList;
+class __attribute__((visibility("default"))) QRegExp
+{
+public:
+ enum PatternSyntax { RegExp, Wildcard, FixedString, RegExp2 };
+ enum CaretMode { CaretAtZero, CaretAtOffset, CaretWontMatch };
+ QRegExp();
+ explicit QRegExp(const QString &pattern, Qt::CaseSensitivity cs = Qt::CaseSensitive,
+ PatternSyntax syntax = RegExp);
+ QRegExp(const QRegExp &rx);
+ ~QRegExp();
+ QRegExp &operator=(const QRegExp &rx);
+ bool operator==(const QRegExp &rx) const;
+ inline bool operator!=(const QRegExp &rx) const { return !operator==(rx); }
+ bool isEmpty() const;
+ bool isValid() const;
+ QString pattern() const;
+ void setPattern(const QString &pattern);
+ Qt::CaseSensitivity caseSensitivity() const;
+ void setCaseSensitivity(Qt::CaseSensitivity cs);
+ PatternSyntax patternSyntax() const;
+ void setPatternSyntax(PatternSyntax syntax);
+ bool isMinimal() const;
+ void setMinimal(bool minimal);
+ bool exactMatch(const QString &str) const;
+ int indexIn(const QString &str, int offset = 0, CaretMode caretMode = CaretAtZero) const;
+ int lastIndexIn(const QString &str, int offset = -1, CaretMode caretMode = CaretAtZero) const;
+ int matchedLength() const;
+ int numCaptures() const;
+ QStringList capturedTexts() const;
+ QStringList capturedTexts();
+ QString cap(int nth = 0) const;
+ QString cap(int nth = 0);
+ int pos(int nth = 0) const;
+ int pos(int nth = 0);
+ QString errorString() const;
+ QString errorString();
+ static QString escape(const QString &str);
+private:
+ QRegExpPrivate *priv;
+};
+template <> class QTypeInfo<QRegExp> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QRegExp)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QRegExp"; } };
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &out, const QRegExp ®Exp);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &in, QRegExp ®Exp);
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QStringMatcherPrivate;
+class __attribute__((visibility("default"))) QStringMatcher
+{
+public:
+ QStringMatcher();
+ QStringMatcher(const QString &pattern,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QStringMatcher(const QChar *uc, int len,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QStringMatcher(const QStringMatcher &other);
+ ~QStringMatcher();
+ QStringMatcher &operator=(const QStringMatcher &other);
+ void setPattern(const QString &pattern);
+ void setCaseSensitivity(Qt::CaseSensitivity cs);
+ int indexIn(const QString &str, int from = 0) const;
+ int indexIn(const QChar *str, int length, int from = 0) const;
+ QString pattern() const;
+ inline Qt::CaseSensitivity caseSensitivity() const { return q_cs; }
+private:
+ QStringMatcherPrivate *d_ptr;
+ QString q_pattern;
+ Qt::CaseSensitivity q_cs;
+ union {
+ uint q_data[256];
+ struct {
+ uchar q_skiptable[256];
+ const QChar *uc;
+ int len;
+ } p;
+ };
+};
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QRegExp;
+typedef QListIterator<QString> QStringListIterator;
+typedef QMutableListIterator<QString> QMutableStringListIterator;
+class QStringList : public QList<QString>
+{
+public:
+ inline QStringList() { }
+ inline explicit QStringList(const QString &i) { append(i); }
+ inline QStringList(const QStringList &l) : QList<QString>(l) { }
+ inline QStringList(const QList<QString> &l) : QList<QString>(l) { }
+ inline void sort();
+ inline int removeDuplicates();
+ inline QString join(const QString &sep) const;
+ inline QStringList filter(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ inline QBool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ inline QStringList &replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ inline QStringList operator+(const QStringList &other) const
+ { QStringList n = *this; n += other; return n; }
+ inline QStringList &operator<<(const QString &str)
+ { append(str); return *this; }
+ inline QStringList &operator<<(const QStringList &l)
+ { *this += l; return *this; }
+ inline QStringList filter(const QRegExp &rx) const;
+ inline QStringList &replaceInStrings(const QRegExp &rx, const QString &after);
+ inline int indexOf(const QRegExp &rx, int from = 0) const;
+ inline int lastIndexOf(const QRegExp &rx, int from = -1) const;
+ inline int indexOf(QRegExp &rx, int from = 0) const;
+ inline int lastIndexOf(QRegExp &rx, int from = -1) const;
+ using QList<QString>::indexOf;
+ using QList<QString>::lastIndexOf;
+};
+namespace QtPrivate {
+ void __attribute__((visibility("default"))) QStringList_sort(QStringList *that);
+ int __attribute__((visibility("default"))) QStringList_removeDuplicates(QStringList *that);
+ QString __attribute__((visibility("default"))) QStringList_join(const QStringList *that, const QString &sep);
+ QStringList __attribute__((visibility("default"))) QStringList_filter(const QStringList *that, const QString &str,
+ Qt::CaseSensitivity cs);
+ QBool __attribute__((visibility("default"))) QStringList_contains(const QStringList *that, const QString &str, Qt::CaseSensitivity cs);
+ void __attribute__((visibility("default"))) QStringList_replaceInStrings(QStringList *that, const QString &before, const QString &after,
+ Qt::CaseSensitivity cs);
+ void __attribute__((visibility("default"))) QStringList_replaceInStrings(QStringList *that, const QRegExp &rx, const QString &after);
+ QStringList __attribute__((visibility("default"))) QStringList_filter(const QStringList *that, const QRegExp &re);
+ int __attribute__((visibility("default"))) QStringList_indexOf(const QStringList *that, const QRegExp &rx, int from);
+ int __attribute__((visibility("default"))) QStringList_lastIndexOf(const QStringList *that, const QRegExp &rx, int from);
+ int __attribute__((visibility("default"))) QStringList_indexOf(const QStringList *that, QRegExp &rx, int from);
+ int __attribute__((visibility("default"))) QStringList_lastIndexOf(const QStringList *that, QRegExp &rx, int from);
+}
+inline void QStringList::sort()
+{
+ QtPrivate::QStringList_sort(this);
+}
+inline int QStringList::removeDuplicates()
+{
+ return QtPrivate::QStringList_removeDuplicates(this);
+}
+inline QString QStringList::join(const QString &sep) const
+{
+ return QtPrivate::QStringList_join(this, sep);
+}
+inline QStringList QStringList::filter(const QString &str, Qt::CaseSensitivity cs) const
+{
+ return QtPrivate::QStringList_filter(this, str, cs);
+}
+inline QBool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const
+{
+ return QtPrivate::QStringList_contains(this, str, cs);
+}
+inline QStringList &QStringList::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs)
+{
+ QtPrivate::QStringList_replaceInStrings(this, before, after, cs);
+ return *this;
+}
+inline QStringList &QStringList::replaceInStrings(const QRegExp &rx, const QString &after)
+{
+ QtPrivate::QStringList_replaceInStrings(this, rx, after);
+ return *this;
+}
+inline QStringList QStringList::filter(const QRegExp &rx) const
+{
+ return QtPrivate::QStringList_filter(this, rx);
+}
+inline int QStringList::indexOf(const QRegExp &rx, int from) const
+{
+ return QtPrivate::QStringList_indexOf(this, rx, from);
+}
+inline int QStringList::lastIndexOf(const QRegExp &rx, int from) const
+{
+ return QtPrivate::QStringList_lastIndexOf(this, rx, from);
+}
+inline int QStringList::indexOf(QRegExp &rx, int from) const
+{
+ return QtPrivate::QStringList_indexOf(this, rx, from);
+}
+inline int QStringList::lastIndexOf(QRegExp &rx, int from) const
+{
+ return QtPrivate::QStringList_lastIndexOf(this, rx, from);
+}
+inline QDataStream &operator>>(QDataStream &in, QStringList &list)
+{
+ return operator>>(in, static_cast<QList<QString> &>(list));
+}
+inline QDataStream &operator<<(QDataStream &out, const QStringList &list)
+{
+ return operator<<(out, static_cast<const QList<QString> &>(list));
+}
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QColor;
+class QColormap;
+class QVariant;
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QColor &);
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QColor &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QColor &);
+class __attribute__((visibility("default"))) QColor
+{
+public:
+ enum Spec { Invalid, Rgb, Hsv, Cmyk };
+ QColor();
+ QColor(Qt::GlobalColor color);
+ QColor(int r, int g, int b, int a = 255);
+ QColor(QRgb rgb);
+ QColor(const QString& name);
+ QColor(const char *name);
+ QColor(const QColor &color);
+ QColor(Spec spec);
+ bool isValid() const;
+ QString name() const;
+ void setNamedColor(const QString& name);
+ static QStringList colorNames();
+ inline Spec spec() const
+ { return cspec; }
+ int alpha() const;
+ void setAlpha(int alpha);
+ qreal alphaF() const;
+ void setAlphaF(qreal alpha);
+ int red() const;
+ int green() const;
+ int blue() const;
+ void setRed(int red);
+ void setGreen(int green);
+ void setBlue(int blue);
+ qreal redF() const;
+ qreal greenF() const;
+ qreal blueF() const;
+ void setRedF(qreal red);
+ void setGreenF(qreal green);
+ void setBlueF(qreal blue);
+ void getRgb(int *r, int *g, int *b, int *a = 0) const;
+ void setRgb(int r, int g, int b, int a = 255);
+ void getRgbF(qreal *r, qreal *g, qreal *b, qreal *a = 0) const;
+ void setRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
+ QRgb rgba() const;
+ void setRgba(QRgb rgba);
+ QRgb rgb() const;
+ void setRgb(QRgb rgb);
+ int hue() const;
+ int saturation() const;
+ int value() const;
+ qreal hueF() const;
+ qreal saturationF() const;
+ qreal valueF() const;
+ void getHsv(int *h, int *s, int *v, int *a = 0) const;
+ void setHsv(int h, int s, int v, int a = 255);
+ void getHsvF(qreal *h, qreal *s, qreal *v, qreal *a = 0) const;
+ void setHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
+ int cyan() const;
+ int magenta() const;
+ int yellow() const;
+ int black() const;
+ qreal cyanF() const;
+ qreal magentaF() const;
+ qreal yellowF() const;
+ qreal blackF() const;
+ void getCmyk(int *c, int *m, int *y, int *k, int *a = 0);
+ void setCmyk(int c, int m, int y, int k, int a = 255);
+ void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = 0);
+ void setCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0);
+ QColor toRgb() const;
+ QColor toHsv() const;
+ QColor toCmyk() const;
+ QColor convertTo(Spec colorSpec) const;
+ static QColor fromRgb(QRgb rgb);
+ static QColor fromRgba(QRgb rgba);
+ static QColor fromRgb(int r, int g, int b, int a = 255);
+ static QColor fromRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
+ static QColor fromHsv(int h, int s, int v, int a = 255);
+ static QColor fromHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
+ static QColor fromCmyk(int c, int m, int y, int k, int a = 255);
+ static QColor fromCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0);
+ QColor light(int f = 150) const;
+ QColor lighter(int f = 150) const;
+ QColor dark(int f = 200) const;
+ QColor darker(int f = 200) const;
+ QColor &operator=(const QColor &);
+ QColor &operator=(Qt::GlobalColor color);
+ bool operator==(const QColor &c) const;
+ bool operator!=(const QColor &c) const;
+ operator QVariant() const;
+private:
+ QColor(int, int, int, Spec);
+ void invalidate();
+ Spec cspec;
+ union {
+ struct {
+ ushort alpha;
+ ushort red;
+ ushort green;
+ ushort blue;
+ ushort pad;
+ } argb;
+ struct {
+ ushort alpha;
+ ushort hue;
+ ushort saturation;
+ ushort value;
+ ushort pad;
+ } ahsv;
+ struct {
+ ushort alpha;
+ ushort cyan;
+ ushort magenta;
+ ushort yellow;
+ ushort black;
+ } acmyk;
+ } ct;
+ friend class QColormap;
+ friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QColor &);
+ friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QColor &);
+};
+inline QColor::QColor()
+{ invalidate(); }
+inline QColor::QColor(int r, int g, int b, int a)
+{ setRgb(r, g, b, a); }
+inline QColor::QColor(const char *aname)
+{ setNamedColor(QLatin1String(aname)); }
+inline QColor::QColor(const QString& aname)
+{ setNamedColor(aname); }
+inline QColor::QColor(const QColor &acolor)
+ : cspec(acolor.cspec)
+{ ct.argb = acolor.ct.argb; }
+inline bool QColor::isValid() const
+{ return cspec != Invalid; }
+inline QColor QColor::lighter(int f) const
+{ return light(f); }
+inline QColor QColor::darker(int f) const
+{ return dark(f); }
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QPaintDevice;
+class QWidget;
+class QDialog;
+class QColor;
+class QPalette;
+class QCursor;
+class QPoint;
+class QSize;
+class QRect;
+class QPolygon;
+class QPainter;
+class QRegion;
+class QFont;
+class QFontMetrics;
+class QFontInfo;
+class QPen;
+class QBrush;
+class QMatrix;
+class QPixmap;
+class QBitmap;
+class QMovie;
+class QImage;
+class QPicture;
+class QPrinter;
+class QTimer;
+class QTime;
+class QClipboard;
+class QString;
+class QByteArray;
+class QApplication;
+template<typename T> class QList;
+typedef QList<QWidget *> QWidgetList;
+typedef unsigned long WId;
+struct QWSEvent;
+template<class K, class V> class QHash;
+typedef QHash<WId, QWidget *> QWidgetMapper;
+template<class V> class QSet;
+typedef QSet<QWidget *> QWidgetSet;
+typedef QtValidLicenseForGuiModule QtGuiModule;
+template <class T> class QVector;
+class QVariant;
+struct QRegionPrivate;
+class QBitmap;
+class __attribute__((visibility("default"))) QRegion
+{
+public:
+ enum RegionType { Rectangle, Ellipse };
+ QRegion();
+ QRegion(int x, int y, int w, int h, RegionType t = Rectangle);
+ QRegion(const QRect &r, RegionType t = Rectangle);
+ QRegion(const QPolygon &pa, Qt::FillRule fillRule = Qt::OddEvenFill);
+ QRegion(const QRegion ®ion);
+ QRegion(const QBitmap &bitmap);
+ ~QRegion();
+ QRegion &operator=(const QRegion &);
+ bool isEmpty() const;
+ bool contains(const QPoint &p) const;
+ bool contains(const QRect &r) const;
+ void translate(int dx, int dy);
+ inline void translate(const QPoint &p) { translate(p.x(), p.y()); }
+ QRegion translated(int dx, int dy) const;
+ inline QRegion translated(const QPoint &p) const { return translated(p.x(), p.y()); }
+ QRegion unite(const QRegion &r) const;
+ QRegion unite(const QRect &r) const;
+ QRegion intersect(const QRegion &r) const;
+ QRegion intersect(const QRect &r) const;
+ QRegion subtract(const QRegion &r) const;
+ QRegion eor(const QRegion &r) const;
+ inline QRegion united(const QRegion &r) const { return unite(r); }
+ inline QRegion united(const QRect &r) const { return unite(r); }
+ inline QRegion intersected(const QRegion &r) const { return intersect(r); }
+ inline QRegion intersected(const QRect &r) const { return intersect(r); }
+ inline QRegion subtracted(const QRegion &r) const { return subtract(r); }
+ inline QRegion xored(const QRegion &r) const { return eor(r); }
+ bool intersects(const QRegion &r) const;
+ bool intersects(const QRect &r) const;
+ QRect boundingRect() const;
+ QVector<QRect> rects() const;
+ void setRects(const QRect *rect, int num);
+ int numRects() const;
+ const QRegion operator|(const QRegion &r) const;
+ const QRegion operator+(const QRegion &r) const;
+ const QRegion operator+(const QRect &r) const;
+ const QRegion operator&(const QRegion &r) const;
+ const QRegion operator&(const QRect &r) const;
+ const QRegion operator-(const QRegion &r) const;
+ const QRegion operator^(const QRegion &r) const;
+ QRegion& operator|=(const QRegion &r);
+ QRegion& operator+=(const QRegion &r);
+ QRegion& operator+=(const QRect &r);
+ QRegion& operator&=(const QRegion &r);
+ QRegion& operator&=(const QRect &r);
+ QRegion& operator-=(const QRegion &r);
+ QRegion& operator^=(const QRegion &r);
+ bool operator==(const QRegion &r) const;
+ inline bool operator!=(const QRegion &r) const { return !(operator==(r)); }
+ operator QVariant() const;
+ inline void *handle() const { return d->qt_rgn; }
+ friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QRegion &);
+ friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QRegion &);
+private:
+ QRegion copy() const;
+ void detach();
+ friend bool qt_region_strictContains(const QRegion ®ion,
+ const QRect &rect);
+ friend struct QRegionPrivate;
+ void exec(const QByteArray &ba, int ver = 0, QDataStream::ByteOrder byteOrder = QDataStream::BigEndian);
+ struct QRegionData {
+ QBasicAtomicInt ref;
+ QRegionPrivate *qt_rgn;
+ };
+ struct QRegionData *d;
+ static struct QRegionData shared_empty;
+ static void cleanUp(QRegionData *x);
+};
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QRegion &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QRegion &);
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QRegion &);
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QKeySequence;
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &out, QKeySequence &ks);
+class QVariant;
+class QKeySequencePrivate;
+class __attribute__((visibility("default"))) QKeySequence
+{
+public:
+ enum StandardKey {
+ UnknownKey,
+ HelpContents,
+ WhatsThis,
+ Open,
+ Close,
+ Save,
+ New,
+ Delete,
+ Cut,
+ Copy,
+ Paste,
+ Undo,
+ Redo,
+ Back,
+ Forward,
+ Refresh,
+ ZoomIn,
+ ZoomOut,
+ Print,
+ AddTab,
+ NextChild,
+ PreviousChild,
+ Find,
+ FindNext,
+ FindPrevious,
+ Replace,
+ SelectAll,
+ Bold,
+ Italic,
+ Underline,
+ MoveToNextChar,
+ MoveToPreviousChar,
+ MoveToNextWord,
+ MoveToPreviousWord,
+ MoveToNextLine,
+ MoveToPreviousLine,
+ MoveToNextPage,
+ MoveToPreviousPage,
+ MoveToStartOfLine,
+ MoveToEndOfLine,
+ MoveToStartOfBlock,
+ MoveToEndOfBlock,
+ MoveToStartOfDocument,
+ MoveToEndOfDocument,
+ SelectNextChar,
+ SelectPreviousChar,
+ SelectNextWord,
+ SelectPreviousWord,
+ SelectNextLine,
+ SelectPreviousLine,
+ SelectNextPage,
+ SelectPreviousPage,
+ SelectStartOfLine,
+ SelectEndOfLine,
+ SelectStartOfBlock,
+ SelectEndOfBlock,
+ SelectStartOfDocument,
+ SelectEndOfDocument,
+ DeleteStartOfWord,
+ DeleteEndOfWord,
+ DeleteEndOfLine,
+ InsertParagraphSeparator,
+ InsertLineSeparator,
+ SaveAs
+ };
+ QKeySequence();
+ QKeySequence(const QString &key);
+ QKeySequence(int k1, int k2 = 0, int k3 = 0, int k4 = 0);
+ QKeySequence(const QKeySequence &ks);
+ QKeySequence(StandardKey key);
+ ~QKeySequence();
+ uint count() const;
+ bool isEmpty() const;
+ enum SequenceMatch {
+ NoMatch,
+ PartialMatch,
+ ExactMatch
+ };
+ enum SequenceFormat {
+ NativeText,
+ PortableText
+ };
+ QString toString(SequenceFormat format = PortableText) const;
+ static QKeySequence fromString(const QString &str, SequenceFormat format = PortableText);
+ SequenceMatch matches(const QKeySequence &seq) const;
+ static QKeySequence mnemonic(const QString &text);
+ static QList<QKeySequence> keyBindings(StandardKey key);
+ operator QString() const;
+ operator QVariant() const;
+ operator int() const;
+ int operator[](uint i) const;
+ QKeySequence &operator=(const QKeySequence &other);
+ bool operator==(const QKeySequence &other) const;
+ inline bool operator!= (const QKeySequence &other) const
+ { return !(*this == other); }
+ bool operator< (const QKeySequence &ks) const;
+ inline bool operator> (const QKeySequence &other) const
+ { return other < *this; }
+ inline bool operator<= (const QKeySequence &other) const
+ { return !(other < *this); }
+ inline bool operator>= (const QKeySequence &other) const
+ { return !(*this < other); }
+ bool isDetached() const;
+private:
+ static int decodeString(const QString &ks);
+ static QString encodeString(int key);
+ int assign(const QString &str);
+ void setKey(int key, int index);
+ QKeySequencePrivate *d;
+ friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
+ friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &in, QKeySequence &ks);
+ friend class Q3AccelManager;
+ friend class QShortcutMap;
+ friend class QShortcut;
+public:
+ typedef QKeySequencePrivate * DataPtr;
+ inline DataPtr &data_ptr() { return d; }
+};
+template <> class QTypeInfo<QKeySequence> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QKeySequence)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QKeySequence"; } };
+template <> inline bool qIsDetached<QKeySequence>(QKeySequence &t) { return t.isDetached(); } template <typename T> inline void qSwap(T &, T &); template <> inline void qSwap<QKeySequence>(QKeySequence &value1, QKeySequence &value2) { const QKeySequence::DataPtr t = value1.data_ptr(); value1.data_ptr() = value2.data_ptr(); value2.data_ptr() = t; }
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QKeySequence &);
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QEventPrivate;
+class __attribute__((visibility("default"))) QEvent
+{
+public:
+ enum Type {
+ None = 0,
+ Timer = 1,
+ MouseButtonPress = 2,
+ MouseButtonRelease = 3,
+ MouseButtonDblClick = 4,
+ MouseMove = 5,
+ KeyPress = 6,
+ KeyRelease = 7,
+ FocusIn = 8,
+ FocusOut = 9,
+ Enter = 10,
+ Leave = 11,
+ Paint = 12,
+ Move = 13,
+ Resize = 14,
+ Create = 15,
+ Destroy = 16,
+ Show = 17,
+ Hide = 18,
+ Close = 19,
+ Quit = 20,
+ ParentChange = 21,
+ ParentAboutToChange = 131,
+ ThreadChange = 22,
+ WindowActivate = 24,
+ WindowDeactivate = 25,
+ ShowToParent = 26,
+ HideToParent = 27,
+ Wheel = 31,
+ WindowTitleChange = 33,
+ WindowIconChange = 34,
+ ApplicationWindowIconChange = 35,
+ ApplicationFontChange = 36,
+ ApplicationLayoutDirectionChange = 37,
+ ApplicationPaletteChange = 38,
+ PaletteChange = 39,
+ Clipboard = 40,
+ Speech = 42,
+ MetaCall = 43,
+ SockAct = 50,
+ WinEventAct = 132,
+ DeferredDelete = 52,
+ DragEnter = 60,
+ DragMove = 61,
+ DragLeave = 62,
+ Drop = 63,
+ DragResponse = 64,
+ ChildAdded = 68,
+ ChildPolished = 69,
+ ChildRemoved = 71,
+ ShowWindowRequest = 73,
+ PolishRequest = 74,
+ Polish = 75,
+ LayoutRequest = 76,
+ UpdateRequest = 77,
+ UpdateLater = 78,
+ EmbeddingControl = 79,
+ ActivateControl = 80,
+ DeactivateControl = 81,
+ ContextMenu = 82,
+ InputMethod = 83,
+ AccessibilityPrepare = 86,
+ TabletMove = 87,
+ LocaleChange = 88,
+ LanguageChange = 89,
+ LayoutDirectionChange = 90,
+ Style = 91,
+ TabletPress = 92,
+ TabletRelease = 93,
+ OkRequest = 94,
+ HelpRequest = 95,
+ IconDrag = 96,
+ FontChange = 97,
+ EnabledChange = 98,
+ ActivationChange = 99,
+ StyleChange = 100,
+ IconTextChange = 101,
+ ModifiedChange = 102,
+ MouseTrackingChange = 109,
+ WindowBlocked = 103,
+ WindowUnblocked = 104,
+ WindowStateChange = 105,
+ ToolTip = 110,
+ WhatsThis = 111,
+ StatusTip = 112,
+ ActionChanged = 113,
+ ActionAdded = 114,
+ ActionRemoved = 115,
+ FileOpen = 116,
+ Shortcut = 117,
+ ShortcutOverride = 51,
+ WhatsThisClicked = 118,
+ ToolBarChange = 120,
+ ApplicationActivate = 121,
+ ApplicationActivated = ApplicationActivate,
+ ApplicationDeactivate = 122,
+ ApplicationDeactivated = ApplicationDeactivate,
+ QueryWhatsThis = 123,
+ EnterWhatsThisMode = 124,
+ LeaveWhatsThisMode = 125,
+ ZOrderChange = 126,
+ HoverEnter = 127,
+ HoverLeave = 128,
+ HoverMove = 129,
+ AccessibilityHelp = 119,
+ AccessibilityDescription = 130,
+ AcceptDropsChange = 152,
+ MenubarUpdated = 153,
+ ZeroTimerEvent = 154,
+ GraphicsSceneMouseMove = 155,
+ GraphicsSceneMousePress = 156,
+ GraphicsSceneMouseRelease = 157,
+ GraphicsSceneMouseDoubleClick = 158,
+ GraphicsSceneContextMenu = 159,
+ GraphicsSceneHoverEnter = 160,
+ GraphicsSceneHoverMove = 161,
+ GraphicsSceneHoverLeave = 162,
+ GraphicsSceneHelp = 163,
+ GraphicsSceneDragEnter = 164,
+ GraphicsSceneDragMove = 165,
+ GraphicsSceneDragLeave = 166,
+ GraphicsSceneDrop = 167,
+ GraphicsSceneWheel = 168,
+ KeyboardLayoutChange = 169,
+ DynamicPropertyChange = 170,
+ TabletEnterProximity = 171,
+ TabletLeaveProximity = 172,
+ NonClientAreaMouseMove = 173,
+ NonClientAreaMouseButtonPress = 174,
+ NonClientAreaMouseButtonRelease = 175,
+ NonClientAreaMouseButtonDblClick = 176,
+ MacSizeChange = 177,
+ ContentsRectChange = 178,
+ MacGLWindowChange = 179,
+ FutureCallOut = 180,
+ GraphicsSceneResize = 181,
+ GraphicsSceneMove = 182,
+ CursorChange = 183,
+ ToolTipChange = 184,
+ NetworkReplyUpdated = 185,
+ GrabMouse = 186,
+ UngrabMouse = 187,
+ GrabKeyboard = 188,
+ UngrabKeyboard = 189,
+ CocoaRequestModal = 190,
+ MacGLClearDrawable = 191,
+ User = 1000,
+ MaxUser = 65535
+ };
+ QEvent(Type type);
+ virtual ~QEvent();
+ inline Type type() const { return static_cast<Type>(t); }
+ inline bool spontaneous() const { return spont; }
+ inline void setAccepted(bool accepted) { m_accept = accepted; }
+ inline bool isAccepted() const { return m_accept; }
+ inline void accept() { m_accept = true; }
+ inline void ignore() { m_accept = false; }
+ static int registerEventType(int hint = -1);
+protected:
+ QEventPrivate *d;
+ ushort t;
+private:
+ ushort posted : 1;
+ ushort spont : 1;
+ ushort m_accept : 1;
+ ushort reserved : 13;
+ friend class QCoreApplication;
+ friend class QCoreApplicationPrivate;
+ friend class QThreadData;
+ friend class QApplication;
+ friend class QApplicationPrivate;
+ friend class Q3AccelManager;
+ friend class QShortcutMap;
+ friend class QETWidget;
+};
+class __attribute__((visibility("default"))) QTimerEvent : public QEvent
+{
+public:
+ QTimerEvent( int timerId );
+ ~QTimerEvent();
+ int timerId() const { return id; }
+protected:
+ int id;
+};
+class QObject;
+class __attribute__((visibility("default"))) QChildEvent : public QEvent
+{
+public:
+ QChildEvent( Type type, QObject *child );
+ ~QChildEvent();
+ QObject *child() const { return c; }
+ bool added() const { return type() == ChildAdded; }
+ bool polished() const { return type() == ChildPolished; }
+ bool removed() const { return type() == ChildRemoved; }
+protected:
+ QObject *c;
+};
+class __attribute__((visibility("default"))) QDynamicPropertyChangeEvent : public QEvent
+{
+public:
+ QDynamicPropertyChangeEvent(const QByteArray &name);
+ ~QDynamicPropertyChangeEvent();
+ inline QByteArray propertyName() const { return n; }
+private:
+ QByteArray n;
+};
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class __attribute__((visibility("default"))) QMetaType {
+public:
+ enum Type {
+ Void = 0, Bool = 1, Int = 2, UInt = 3, LongLong = 4, ULongLong = 5,
+ Double = 6, QChar = 7, QVariantMap = 8, QVariantList = 9,
+ QString = 10, QStringList = 11, QByteArray = 12,
+ QBitArray = 13, QDate = 14, QTime = 15, QDateTime = 16, QUrl = 17,
+ QLocale = 18, QRect = 19, QRectF = 20, QSize = 21, QSizeF = 22,
+ QLine = 23, QLineF = 24, QPoint = 25, QPointF = 26, QRegExp = 27,
+ QVariantHash = 28, LastCoreType = 28 ,
+ FirstGuiType = 63 ,
+ QFont = 64, QPixmap = 65, QBrush = 66, QColor = 67, QPalette = 68,
+ QIcon = 69, QImage = 70, QPolygon = 71, QRegion = 72, QBitmap = 73,
+ QCursor = 74, QSizePolicy = 75, QKeySequence = 76, QPen = 77,
+ QTextLength = 78, QTextFormat = 79, QMatrix = 80, QTransform = 81,
+ LastGuiType = 81 ,
+ FirstCoreExtType = 128 ,
+ VoidStar = 128, Long = 129, Short = 130, Char = 131, ULong = 132,
+ UShort = 133, UChar = 134, Float = 135, QObjectStar = 136, QWidgetStar = 137,
+ LastCoreExtType = 137 ,
+ User = 256
+ };
+ typedef void (*Destructor)(void *);
+ typedef void *(*Constructor)(const void *);
+ typedef void (*SaveOperator)(QDataStream &, const void *);
+ typedef void (*LoadOperator)(QDataStream &, void *);
+ static void registerStreamOperators(const char *typeName, SaveOperator saveOp,
+ LoadOperator loadOp);
+ static int registerType(const char *typeName, Destructor destructor,
+ Constructor constructor);
+ static int type(const char *typeName);
+ static const char *typeName(int type);
+ static bool isRegistered(int type);
+ static void *construct(int type, const void *copy = 0);
+ static void destroy(int type, void *data);
+ static void unregisterType(const char *typeName);
+ static bool save(QDataStream &stream, int type, const void *data);
+ static bool load(QDataStream &stream, int type, void *data);
+};
+template <typename T>
+void qMetaTypeDeleteHelper(T *t)
+{
+ delete t;
+}
+template <typename T>
+void *qMetaTypeConstructHelper(const T *t)
+{
+ if (!t)
+ return new T;
+ return new T(*static_cast<const T*>(t));
+}
+template <typename T>
+void qMetaTypeSaveHelper(QDataStream &stream, const T *t)
+{
+ stream << *t;
+}
+template <typename T>
+void qMetaTypeLoadHelper(QDataStream &stream, T *t)
+{
+ stream >> *t;
+}
+template <typename T>
+int qRegisterMetaType(const char *typeName
+ , T * = 0
+)
+{
+ typedef void*(*ConstructPtr)(const T*);
+ ConstructPtr cptr = qMetaTypeConstructHelper<T>;
+ typedef void(*DeletePtr)(T*);
+ DeletePtr dptr = qMetaTypeDeleteHelper<T>;
+ return QMetaType::registerType(typeName, reinterpret_cast<QMetaType::Destructor>(dptr),
+ reinterpret_cast<QMetaType::Constructor>(cptr));
+}
+template <typename T>
+void qRegisterMetaTypeStreamOperators(const char *typeName
+ , T * = 0
+)
+{
+ typedef void(*SavePtr)(QDataStream &, const T *);
+ typedef void(*LoadPtr)(QDataStream &, T *);
+ SavePtr sptr = qMetaTypeSaveHelper<T>;
+ LoadPtr lptr = qMetaTypeLoadHelper<T>;
+ qRegisterMetaType<T>(typeName);
+ QMetaType::registerStreamOperators(typeName, reinterpret_cast<QMetaType::SaveOperator>(sptr),
+ reinterpret_cast<QMetaType::LoadOperator>(lptr));
+}
+template <typename T>
+struct QMetaTypeId
+{
+ enum { Defined = 0 };
+};
+template <typename T>
+struct QMetaTypeId2
+{
+ enum { Defined = QMetaTypeId<T>::Defined };
+ static inline int qt_metatype_id() { return QMetaTypeId<T>::qt_metatype_id(); }
+};
+template <typename T>
+inline int qMetaTypeId(
+ T * = 0
+)
+{
+ return QMetaTypeId2<T>::qt_metatype_id();
+}
+template <typename T>
+inline int qRegisterMetaType(
+ T * dummy = 0
+)
+{
+ return qMetaTypeId(dummy);
+}
+class QString;
+class QByteArray;
+class QChar;
+class QStringList;
+class QBitArray;
+class QDate;
+class QTime;
+class QDateTime;
+class QUrl;
+class QLocale;
+class QRect;
+class QRectF;
+class QSize;
+class QSizeF;
+class QLine;
+class QLineF;
+class QPoint;
+class QPointF;
+class QRegExp;
+class QWidget;
+class QObject;
+class QFont;
+class QPixmap;
+class QBrush;
+class QColor;
+class QPalette;
+class QIcon;
+class QImage;
+class QPolygon;
+class QRegion;
+class QBitmap;
+class QCursor;
+class QSizePolicy;
+class QKeySequence;
+class QPen;
+class QTextLength;
+class QTextFormat;
+class QMatrix;
+class QTransform;
+ template<> struct QMetaTypeId2<QString> { enum { Defined = 1, MetaType = QMetaType::QString }; static inline int qt_metatype_id() { return QMetaType::QString; } };
+ template<> struct QMetaTypeId2<int> { enum { Defined = 1, MetaType = QMetaType::Int }; static inline int qt_metatype_id() { return QMetaType::Int; } };
+ template<> struct QMetaTypeId2<uint> { enum { Defined = 1, MetaType = QMetaType::UInt }; static inline int qt_metatype_id() { return QMetaType::UInt; } };
+ template<> struct QMetaTypeId2<bool> { enum { Defined = 1, MetaType = QMetaType::Bool }; static inline int qt_metatype_id() { return QMetaType::Bool; } };
+ template<> struct QMetaTypeId2<double> { enum { Defined = 1, MetaType = QMetaType::Double }; static inline int qt_metatype_id() { return QMetaType::Double; } };
+ template<> struct QMetaTypeId2<QByteArray> { enum { Defined = 1, MetaType = QMetaType::QByteArray }; static inline int qt_metatype_id() { return QMetaType::QByteArray; } };
+ template<> struct QMetaTypeId2<QChar> { enum { Defined = 1, MetaType = QMetaType::QChar }; static inline int qt_metatype_id() { return QMetaType::QChar; } };
+ template<> struct QMetaTypeId2<long> { enum { Defined = 1, MetaType = QMetaType::Long }; static inline int qt_metatype_id() { return QMetaType::Long; } };
+ template<> struct QMetaTypeId2<short> { enum { Defined = 1, MetaType = QMetaType::Short }; static inline int qt_metatype_id() { return QMetaType::Short; } };
+ template<> struct QMetaTypeId2<char> { enum { Defined = 1, MetaType = QMetaType::Char }; static inline int qt_metatype_id() { return QMetaType::Char; } };
+ template<> struct QMetaTypeId2<ulong> { enum { Defined = 1, MetaType = QMetaType::ULong }; static inline int qt_metatype_id() { return QMetaType::ULong; } };
+ template<> struct QMetaTypeId2<ushort> { enum { Defined = 1, MetaType = QMetaType::UShort }; static inline int qt_metatype_id() { return QMetaType::UShort; } };
+ template<> struct QMetaTypeId2<uchar> { enum { Defined = 1, MetaType = QMetaType::UChar }; static inline int qt_metatype_id() { return QMetaType::UChar; } };
+ template<> struct QMetaTypeId2<float> { enum { Defined = 1, MetaType = QMetaType::Float }; static inline int qt_metatype_id() { return QMetaType::Float; } };
+ template<> struct QMetaTypeId2<QObject *> { enum { Defined = 1, MetaType = QMetaType::QObjectStar }; static inline int qt_metatype_id() { return QMetaType::QObjectStar; } };
+ template<> struct QMetaTypeId2<QWidget *> { enum { Defined = 1, MetaType = QMetaType::QWidgetStar }; static inline int qt_metatype_id() { return QMetaType::QWidgetStar; } };
+ template<> struct QMetaTypeId2<void *> { enum { Defined = 1, MetaType = QMetaType::VoidStar }; static inline int qt_metatype_id() { return QMetaType::VoidStar; } };
+ template<> struct QMetaTypeId2<qlonglong> { enum { Defined = 1, MetaType = QMetaType::LongLong }; static inline int qt_metatype_id() { return QMetaType::LongLong; } };
+ template<> struct QMetaTypeId2<qulonglong> { enum { Defined = 1, MetaType = QMetaType::ULongLong }; static inline int qt_metatype_id() { return QMetaType::ULongLong; } };
+ template<> struct QMetaTypeId2<QStringList> { enum { Defined = 1, MetaType = QMetaType::QStringList }; static inline int qt_metatype_id() { return QMetaType::QStringList; } };
+ template<> struct QMetaTypeId2<QBitArray> { enum { Defined = 1, MetaType = QMetaType::QBitArray }; static inline int qt_metatype_id() { return QMetaType::QBitArray; } };
+ template<> struct QMetaTypeId2<QDate> { enum { Defined = 1, MetaType = QMetaType::QDate }; static inline int qt_metatype_id() { return QMetaType::QDate; } };
+ template<> struct QMetaTypeId2<QTime> { enum { Defined = 1, MetaType = QMetaType::QTime }; static inline int qt_metatype_id() { return QMetaType::QTime; } };
+ template<> struct QMetaTypeId2<QDateTime> { enum { Defined = 1, MetaType = QMetaType::QDateTime }; static inline int qt_metatype_id() { return QMetaType::QDateTime; } };
+ template<> struct QMetaTypeId2<QUrl> { enum { Defined = 1, MetaType = QMetaType::QUrl }; static inline int qt_metatype_id() { return QMetaType::QUrl; } };
+ template<> struct QMetaTypeId2<QLocale> { enum { Defined = 1, MetaType = QMetaType::QLocale }; static inline int qt_metatype_id() { return QMetaType::QLocale; } };
+ template<> struct QMetaTypeId2<QRect> { enum { Defined = 1, MetaType = QMetaType::QRect }; static inline int qt_metatype_id() { return QMetaType::QRect; } };
+ template<> struct QMetaTypeId2<QRectF> { enum { Defined = 1, MetaType = QMetaType::QRectF }; static inline int qt_metatype_id() { return QMetaType::QRectF; } };
+ template<> struct QMetaTypeId2<QSize> { enum { Defined = 1, MetaType = QMetaType::QSize }; static inline int qt_metatype_id() { return QMetaType::QSize; } };
+ template<> struct QMetaTypeId2<QSizeF> { enum { Defined = 1, MetaType = QMetaType::QSizeF }; static inline int qt_metatype_id() { return QMetaType::QSizeF; } };
+ template<> struct QMetaTypeId2<QLine> { enum { Defined = 1, MetaType = QMetaType::QLine }; static inline int qt_metatype_id() { return QMetaType::QLine; } };
+ template<> struct QMetaTypeId2<QLineF> { enum { Defined = 1, MetaType = QMetaType::QLineF }; static inline int qt_metatype_id() { return QMetaType::QLineF; } };
+ template<> struct QMetaTypeId2<QPoint> { enum { Defined = 1, MetaType = QMetaType::QPoint }; static inline int qt_metatype_id() { return QMetaType::QPoint; } };
+ template<> struct QMetaTypeId2<QPointF> { enum { Defined = 1, MetaType = QMetaType::QPointF }; static inline int qt_metatype_id() { return QMetaType::QPointF; } };
+ template<> struct QMetaTypeId2<QRegExp> { enum { Defined = 1, MetaType = QMetaType::QRegExp }; static inline int qt_metatype_id() { return QMetaType::QRegExp; } };
+ template<> struct QMetaTypeId2<QFont> { enum { Defined = 1, MetaType = QMetaType::QFont }; static inline int qt_metatype_id() { return QMetaType::QFont; } };
+ template<> struct QMetaTypeId2<QPixmap> { enum { Defined = 1, MetaType = QMetaType::QPixmap }; static inline int qt_metatype_id() { return QMetaType::QPixmap; } };
+ template<> struct QMetaTypeId2<QBrush> { enum { Defined = 1, MetaType = QMetaType::QBrush }; static inline int qt_metatype_id() { return QMetaType::QBrush; } };
+ template<> struct QMetaTypeId2<QColor> { enum { Defined = 1, MetaType = QMetaType::QColor }; static inline int qt_metatype_id() { return QMetaType::QColor; } };
+ template<> struct QMetaTypeId2<QPalette> { enum { Defined = 1, MetaType = QMetaType::QPalette }; static inline int qt_metatype_id() { return QMetaType::QPalette; } };
+ template<> struct QMetaTypeId2<QIcon> { enum { Defined = 1, MetaType = QMetaType::QIcon }; static inline int qt_metatype_id() { return QMetaType::QIcon; } };
+ template<> struct QMetaTypeId2<QImage> { enum { Defined = 1, MetaType = QMetaType::QImage }; static inline int qt_metatype_id() { return QMetaType::QImage; } };
+ template<> struct QMetaTypeId2<QPolygon> { enum { Defined = 1, MetaType = QMetaType::QPolygon }; static inline int qt_metatype_id() { return QMetaType::QPolygon; } };
+ template<> struct QMetaTypeId2<QRegion> { enum { Defined = 1, MetaType = QMetaType::QRegion }; static inline int qt_metatype_id() { return QMetaType::QRegion; } };
+ template<> struct QMetaTypeId2<QBitmap> { enum { Defined = 1, MetaType = QMetaType::QBitmap }; static inline int qt_metatype_id() { return QMetaType::QBitmap; } };
+ template<> struct QMetaTypeId2<QCursor> { enum { Defined = 1, MetaType = QMetaType::QCursor }; static inline int qt_metatype_id() { return QMetaType::QCursor; } };
+ template<> struct QMetaTypeId2<QSizePolicy> { enum { Defined = 1, MetaType = QMetaType::QSizePolicy }; static inline int qt_metatype_id() { return QMetaType::QSizePolicy; } };
+ template<> struct QMetaTypeId2<QKeySequence> { enum { Defined = 1, MetaType = QMetaType::QKeySequence }; static inline int qt_metatype_id() { return QMetaType::QKeySequence; } };
+ template<> struct QMetaTypeId2<QPen> { enum { Defined = 1, MetaType = QMetaType::QPen }; static inline int qt_metatype_id() { return QMetaType::QPen; } };
+ template<> struct QMetaTypeId2<QTextLength> { enum { Defined = 1, MetaType = QMetaType::QTextLength }; static inline int qt_metatype_id() { return QMetaType::QTextLength; } };
+ template<> struct QMetaTypeId2<QTextFormat> { enum { Defined = 1, MetaType = QMetaType::QTextFormat }; static inline int qt_metatype_id() { return QMetaType::QTextFormat; } };
+ template<> struct QMetaTypeId2<QMatrix> { enum { Defined = 1, MetaType = QMetaType::QMatrix }; static inline int qt_metatype_id() { return QMetaType::QMatrix; } };
+ template<> struct QMetaTypeId2<QTransform> { enum { Defined = 1, MetaType = QMetaType::QTransform }; static inline int qt_metatype_id() { return QMetaType::QTransform; } };
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QBitArray;
+class QDataStream;
+class QDate;
+class QDateTime;
+class QLine;
+class QLineF;
+class QLocale;
+class QMatrix;
+class QTransform;
+class QStringList;
+class QTime;
+class QPoint;
+class QPointF;
+class QSize;
+class QSizeF;
+class QRect;
+class QRectF;
+class QRegExp;
+class QTextFormat;
+class QTextLength;
+class QUrl;
+class QVariant;
+class QVariantComparisonHelper;
+template <typename T>
+inline QVariant qVariantFromValue(const T &);
+template <typename T>
+inline void qVariantSetValue(QVariant &, const T &);
+template<typename T>
+inline T qVariantValue(const QVariant &);
+template<typename T>
+inline bool qVariantCanConvert(const QVariant &);
+class __attribute__((visibility("default"))) QVariant
+{
+ public:
+ enum Type {
+ Invalid = 0,
+ Bool = 1,
+ Int = 2,
+ UInt = 3,
+ LongLong = 4,
+ ULongLong = 5,
+ Double = 6,
+ Char = 7,
+ Map = 8,
+ List = 9,
+ String = 10,
+ StringList = 11,
+ ByteArray = 12,
+ BitArray = 13,
+ Date = 14,
+ Time = 15,
+ DateTime = 16,
+ Url = 17,
+ Locale = 18,
+ Rect = 19,
+ RectF = 20,
+ Size = 21,
+ SizeF = 22,
+ Line = 23,
+ LineF = 24,
+ Point = 25,
+ PointF = 26,
+ RegExp = 27,
+ Hash = 28,
+ LastCoreType = Hash,
+ Font = 64,
+ Pixmap = 65,
+ Brush = 66,
+ Color = 67,
+ Palette = 68,
+ Icon = 69,
+ Image = 70,
+ Polygon = 71,
+ Region = 72,
+ Bitmap = 73,
+ Cursor = 74,
+ SizePolicy = 75,
+ KeySequence = 76,
+ Pen = 77,
+ TextLength = 78,
+ TextFormat = 79,
+ Matrix = 80,
+ Transform = 81,
+ LastGuiType = Transform,
+ UserType = 127,
+ LastType = 0xffffffff
+ };
+ inline QVariant();
+ ~QVariant();
+ QVariant(Type type);
+ QVariant(int typeOrUserType, const void *copy);
+ QVariant(const QVariant &other);
+ QVariant(QDataStream &s);
+ QVariant(int i);
+ QVariant(uint ui);
+ QVariant(qlonglong ll);
+ QVariant(qulonglong ull);
+ QVariant(bool b);
+ QVariant(double d);
+ __attribute__ ((__deprecated__)) QVariant(const char *str);
+ QVariant(const QByteArray &bytearray);
+ QVariant(const QBitArray &bitarray);
+ QVariant(const QString &string);
+ QVariant(const QLatin1String &string);
+ QVariant(const QStringList &stringlist);
+ QVariant(const QChar &qchar);
+ QVariant(const QDate &date);
+ QVariant(const QTime &time);
+ QVariant(const QDateTime &datetime);
+ QVariant(const QList<QVariant> &list);
+ QVariant(const QMap<QString,QVariant> &map);
+ QVariant(const QHash<QString,QVariant> &hash);
+ QVariant(const QSize &size);
+ QVariant(const QSizeF &size);
+ QVariant(const QPoint &pt);
+ QVariant(const QPointF &pt);
+ QVariant(const QLine &line);
+ QVariant(const QLineF &line);
+ QVariant(const QRect &rect);
+ QVariant(const QRectF &rect);
+ QVariant(const QUrl &url);
+ QVariant(const QLocale &locale);
+ QVariant(const QRegExp ®Exp);
+ QVariant(Qt::GlobalColor color);
+ QVariant& operator=(const QVariant &other);
+ Type type() const;
+ int userType() const;
+ const char *typeName() const;
+ bool canConvert(Type t) const;
+ bool convert(Type t);
+ inline bool isValid() const;
+ bool isNull() const;
+ void clear();
+ void detach();
+ inline bool isDetached() const;
+ int toInt(bool *ok = 0) const;
+ uint toUInt(bool *ok = 0) const;
+ qlonglong toLongLong(bool *ok = 0) const;
+ qulonglong toULongLong(bool *ok = 0) const;
+ bool toBool() const;
+ double toDouble(bool *ok = 0) const;
+ QByteArray toByteArray() const;
+ QBitArray toBitArray() const;
+ QString toString() const;
+ QStringList toStringList() const;
+ QChar toChar() const;
+ QDate toDate() const;
+ QTime toTime() const;
+ QDateTime toDateTime() const;
+ QList<QVariant> toList() const;
+ QMap<QString, QVariant> toMap() const;
+ QHash<QString, QVariant> toHash() const;
+ QPoint toPoint() const;
+ QPointF toPointF() const;
+ QRect toRect() const;
+ QSize toSize() const;
+ QSizeF toSizeF() const;
+ QLine toLine() const;
+ QLineF toLineF() const;
+ QRectF toRectF() const;
+ QUrl toUrl() const;
+ QLocale toLocale() const;
+ QRegExp toRegExp() const;
+ void load(QDataStream &ds);
+ void save(QDataStream &ds) const;
+ static const char *typeToName(Type type);
+ static Type nameToType(const char *name);
+ void *data();
+ const void *constData() const;
+ inline const void *data() const { return constData(); }
+ template<typename T>
+ inline void setValue(const T &value);
+ template<typename T>
+ inline T value() const
+ { return qVariantValue<T>(*this); }
+ template<typename T>
+ static inline QVariant fromValue(const T &value)
+ { return qVariantFromValue(value); }
+ template<typename T>
+ bool canConvert() const
+ { return qVariantCanConvert<T>(*this); }
+ public:
+ struct PrivateShared
+ {
+ inline PrivateShared(void *v) : ptr(v), ref(1) { }
+ void *ptr;
+ QAtomicInt ref;
+ };
+ struct Private
+ {
+ inline Private(): type(Invalid), is_shared(false), is_null(true) { data.ptr = 0; }
+ inline Private(const Private &other)
+ : data(other.data), type(other.type),
+ is_shared(other.is_shared), is_null(other.is_null)
+ {}
+ union Data
+ {
+ char c;
+ int i;
+ uint u;
+ bool b;
+ double d;
+ qlonglong ll;
+ qulonglong ull;
+ void *ptr;
+ PrivateShared *shared;
+ } data;
+ uint type : 30;
+ uint is_shared : 1;
+ uint is_null : 1;
+ };
+ public:
+ typedef void (*f_construct)(Private *, const void *);
+ typedef void (*f_clear)(Private *);
+ typedef bool (*f_null)(const Private *);
+ typedef void (*f_load)(Private *, QDataStream &);
+ typedef void (*f_save)(const Private *, QDataStream &);
+ typedef bool (*f_compare)(const Private *, const Private *);
+ typedef bool (*f_convert)(const QVariant::Private *d, Type t, void *, bool *);
+ typedef bool (*f_canConvert)(const QVariant::Private *d, Type t);
+ typedef void (*f_debugStream)(QDebug, const QVariant &);
+ struct Handler {
+ f_construct construct;
+ f_clear clear;
+ f_null isNull;
+ f_load load;
+ f_save save;
+ f_compare compare;
+ f_convert convert;
+ f_canConvert canConvert;
+ f_debugStream debugStream;
+ };
+ inline bool operator==(const QVariant &v) const
+ { return cmp(v); }
+ inline bool operator!=(const QVariant &v) const
+ { return !cmp(v); }
+protected:
+ friend inline bool qvariant_cast_helper(const QVariant &, QVariant::Type, void *);
+ friend int qRegisterGuiVariant();
+ friend int qUnregisterGuiVariant();
+ friend inline bool operator==(const QVariant &, const QVariantComparisonHelper &);
+ friend __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QVariant &);
+ Private d;
+ static const Handler *handler;
+ void create(int type, const void *copy);
+ bool cmp(const QVariant &other) const;
+private:
+ inline QVariant(void *) { qt_noop(); }
+ inline QVariant(bool, int) { qt_noop(); }
+public:
+ typedef Private DataPtr;
+ inline DataPtr &data_ptr() { return d; }
+};
+typedef QList<QVariant> QVariantList;
+typedef QMap<QString, QVariant> QVariantMap;
+typedef QHash<QString, QVariant> QVariantHash;
+inline bool qvariant_cast_helper(const QVariant &v, QVariant::Type tp, void *ptr)
+{ return QVariant::handler->convert(&v.d, tp, ptr, 0); }
+template <typename T>
+inline QVariant qVariantFromValue(const T &t)
+{
+ return QVariant(qMetaTypeId<T>(reinterpret_cast<T *>(0)), &t);
+}
+template <>
+inline QVariant qVariantFromValue(const QVariant &t) { return t; }
+template <typename T>
+inline void qVariantSetValue(QVariant &v, const T &t)
+{
+ v = QVariant(qMetaTypeId<T>(reinterpret_cast<T *>(0)), &t);
+}
+inline QVariant::QVariant() {}
+inline bool QVariant::isValid() const { return d.type != Invalid; }
+template<typename T>
+inline void QVariant::setValue(const T &avalue)
+{ qVariantSetValue(*this, avalue); }
+__attribute__((visibility("default"))) QDataStream& operator>> (QDataStream& s, QVariant& p);
+__attribute__((visibility("default"))) QDataStream& operator<< (QDataStream& s, const QVariant& p);
+__attribute__((visibility("default"))) QDataStream& operator>> (QDataStream& s, QVariant::Type& p);
+__attribute__((visibility("default"))) QDataStream& operator<< (QDataStream& s, const QVariant::Type p);
+inline bool QVariant::isDetached() const
+{ return !d.is_shared || d.data.shared->ref == 1; }
+class QVariantComparisonHelper
+{
+public:
+ inline QVariantComparisonHelper(const QVariant &var)
+ : v(&var) {}
+private:
+ friend inline bool operator==(const QVariant &, const QVariantComparisonHelper &);
+ const QVariant *v;
+};
+inline bool operator==(const QVariant &v1, const QVariantComparisonHelper &v2)
+{
+ return v1.cmp(*v2.v);
+}
+inline bool operator!=(const QVariant &v1, const QVariantComparisonHelper &v2)
+{
+ return !operator==(v1, v2);
+}
+template<typename T> T qvariant_cast(const QVariant &v)
+{
+ const int vid = qMetaTypeId<T>(static_cast<T *>(0));
+ if (vid == v.userType())
+ return *reinterpret_cast<const T *>(v.constData());
+ if (vid < int(QMetaType::User)) {
+ T t;
+ if (qvariant_cast_helper(v, QVariant::Type(vid), &t))
+ return t;
+ }
+ return T();
+}
+template<typename T>
+inline T qVariantValue(const QVariant &variant)
+{ return qvariant_cast<T>(variant); }
+template<typename T>
+inline bool qVariantCanConvert(const QVariant &variant)
+{
+ return variant.canConvert(static_cast<QVariant::Type>(
+ qMetaTypeId<T>(static_cast<T *>(0))));
+}
+template <> inline bool qIsDetached<QVariant>(QVariant &t) { return t.isDetached(); } template <typename T> inline void qSwap(T &, T &); template <> inline void qSwap<QVariant>(QVariant &value1, QVariant &value2) { const QVariant::DataPtr t = value1.data_ptr(); value1.data_ptr() = value2.data_ptr(); value2.data_ptr() = t; }
+template <> class QTypeInfo<QVariant> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QVariant)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QVariant"; } };
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QVariant &);
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QVariant::Type);
+ template<> struct QMetaTypeId2<QVariantList> { enum { Defined = 1, MetaType = QMetaType::QVariantList }; static inline int qt_metatype_id() { return QMetaType::QVariantList; } };
+ template<> struct QMetaTypeId2<QVariantMap> { enum { Defined = 1, MetaType = QMetaType::QVariantMap }; static inline int qt_metatype_id() { return QMetaType::QVariantMap; } };
+ template<> struct QMetaTypeId2<QVariantHash> { enum { Defined = 1, MetaType = QMetaType::QVariantHash }; static inline int qt_metatype_id() { return QMetaType::QVariantHash; } };
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QUrl;
+class QMimeDataPrivate;
+class __attribute__((visibility("default"))) QMimeData : public QObject
+{
+ public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
+public:
+ QMimeData();
+ ~QMimeData();
+ QList<QUrl> urls() const;
+ void setUrls(const QList<QUrl> &urls);
+ bool hasUrls() const;
+ QString text() const;
+ void setText(const QString &text);
+ bool hasText() const;
+ QString html() const;
+ void setHtml(const QString &html);
+ bool hasHtml() const;
+ QVariant imageData() const;
+ void setImageData(const QVariant &image);
+ bool hasImage() const;
+ QVariant colorData() const;
+ void setColorData(const QVariant &color);
+ bool hasColor() const;
+ QByteArray data(const QString &mimetype) const;
+ void setData(const QString &mimetype, const QByteArray &data);
+ void removeFormat(const QString &mimetype);
+ virtual bool hasFormat(const QString &mimetype) const;
+ virtual QStringList formats() const;
+ void clear();
+protected:
+ virtual QVariant retrieveData(const QString &mimetype,
+ QVariant::Type preferredType) const;
+private:
+ QMimeData(const QMimeData &); QMimeData &operator=(const QMimeData &);
+ inline QMimeDataPrivate* d_func() { return reinterpret_cast<QMimeDataPrivate *>(d_ptr); } inline const QMimeDataPrivate* d_func() const { return reinterpret_cast<const QMimeDataPrivate *>(d_ptr); } friend class QMimeDataPrivate;
+};
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class __attribute__((visibility("default"))) QMimeSource
+{
+public:
+ virtual ~QMimeSource();
+ virtual const char* format(int n = 0) const = 0;
+ virtual bool provides(const char*) const;
+ virtual QByteArray encodedData(const char*) const = 0;
+};
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QMimeData;
+class QDragPrivate;
+class QWidget;
+class QPixmap;
+class QPoint;
+class QDragManager;
+class __attribute__((visibility("default"))) QDrag : public QObject
+{
+ public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
+ inline QDragPrivate* d_func() { return reinterpret_cast<QDragPrivate *>(d_ptr); } inline const QDragPrivate* d_func() const { return reinterpret_cast<const QDragPrivate *>(d_ptr); } friend class QDragPrivate;
+public:
+ explicit QDrag(QWidget *dragSource);
+ ~QDrag();
+ void setMimeData(QMimeData *data);
+ QMimeData *mimeData() const;
+ void setPixmap(const QPixmap &);
+ QPixmap pixmap() const;
+ void setHotSpot(const QPoint &hotspot);
+ QPoint hotSpot() const;
+ QWidget *source() const;
+ QWidget *target() const;
+ Qt::DropAction start(Qt::DropActions supportedActions = Qt::CopyAction);
+ Qt::DropAction exec(Qt::DropActions supportedActions = Qt::MoveAction);
+ Qt::DropAction exec(Qt::DropActions supportedActions, Qt::DropAction defaultAction);
+ void setDragCursor(const QPixmap &cursor, Qt::DropAction action);
+protected:
+ void actionChanged(Qt::DropAction action);
+ void targetChanged(QWidget *newTarget);
+private:
+ friend class QDragManager;
+ QDrag(const QDrag &); QDrag &operator=(const QDrag &);
+};
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QAction;
+class __attribute__((visibility("default"))) QInputEvent : public QEvent
+{
+public:
+ QInputEvent(Type type, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
+ ~QInputEvent();
+ inline Qt::KeyboardModifiers modifiers() const { return modState; }
+protected:
+ Qt::KeyboardModifiers modState;
+};
+class __attribute__((visibility("default"))) QMouseEvent : public QInputEvent
+{
+public:
+ QMouseEvent(Type type, const QPoint &pos, Qt::MouseButton button,
+ Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
+ QMouseEvent(Type type, const QPoint &pos, const QPoint &globalPos,
+ Qt::MouseButton button, Qt::MouseButtons buttons,
+ Qt::KeyboardModifiers modifiers);
+ ~QMouseEvent();
+ inline const QPoint &pos() const { return p; }
+ inline const QPoint &globalPos() const { return g; }
+ inline int x() const { return p.x(); }
+ inline int y() const { return p.y(); }
+ inline int globalX() const { return g.x(); }
+ inline int globalY() const { return g.y(); }
+ inline Qt::MouseButton button() const { return b; }
+ inline Qt::MouseButtons buttons() const { return mouseState; }
+ static QMouseEvent *createExtendedMouseEvent(Type type, const QPointF &pos,
+ const QPoint &globalPos, Qt::MouseButton button,
+ Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
+ inline bool hasExtendedInfo() const { return reinterpret_cast<const QMouseEvent *>(d) == this; }
+ QPointF posF() const;
+protected:
+ QPoint p, g;
+ Qt::MouseButton b;
+ Qt::MouseButtons mouseState;
+};
+class __attribute__((visibility("default"))) QHoverEvent : public QEvent
+{
+public:
+ QHoverEvent(Type type, const QPoint &pos, const QPoint &oldPos);
+ ~QHoverEvent();
+ inline const QPoint &pos() const { return p; }
+ inline const QPoint &oldPos() const { return op; }
+protected:
+ QPoint p, op;
+};
+class __attribute__((visibility("default"))) QWheelEvent : public QInputEvent
+{
+public:
+ QWheelEvent(const QPoint &pos, int delta,
+ Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
+ Qt::Orientation orient = Qt::Vertical);
+ QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta,
+ Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
+ Qt::Orientation orient = Qt::Vertical);
+ ~QWheelEvent();
+ inline int delta() const { return d; }
+ inline const QPoint &pos() const { return p; }
+ inline const QPoint &globalPos() const { return g; }
+ inline int x() const { return p.x(); }
+ inline int y() const { return p.y(); }
+ inline int globalX() const { return g.x(); }
+ inline int globalY() const { return g.y(); }
+ inline Qt::MouseButtons buttons() const { return mouseState; }
+ Qt::Orientation orientation() const { return o; }
+protected:
+ QPoint p;
+ QPoint g;
+ int d;
+ Qt::MouseButtons mouseState;
+ Qt::Orientation o;
+};
+class __attribute__((visibility("default"))) QTabletEvent : public QInputEvent
+{
+public:
+ enum TabletDevice { NoDevice, Puck, Stylus, Airbrush, FourDMouse,
+ XFreeEraser , RotationStylus };
+ enum PointerType { UnknownPointer, Pen, Cursor, Eraser };
+ QTabletEvent(Type t, const QPoint &pos, const QPoint &globalPos, const QPointF &hiResGlobalPos,
+ int device, int pointerType, qreal pressure, int xTilt, int yTilt,
+ qreal tangentialPressure, qreal rotation, int z,
+ Qt::KeyboardModifiers keyState, qint64 uniqueID);
+ ~QTabletEvent();
+ inline const QPoint &pos() const { return mPos; }
+ inline const QPoint &globalPos() const { return mGPos; }
+ inline const QPointF &hiResGlobalPos() const { return mHiResGlobalPos; }
+ inline int x() const { return mPos.x(); }
+ inline int y() const { return mPos.y(); }
+ inline int globalX() const { return mGPos.x(); }
+ inline int globalY() const { return mGPos.y(); }
+ inline qreal hiResGlobalX() const { return mHiResGlobalPos.x(); }
+ inline qreal hiResGlobalY() const { return mHiResGlobalPos.y(); }
+ inline TabletDevice device() const { return TabletDevice(mDev); }
+ inline PointerType pointerType() const { return PointerType(mPointerType); }
+ inline qint64 uniqueId() const { return mUnique; }
+ inline qreal pressure() const { return mPress; }
+ inline int z() const { return mZ; }
+ inline qreal tangentialPressure() const { return mTangential; }
+ inline qreal rotation() const { return mRot; }
+ inline int xTilt() const { return mXT; }
+ inline int yTilt() const { return mYT; }
+protected:
+ QPoint mPos, mGPos;
+ QPointF mHiResGlobalPos;
+ int mDev, mPointerType, mXT, mYT, mZ;
+ qreal mPress, mTangential, mRot;
+ qint64 mUnique;
+ void *mExtra;
+};
+class __attribute__((visibility("default"))) QKeyEvent : public QInputEvent
+{
+public:
+ QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(),
+ bool autorep = false, ushort count = 1);
+ ~QKeyEvent();
+ int key() const { return k; }
+ bool matches(QKeySequence::StandardKey key) const;
+ Qt::KeyboardModifiers modifiers() const;
+ inline QString text() const { return txt; }
+ inline bool isAutoRepeat() const { return autor; }
+ inline int count() const { return int(c); }
+ static QKeyEvent *createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
+ quint32 nativeScanCode, quint32 nativeVirtualKey,
+ quint32 nativeModifiers,
+ const QString& text = QString(), bool autorep = false,
+ ushort count = 1);
+ inline bool hasExtendedInfo() const { return reinterpret_cast<const QKeyEvent*>(d) == this; }
+ quint32 nativeScanCode() const;
+ quint32 nativeVirtualKey() const;
+ quint32 nativeModifiers() const;
+protected:
+ QString txt;
+ int k;
+ ushort c;
+ uint autor:1;
+};
+class __attribute__((visibility("default"))) QFocusEvent : public QEvent
+{
+public:
+ QFocusEvent(Type type, Qt::FocusReason reason=Qt::OtherFocusReason);
+ ~QFocusEvent();
+ inline bool gotFocus() const { return type() == FocusIn; }
+ inline bool lostFocus() const { return type() == FocusOut; }
+ Qt::FocusReason reason();
+ Qt::FocusReason reason() const;
+private:
+ Qt::FocusReason m_reason;
+};
+class __attribute__((visibility("default"))) QPaintEvent : public QEvent
+{
+public:
+ QPaintEvent(const QRegion& paintRegion);
+ QPaintEvent(const QRect &paintRect);
+ ~QPaintEvent();
+ inline const QRect &rect() const { return m_rect; }
+ inline const QRegion ®ion() const { return m_region; }
+protected:
+ friend class QApplication;
+ friend class QCoreApplication;
+ QRect m_rect;
+ QRegion m_region;
+ bool m_erased;
+};
+class QUpdateLaterEvent : public QEvent
+{
+public:
+ QUpdateLaterEvent(const QRegion& paintRegion);
+ ~QUpdateLaterEvent();
+ inline const QRegion ®ion() const { return m_region; }
+protected:
+ QRegion m_region;
+};
+class __attribute__((visibility("default"))) QMoveEvent : public QEvent
+{
+public:
+ QMoveEvent(const QPoint &pos, const QPoint &oldPos);
+ ~QMoveEvent();
+ inline const QPoint &pos() const { return p; }
+ inline const QPoint &oldPos() const { return oldp;}
+protected:
+ QPoint p, oldp;
+ friend class QApplication;
+ friend class QCoreApplication;
+};
+class __attribute__((visibility("default"))) QResizeEvent : public QEvent
+{
+public:
+ QResizeEvent(const QSize &size, const QSize &oldSize);
+ ~QResizeEvent();
+ inline const QSize &size() const { return s; }
+ inline const QSize &oldSize()const { return olds;}
+protected:
+ QSize s, olds;
+ friend class QApplication;
+ friend class QCoreApplication;
+};
+class __attribute__((visibility("default"))) QCloseEvent : public QEvent
+{
+public:
+ QCloseEvent();
+ ~QCloseEvent();
+};
+class __attribute__((visibility("default"))) QIconDragEvent : public QEvent
+{
+public:
+ QIconDragEvent();
+ ~QIconDragEvent();
+};
+class __attribute__((visibility("default"))) QShowEvent : public QEvent
+{
+public:
+ QShowEvent();
+ ~QShowEvent();
+};
+class __attribute__((visibility("default"))) QHideEvent : public QEvent
+{
+public:
+ QHideEvent();
+ ~QHideEvent();
+};
+class __attribute__((visibility("default"))) QContextMenuEvent : public QInputEvent
+{
+public:
+ enum Reason { Mouse, Keyboard, Other };
+ QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos,
+ Qt::KeyboardModifiers modifiers);
+ QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos);
+ QContextMenuEvent(Reason reason, const QPoint &pos);
+ ~QContextMenuEvent();
+ inline int x() const { return p.x(); }
+ inline int y() const { return p.y(); }
+ inline int globalX() const { return gp.x(); }
+ inline int globalY() const { return gp.y(); }
+ inline const QPoint& pos() const { return p; }
+ inline const QPoint& globalPos() const { return gp; }
+ inline Reason reason() const { return Reason(reas); }
+protected:
+ QPoint p;
+ QPoint gp;
+ uint reas : 8;
+};
+class __attribute__((visibility("default"))) QInputMethodEvent : public QEvent
+{
+public:
+ enum AttributeType {
+ TextFormat,
+ Cursor,
+ Language,
+ Ruby
+ };
+ class Attribute {
+ public:
+ Attribute(AttributeType t, int s, int l, QVariant val) : type(t), start(s), length(l), value(val) {}
+ AttributeType type;
+ int start;
+ int length;
+ QVariant value;
+ };
+ QInputMethodEvent();
+ QInputMethodEvent(const QString &preeditText, const QList<Attribute> &attributes);
+ void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0);
+ inline const QList<Attribute> &attributes() const { return attrs; }
+ inline const QString &preeditString() const { return preedit; }
+ inline const QString &commitString() const { return commit; }
+ inline int replacementStart() const { return replace_from; }
+ inline int replacementLength() const { return replace_length; }
+ QInputMethodEvent(const QInputMethodEvent &other);
+private:
+ QString preedit;
+ QList<Attribute> attrs;
+ QString commit;
+ int replace_from;
+ int replace_length;
+};
+class QMimeData;
+class __attribute__((visibility("default"))) QDropEvent : public QEvent
+ , public QMimeSource
+{
+public:
+ QDropEvent(const QPoint& pos, Qt::DropActions actions, const QMimeData *data,
+ Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = Drop);
+ ~QDropEvent();
+ inline const QPoint &pos() const { return p; }
+ inline Qt::MouseButtons mouseButtons() const { return mouseState; }
+ inline Qt::KeyboardModifiers keyboardModifiers() const { return modState; }
+ inline Qt::DropActions possibleActions() const { return act; }
+ inline Qt::DropAction proposedAction() const { return default_action; }
+ inline void acceptProposedAction() { drop_action = default_action; accept(); }
+ inline Qt::DropAction dropAction() const { return drop_action; }
+ void setDropAction(Qt::DropAction action);
+ QWidget* source() const;
+ inline const QMimeData *mimeData() const { return mdata; }
+ const char* format(int n = 0) const;
+ QByteArray encodedData(const char*) const;
+ bool provides(const char*) const;
+protected:
+ friend class QApplication;
+ QPoint p;
+ Qt::MouseButtons mouseState;
+ Qt::KeyboardModifiers modState;
+ Qt::DropActions act;
+ Qt::DropAction drop_action;
+ Qt::DropAction default_action;
+ const QMimeData *mdata;
+ mutable QList<QByteArray> fmts;
+};
+class __attribute__((visibility("default"))) QDragMoveEvent : public QDropEvent
+{
+public:
+ QDragMoveEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
+ Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove);
+ ~QDragMoveEvent();
+ inline QRect answerRect() const { return rect; }
+ inline void accept() { QDropEvent::accept(); }
+ inline void ignore() { QDropEvent::ignore(); }
+ inline void accept(const QRect & r) { accept(); rect = r; }
+ inline void ignore(const QRect & r) { ignore(); rect = r; }
+protected:
+ friend class QApplication;
+ QRect rect;
+};
+class __attribute__((visibility("default"))) QDragEnterEvent : public QDragMoveEvent
+{
+public:
+ QDragEnterEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
+ Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
+ ~QDragEnterEvent();
+};
+class __attribute__((visibility("default"))) QDragResponseEvent : public QEvent
+{
+public:
+ QDragResponseEvent(bool accepted);
+ ~QDragResponseEvent();
+ inline bool dragAccepted() const { return a; }
+protected:
+ bool a;
+};
+class __attribute__((visibility("default"))) QDragLeaveEvent : public QEvent
+{
+public:
+ QDragLeaveEvent();
+ ~QDragLeaveEvent();
+};
+class __attribute__((visibility("default"))) QHelpEvent : public QEvent
+{
+public:
+ QHelpEvent(Type type, const QPoint &pos, const QPoint &globalPos);
+ ~QHelpEvent();
+ inline int x() const { return p.x(); }
+ inline int y() const { return p.y(); }
+ inline int globalX() const { return gp.x(); }
+ inline int globalY() const { return gp.y(); }
+ inline const QPoint& pos() const { return p; }
+ inline const QPoint& globalPos() const { return gp; }
+private:
+ QPoint p;
+ QPoint gp;
+};
+class __attribute__((visibility("default"))) QStatusTipEvent : public QEvent
+{
+public:
+ QStatusTipEvent(const QString &tip);
+ ~QStatusTipEvent();
+ inline QString tip() const { return s; }
+private:
+ QString s;
+};
+class __attribute__((visibility("default"))) QWhatsThisClickedEvent : public QEvent
+{
+public:
+ QWhatsThisClickedEvent(const QString &href);
+ ~QWhatsThisClickedEvent();
+ inline QString href() const { return s; }
+private:
+ QString s;
+};
+class __attribute__((visibility("default"))) QActionEvent : public QEvent
+{
+ QAction *act, *bef;
+public:
+ QActionEvent(int type, QAction *action, QAction *before = 0);
+ ~QActionEvent();
+ inline QAction *action() const { return act; }
+ inline QAction *before() const { return bef; }
+};
+class __attribute__((visibility("default"))) QFileOpenEvent : public QEvent
+{
+public:
+ QFileOpenEvent(const QString &file);
+ ~QFileOpenEvent();
+ inline QString file() const { return f; }
+private:
+ QString f;
+};
+class __attribute__((visibility("default"))) QToolBarChangeEvent : public QEvent
+{
+public:
+ QToolBarChangeEvent(bool t);
+ ~QToolBarChangeEvent();
+ inline bool toggle() const { return tog; }
+private:
+ uint tog : 1;
+};
+class __attribute__((visibility("default"))) QShortcutEvent : public QEvent
+{
+public:
+ QShortcutEvent(const QKeySequence &key, int id, bool ambiguous = false);
+ ~QShortcutEvent();
+ inline const QKeySequence &key() { return sequence; }
+ inline const QKeySequence &key() const { return sequence; }
+ inline int shortcutId() { return sid; }
+ inline int shortcutId() const { return sid; }
+ inline bool isAmbiguous() { return ambig; }
+ inline bool isAmbiguous() const { return ambig; }
+protected:
+ QKeySequence sequence;
+ bool ambig;
+ int sid;
+};
+class __attribute__((visibility("default"))) QClipboardEvent : public QEvent
+{
+public:
+ QClipboardEvent(QEventPrivate *data);
+ ~QClipboardEvent();
+ QEventPrivate *data() { return d; };
+};
+class __attribute__((visibility("default"))) QWindowStateChangeEvent: public QEvent
+{
+public:
+ QWindowStateChangeEvent(Qt::WindowStates aOldState);
+ QWindowStateChangeEvent(Qt::WindowStates aOldState, bool isOverride);
+ ~QWindowStateChangeEvent();
+ inline Qt::WindowStates oldState() const { return ostate; }
+ bool isOverride() const;
+private:
+ Qt::WindowStates ostate;
+};
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QEvent *);
+inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key){return (e ? e->matches(key) : false);}
+inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e){return (e ? e->matches(key) : false);}
+typedef struct FT_FaceRec_* FT_Face;
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QFontPrivate;
+class QStringList;
+class QVariant;
+class Q3TextFormatCollection;
+class __attribute__((visibility("default"))) QFont
+{
+ public: static const QMetaObject staticMetaObject; private:
+public:
+ enum StyleHint {
+ Helvetica, SansSerif = Helvetica,
+ Times, Serif = Times,
+ Courier, TypeWriter = Courier,
+ OldEnglish, Decorative = OldEnglish,
+ System,
+ AnyStyle
+ };
+ enum StyleStrategy {
+ PreferDefault = 0x0001,
+ PreferBitmap = 0x0002,
+ PreferDevice = 0x0004,
+ PreferOutline = 0x0008,
+ ForceOutline = 0x0010,
+ PreferMatch = 0x0020,
+ PreferQuality = 0x0040,
+ PreferAntialias = 0x0080,
+ NoAntialias = 0x0100,
+ OpenGLCompatible = 0x0200,
+ NoFontMerging = 0x8000
+ };
+ enum Weight {
+ Light = 25,
+ Normal = 50,
+ DemiBold = 63,
+ Bold = 75,
+ Black = 87
+ };
+ enum Style {
+ StyleNormal,
+ StyleItalic,
+ StyleOblique
+ };
+ enum Stretch {
+ UltraCondensed = 50,
+ ExtraCondensed = 62,
+ Condensed = 75,
+ SemiCondensed = 87,
+ Unstretched = 100,
+ SemiExpanded = 112,
+ Expanded = 125,
+ ExtraExpanded = 150,
+ UltraExpanded = 200
+ };
+ enum Capitalization {
+ MixedCase,
+ AllUppercase,
+ AllLowercase,
+ SmallCaps,
+ Capitalize
+ };
+ enum SpacingType {
+ PercentageSpacing,
+ AbsoluteSpacing
+ };
+ enum ResolveProperties {
+ FamilyResolved = 0x0001,
+ SizeResolved = 0x0002,
+ StyleHintResolved = 0x0004,
+ StyleStrategyResolved = 0x0008,
+ WeightResolved = 0x0010,
+ StyleResolved = 0x0020,
+ UnderlineResolved = 0x0040,
+ OverlineResolved = 0x0080,
+ StrikeOutResolved = 0x0100,
+ FixedPitchResolved = 0x0200,
+ StretchResolved = 0x0400,
+ KerningResolved = 0x0800,
+ CapitalizationResolved = 0x1000,
+ LetterSpacingResolved = 0x2000,
+ WordSpacingResolved = 0x4000,
+ AllPropertiesResolved = 0x7fff
+ };
+ QFont();
+ QFont(const QString &family, int pointSize = -1, int weight = -1, bool italic = false);
+ QFont(const QFont &, QPaintDevice *pd);
+ QFont(const QFont &);
+ ~QFont();
+ QString family() const;
+ void setFamily(const QString &);
+ int pointSize() const;
+ void setPointSize(int);
+ qreal pointSizeF() const;
+ void setPointSizeF(qreal);
+ int pixelSize() const;
+ void setPixelSize(int);
+ int weight() const;
+ void setWeight(int);
+ inline bool bold() const;
+ inline void setBold(bool);
+ void setStyle(Style style);
+ Style style() const;
+ inline bool italic() const;
+ inline void setItalic(bool b);
+ bool underline() const;
+ void setUnderline(bool);
+ bool overline() const;
+ void setOverline(bool);
+ bool strikeOut() const;
+ void setStrikeOut(bool);
+ bool fixedPitch() const;
+ void setFixedPitch(bool);
+ bool kerning() const;
+ void setKerning(bool);
+ StyleHint styleHint() const;
+ StyleStrategy styleStrategy() const;
+ void setStyleHint(StyleHint, StyleStrategy = PreferDefault);
+ void setStyleStrategy(StyleStrategy s);
+ int stretch() const;
+ void setStretch(int);
+ qreal letterSpacing() const;
+ SpacingType letterSpacingType() const;
+ void setLetterSpacing(SpacingType type, qreal spacing);
+ qreal wordSpacing() const;
+ void setWordSpacing(qreal spacing);
+ void setCapitalization(Capitalization);
+ Capitalization capitalization() const;
+ bool rawMode() const;
+ void setRawMode(bool);
+ bool exactMatch() const;
+ QFont &operator=(const QFont &);
+ bool operator==(const QFont &) const;
+ bool operator!=(const QFont &) const;
+ bool operator<(const QFont &) const;
+ operator QVariant() const;
+ bool isCopyOf(const QFont &) const;
+ Qt::HANDLE handle() const;
+ FT_Face freetypeFace() const;
+ void setRawName(const QString &);
+ QString rawName() const;
+ QString key() const;
+ QString toString() const;
+ bool fromString(const QString &);
+ static QString substitute(const QString &);
+ static QStringList substitutes(const QString &);
+ static QStringList substitutions();
+ static void insertSubstitution(const QString&, const QString &);
+ static void insertSubstitutions(const QString&, const QStringList &);
+ static void removeSubstitution(const QString &);
+ static void initialize();
+ static void cleanup();
+ QString defaultFamily() const;
+ QString lastResortFamily() const;
+ QString lastResortFont() const;
+ QFont resolve(const QFont &) const;
+ inline uint resolve() const { return resolve_mask; }
+ inline void resolve(uint mask) { resolve_mask = mask; }
+private:
+ QFont(QFontPrivate *);
+ void detach();
+ friend class QFontPrivate;
+ friend class QFontDialogPrivate;
+ friend class QFontMetrics;
+ friend class QFontMetricsF;
+ friend class QFontInfo;
+ friend class QPainter;
+ friend class QPSPrintEngineFont;
+ friend class QApplication;
+ friend class QWidget;
+ friend class QWidgetPrivate;
+ friend class Q3TextFormatCollection;
+ friend class QTextLayout;
+ friend class QTextEngine;
+ friend class QStackTextEngine;
+ friend class QTextLine;
+ friend struct QScriptLine;
+ friend class QGLContext;
+ friend class QWin32PaintEngine;
+ friend class QAlphaPaintEngine;
+ friend class QPainterPath;
+ friend class QTextItemInt;
+ friend class QPicturePaintEngine;
+ friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QFont &);
+ friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QFont &);
+ QFontPrivate *d;
+ uint resolve_mask;
+};
+inline bool QFont::bold() const
+{ return weight() > Normal; }
+inline void QFont::setBold(bool enable)
+{ setWeight(enable ? Bold : Normal); }
+inline bool QFont::italic() const
+{
+ return (style() != StyleNormal);
+}
+inline void QFont::setItalic(bool b) {
+ setStyle(b ? StyleItalic : StyleNormal);
+}
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QFont &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QFont &);
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QFont &);
+typedef QtValidLicenseForCoreModule QtCoreModule;
+template <class T> class QSharedDataPointer;
+class __attribute__((visibility("default"))) QSharedData
+{
+public:
+ mutable QAtomicInt ref;
+ inline QSharedData() : ref(0) { }
+ inline QSharedData(const QSharedData &) : ref(0) { }
+private:
+ QSharedData &operator=(const QSharedData &);
+};
+template <class T> class QSharedDataPointer
+{
+public:
+ inline void detach() { if (d && d->ref != 1) detach_helper(); }
+ inline T &operator*() { detach(); return *d; }
+ inline const T &operator*() const { return *d; }
+ inline T *operator->() { detach(); return d; }
+ inline const T *operator->() const { return d; }
+ inline operator T *() { detach(); return d; }
+ inline operator const T *() const { return d; }
+ inline T *data() { detach(); return d; }
+ inline const T *data() const { return d; }
+ inline const T *constData() const { return d; }
+ inline bool operator==(const QSharedDataPointer<T> &other) const { return d == other.d; }
+ inline bool operator!=(const QSharedDataPointer<T> &other) const { return d != other.d; }
+ inline QSharedDataPointer() { d = 0; }
+ inline ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; }
+ explicit QSharedDataPointer(T *data);
+ inline QSharedDataPointer(const QSharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
+ inline QSharedDataPointer<T> & operator=(const QSharedDataPointer<T> &o) {
+ if (o.d != d) {
+ if (o.d)
+ o.d->ref.ref();
+ if (d && !d->ref.deref())
+ delete d;
+ d = o.d;
+ }
+ return *this;
+ }
+ inline QSharedDataPointer &operator=(T *o) {
+ if (o != d) {
+ if (o)
+ o->ref.ref();
+ if (d && !d->ref.deref())
+ delete d;
+ d = o;
+ }
+ return *this;
+ }
+ inline bool operator!() const { return !d; }
+protected:
+ T *clone();
+private:
+ void detach_helper();
+ T *d;
+};
+template <class T> class QExplicitlySharedDataPointer
+{
+public:
+ typedef T Type;
+ inline T &operator*() const { return *d; }
+ inline T *operator->() { return d; }
+ inline T *operator->() const { return d; }
+ inline T *data() const { return d; }
+ inline const T *constData() const { return d; }
+ inline void detach() { if (d && d->ref != 1) detach_helper(); }
+ inline void reset()
+ {
+ if(d && !d->ref.deref())
+ delete d;
+ d = 0;
+ }
+ inline operator bool () const { return d != 0; }
+ inline bool operator==(const QExplicitlySharedDataPointer<T> &other) const { return d == other.d; }
+ inline bool operator!=(const QExplicitlySharedDataPointer<T> &other) const { return d != other.d; }
+ inline bool operator==(const T *ptr) const { return d == ptr; }
+ inline bool operator!=(const T *ptr) const { return d != ptr; }
+ inline QExplicitlySharedDataPointer() { d = 0; }
+ inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; }
+ explicit QExplicitlySharedDataPointer(T *data);
+ inline QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
+ template<class X>
+ inline QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer<X> &o) : d(static_cast<T *>(o.data()))
+ {
+ if(d)
+ d->ref.ref();
+ }
+ inline QExplicitlySharedDataPointer<T> & operator=(const QExplicitlySharedDataPointer<T> &o) {
+ if (o.d != d) {
+ if (o.d)
+ o.d->ref.ref();
+ if (d && !d->ref.deref())
+ delete d;
+ d = o.d;
+ }
+ return *this;
+ }
+ inline QExplicitlySharedDataPointer &operator=(T *o) {
+ if (o != d) {
+ if (o)
+ o->ref.ref();
+ if (d && !d->ref.deref())
+ delete d;
+ d = o;
+ }
+ return *this;
+ }
+ inline bool operator!() const { return !d; }
+protected:
+ T *clone();
+private:
+ void detach_helper();
+ T *d;
+};
+template <class T>
+inline QSharedDataPointer<T>::QSharedDataPointer(T *adata) : d(adata)
+{ if (d) d->ref.ref(); }
+template <class T>
+inline T *QSharedDataPointer<T>::clone()
+{
+ return new T(*d);
+}
+template <class T>
+ void QSharedDataPointer<T>::detach_helper()
+{
+ T *x = clone();
+ x->ref.ref();
+ if (!d->ref.deref())
+ delete d;
+ d = x;
+}
+template <class T>
+inline T *QExplicitlySharedDataPointer<T>::clone()
+{
+ return new T(*d);
+}
+template <class T>
+ void QExplicitlySharedDataPointer<T>::detach_helper()
+{
+ T *x = clone();
+ x->ref.ref();
+ if (!d->ref.deref())
+ delete d;
+ d = x;
+}
+template <class T>
+inline QExplicitlySharedDataPointer<T>::QExplicitlySharedDataPointer(T *adata) : d(adata)
+{ if (d) d->ref.ref(); }
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QMatrix;
+class QTransform;
+class QRect;
+class QVariant;
+class __attribute__((visibility("default"))) QPolygon : public QVector<QPoint>
+{
+public:
+ inline QPolygon() {}
+ inline ~QPolygon() {}
+ inline QPolygon(int size);
+ inline QPolygon(const QPolygon &a) : QVector<QPoint>(a) {}
+ inline QPolygon(const QVector<QPoint> &v) : QVector<QPoint>(v) {}
+ QPolygon(const QRect &r, bool closed=false);
+ QPolygon(int nPoints, const int *points);
+ operator QVariant() const;
+ void translate(int dx, int dy);
+ void translate(const QPoint &offset);
+ QRect boundingRect() const;
+ void point(int i, int *x, int *y) const;
+ QPoint point(int i) const;
+ void setPoint(int index, int x, int y);
+ void setPoint(int index, const QPoint &p);
+ void setPoints(int nPoints, const int *points);
+ void setPoints(int nPoints, int firstx, int firsty, ...);
+ void putPoints(int index, int nPoints, const int *points);
+ void putPoints(int index, int nPoints, int firstx, int firsty, ...);
+ void putPoints(int index, int nPoints, const QPolygon & from, int fromIndex=0);
+ bool containsPoint(const QPoint &pt, Qt::FillRule fillRule) const;
+ QPolygon united(const QPolygon &r) const;
+ QPolygon intersected(const QPolygon &r) const;
+ QPolygon subtracted(const QPolygon &r) const;
+};
+inline QPolygon::QPolygon(int asize) : QVector<QPoint>(asize) {}
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QPolygon &);
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &stream, const QPolygon &polygon);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &stream, QPolygon &polygon);
+inline void QPolygon::setPoint(int index, const QPoint &pt)
+{ (*this)[index] = pt; }
+inline void QPolygon::setPoint(int index, int x, int y)
+{ (*this)[index] = QPoint(x, y); }
+inline QPoint QPolygon::point(int index) const
+{ return at(index); }
+inline void QPolygon::translate(const QPoint &offset)
+{ translate(offset.x(), offset.y()); }
+class QRectF;
+class __attribute__((visibility("default"))) QPolygonF : public QVector<QPointF>
+{
+public:
+ inline QPolygonF() {}
+ inline ~QPolygonF() {}
+ inline QPolygonF(int size);
+ inline QPolygonF(const QPolygonF &a) : QVector<QPointF>(a) {}
+ inline QPolygonF(const QVector<QPointF> &v) : QVector<QPointF>(v) {}
+ QPolygonF(const QRectF &r);
+ QPolygonF(const QPolygon &a);
+ inline void translate(qreal dx, qreal dy);
+ void translate(const QPointF &offset);
+ QPolygon toPolygon() const;
+ bool isClosed() const { return !isEmpty() && first() == last(); }
+ QRectF boundingRect() const;
+ bool containsPoint(const QPointF &pt, Qt::FillRule fillRule) const;
+ QPolygonF united(const QPolygonF &r) const;
+ QPolygonF intersected(const QPolygonF &r) const;
+ QPolygonF subtracted(const QPolygonF &r) const;
+};
+inline QPolygonF::QPolygonF(int asize) : QVector<QPointF>(asize) {}
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QPolygonF &);
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &stream, const QPolygonF &array);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &stream, QPolygonF &array);
+inline void QPolygonF::translate(qreal dx, qreal dy)
+{ translate(QPointF(dx, dy)); }
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class __attribute__((visibility("default"))) QLine
+{
+public:
+ inline QLine();
+ inline QLine(const QPoint &pt1, const QPoint &pt2);
+ inline QLine(int x1, int y1, int x2, int y2);
+ inline bool isNull() const;
+ inline QPoint p1() const;
+ inline QPoint p2() const;
+ inline int x1() const;
+ inline int y1() const;
+ inline int x2() const;
+ inline int y2() const;
+ inline int dx() const;
+ inline int dy() const;
+ inline void translate(const QPoint &p);
+ inline void translate(int dx, int dy);
+ inline QLine translated(const QPoint &p) const;
+ inline QLine translated(int dx, int dy) const;
+ inline void setP1(const QPoint &p1);
+ inline void setP2(const QPoint &p2);
+ inline void setPoints(const QPoint &p1, const QPoint &p2);
+ inline void setLine(int x1, int y1, int x2, int y2);
+ inline bool operator==(const QLine &d) const;
+ inline bool operator!=(const QLine &d) const { return !(*this == d); }
+private:
+ QPoint pt1, pt2;
+};
+template <> class QTypeInfo<QLine> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QLine)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QLine"; } };
+inline QLine::QLine() { }
+inline QLine::QLine(const QPoint &pt1_, const QPoint &pt2_) : pt1(pt1_), pt2(pt2_) { }
+inline QLine::QLine(int x1pos, int y1pos, int x2pos, int y2pos) : pt1(QPoint(x1pos, y1pos)), pt2(QPoint(x2pos, y2pos)) { }
+inline bool QLine::isNull() const
+{
+ return pt1 == pt2;
+}
+inline int QLine::x1() const
+{
+ return pt1.x();
+}
+inline int QLine::y1() const
+{
+ return pt1.y();
+}
+inline int QLine::x2() const
+{
+ return pt2.x();
+}
+inline int QLine::y2() const
+{
+ return pt2.y();
+}
+inline QPoint QLine::p1() const
+{
+ return pt1;
+}
+inline QPoint QLine::p2() const
+{
+ return pt2;
+}
+inline int QLine::dx() const
+{
+ return pt2.x() - pt1.x();
+}
+inline int QLine::dy() const
+{
+ return pt2.y() - pt1.y();
+}
+inline void QLine::translate(const QPoint &point)
+{
+ pt1 += point;
+ pt2 += point;
+}
+inline void QLine::translate(int adx, int ady)
+{
+ this->translate(QPoint(adx, ady));
+}
+inline QLine QLine::translated(const QPoint &p) const
+{
+ return QLine(pt1 + p, pt2 + p);
+}
+inline QLine QLine::translated(int adx, int ady) const
+{
+ return translated(QPoint(adx, ady));
+}
+inline void QLine::setP1(const QPoint &aP1)
+{
+ pt1 = aP1;
+}
+inline void QLine::setP2(const QPoint &aP2)
+{
+ pt2 = aP2;
+}
+inline void QLine::setPoints(const QPoint &aP1, const QPoint &aP2)
+{
+ pt1 = aP1;
+ pt2 = aP2;
+}
+inline void QLine::setLine(int aX1, int aY1, int aX2, int aY2)
+{
+ pt1 = QPoint(aX1, aY1);
+ pt2 = QPoint(aX2, aY2);
+}
+inline bool QLine::operator==(const QLine &d) const
+{
+ return pt1 == d.pt1 && pt2 == d.pt2;
+}
+__attribute__((visibility("default"))) QDebug operator<<(QDebug d, const QLine &p);
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QLine &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QLine &);
+class __attribute__((visibility("default"))) QLineF {
+public:
+ enum IntersectType { NoIntersection, BoundedIntersection, UnboundedIntersection };
+ inline QLineF();
+ inline QLineF(const QPointF &pt1, const QPointF &pt2);
+ inline QLineF(qreal x1, qreal y1, qreal x2, qreal y2);
+ inline QLineF(const QLine &line) : pt1(line.p1()), pt2(line.p2()) { }
+ static QLineF fromPolar(qreal length, qreal angle);
+ bool isNull() const;
+ inline QPointF p1() const;
+ inline QPointF p2() const;
+ inline qreal x1() const;
+ inline qreal y1() const;
+ inline qreal x2() const;
+ inline qreal y2() const;
+ inline qreal dx() const;
+ inline qreal dy() const;
+ qreal length() const;
+ void setLength(qreal len);
+ qreal angle() const;
+ void setAngle(qreal angle);
+ qreal angleTo(const QLineF &l) const;
+ QLineF unitVector() const;
+ QLineF normalVector() const;
+ IntersectType intersect(const QLineF &l, QPointF *intersectionPoint) const;
+ qreal angle(const QLineF &l) const;
+ QPointF pointAt(qreal t) const;
+ inline void translate(const QPointF &p);
+ inline void translate(qreal dx, qreal dy);
+ inline QLineF translated(const QPointF &p) const;
+ inline QLineF translated(qreal dx, qreal dy) const;
+ inline void setP1(const QPointF &p1);
+ inline void setP2(const QPointF &p2);
+ inline void setPoints(const QPointF &p1, const QPointF &p2);
+ inline void setLine(qreal x1, qreal y1, qreal x2, qreal y2);
+ inline bool operator==(const QLineF &d) const;
+ inline bool operator!=(const QLineF &d) const { return !(*this == d); }
+ QLine toLine() const;
+private:
+ QPointF pt1, pt2;
+};
+template <> class QTypeInfo<QLineF> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QLineF)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QLineF"; } };
+inline QLineF::QLineF()
+{
+}
+inline QLineF::QLineF(const QPointF &apt1, const QPointF &apt2)
+ : pt1(apt1), pt2(apt2)
+{
+}
+inline QLineF::QLineF(qreal x1pos, qreal y1pos, qreal x2pos, qreal y2pos)
+ : pt1(x1pos, y1pos), pt2(x2pos, y2pos)
+{
+}
+inline qreal QLineF::x1() const
+{
+ return pt1.x();
+}
+inline qreal QLineF::y1() const
+{
+ return pt1.y();
+}
+inline qreal QLineF::x2() const
+{
+ return pt2.x();
+}
+inline qreal QLineF::y2() const
+{
+ return pt2.y();
+}
+inline QPointF QLineF::p1() const
+{
+ return pt1;
+}
+inline QPointF QLineF::p2() const
+{
+ return pt2;
+}
+inline qreal QLineF::dx() const
+{
+ return pt2.x() - pt1.x();
+}
+inline qreal QLineF::dy() const
+{
+ return pt2.y() - pt1.y();
+}
+inline QLineF QLineF::normalVector() const
+{
+ return QLineF(p1(), p1() + QPointF(dy(), -dx()));
+}
+inline void QLineF::translate(const QPointF &point)
+{
+ pt1 += point;
+ pt2 += point;
+}
+inline void QLineF::translate(qreal adx, qreal ady)
+{
+ this->translate(QPointF(adx, ady));
+}
+inline QLineF QLineF::translated(const QPointF &p) const
+{
+ return QLineF(pt1 + p, pt2 + p);
+}
+inline QLineF QLineF::translated(qreal adx, qreal ady) const
+{
+ return translated(QPointF(adx, ady));
+}
+inline void QLineF::setLength(qreal len)
+{
+ if (isNull())
+ return;
+ QLineF v = unitVector();
+ pt2 = QPointF(pt1.x() + v.dx() * len, pt1.y() + v.dy() * len);
+}
+inline QPointF QLineF::pointAt(qreal t) const
+{
+ qreal vx = pt2.x() - pt1.x();
+ qreal vy = pt2.y() - pt1.y();
+ return QPointF(pt1.x() + vx * t, pt1.y() + vy * t);
+}
+inline QLine QLineF::toLine() const
+{
+ return QLine(pt1.toPoint(), pt2.toPoint());
+}
+inline void QLineF::setP1(const QPointF &aP1)
+{
+ pt1 = aP1;
+}
+inline void QLineF::setP2(const QPointF &aP2)
+{
+ pt2 = aP2;
+}
+inline void QLineF::setPoints(const QPointF &aP1, const QPointF &aP2)
+{
+ pt1 = aP1;
+ pt2 = aP2;
+}
+inline void QLineF::setLine(qreal aX1, qreal aY1, qreal aX2, qreal aY2)
+{
+ pt1 = QPointF(aX1, aY1);
+ pt2 = QPointF(aX2, aY2);
+}
+inline bool QLineF::operator==(const QLineF &d) const
+{
+ return pt1 == d.pt1 && pt2 == d.pt2;
+}
+__attribute__((visibility("default"))) QDebug operator<<(QDebug d, const QLineF &p);
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QLineF &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QLineF &);
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QPainterPath;
+class QVariant;
+class __attribute__((visibility("default"))) QMatrix
+{
+public:
+ QMatrix();
+ QMatrix(qreal m11, qreal m12, qreal m21, qreal m22,
+ qreal dx, qreal dy);
+ QMatrix(const QMatrix &matrix);
+ void setMatrix(qreal m11, qreal m12, qreal m21, qreal m22,
+ qreal dx, qreal dy);
+ qreal m11() const { return _m11; }
+ qreal m12() const { return _m12; }
+ qreal m21() const { return _m21; }
+ qreal m22() const { return _m22; }
+ qreal dx() const { return _dx; }
+ qreal dy() const { return _dy; }
+ void map(int x, int y, int *tx, int *ty) const;
+ void map(qreal x, qreal y, qreal *tx, qreal *ty) const;
+ QRect mapRect(const QRect &) const;
+ QRectF mapRect(const QRectF &) const;
+ QPoint map(const QPoint &p) const;
+ QPointF map(const QPointF&p) const;
+ QLine map(const QLine &l) const;
+ QLineF map(const QLineF &l) const;
+ QPolygonF map(const QPolygonF &a) const;
+ QPolygon map(const QPolygon &a) const;
+ QRegion map(const QRegion &r) const;
+ QPainterPath map(const QPainterPath &p) const;
+ QPolygon mapToPolygon(const QRect &r) const;
+ void reset();
+ inline bool isIdentity() const;
+ QMatrix &translate(qreal dx, qreal dy);
+ QMatrix &scale(qreal sx, qreal sy);
+ QMatrix &shear(qreal sh, qreal sv);
+ QMatrix &rotate(qreal a);
+ bool isInvertible() const { return !qFuzzyCompare(_m11*_m22 - _m12*_m21 + 1, 1); }
+ qreal det() const { return _m11*_m22 - _m12*_m21; }
+ QMatrix inverted(bool *invertible = 0) const;
+ bool operator==(const QMatrix &) const;
+ bool operator!=(const QMatrix &) const;
+ QMatrix &operator*=(const QMatrix &);
+ QMatrix operator*(const QMatrix &o) const;
+ QMatrix &operator=(const QMatrix &);
+ operator QVariant() const;
+private:
+ friend class QTransform;
+ qreal _m11, _m12;
+ qreal _m21, _m22;
+ qreal _dx, _dy;
+};
+template <> class QTypeInfo<QMatrix> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QMatrix)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QMatrix"; } };
+__attribute__((visibility("default"))) inline QPoint operator*(const QPoint &p, const QMatrix &m)
+{ return m.map(p); }
+__attribute__((visibility("default"))) inline QPointF operator*(const QPointF &p, const QMatrix &m)
+{ return m.map(p); }
+__attribute__((visibility("default"))) inline QLineF operator*(const QLineF &l, const QMatrix &m)
+{ return m.map(l); }
+__attribute__((visibility("default"))) inline QLine operator*(const QLine &l, const QMatrix &m)
+{ return m.map(l); }
+__attribute__((visibility("default"))) inline QPolygon operator *(const QPolygon &a, const QMatrix &m)
+{ return m.map(a); }
+__attribute__((visibility("default"))) inline QPolygonF operator *(const QPolygonF &a, const QMatrix &m)
+{ return m.map(a); }
+__attribute__((visibility("default"))) inline QRegion operator *(const QRegion &r, const QMatrix &m)
+{ return m.map(r); }
+__attribute__((visibility("default"))) QPainterPath operator *(const QPainterPath &p, const QMatrix &m);
+inline bool QMatrix::isIdentity() const
+{
+ return qFuzzyCompare(_m11, 1) && qFuzzyCompare(_m22, 1) && qFuzzyCompare(_m12 + 1, 1)
+ && qFuzzyCompare(_m21 + 1, 1) && qFuzzyCompare(_dx + 1, 1) && qFuzzyCompare(_dy + 1, 1);
+}
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QMatrix &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QMatrix &);
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QMatrix &);
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QFont;
+class QPainterPathPrivate;
+class QPainterPathData;
+class QPainterPathStrokerPrivate;
+class QPolygonF;
+class QRegion;
+class QVectorPath;
+class __attribute__((visibility("default"))) QPainterPath
+{
+public:
+ enum ElementType {
+ MoveToElement,
+ LineToElement,
+ CurveToElement,
+ CurveToDataElement
+ };
+ class Element {
+ public:
+ qreal x;
+ qreal y;
+ ElementType type;
+ bool isMoveTo() const { return type == MoveToElement; }
+ bool isLineTo() const { return type == LineToElement; }
+ bool isCurveTo() const { return type == CurveToElement; }
+ operator QPointF () const { return QPointF(x, y); }
+ bool operator==(const Element &e) const { return qFuzzyCompare(x, e.x)
+ && qFuzzyCompare(y, e.y) && type == e.type; }
+ inline bool operator!=(const Element &e) const { return !operator==(e); }
+ };
+ QPainterPath();
+ explicit QPainterPath(const QPointF &startPoint);
+ QPainterPath(const QPainterPath &other);
+ QPainterPath &operator=(const QPainterPath &other);
+ ~QPainterPath();
+ void closeSubpath();
+ void moveTo(const QPointF &p);
+ inline void moveTo(qreal x, qreal y);
+ void lineTo(const QPointF &p);
+ inline void lineTo(qreal x, qreal y);
+ void arcMoveTo(const QRectF &rect, qreal angle);
+ inline void arcMoveTo(qreal x, qreal y, qreal w, qreal h, qreal angle);
+ void arcTo(const QRectF &rect, qreal startAngle, qreal arcLength);
+ inline void arcTo(qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal arcLength);
+ void cubicTo(const QPointF &ctrlPt1, const QPointF &ctrlPt2, const QPointF &endPt);
+ inline void cubicTo(qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y,
+ qreal endPtx, qreal endPty);
+ void quadTo(const QPointF &ctrlPt, const QPointF &endPt);
+ inline void quadTo(qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty);
+ QPointF currentPosition() const;
+ void addRect(const QRectF &rect);
+ inline void addRect(qreal x, qreal y, qreal w, qreal h);
+ void addEllipse(const QRectF &rect);
+ inline void addEllipse(qreal x, qreal y, qreal w, qreal h);
+ inline void addEllipse(const QPointF ¢er, qreal rx, qreal ry);
+ void addPolygon(const QPolygonF &polygon);
+ void addText(const QPointF &point, const QFont &f, const QString &text);
+ inline void addText(qreal x, qreal y, const QFont &f, const QString &text);
+ void addPath(const QPainterPath &path);
+ void addRegion(const QRegion ®ion);
+ void addRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius,
+ Qt::SizeMode mode = Qt::AbsoluteSize);
+ inline void addRoundedRect(qreal x, qreal y, qreal w, qreal h,
+ qreal xRadius, qreal yRadius,
+ Qt::SizeMode mode = Qt::AbsoluteSize);
+ void addRoundRect(const QRectF &rect, int xRnd, int yRnd);
+ inline void addRoundRect(qreal x, qreal y, qreal w, qreal h,
+ int xRnd, int yRnd);
+ inline void addRoundRect(const QRectF &rect, int roundness);
+ inline void addRoundRect(qreal x, qreal y, qreal w, qreal h,
+ int roundness);
+ void connectPath(const QPainterPath &path);
+ bool contains(const QPointF &pt) const;
+ bool contains(const QRectF &rect) const;
+ bool intersects(const QRectF &rect) const;
+ QRectF boundingRect() const;
+ QRectF controlPointRect() const;
+ Qt::FillRule fillRule() const;
+ void setFillRule(Qt::FillRule fillRule);
+ inline bool isEmpty() const;
+ QPainterPath toReversed() const;
+ QList<QPolygonF> toSubpathPolygons(const QMatrix &matrix = QMatrix()) const;
+ QList<QPolygonF> toFillPolygons(const QMatrix &matrix = QMatrix()) const;
+ QPolygonF toFillPolygon(const QMatrix &matrix = QMatrix()) const;
+ QList<QPolygonF> toSubpathPolygons(const QTransform &matrix) const;
+ QList<QPolygonF> toFillPolygons(const QTransform &matrix) const;
+ QPolygonF toFillPolygon(const QTransform &matrix) const;
+ inline int elementCount() const;
+ inline const QPainterPath::Element &elementAt(int i) const;
+ inline void setElementPositionAt(int i, qreal x, qreal y);
+ qreal length() const;
+ qreal percentAtLength(qreal t) const;
+ QPointF pointAtPercent(qreal t) const;
+ qreal angleAtPercent(qreal t) const;
+ qreal slopeAtPercent(qreal t) const;
+ bool intersects(const QPainterPath &p) const;
+ bool contains(const QPainterPath &p) const;
+ QPainterPath united(const QPainterPath &r) const;
+ QPainterPath intersected(const QPainterPath &r) const;
+ QPainterPath subtracted(const QPainterPath &r) const;
+ QPainterPath subtractedInverted(const QPainterPath &r) const;
+ QPainterPath simplified() const;
+ bool operator==(const QPainterPath &other) const;
+ bool operator!=(const QPainterPath &other) const;
+ QPainterPath operator&(const QPainterPath &other) const;
+ QPainterPath operator|(const QPainterPath &other) const;
+ QPainterPath operator+(const QPainterPath &other) const;
+ QPainterPath operator-(const QPainterPath &other) const;
+ QPainterPath &operator&=(const QPainterPath &other);
+ QPainterPath &operator|=(const QPainterPath &other);
+ QPainterPath &operator+=(const QPainterPath &other);
+ QPainterPath &operator-=(const QPainterPath &other);
+private:
+ QPainterPathPrivate *d_ptr;
+ inline void ensureData() { if (!d_ptr) ensureData_helper(); }
+ void ensureData_helper();
+ inline void detach();
+ void detach_helper();
+ void setDirty(bool);
+ void computeBoundingRect() const;
+ void computeControlPointRect() const;
+ QPainterPathData *d_func() const { return reinterpret_cast<QPainterPathData *>(d_ptr); }
+ friend class QPainterPathData;
+ friend class QPainterPathStroker;
+ friend class QPainterPathStrokerPrivate;
+ friend class QMatrix;
+ friend class QTransform;
+ friend __attribute__((visibility("default"))) const QVectorPath &qtVectorPathForPath(const QPainterPath &);
+ friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPainterPath &);
+ friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPainterPath &);
+};
+class QPainterPathPrivate
+{
+public:
+ friend class QPainterPath;
+ friend class QPainterPathData;
+ friend class QPainterPathStroker;
+ friend class QPainterPathStrokerPrivate;
+ friend class QMatrix;
+ friend class QTransform;
+ friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPainterPath &);
+ friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPainterPath &);
+private:
+ QAtomicInt ref;
+ QVector<QPainterPath::Element> elements;
+};
+template <> class QTypeInfo<QPainterPath::Element> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QPainterPath::Element)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QPainterPath::Element"; } };
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPainterPath &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPainterPath &);
+class __attribute__((visibility("default"))) QPainterPathStroker
+{
+ inline QPainterPathStrokerPrivate* d_func() { return reinterpret_cast<QPainterPathStrokerPrivate *>(d_ptr); } inline const QPainterPathStrokerPrivate* d_func() const { return reinterpret_cast<const QPainterPathStrokerPrivate *>(d_ptr); } friend class QPainterPathStrokerPrivate;
+public:
+ QPainterPathStroker();
+ ~QPainterPathStroker();
+ void setWidth(qreal width);
+ qreal width() const;
+ void setCapStyle(Qt::PenCapStyle style);
+ Qt::PenCapStyle capStyle() const;
+ void setJoinStyle(Qt::PenJoinStyle style);
+ Qt::PenJoinStyle joinStyle() const;
+ void setMiterLimit(qreal length);
+ qreal miterLimit() const;
+ void setCurveThreshold(qreal threshold);
+ qreal curveThreshold() const;
+ void setDashPattern(Qt::PenStyle);
+ void setDashPattern(const QVector<qreal> &dashPattern);
+ QVector<qreal> dashPattern() const;
+ void setDashOffset(qreal offset);
+ qreal dashOffset() const;
+ QPainterPath createStroke(const QPainterPath &path) const;
+private:
+ friend class QX11PaintEngine;
+ QPainterPathStrokerPrivate *d_ptr;
+};
+inline void QPainterPath::moveTo(qreal x, qreal y)
+{
+ moveTo(QPointF(x, y));
+}
+inline void QPainterPath::lineTo(qreal x, qreal y)
+{
+ lineTo(QPointF(x, y));
+}
+inline void QPainterPath::arcTo(qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal arcLenght)
+{
+ arcTo(QRectF(x, y, w, h), startAngle, arcLenght);
+}
+inline void QPainterPath::arcMoveTo(qreal x, qreal y, qreal w, qreal h, qreal angle)
+{
+ arcMoveTo(QRectF(x, y, w, h), angle);
+}
+inline void QPainterPath::cubicTo(qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y,
+ qreal endPtx, qreal endPty)
+{
+ cubicTo(QPointF(ctrlPt1x, ctrlPt1y), QPointF(ctrlPt2x, ctrlPt2y),
+ QPointF(endPtx, endPty));
+}
+inline void QPainterPath::quadTo(qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty)
+{
+ quadTo(QPointF(ctrlPtx, ctrlPty), QPointF(endPtx, endPty));
+}
+inline void QPainterPath::addEllipse(qreal x, qreal y, qreal w, qreal h)
+{
+ addEllipse(QRectF(x, y, w, h));
+}
+inline void QPainterPath::addEllipse(const QPointF ¢er, qreal rx, qreal ry)
+{
+ addEllipse(QRectF(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
+}
+inline void QPainterPath::addRect(qreal x, qreal y, qreal w, qreal h)
+{
+ addRect(QRectF(x, y, w, h));
+}
+inline void QPainterPath::addRoundedRect(qreal x, qreal y, qreal w, qreal h,
+ qreal xRadius, qreal yRadius,
+ Qt::SizeMode mode)
+{
+ addRoundedRect(QRectF(x, y, w, h), xRadius, yRadius, mode);
+}
+inline void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h,
+ int xRnd, int yRnd)
+{
+ addRoundRect(QRectF(x, y, w, h), xRnd, yRnd);
+}
+inline void QPainterPath::addRoundRect(const QRectF &rect,
+ int roundness)
+{
+ int xRnd = roundness;
+ int yRnd = roundness;
+ if (rect.width() > rect.height())
+ xRnd = int(roundness * rect.height()/rect.width());
+ else
+ yRnd = int(roundness * rect.width()/rect.height());
+ addRoundRect(rect, xRnd, yRnd);
+}
+inline void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h,
+ int roundness)
+{
+ addRoundRect(QRectF(x, y, w, h), roundness);
+}
+inline void QPainterPath::addText(qreal x, qreal y, const QFont &f, const QString &text)
+{
+ addText(QPointF(x, y), f, text);
+}
+inline bool QPainterPath::isEmpty() const
+{
+ return !d_ptr || (d_ptr->elements.size() == 1 && d_ptr->elements.first().type == MoveToElement);
+}
+inline int QPainterPath::elementCount() const
+{
+ return d_ptr ? d_ptr->elements.size() : 0;
+}
+inline const QPainterPath::Element &QPainterPath::elementAt(int i) const
+{
+ qt_noop();
+ qt_noop();
+ return d_ptr->elements.at(i);
+}
+inline void QPainterPath::setElementPositionAt(int i, qreal x, qreal y)
+{
+ qt_noop();
+ qt_noop();
+ detach();
+ QPainterPath::Element &e = d_ptr->elements[i];
+ e.x = x;
+ e.y = y;
+}
+inline void QPainterPath::detach()
+{
+ if (d_ptr->ref != 1)
+ detach_helper();
+ setDirty(true);
+}
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QPainterPath &);
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QVariant;
+class __attribute__((visibility("default"))) QTransform
+{
+public:
+ enum TransformationType {
+ TxNone = 0x00,
+ TxTranslate = 0x01,
+ TxScale = 0x02,
+ TxRotate = 0x04,
+ TxShear = 0x08,
+ TxProject = 0x10
+ };
+ QTransform();
+ QTransform(qreal h11, qreal h12, qreal h13,
+ qreal h21, qreal h22, qreal h23,
+ qreal h31, qreal h32, qreal h33 = 1.0);
+ QTransform(qreal h11, qreal h12, qreal h21,
+ qreal h22, qreal dx, qreal dy);
+ explicit QTransform(const QMatrix &mtx);
+ bool isAffine() const;
+ bool isIdentity() const;
+ bool isInvertible() const;
+ bool isScaling() const;
+ bool isRotating() const;
+ bool isTranslating() const;
+ TransformationType type() const;
+ inline qreal determinant() const;
+ qreal det() const;
+ qreal m11() const;
+ qreal m12() const;
+ qreal m13() const;
+ qreal m21() const;
+ qreal m22() const;
+ qreal m23() const;
+ qreal m31() const;
+ qreal m32() const;
+ qreal m33() const;
+ qreal dx() const;
+ qreal dy() const;
+ void setMatrix(qreal m11, qreal m12, qreal m13,
+ qreal m21, qreal m22, qreal m23,
+ qreal m31, qreal m32, qreal m33);
+ QTransform inverted(bool *invertible = 0) const;
+ QTransform adjoint() const;
+ QTransform transposed() const;
+ QTransform &translate(qreal dx, qreal dy);
+ QTransform &scale(qreal sx, qreal sy);
+ QTransform &shear(qreal sh, qreal sv);
+ QTransform &rotate(qreal a, Qt::Axis axis = Qt::ZAxis);
+ QTransform &rotateRadians(qreal a, Qt::Axis axis = Qt::ZAxis);
+ static bool squareToQuad(const QPolygonF &square, QTransform &result);
+ static bool quadToSquare(const QPolygonF &quad, QTransform &result);
+ static bool quadToQuad(const QPolygonF &one,
+ const QPolygonF &two,
+ QTransform &result);
+ bool operator==(const QTransform &) const;
+ bool operator!=(const QTransform &) const;
+ QTransform &operator*=(const QTransform &);
+ QTransform operator*(const QTransform &o) const;
+ QTransform &operator=(const QTransform &);
+ operator QVariant() const;
+ void reset();
+ QPoint map(const QPoint &p) const;
+ QPointF map(const QPointF &p) const;
+ QLine map(const QLine &l) const;
+ QLineF map(const QLineF &l) const;
+ QPolygonF map(const QPolygonF &a) const;
+ QPolygon map(const QPolygon &a) const;
+ QRegion map(const QRegion &r) const;
+ QPainterPath map(const QPainterPath &p) const;
+ QPolygon mapToPolygon(const QRect &r) const;
+ QRect mapRect(const QRect &) const;
+ QRectF mapRect(const QRectF &) const;
+ void map(int x, int y, int *tx, int *ty) const;
+ void map(qreal x, qreal y, qreal *tx, qreal *ty) const;
+ const QMatrix &toAffine() const;
+ QTransform &operator*=(qreal div);
+ QTransform &operator/=(qreal div);
+ QTransform &operator+=(qreal div);
+ QTransform &operator-=(qreal div);
+ static QTransform fromTranslate(qreal dx, qreal dy);
+ static QTransform fromScale(qreal dx, qreal dy);
+private:
+ QMatrix affine;
+ qreal m_13;
+ qreal m_23;
+ qreal m_33;
+ mutable uint m_type : 5;
+ mutable uint m_dirty : 5;
+ class Private;
+ Private *d;
+};
+template <> class QTypeInfo<QTransform> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QTransform)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QTransform"; } };
+inline bool QTransform::isAffine() const
+{
+ return type() < TxProject;
+}
+inline bool QTransform::isIdentity() const
+{
+ return type() == TxNone;
+}
+inline bool QTransform::isInvertible() const
+{
+ return !qFuzzyCompare(determinant() + 1, 1);
+}
+inline bool QTransform::isScaling() const
+{
+ return type() >= TxScale;
+}
+inline bool QTransform::isRotating() const
+{
+ return type() >= TxRotate;
+}
+inline bool QTransform::isTranslating() const
+{
+ return type() >= TxTranslate;
+}
+inline qreal QTransform::determinant() const
+{
+ return affine._m11*(m_33*affine._m22-affine._dy*m_23) -
+ affine._m21*(m_33*affine._m12-affine._dy*m_13)+affine._dx*(m_23*affine._m12-affine._m22*m_13);
+}
+inline qreal QTransform::det() const
+{
+ return determinant();
+}
+inline qreal QTransform::m11() const
+{
+ return affine._m11;
+}
+inline qreal QTransform::m12() const
+{
+ return affine._m12;
+}
+inline qreal QTransform::m13() const
+{
+ return m_13;
+}
+inline qreal QTransform::m21() const
+{
+ return affine._m21;
+}
+inline qreal QTransform::m22() const
+{
+ return affine._m22;
+}
+inline qreal QTransform::m23() const
+{
+ return m_23;
+}
+inline qreal QTransform::m31() const
+{
+ return affine._dx;
+}
+inline qreal QTransform::m32() const
+{
+ return affine._dy;
+}
+inline qreal QTransform::m33() const
+{
+ return m_33;
+}
+inline qreal QTransform::dx() const
+{
+ return affine._dx;
+}
+inline qreal QTransform::dy() const
+{
+ return affine._dy;
+}
+inline QTransform &QTransform::operator*=(qreal num)
+{
+ if (num == 1.)
+ return *this;
+ affine._m11 *= num;
+ affine._m12 *= num;
+ m_13 *= num;
+ affine._m21 *= num;
+ affine._m22 *= num;
+ m_23 *= num;
+ affine._dx *= num;
+ affine._dy *= num;
+ m_33 *= num;
+ m_dirty |= TxScale;
+ return *this;
+}
+inline QTransform &QTransform::operator/=(qreal div)
+{
+ if (div == 0)
+ return *this;
+ div = 1/div;
+ return operator*=(div);
+}
+inline QTransform &QTransform::operator+=(qreal num)
+{
+ if (num == 0)
+ return *this;
+ affine._m11 += num;
+ affine._m12 += num;
+ m_13 += num;
+ affine._m21 += num;
+ affine._m22 += num;
+ m_23 += num;
+ affine._dx += num;
+ affine._dy += num;
+ m_33 += num;
+ m_dirty |= TxProject;
+ return *this;
+}
+inline QTransform &QTransform::operator-=(qreal num)
+{
+ if (num == 0)
+ return *this;
+ affine._m11 -= num;
+ affine._m12 -= num;
+ m_13 -= num;
+ affine._m21 -= num;
+ affine._m22 -= num;
+ m_23 -= num;
+ affine._dx -= num;
+ affine._dy -= num;
+ m_33 -= num;
+ m_dirty |= TxProject;
+ return *this;
+}
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QTransform &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QTransform &);
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QTransform &);
+__attribute__((visibility("default"))) inline QPoint operator*(const QPoint &p, const QTransform &m)
+{ return m.map(p); }
+__attribute__((visibility("default"))) inline QPointF operator*(const QPointF &p, const QTransform &m)
+{ return m.map(p); }
+__attribute__((visibility("default"))) inline QLineF operator*(const QLineF &l, const QTransform &m)
+{ return m.map(l); }
+__attribute__((visibility("default"))) inline QLine operator*(const QLine &l, const QTransform &m)
+{ return m.map(l); }
+__attribute__((visibility("default"))) inline QPolygon operator *(const QPolygon &a, const QTransform &m)
+{ return m.map(a); }
+__attribute__((visibility("default"))) inline QPolygonF operator *(const QPolygonF &a, const QTransform &m)
+{ return m.map(a); }
+__attribute__((visibility("default"))) inline QRegion operator *(const QRegion &r, const QTransform &m)
+{ return m.map(r); }
+__attribute__((visibility("default"))) inline QPainterPath operator *(const QPainterPath &p, const QTransform &m)
+{ return m.map(p); }
+__attribute__((visibility("default"))) inline QTransform operator *(const QTransform &a, qreal n)
+{ QTransform t(a); t *= n; return t; }
+__attribute__((visibility("default"))) inline QTransform operator /(const QTransform &a, qreal n)
+{ QTransform t(a); t /= n; return t; }
+__attribute__((visibility("default"))) inline QTransform operator +(const QTransform &a, qreal n)
+{ QTransform t(a); t += n; return t; }
+__attribute__((visibility("default"))) inline QTransform operator -(const QTransform &a, qreal n)
+{ QTransform t(a); t -= n; return t; }
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QWSDisplay;
+class QPaintEngine;
+class __attribute__((visibility("default"))) QPaintDevice
+{
+public:
+ enum PaintDeviceMetric {
+ PdmWidth = 1,
+ PdmHeight,
+ PdmWidthMM,
+ PdmHeightMM,
+ PdmNumColors,
+ PdmDepth,
+ PdmDpiX,
+ PdmDpiY,
+ PdmPhysicalDpiX,
+ PdmPhysicalDpiY
+ };
+ virtual ~QPaintDevice();
+ virtual int devType() const;
+ bool paintingActive() const;
+ virtual QPaintEngine *paintEngine() const = 0;
+ static QWSDisplay *qwsDisplay();
+ int width() const { return metric(PdmWidth); }
+ int height() const { return metric(PdmHeight); }
+ int widthMM() const { return metric(PdmWidthMM); }
+ int heightMM() const { return metric(PdmHeightMM); }
+ int logicalDpiX() const { return metric(PdmDpiX); }
+ int logicalDpiY() const { return metric(PdmDpiY); }
+ int physicalDpiX() const { return metric(PdmPhysicalDpiX); }
+ int physicalDpiY() const { return metric(PdmPhysicalDpiY); }
+ int numColors() const { return metric(PdmNumColors); }
+ int depth() const { return metric(PdmDepth); }
+protected:
+ QPaintDevice();
+ virtual int metric(PaintDeviceMetric metric) const;
+ ushort painters;
+private:
+ QPaintDevice(const QPaintDevice &); QPaintDevice &operator=(const QPaintDevice &);
+ friend class QPainter;
+ friend class QFontEngineMac;
+ friend class QX11PaintEngine;
+};
+inline int QPaintDevice::devType() const
+{ return QInternal::UnknownDevice; }
+inline bool QPaintDevice::paintingActive() const
+{ return painters != 0; }
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QIODevice;
+class QStringList;
+class QMatrix;
+class QTransform;
+class QVariant;
+template <class T> class QList;
+template <class T> class QVector;
+struct QImageData;
+class QImageDataMisc;
+class __attribute__((visibility("default"))) QImageTextKeyLang {
+public:
+ QImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { }
+ QImageTextKeyLang() { }
+ QByteArray key;
+ QByteArray lang;
+ bool operator< (const QImageTextKeyLang& other) const
+ { return key < other.key || (key==other.key && lang < other.lang); }
+ bool operator== (const QImageTextKeyLang& other) const
+ { return key==other.key && lang==other.lang; }
+ inline bool operator!= (const QImageTextKeyLang &other) const
+ { return !operator==(other); }
+};
+class __attribute__((visibility("default"))) QImage : public QPaintDevice
+{
+public:
+ enum InvertMode { InvertRgb, InvertRgba };
+ enum Format {
+ Format_Invalid,
+ Format_Mono,
+ Format_MonoLSB,
+ Format_Indexed8,
+ Format_RGB32,
+ Format_ARGB32,
+ Format_ARGB32_Premultiplied,
+ Format_RGB16,
+ Format_ARGB8565_Premultiplied,
+ Format_RGB666,
+ Format_ARGB6666_Premultiplied,
+ Format_RGB555,
+ Format_ARGB8555_Premultiplied,
+ Format_RGB888,
+ Format_RGB444,
+ Format_ARGB4444_Premultiplied,
+ NImageFormats
+ };
+ QImage();
+ QImage(const QSize &size, Format format);
+ QImage(int width, int height, Format format);
+ QImage(uchar *data, int width, int height, Format format);
+ QImage(const uchar *data, int width, int height, Format format);
+ QImage(uchar *data, int width, int height, int bytesPerLine, Format format);
+ QImage(const uchar *data, int width, int height, int bytesPerLine, Format format);
+ explicit QImage(const char * const xpm[]);
+ explicit QImage(const QString &fileName, const char *format = 0);
+ explicit QImage(const char *fileName, const char *format = 0);
+ QImage(const QImage &);
+ ~QImage();
+ QImage &operator=(const QImage &);
+ bool isNull() const;
+ int devType() const;
+ bool operator==(const QImage &) const;
+ bool operator!=(const QImage &) const;
+ operator QVariant() const;
+ void detach();
+ bool isDetached() const;
+ QImage copy(const QRect &rect = QRect()) const;
+ inline QImage copy(int x, int y, int w, int h) const
+ { return copy(QRect(x, y, w, h)); }
+ Format format() const;
+ QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const __attribute__ ((warn_unused_result));
+ QImage convertToFormat(Format f, const QVector<QRgb> &colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor) const __attribute__ ((warn_unused_result));
+ int width() const;
+ int height() const;
+ QSize size() const;
+ QRect rect() const;
+ int depth() const;
+ int numColors() const;
+ QRgb color(int i) const;
+ void setColor(int i, QRgb c);
+ void setNumColors(int);
+ bool allGray() const;
+ bool isGrayscale() const;
+ uchar *bits();
+ const uchar *bits() const;
+ int numBytes() const;
+ uchar *scanLine(int);
+ const uchar *scanLine(int) const;
+ int bytesPerLine() const;
+ bool valid(int x, int y) const;
+ bool valid(const QPoint &pt) const;
+ int pixelIndex(int x, int y) const;
+ int pixelIndex(const QPoint &pt) const;
+ QRgb pixel(int x, int y) const;
+ QRgb pixel(const QPoint &pt) const;
+ void setPixel(int x, int y, uint index_or_rgb);
+ void setPixel(const QPoint &pt, uint index_or_rgb);
+ QVector<QRgb> colorTable() const;
+ void setColorTable(const QVector<QRgb> colors);
+ void fill(uint pixel);
+ bool hasAlphaChannel() const;
+ void setAlphaChannel(const QImage &alphaChannel);
+ QImage alphaChannel() const;
+ QImage createAlphaMask(Qt::ImageConversionFlags flags = Qt::AutoColor) const;
+ QImage createHeuristicMask(bool clipTight = true) const;
+ QImage createMaskFromColor(QRgb color, Qt::MaskMode mode = Qt::MaskInColor) const;
+ inline QImage scaled(int w, int h, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
+ Qt::TransformationMode mode = Qt::FastTransformation) const
+ { return scaled(QSize(w, h), aspectMode, mode); }
+ QImage scaled(const QSize &s, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
+ Qt::TransformationMode mode = Qt::FastTransformation) const;
+ QImage scaledToWidth(int w, Qt::TransformationMode mode = Qt::FastTransformation) const;
+ QImage scaledToHeight(int h, Qt::TransformationMode mode = Qt::FastTransformation) const;
+ QImage transformed(const QMatrix &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const;
+ static QMatrix trueMatrix(const QMatrix &, int w, int h);
+ QImage transformed(const QTransform &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const;
+ static QTransform trueMatrix(const QTransform &, int w, int h);
+ QImage mirrored(bool horizontally = false, bool vertically = true) const;
+ QImage rgbSwapped() const;
+ void invertPixels(InvertMode = InvertRgb);
+ bool load(QIODevice *device, const char* format);
+ bool load(const QString &fileName, const char* format=0);
+ bool loadFromData(const uchar *buf, int len, const char *format = 0);
+ inline bool loadFromData(const QByteArray &data, const char* aformat=0)
+ { return loadFromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), aformat); }
+ bool save(const QString &fileName, const char* format=0, int quality=-1) const;
+ bool save(QIODevice *device, const char* format=0, int quality=-1) const;
+ static QImage fromData(const uchar *data, int size, const char *format = 0);
+ inline static QImage fromData(const QByteArray &data, const char *format = 0)
+ { return fromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), format); }
+ int serialNumber() const;
+ qint64 cacheKey() const;
+ QPaintEngine *paintEngine() const;
+ int dotsPerMeterX() const;
+ int dotsPerMeterY() const;
+ void setDotsPerMeterX(int);
+ void setDotsPerMeterY(int);
+ QPoint offset() const;
+ void setOffset(const QPoint&);
+ QStringList textKeys() const;
+ QString text(const QString &key = QString()) const;
+ void setText(const QString &key, const QString &value);
+ QString text(const char* key, const char* lang=0) const;
+ QList<QImageTextKeyLang> textList() const;
+ QStringList textLanguages() const;
+ QString text(const QImageTextKeyLang&) const;
+ void setText(const char* key, const char* lang, const QString&);
+protected:
+ virtual int metric(PaintDeviceMetric metric) const;
+private:
+ friend class QWSOnScreenSurface;
+ QImageData *d;
+ friend class QRasterPixmapData;
+ friend class QDetachedPixmap;
+ friend __attribute__((visibility("default"))) qint64 qt_image_id(const QImage &image);
+ friend const QVector<QRgb> *qt_image_colortable(const QImage &image);
+public:
+ typedef QImageData * DataPtr;
+ inline DataPtr &data_ptr() { return d; }
+};
+template <> inline bool qIsDetached<QImage>(QImage &t) { return t.isDetached(); } template <typename T> inline void qSwap(T &, T &); template <> inline void qSwap<QImage>(QImage &value1, QImage &value2) { const QImage::DataPtr t = value1.data_ptr(); value1.data_ptr() = value2.data_ptr(); value2.data_ptr() = t; }
+template <> class QTypeInfo<QImage> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QImage)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QImage"; } };
+__attribute__((visibility("default"))) inline bool QImage::valid(const QPoint &pt) const { return valid(pt.x(), pt.y()); }
+__attribute__((visibility("default"))) inline int QImage::pixelIndex(const QPoint &pt) const { return pixelIndex(pt.x(), pt.y());}
+__attribute__((visibility("default"))) inline QRgb QImage::pixel(const QPoint &pt) const { return pixel(pt.x(), pt.y()); }
+__attribute__((visibility("default"))) inline void QImage::setPixel(const QPoint &pt, uint index_or_rgb) { setPixel(pt.x(), pt.y(), index_or_rgb); }
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QImage &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QImage &);
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QImageWriter;
+class QColor;
+class QVariant;
+class QX11Info;
+class QPixmapData;
+class __attribute__((visibility("default"))) QPixmap : public QPaintDevice
+{
+public:
+ QPixmap();
+ explicit QPixmap(QPixmapData *data);
+ QPixmap(int w, int h);
+ QPixmap(const QSize &);
+ QPixmap(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ QPixmap(const char * const xpm[]);
+ QPixmap(const QPixmap &);
+ ~QPixmap();
+ QPixmap &operator=(const QPixmap &);
+ operator QVariant() const;
+ bool isNull() const;
+ int devType() const;
+ int width() const;
+ int height() const;
+ QSize size() const;
+ QRect rect() const;
+ int depth() const;
+ static int defaultDepth();
+ void fill(const QColor &fillColor = Qt::white);
+ void fill(const QWidget *widget, const QPoint &ofs);
+ inline void fill(const QWidget *widget, int xofs, int yofs) { fill(widget, QPoint(xofs, yofs)); }
+ QBitmap mask() const;
+ void setMask(const QBitmap &);
+ QPixmap alphaChannel() const;
+ void setAlphaChannel(const QPixmap &);
+ bool hasAlpha() const;
+ bool hasAlphaChannel() const;
+ QBitmap createHeuristicMask(bool clipTight = true) const;
+ QBitmap createMaskFromColor(const QColor &maskColor) const;
+ QBitmap createMaskFromColor(const QColor &maskColor, Qt::MaskMode mode) const;
+ static QPixmap grabWindow(WId, int x=0, int y=0, int w=-1, int h=-1);
+ static QPixmap grabWidget(QWidget *widget, const QRect &rect);
+ static inline QPixmap grabWidget(QWidget *widget, int x=0, int y=0, int w=-1, int h=-1)
+ { return grabWidget(widget, QRect(x, y, w, h)); }
+ inline QPixmap scaled(int w, int h, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
+ Qt::TransformationMode mode = Qt::FastTransformation) const
+ { return scaled(QSize(w, h), aspectMode, mode); }
+ QPixmap scaled(const QSize &s, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
+ Qt::TransformationMode mode = Qt::FastTransformation) const;
+ QPixmap scaledToWidth(int w, Qt::TransformationMode mode = Qt::FastTransformation) const;
+ QPixmap scaledToHeight(int h, Qt::TransformationMode mode = Qt::FastTransformation) const;
+ QPixmap transformed(const QMatrix &, Qt::TransformationMode mode = Qt::FastTransformation) const;
+ static QMatrix trueMatrix(const QMatrix &m, int w, int h);
+ QPixmap transformed(const QTransform &, Qt::TransformationMode mode = Qt::FastTransformation) const;
+ static QTransform trueMatrix(const QTransform &m, int w, int h);
+ QImage toImage() const;
+ static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ bool load(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ bool loadFromData(const uchar *buf, uint len, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ inline bool loadFromData(const QByteArray &data, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ bool save(const QString& fileName, const char* format = 0, int quality = -1) const;
+ bool save(QIODevice* device, const char* format = 0, int quality = -1) const;
+ inline QPixmap copy(int x, int y, int width, int height) const;
+ QPixmap copy(const QRect &rect = QRect()) const;
+ int serialNumber() const;
+ qint64 cacheKey() const;
+ bool isDetached() const;
+ void detach();
+ bool isQBitmap() const;
+ const uchar *qwsBits() const;
+ int qwsBytesPerLine() const;
+ QRgb *clut() const;
+ int numCols() const;
+ Qt::HANDLE handle() const;
+ QPaintEngine *paintEngine() const;
+ inline bool operator!() const { return isNull(); }
+protected:
+ int metric(PaintDeviceMetric) const;
+private:
+ QPixmapData *data;
+ bool doImageIO(QImageWriter *io, int quality) const;
+ enum Type { PixmapType, BitmapType };
+ QPixmap(const QSize &s, Type);
+ void init(int, int, Type = PixmapType);
+ QPixmap(const QSize &s, int type);
+ void init(int, int, int);
+ void deref();
+ friend class QPixmapData;
+ friend class QX11PixmapData;
+ friend class QMacPixmapData;
+ friend class QBitmap;
+ friend class QPaintDevice;
+ friend class QPainter;
+ friend class QGLWidget;
+ friend class QX11PaintEngine;
+ friend class QCoreGraphicsPaintEngine;
+ friend class QWidgetPrivate;
+ friend class QRasterPaintEngine;
+ friend class QRasterBuffer;
+ friend class QDirect3DPaintEngine;
+ friend class QDirect3DPaintEnginePrivate;
+ friend class QDetachedPixmap;
+ friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPixmap &);
+ friend __attribute__((visibility("default"))) qint64 qt_pixmap_id(const QPixmap &pixmap);
+public:
+ QPixmapData* pixmapData() const;
+public:
+ typedef QPixmapData * DataPtr;
+ inline DataPtr &data_ptr() { return data; }
+};
+template <> inline bool qIsDetached<QPixmap>(QPixmap &t) { return t.isDetached(); } template <typename T> inline void qSwap(T &, T &); template <> inline void qSwap<QPixmap>(QPixmap &value1, QPixmap &value2) { const QPixmap::DataPtr t = value1.data_ptr(); value1.data_ptr() = value2.data_ptr(); value2.data_ptr() = t; }
+inline QPixmap QPixmap::copy(int ax, int ay, int awidth, int aheight) const
+{
+ return copy(QRect(ax, ay, awidth, aheight));
+}
+inline bool QPixmap::loadFromData(const QByteArray &buf, const char *format,
+ Qt::ImageConversionFlags flags)
+{
+ return loadFromData(reinterpret_cast<const uchar *>(buf.constData()), buf.size(), format, flags);
+}
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPixmap &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPixmap &);
+typedef QtValidLicenseForGuiModule QtGuiModule;
+struct QBrushData;
+class QPixmap;
+class QGradient;
+class QVariant;
+class __attribute__((visibility("default"))) QBrush
+{
+public:
+ QBrush();
+ QBrush(Qt::BrushStyle bs);
+ QBrush(const QColor &color, Qt::BrushStyle bs=Qt::SolidPattern);
+ QBrush(Qt::GlobalColor color, Qt::BrushStyle bs=Qt::SolidPattern);
+ QBrush(const QColor &color, const QPixmap &pixmap);
+ QBrush(Qt::GlobalColor color, const QPixmap &pixmap);
+ QBrush(const QPixmap &pixmap);
+ QBrush(const QImage &image);
+ QBrush(const QBrush &brush);
+ QBrush(const QGradient &gradient);
+ ~QBrush();
+ QBrush &operator=(const QBrush &brush);
+ operator QVariant() const;
+ inline Qt::BrushStyle style() const;
+ void setStyle(Qt::BrushStyle);
+ inline const QMatrix &matrix() const;
+ void setMatrix(const QMatrix &mat);
+ inline QTransform transform() const;
+ void setTransform(const QTransform &);
+ QPixmap texture() const;
+ void setTexture(const QPixmap &pixmap);
+ QImage textureImage() const;
+ void setTextureImage(const QImage &image);
+ inline const QColor &color() const;
+ void setColor(const QColor &color);
+ inline void setColor(Qt::GlobalColor color);
+ const QGradient *gradient() const;
+ bool isOpaque() const;
+ bool operator==(const QBrush &b) const;
+ inline bool operator!=(const QBrush &b) const { return !(operator==(b)); }
+private:
+ friend class QRasterPaintEngine;
+ friend class QRasterPaintEnginePrivate;
+ friend struct QSpanData;
+ friend class QPainter;
+ friend bool qHasPixmapTexture(const QBrush& brush);
+ void detach(Qt::BrushStyle newStyle);
+ void init(const QColor &color, Qt::BrushStyle bs);
+ QBrushData *d;
+ void cleanUp(QBrushData *x);
+public:
+ inline bool isDetached() const;
+ typedef QBrushData * DataPtr;
+ inline DataPtr &data_ptr() { return d; }
+};
+inline void QBrush::setColor(Qt::GlobalColor acolor)
+{ setColor(QColor(acolor)); }
+template <> class QTypeInfo<QBrush> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QBrush)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QBrush"; } };
+template <> inline bool qIsDetached<QBrush>(QBrush &t) { return t.isDetached(); } template <typename T> inline void qSwap(T &, T &); template <> inline void qSwap<QBrush>(QBrush &value1, QBrush &value2) { const QBrush::DataPtr t = value1.data_ptr(); value1.data_ptr() = value2.data_ptr(); value2.data_ptr() = t; }
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QBrush &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QBrush &);
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QBrush &);
+struct QBrushData
+{
+ QAtomicInt ref;
+ Qt::BrushStyle style;
+ QColor color;
+ QTransform transform;
+};
+inline Qt::BrushStyle QBrush::style() const { return d->style; }
+inline const QColor &QBrush::color() const { return d->color; }
+inline const QMatrix &QBrush::matrix() const { return d->transform.toAffine(); }
+inline QTransform QBrush::transform() const { return d->transform; }
+inline bool QBrush::isDetached() const { return d->ref == 1; }
+class QGradientPrivate;
+typedef QPair<qreal, QColor> QGradientStop;
+typedef QVector<QGradientStop> QGradientStops;
+class __attribute__((visibility("default"))) QGradient
+{
+ public: static const QMetaObject staticMetaObject; private:
+public:
+ enum Type {
+ LinearGradient,
+ RadialGradient,
+ ConicalGradient,
+ NoGradient
+ };
+ enum Spread {
+ PadSpread,
+ ReflectSpread,
+ RepeatSpread
+ };
+ enum CoordinateMode {
+ LogicalMode,
+ StretchToDeviceMode,
+ ObjectBoundingMode
+ };
+ enum InterpolationMode {
+ ColorInterpolation,
+ ComponentInterpolation
+ };
+ QGradient();
+ Type type() const { return m_type; }
+ inline void setSpread(Spread spread);
+ Spread spread() const { return m_spread; }
+ void setColorAt(qreal pos, const QColor &color);
+ void setStops(const QGradientStops &stops);
+ QGradientStops stops() const;
+ CoordinateMode coordinateMode() const;
+ void setCoordinateMode(CoordinateMode mode);
+ InterpolationMode interpolationMode() const;
+ void setInterpolationMode(InterpolationMode mode);
+ bool operator==(const QGradient &gradient) const;
+ inline bool operator!=(const QGradient &other) const
+ { return !operator==(other); }
+ bool operator==(const QGradient &gradient);
+private:
+ friend class QLinearGradient;
+ friend class QRadialGradient;
+ friend class QConicalGradient;
+ Type m_type;
+ Spread m_spread;
+ QGradientStops m_stops;
+ union {
+ struct {
+ qreal x1, y1, x2, y2;
+ } linear;
+ struct {
+ qreal cx, cy, fx, fy, radius;
+ } radial;
+ struct {
+ qreal cx, cy, angle;
+ } conical;
+ } m_data;
+ void *dummy;
+};
+inline void QGradient::setSpread(Spread aspread)
+{ m_spread = aspread; }
+class __attribute__((visibility("default"))) QLinearGradient : public QGradient
+{
+public:
+ QLinearGradient();
+ QLinearGradient(const QPointF &start, const QPointF &finalStop);
+ QLinearGradient(qreal xStart, qreal yStart, qreal xFinalStop, qreal yFinalStop);
+ QPointF start() const;
+ void setStart(const QPointF &start);
+ inline void setStart(qreal x, qreal y) { setStart(QPointF(x, y)); }
+ QPointF finalStop() const;
+ void setFinalStop(const QPointF &stop);
+ inline void setFinalStop(qreal x, qreal y) { setFinalStop(QPointF(x, y)); }
+};
+class __attribute__((visibility("default"))) QRadialGradient : public QGradient
+{
+public:
+ QRadialGradient();
+ QRadialGradient(const QPointF ¢er, qreal radius, const QPointF &focalPoint);
+ QRadialGradient(qreal cx, qreal cy, qreal radius, qreal fx, qreal fy);
+ QRadialGradient(const QPointF ¢er, qreal radius);
+ QRadialGradient(qreal cx, qreal cy, qreal radius);
+ QPointF center() const;
+ void setCenter(const QPointF ¢er);
+ inline void setCenter(qreal x, qreal y) { setCenter(QPointF(x, y)); }
+ QPointF focalPoint() const;
+ void setFocalPoint(const QPointF &focalPoint);
+ inline void setFocalPoint(qreal x, qreal y) { setFocalPoint(QPointF(x, y)); }
+ qreal radius() const;
+ void setRadius(qreal radius);
+};
+class __attribute__((visibility("default"))) QConicalGradient : public QGradient
+{
+public:
+ QConicalGradient();
+ QConicalGradient(const QPointF ¢er, qreal startAngle);
+ QConicalGradient(qreal cx, qreal cy, qreal startAngle);
+ QPointF center() const;
+ void setCenter(const QPointF ¢er);
+ inline void setCenter(qreal x, qreal y) { setCenter(QPointF(x, y)); }
+ qreal angle() const;
+ void setAngle(qreal angle);
+};
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QVariant;
+class QPenPrivate;
+class QBrush;
+class QPen;
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPen &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPen &);
+class __attribute__((visibility("default"))) QPen
+{
+public:
+ QPen();
+ QPen(Qt::PenStyle);
+ QPen(const QColor &color);
+ QPen(const QBrush &brush, qreal width, Qt::PenStyle s = Qt::SolidLine,
+ Qt::PenCapStyle c = Qt::SquareCap, Qt::PenJoinStyle j = Qt::BevelJoin);
+ QPen(const QPen &pen);
+ ~QPen();
+ QPen &operator=(const QPen &pen);
+ Qt::PenStyle style() const;
+ void setStyle(Qt::PenStyle);
+ QVector<qreal> dashPattern() const;
+ void setDashPattern(const QVector<qreal> &pattern);
+ qreal dashOffset() const;
+ void setDashOffset(qreal doffset);
+ qreal miterLimit() const;
+ void setMiterLimit(qreal limit);
+ qreal widthF() const;
+ void setWidthF(qreal width);
+ int width() const;
+ void setWidth(int width);
+ QColor color() const;
+ void setColor(const QColor &color);
+ QBrush brush() const;
+ void setBrush(const QBrush &brush);
+ bool isSolid() const;
+ Qt::PenCapStyle capStyle() const;
+ void setCapStyle(Qt::PenCapStyle pcs);
+ Qt::PenJoinStyle joinStyle() const;
+ void setJoinStyle(Qt::PenJoinStyle pcs);
+ bool isCosmetic() const;
+ void setCosmetic(bool cosmetic);
+ bool operator==(const QPen &p) const;
+ inline bool operator!=(const QPen &p) const { return !(operator==(p)); }
+ operator QVariant() const;
+ bool isDetached();
+private:
+ friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPen &);
+ friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPen &);
+ void detach();
+ class QPenPrivate *d;
+public:
+ typedef QPenPrivate * DataPtr;
+ inline DataPtr &data_ptr() { return d; }
+};
+template <> class QTypeInfo<QPen> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QPen)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QPen"; } };
+template <> inline bool qIsDetached<QPen>(QPen &t) { return t.isDetached(); } template <typename T> inline void qSwap(T &, T &); template <> inline void qSwap<QPen>(QPen &value1, QPen &value2) { const QPen::DataPtr t = value1.data_ptr(); value1.data_ptr() = value2.data_ptr(); value2.data_ptr() = t; }
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QPen &);
+typedef QtValidLicenseForGuiModule QtGuiModule;
+template <typename T> class QList;
+struct QTextOptionPrivate;
+class __attribute__((visibility("default"))) QTextOption
+{
+public:
+ enum TabType {
+ LeftTab,
+ RightTab,
+ CenterTab,
+ DelimiterTab
+ };
+ struct __attribute__((visibility("default"))) Tab {
+ inline Tab() : position(80), type(QTextOption::LeftTab) { }
+ inline bool operator==(const Tab &other) const {
+ return type == other.type
+ && qFuzzyCompare(position, other.position)
+ && delimiter == other.delimiter;
+ }
+ inline bool operator!=(const Tab &other) const {
+ return !operator==(other);
+ }
+ qreal position;
+ TabType type;
+ QChar delimiter;
+ };
+ QTextOption();
+ QTextOption(Qt::Alignment alignment);
+ ~QTextOption();
+ QTextOption(const QTextOption &o);
+ QTextOption &operator=(const QTextOption &o);
+ inline void setAlignment(Qt::Alignment alignment);
+ inline Qt::Alignment alignment() const { return Qt::Alignment(align); }
+ inline void setTextDirection(Qt::LayoutDirection aDirection) { this->direction = aDirection; }
+ inline Qt::LayoutDirection textDirection() const { return Qt::LayoutDirection(direction); }
+ enum WrapMode {
+ NoWrap,
+ WordWrap,
+ ManualWrap,
+ WrapAnywhere,
+ WrapAtWordBoundaryOrAnywhere
+ };
+ inline void setWrapMode(WrapMode wrap) { wordWrap = wrap; }
+ inline WrapMode wrapMode() const { return static_cast<WrapMode>(wordWrap); }
+ enum Flag {
+ ShowTabsAndSpaces = 0x1,
+ ShowLineAndParagraphSeparators = 0x2,
+ AddSpaceForLineAndParagraphSeparators = 0x4,
+ SuppressColors = 0x8,
+ IncludeTrailingSpaces = 0x80000000
+ };
+ typedef QFlags<Flag> Flags;
+ inline void setFlags(Flags flags);
+ inline Flags flags() const { return Flags(f); }
+ inline void setTabStop(qreal tabStop);
+ inline qreal tabStop() const { return tab; }
+ void setTabArray(QList<qreal> tabStops);
+ QList<qreal> tabArray() const;
+ void setTabs(QList<Tab> tabStops);
+ QList<Tab> tabs() const;
+ void setUseDesignMetrics(bool b) { design = b; }
+ bool useDesignMetrics() const { return design; }
+private:
+ uint align : 8;
+ uint wordWrap : 4;
+ uint design : 1;
+ uint direction : 1;
+ uint unused : 19;
+ uint f;
+ qreal tab;
+ QTextOptionPrivate *d;
+};
+inline QFlags<QTextOption::Flags::enum_type> operator|(QTextOption::Flags::enum_type f1, QTextOption::Flags::enum_type f2) { return QFlags<QTextOption::Flags::enum_type>(f1) | f2; } inline QFlags<QTextOption::Flags::enum_type> operator|(QTextOption::Flags::enum_type f1, QFlags<QTextOption::Flags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QTextOption::Flags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline void QTextOption::setAlignment(Qt::Alignment aalignment)
+{ align = aalignment; }
+inline void QTextOption::setFlags(Flags aflags)
+{ f = aflags; }
+inline void QTextOption::setTabStop(qreal atabStop)
+{ tab = atabStop; }
+ template <> struct QMetaTypeId< QTextOption::Tab > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = { (0) }; if (!metatype_id) metatype_id = qRegisterMetaType< QTextOption::Tab >("QTextOption::Tab"); return metatype_id; } };
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QString;
+class QVariant;
+class QFont;
+class QTextFormatCollection;
+class QTextFormatPrivate;
+class QTextBlockFormat;
+class QTextCharFormat;
+class QTextListFormat;
+class QTextTableFormat;
+class QTextFrameFormat;
+class QTextImageFormat;
+class QTextTableCellFormat;
+class QTextFormat;
+class QTextObject;
+class QTextCursor;
+class QTextDocument;
+class QTextLength;
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QTextLength &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QTextLength &);
+class __attribute__((visibility("default"))) QTextLength
+{
+public:
+ enum Type { VariableLength = 0, FixedLength, PercentageLength };
+ inline QTextLength() : lengthType(VariableLength), fixedValueOrPercentage(0) {}
+ inline explicit QTextLength(Type type, qreal value);
+ inline Type type() const { return lengthType; }
+ inline qreal value(qreal maximumLength) const
+ {
+ switch (lengthType) {
+ case FixedLength: return fixedValueOrPercentage;
+ case VariableLength: return maximumLength;
+ case PercentageLength: return fixedValueOrPercentage * maximumLength / qreal(100);
+ }
+ return -1;
+ }
+ inline qreal rawValue() const { return fixedValueOrPercentage; }
+ inline bool operator==(const QTextLength &other) const
+ { return lengthType == other.lengthType
+ && qFuzzyCompare(fixedValueOrPercentage, other.fixedValueOrPercentage); }
+ inline bool operator!=(const QTextLength &other) const
+ { return lengthType != other.lengthType
+ || !qFuzzyCompare(fixedValueOrPercentage, other.fixedValueOrPercentage); }
+ operator QVariant() const;
+private:
+ Type lengthType;
+ qreal fixedValueOrPercentage;
+ friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QTextLength &);
+ friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QTextLength &);
+};
+inline QTextLength::QTextLength(Type atype, qreal avalue)
+ : lengthType(atype), fixedValueOrPercentage(avalue) {}
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QTextFormat &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QTextFormat &);
+class __attribute__((visibility("default"))) QTextFormat
+{
+ public: static const QMetaObject staticMetaObject; private:
+public:
+ enum FormatType {
+ InvalidFormat = -1,
+ BlockFormat = 1,
+ CharFormat = 2,
+ ListFormat = 3,
+ TableFormat = 4,
+ FrameFormat = 5,
+ UserFormat = 100
+ };
+ enum Property {
+ ObjectIndex = 0x0,
+ CssFloat = 0x0800,
+ LayoutDirection = 0x0801,
+ OutlinePen = 0x810,
+ BackgroundBrush = 0x820,
+ ForegroundBrush = 0x821,
+ BackgroundImageUrl = 0x823,
+ BlockAlignment = 0x1010,
+ BlockTopMargin = 0x1030,
+ BlockBottomMargin = 0x1031,
+ BlockLeftMargin = 0x1032,
+ BlockRightMargin = 0x1033,
+ TextIndent = 0x1034,
+ TabPositions = 0x1035,
+ BlockIndent = 0x1040,
+ BlockNonBreakableLines = 0x1050,
+ BlockTrailingHorizontalRulerWidth = 0x1060,
+ FirstFontProperty = 0x1FE0,
+ FontCapitalization = FirstFontProperty,
+ FontLetterSpacing = 0x1FE1,
+ FontWordSpacing = 0x1FE2,
+ FontStyleHint = 0x1FE3,
+ FontStyleStrategy = 0x1FE4,
+ FontKerning = 0x1FE5,
+ FontFamily = 0x2000,
+ FontPointSize = 0x2001,
+ FontSizeAdjustment = 0x2002,
+ FontSizeIncrement = FontSizeAdjustment,
+ FontWeight = 0x2003,
+ FontItalic = 0x2004,
+ FontUnderline = 0x2005,
+ FontOverline = 0x2006,
+ FontStrikeOut = 0x2007,
+ FontFixedPitch = 0x2008,
+ FontPixelSize = 0x2009,
+ LastFontProperty = FontPixelSize,
+ TextUnderlineColor = 0x2010,
+ TextVerticalAlignment = 0x2021,
+ TextOutline = 0x2022,
+ TextUnderlineStyle = 0x2023,
+ TextToolTip = 0x2024,
+ IsAnchor = 0x2030,
+ AnchorHref = 0x2031,
+ AnchorName = 0x2032,
+ ObjectType = 0x2f00,
+ ListStyle = 0x3000,
+ ListIndent = 0x3001,
+ FrameBorder = 0x4000,
+ FrameMargin = 0x4001,
+ FramePadding = 0x4002,
+ FrameWidth = 0x4003,
+ FrameHeight = 0x4004,
+ FrameTopMargin = 0x4005,
+ FrameBottomMargin = 0x4006,
+ FrameLeftMargin = 0x4007,
+ FrameRightMargin = 0x4008,
+ FrameBorderBrush = 0x4009,
+ FrameBorderStyle = 0x4010,
+ TableColumns = 0x4100,
+ TableColumnWidthConstraints = 0x4101,
+ TableCellSpacing = 0x4102,
+ TableCellPadding = 0x4103,
+ TableHeaderRowCount = 0x4104,
+ TableCellRowSpan = 0x4810,
+ TableCellColumnSpan = 0x4811,
+ TableCellTopPadding = 0x4812,
+ TableCellBottomPadding = 0x4813,
+ TableCellLeftPadding = 0x4814,
+ TableCellRightPadding = 0x4815,
+ ImageName = 0x5000,
+ ImageWidth = 0x5010,
+ ImageHeight = 0x5011,
+ FullWidthSelection = 0x06000,
+ PageBreakPolicy = 0x7000,
+ UserProperty = 0x100000
+ };
+ enum ObjectTypes {
+ NoObject,
+ ImageObject,
+ TableObject,
+ TableCellObject,
+ UserObject = 0x1000
+ };
+ enum PageBreakFlag {
+ PageBreak_Auto = 0,
+ PageBreak_AlwaysBefore = 0x001,
+ PageBreak_AlwaysAfter = 0x010
+ };
+ typedef QFlags<PageBreakFlag> PageBreakFlags;
+ QTextFormat();
+ explicit QTextFormat(int type);
+ QTextFormat(const QTextFormat &rhs);
+ QTextFormat &operator=(const QTextFormat &rhs);
+ ~QTextFormat();
+ void merge(const QTextFormat &other);
+ inline bool isValid() const { return type() != InvalidFormat; }
+ int type() const;
+ int objectIndex() const;
+ void setObjectIndex(int object);
+ QVariant property(int propertyId) const;
+ void setProperty(int propertyId, const QVariant &value);
+ void clearProperty(int propertyId);
+ bool hasProperty(int propertyId) const;
+ bool boolProperty(int propertyId) const;
+ int intProperty(int propertyId) const;
+ qreal doubleProperty(int propertyId) const;
+ QString stringProperty(int propertyId) const;
+ QColor colorProperty(int propertyId) const;
+ QPen penProperty(int propertyId) const;
+ QBrush brushProperty(int propertyId) const;
+ QTextLength lengthProperty(int propertyId) const;
+ QVector<QTextLength> lengthVectorProperty(int propertyId) const;
+ void setProperty(int propertyId, const QVector<QTextLength> &lengths);
+ QMap<int, QVariant> properties() const;
+ int propertyCount() const;
+ inline void setObjectType(int type);
+ inline int objectType() const
+ { return intProperty(ObjectType); }
+ inline bool isCharFormat() const { return type() == CharFormat; }
+ inline bool isBlockFormat() const { return type() == BlockFormat; }
+ inline bool isListFormat() const { return type() == ListFormat; }
+ inline bool isFrameFormat() const { return type() == FrameFormat; }
+ inline bool isImageFormat() const { return type() == CharFormat && objectType() == ImageObject; }
+ inline bool isTableFormat() const { return type() == FrameFormat && objectType() == TableObject; }
+ inline bool isTableCellFormat() const { return type() == CharFormat && objectType() == TableCellObject; }
+ QTextBlockFormat toBlockFormat() const;
+ QTextCharFormat toCharFormat() const;
+ QTextListFormat toListFormat() const;
+ QTextTableFormat toTableFormat() const;
+ QTextFrameFormat toFrameFormat() const;
+ QTextImageFormat toImageFormat() const;
+ QTextTableCellFormat toTableCellFormat() const;
+ bool operator==(const QTextFormat &rhs) const;
+ inline bool operator!=(const QTextFormat &rhs) const { return !operator==(rhs); }
+ operator QVariant() const;
+ inline void setLayoutDirection(Qt::LayoutDirection direction)
+ { setProperty(QTextFormat::LayoutDirection, direction); }
+ inline Qt::LayoutDirection layoutDirection() const
+ { return Qt::LayoutDirection(intProperty(QTextFormat::LayoutDirection)); }
+ inline void setBackground(const QBrush &brush)
+ { setProperty(BackgroundBrush, brush); }
+ inline QBrush background() const
+ { return brushProperty(BackgroundBrush); }
+ inline void clearBackground()
+ { clearProperty(BackgroundBrush); }
+ inline void setForeground(const QBrush &brush)
+ { setProperty(ForegroundBrush, brush); }
+ inline QBrush foreground() const
+ { return brushProperty(ForegroundBrush); }
+ inline void clearForeground()
+ { clearProperty(ForegroundBrush); }
+private:
+ QSharedDataPointer<QTextFormatPrivate> d;
+ qint32 format_type;
+ friend class QTextFormatCollection;
+ friend class QTextCharFormat;
+ friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QTextFormat &);
+ friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QTextFormat &);
+};
+inline void QTextFormat::setObjectType(int atype)
+{ setProperty(ObjectType, atype); }
+inline QFlags<QTextFormat::PageBreakFlags::enum_type> operator|(QTextFormat::PageBreakFlags::enum_type f1, QTextFormat::PageBreakFlags::enum_type f2) { return QFlags<QTextFormat::PageBreakFlags::enum_type>(f1) | f2; } inline QFlags<QTextFormat::PageBreakFlags::enum_type> operator|(QTextFormat::PageBreakFlags::enum_type f1, QFlags<QTextFormat::PageBreakFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QTextFormat::PageBreakFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+class __attribute__((visibility("default"))) QTextCharFormat : public QTextFormat
+{
+public:
+ enum VerticalAlignment {
+ AlignNormal = 0,
+ AlignSuperScript,
+ AlignSubScript,
+ AlignMiddle,
+ AlignTop,
+ AlignBottom
+ };
+ enum UnderlineStyle {
+ NoUnderline,
+ SingleUnderline,
+ DashUnderline,
+ DotLine,
+ DashDotLine,
+ DashDotDotLine,
+ WaveUnderline,
+ SpellCheckUnderline
+ };
+ QTextCharFormat();
+ bool isValid() const { return isCharFormat(); }
+ void setFont(const QFont &font);
+ QFont font() const;
+ inline void setFontFamily(const QString &family)
+ { setProperty(FontFamily, family); }
+ inline QString fontFamily() const
+ { return stringProperty(FontFamily); }
+ inline void setFontPointSize(qreal size)
+ { setProperty(FontPointSize, size); }
+ inline qreal fontPointSize() const
+ { return doubleProperty(FontPointSize); }
+ inline void setFontWeight(int weight)
+ { if (weight == QFont::Normal) weight = 0; setProperty(FontWeight, weight); }
+ inline int fontWeight() const
+ { int weight = intProperty(FontWeight); if (weight == 0) weight = QFont::Normal; return weight; }
+ inline void setFontItalic(bool italic)
+ { setProperty(FontItalic, italic); }
+ inline bool fontItalic() const
+ { return boolProperty(FontItalic); }
+ inline void setFontCapitalization(QFont::Capitalization capitalization)
+ { setProperty(FontCapitalization, capitalization); }
+ inline QFont::Capitalization fontCapitalization() const
+ { return static_cast<QFont::Capitalization>(intProperty(FontCapitalization)); }
+ inline void setFontLetterSpacing(qreal spacing)
+ { setProperty(FontLetterSpacing, spacing); }
+ inline qreal fontLetterSpacing() const
+ { return doubleProperty(FontLetterSpacing); }
+ inline void setFontWordSpacing(qreal spacing)
+ { setProperty(FontWordSpacing, spacing); }
+ inline qreal fontWordSpacing() const
+ { return doubleProperty(FontWordSpacing); }
+ inline void setFontUnderline(bool underline)
+ { setProperty(TextUnderlineStyle, underline ? SingleUnderline : NoUnderline); }
+ bool fontUnderline() const;
+ inline void setFontOverline(bool overline)
+ { setProperty(FontOverline, overline); }
+ inline bool fontOverline() const
+ { return boolProperty(FontOverline); }
+ inline void setFontStrikeOut(bool strikeOut)
+ { setProperty(FontStrikeOut, strikeOut); }
+ inline bool fontStrikeOut() const
+ { return boolProperty(FontStrikeOut); }
+ inline void setUnderlineColor(const QColor &color)
+ { setProperty(TextUnderlineColor, color); }
+ inline QColor underlineColor() const
+ { return colorProperty(TextUnderlineColor); }
+ inline void setFontFixedPitch(bool fixedPitch)
+ { setProperty(FontFixedPitch, fixedPitch); }
+ inline bool fontFixedPitch() const
+ { return boolProperty(FontFixedPitch); }
+ inline void setFontStyleHint(QFont::StyleHint hint, QFont::StyleStrategy strategy = QFont::PreferDefault)
+ { setProperty(FontStyleHint, hint); setProperty(FontStyleStrategy, strategy); }
+ inline void setFontStyleStrategy(QFont::StyleStrategy strategy)
+ { setProperty(FontStyleStrategy, strategy); }
+ QFont::StyleHint fontStyleHint() const
+ { return static_cast<QFont::StyleHint>(intProperty(FontStyleHint)); }
+ QFont::StyleStrategy fontStyleStrategy() const
+ { return static_cast<QFont::StyleStrategy>(intProperty(FontStyleStrategy)); }
+ inline void setFontKerning(bool enable)
+ { setProperty(FontKerning, enable); }
+ inline bool fontKerning() const
+ { return boolProperty(FontKerning); }
+ void setUnderlineStyle(UnderlineStyle style);
+ inline UnderlineStyle underlineStyle() const
+ { return static_cast<UnderlineStyle>(intProperty(TextUnderlineStyle)); }
+ inline void setVerticalAlignment(VerticalAlignment alignment)
+ { setProperty(TextVerticalAlignment, alignment); }
+ inline VerticalAlignment verticalAlignment() const
+ { return static_cast<VerticalAlignment>(intProperty(TextVerticalAlignment)); }
+ inline void setTextOutline(const QPen &pen)
+ { setProperty(TextOutline, pen); }
+ inline QPen textOutline() const
+ { return penProperty(TextOutline); }
+ inline void setToolTip(const QString &tip)
+ { setProperty(TextToolTip, tip); }
+ inline QString toolTip() const
+ { return stringProperty(TextToolTip); }
+ inline void setAnchor(bool anchor)
+ { setProperty(IsAnchor, anchor); }
+ inline bool isAnchor() const
+ { return boolProperty(IsAnchor); }
+ inline void setAnchorHref(const QString &value)
+ { setProperty(AnchorHref, value); }
+ inline QString anchorHref() const
+ { return stringProperty(AnchorHref); }
+ inline void setAnchorName(const QString &name)
+ { setAnchorNames(QStringList(name)); }
+ QString anchorName() const;
+ inline void setAnchorNames(const QStringList &names)
+ { setProperty(AnchorName, names); }
+ QStringList anchorNames() const;
+ inline void setTableCellRowSpan(int tableCellRowSpan);
+ inline int tableCellRowSpan() const
+ { int s = intProperty(TableCellRowSpan); if (s == 0) s = 1; return s; }
+ inline void setTableCellColumnSpan(int tableCellColumnSpan);
+ inline int tableCellColumnSpan() const
+ { int s = intProperty(TableCellColumnSpan); if (s == 0) s = 1; return s; }
+protected:
+ explicit QTextCharFormat(const QTextFormat &fmt);
+ friend class QTextFormat;
+};
+inline void QTextCharFormat::setTableCellRowSpan(int _tableCellRowSpan)
+{
+ if (_tableCellRowSpan <= 1)
+ clearProperty(TableCellRowSpan);
+ else
+ setProperty(TableCellRowSpan, _tableCellRowSpan);
+}
+inline void QTextCharFormat::setTableCellColumnSpan(int _tableCellColumnSpan)
+{
+ if (_tableCellColumnSpan <= 1)
+ clearProperty(TableCellColumnSpan);
+ else
+ setProperty(TableCellColumnSpan, _tableCellColumnSpan);
+}
+class __attribute__((visibility("default"))) QTextBlockFormat : public QTextFormat
+{
+public:
+ QTextBlockFormat();
+ bool isValid() const { return isBlockFormat(); }
+ inline void setAlignment(Qt::Alignment alignment);
+ inline Qt::Alignment alignment() const
+ { int a = intProperty(BlockAlignment); if (a == 0) a = Qt::AlignLeft; return QFlag(a); }
+ inline void setTopMargin(qreal margin)
+ { setProperty(BlockTopMargin, margin); }
+ inline qreal topMargin() const
+ { return doubleProperty(BlockTopMargin); }
+ inline void setBottomMargin(qreal margin)
+ { setProperty(BlockBottomMargin, margin); }
+ inline qreal bottomMargin() const
+ { return doubleProperty(BlockBottomMargin); }
+ inline void setLeftMargin(qreal margin)
+ { setProperty(BlockLeftMargin, margin); }
+ inline qreal leftMargin() const
+ { return doubleProperty(BlockLeftMargin); }
+ inline void setRightMargin(qreal margin)
+ { setProperty(BlockRightMargin, margin); }
+ inline qreal rightMargin() const
+ { return doubleProperty(BlockRightMargin); }
+ inline void setTextIndent(qreal aindent)
+ { setProperty(TextIndent, aindent); }
+ inline qreal textIndent() const
+ { return doubleProperty(TextIndent); }
+ inline void setIndent(int indent);
+ inline int indent() const
+ { return intProperty(BlockIndent); }
+ inline void setNonBreakableLines(bool b)
+ { setProperty(BlockNonBreakableLines, b); }
+ inline bool nonBreakableLines() const
+ { return boolProperty(BlockNonBreakableLines); }
+ inline void setPageBreakPolicy(PageBreakFlags flags)
+ { setProperty(PageBreakPolicy, int(flags)); }
+ inline PageBreakFlags pageBreakPolicy() const
+ { return PageBreakFlags(intProperty(PageBreakPolicy)); }
+ void setTabPositions(const QList<QTextOption::Tab> &tabs);
+ QList<QTextOption::Tab> tabPositions() const;
+protected:
+ explicit QTextBlockFormat(const QTextFormat &fmt);
+ friend class QTextFormat;
+};
+inline void QTextBlockFormat::setAlignment(Qt::Alignment aalignment)
+{ setProperty(BlockAlignment, int(aalignment)); }
+inline void QTextBlockFormat::setIndent(int aindent)
+{ setProperty(BlockIndent, aindent); }
+class __attribute__((visibility("default"))) QTextListFormat : public QTextFormat
+{
+public:
+ QTextListFormat();
+ bool isValid() const { return isListFormat(); }
+ enum Style {
+ ListDisc = -1,
+ ListCircle = -2,
+ ListSquare = -3,
+ ListDecimal = -4,
+ ListLowerAlpha = -5,
+ ListUpperAlpha = -6,
+ ListStyleUndefined = 0
+ };
+ inline void setStyle(Style style);
+ inline Style style() const
+ { return static_cast<Style>(intProperty(ListStyle)); }
+ inline void setIndent(int indent);
+ inline int indent() const
+ { return intProperty(ListIndent); }
+protected:
+ explicit QTextListFormat(const QTextFormat &fmt);
+ friend class QTextFormat;
+};
+inline void QTextListFormat::setStyle(Style astyle)
+{ setProperty(ListStyle, astyle); }
+inline void QTextListFormat::setIndent(int aindent)
+{ setProperty(ListIndent, aindent); }
+class __attribute__((visibility("default"))) QTextImageFormat : public QTextCharFormat
+{
+public:
+ QTextImageFormat();
+ bool isValid() const { return isImageFormat(); }
+ inline void setName(const QString &name);
+ inline QString name() const
+ { return stringProperty(ImageName); }
+ inline void setWidth(qreal width);
+ inline qreal width() const
+ { return doubleProperty(ImageWidth); }
+ inline void setHeight(qreal height);
+ inline qreal height() const
+ { return doubleProperty(ImageHeight); }
+protected:
+ explicit QTextImageFormat(const QTextFormat &format);
+ friend class QTextFormat;
+};
+inline void QTextImageFormat::setName(const QString &aname)
+{ setProperty(ImageName, aname); }
+inline void QTextImageFormat::setWidth(qreal awidth)
+{ setProperty(ImageWidth, awidth); }
+inline void QTextImageFormat::setHeight(qreal aheight)
+{ setProperty(ImageHeight, aheight); }
+class __attribute__((visibility("default"))) QTextFrameFormat : public QTextFormat
+{
+public:
+ QTextFrameFormat();
+ bool isValid() const { return isFrameFormat(); }
+ enum Position {
+ InFlow,
+ FloatLeft,
+ FloatRight
+ };
+ enum BorderStyle {
+ BorderStyle_None,
+ BorderStyle_Dotted,
+ BorderStyle_Dashed,
+ BorderStyle_Solid,
+ BorderStyle_Double,
+ BorderStyle_DotDash,
+ BorderStyle_DotDotDash,
+ BorderStyle_Groove,
+ BorderStyle_Ridge,
+ BorderStyle_Inset,
+ BorderStyle_Outset
+ };
+ inline void setPosition(Position f)
+ { setProperty(CssFloat, f); }
+ inline Position position() const
+ { return static_cast<Position>(intProperty(CssFloat)); }
+ inline void setBorder(qreal border);
+ inline qreal border() const
+ { return doubleProperty(FrameBorder); }
+ inline void setBorderBrush(const QBrush &brush)
+ { setProperty(FrameBorderBrush, brush); }
+ inline QBrush borderBrush() const
+ { return brushProperty(FrameBorderBrush); }
+ inline void setBorderStyle(BorderStyle style)
+ { setProperty(FrameBorderStyle, style); }
+ inline BorderStyle borderStyle() const
+ { return static_cast<BorderStyle>(intProperty(FrameBorderStyle)); }
+ void setMargin(qreal margin);
+ inline qreal margin() const
+ { return doubleProperty(FrameMargin); }
+ inline void setTopMargin(qreal margin);
+ qreal topMargin() const;
+ inline void setBottomMargin(qreal margin);
+ qreal bottomMargin() const;
+ inline void setLeftMargin(qreal margin);
+ qreal leftMargin() const;
+ inline void setRightMargin(qreal margin);
+ qreal rightMargin() const;
+ inline void setPadding(qreal padding);
+ inline qreal padding() const
+ { return doubleProperty(FramePadding); }
+ inline void setWidth(qreal width);
+ inline void setWidth(const QTextLength &length)
+ { setProperty(FrameWidth, length); }
+ inline QTextLength width() const
+ { return lengthProperty(FrameWidth); }
+ inline void setHeight(qreal height);
+ inline void setHeight(const QTextLength &height);
+ inline QTextLength height() const
+ { return lengthProperty(FrameHeight); }
+ inline void setPageBreakPolicy(PageBreakFlags flags)
+ { setProperty(PageBreakPolicy, int(flags)); }
+ inline PageBreakFlags pageBreakPolicy() const
+ { return PageBreakFlags(intProperty(PageBreakPolicy)); }
+protected:
+ explicit QTextFrameFormat(const QTextFormat &fmt);
+ friend class QTextFormat;
+};
+inline void QTextFrameFormat::setBorder(qreal aborder)
+{ setProperty(FrameBorder, aborder); }
+inline void QTextFrameFormat::setPadding(qreal apadding)
+{ setProperty(FramePadding, apadding); }
+inline void QTextFrameFormat::setWidth(qreal awidth)
+{ setProperty(FrameWidth, QTextLength(QTextLength::FixedLength, awidth)); }
+inline void QTextFrameFormat::setHeight(qreal aheight)
+{ setProperty(FrameHeight, QTextLength(QTextLength::FixedLength, aheight)); }
+inline void QTextFrameFormat::setHeight(const QTextLength &aheight)
+{ setProperty(FrameHeight, aheight); }
+inline void QTextFrameFormat::setTopMargin(qreal amargin)
+{ setProperty(FrameTopMargin, amargin); }
+inline void QTextFrameFormat::setBottomMargin(qreal amargin)
+{ setProperty(FrameBottomMargin, amargin); }
+inline void QTextFrameFormat::setLeftMargin(qreal amargin)
+{ setProperty(FrameLeftMargin, amargin); }
+inline void QTextFrameFormat::setRightMargin(qreal amargin)
+{ setProperty(FrameRightMargin, amargin); }
+class __attribute__((visibility("default"))) QTextTableFormat : public QTextFrameFormat
+{
+public:
+ QTextTableFormat();
+ inline bool isValid() const { return isTableFormat(); }
+ inline int columns() const
+ { int cols = intProperty(TableColumns); if (cols == 0) cols = 1; return cols; }
+ inline void setColumns(int columns);
+ inline void setColumnWidthConstraints(const QVector<QTextLength> &constraints)
+ { setProperty(TableColumnWidthConstraints, constraints); }
+ inline QVector<QTextLength> columnWidthConstraints() const
+ { return lengthVectorProperty(TableColumnWidthConstraints); }
+ inline void clearColumnWidthConstraints()
+ { clearProperty(TableColumnWidthConstraints); }
+ inline qreal cellSpacing() const
+ { return doubleProperty(TableCellSpacing); }
+ inline void setCellSpacing(qreal spacing)
+ { setProperty(TableCellSpacing, spacing); }
+ inline qreal cellPadding() const
+ { return doubleProperty(TableCellPadding); }
+ inline void setCellPadding(qreal padding);
+ inline void setAlignment(Qt::Alignment alignment);
+ inline Qt::Alignment alignment() const
+ { return QFlag(intProperty(BlockAlignment)); }
+ inline void setHeaderRowCount(int count)
+ { setProperty(TableHeaderRowCount, count); }
+ inline int headerRowCount() const
+ { return intProperty(TableHeaderRowCount); }
+protected:
+ explicit QTextTableFormat(const QTextFormat &fmt);
+ friend class QTextFormat;
+};
+inline void QTextTableFormat::setColumns(int acolumns)
+{
+ if (acolumns == 1)
+ acolumns = 0;
+ setProperty(TableColumns, acolumns);
+}
+inline void QTextTableFormat::setCellPadding(qreal apadding)
+{ setProperty(TableCellPadding, apadding); }
+inline void QTextTableFormat::setAlignment(Qt::Alignment aalignment)
+{ setProperty(BlockAlignment, int(aalignment)); }
+class __attribute__((visibility("default"))) QTextTableCellFormat : public QTextCharFormat
+{
+public:
+ QTextTableCellFormat();
+ inline bool isValid() const { return isTableCellFormat(); }
+ inline void setTopPadding(qreal padding);
+ inline qreal topPadding() const;
+ inline void setBottomPadding(qreal padding);
+ inline qreal bottomPadding() const;
+ inline void setLeftPadding(qreal padding);
+ inline qreal leftPadding() const;
+ inline void setRightPadding(qreal padding);
+ inline qreal rightPadding() const;
+ inline void setPadding(qreal padding);
+protected:
+ explicit QTextTableCellFormat(const QTextFormat &fmt);
+ friend class QTextFormat;
+};
+inline void QTextTableCellFormat::setTopPadding(qreal padding)
+{
+ setProperty(TableCellTopPadding, padding);
+}
+inline qreal QTextTableCellFormat::topPadding() const
+{
+ return doubleProperty(TableCellTopPadding);
+}
+inline void QTextTableCellFormat::setBottomPadding(qreal padding)
+{
+ setProperty(TableCellBottomPadding, padding);
+}
+inline qreal QTextTableCellFormat::bottomPadding() const
+{
+ return doubleProperty(TableCellBottomPadding);
+}
+inline void QTextTableCellFormat::setLeftPadding(qreal padding)
+{
+ setProperty(TableCellLeftPadding, padding);
+}
+inline qreal QTextTableCellFormat::leftPadding() const
+{
+ return doubleProperty(TableCellLeftPadding);
+}
+inline void QTextTableCellFormat::setRightPadding(qreal padding)
+{
+ setProperty(TableCellRightPadding, padding);
+}
+inline qreal QTextTableCellFormat::rightPadding() const
+{
+ return doubleProperty(TableCellRightPadding);
+}
+inline void QTextTableCellFormat::setPadding(qreal padding)
+{
+ setTopPadding(padding);
+ setBottomPadding(padding);
+ setLeftPadding(padding);
+ setRightPadding(padding);
+}
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QTextEngine;
+class QFont;
+class QRect;
+class QRegion;
+class QTextFormat;
+class QPalette;
+class QPainter;
+class __attribute__((visibility("default"))) QTextInlineObject
+{
+public:
+ QTextInlineObject(int i, QTextEngine *e) : itm(i), eng(e) {}
+ inline QTextInlineObject() : itm(0), eng(0) {}
+ inline bool isValid() const { return eng; }
+ QRectF rect() const;
+ qreal width() const;
+ qreal ascent() const;
+ qreal descent() const;
+ qreal height() const;
+ Qt::LayoutDirection textDirection() const;
+ void setWidth(qreal w);
+ void setAscent(qreal a);
+ void setDescent(qreal d);
+ int textPosition() const;
+ int formatIndex() const;
+ QTextFormat format() const;
+private:
+ friend class QTextLayout;
+ int itm;
+ QTextEngine *eng;
+};
+class QPaintDevice;
+class QTextFormat;
+class QTextLine;
+class QTextBlock;
+class QTextOption;
+class __attribute__((visibility("default"))) QTextLayout
+{
+public:
+ QTextLayout();
+ QTextLayout(const QString& text);
+ QTextLayout(const QString& text, const QFont &font, QPaintDevice *paintdevice = 0);
+ QTextLayout(const QTextBlock &b);
+ ~QTextLayout();
+ void setFont(const QFont &f);
+ QFont font() const;
+ void setText(const QString& string);
+ QString text() const;
+ void setTextOption(const QTextOption &option);
+ QTextOption textOption() const;
+ void setPreeditArea(int position, const QString &text);
+ int preeditAreaPosition() const;
+ QString preeditAreaText() const;
+ struct FormatRange {
+ int start;
+ int length;
+ QTextCharFormat format;
+ };
+ void setAdditionalFormats(const QList<FormatRange> &overrides);
+ QList<FormatRange> additionalFormats() const;
+ void clearAdditionalFormats();
+ void setCacheEnabled(bool enable);
+ bool cacheEnabled() const;
+ void beginLayout();
+ void endLayout();
+ void clearLayout();
+ QTextLine createLine();
+ int lineCount() const;
+ QTextLine lineAt(int i) const;
+ QTextLine lineForTextPosition(int pos) const;
+ enum CursorMode {
+ SkipCharacters,
+ SkipWords
+ };
+ bool isValidCursorPosition(int pos) const;
+ int nextCursorPosition(int oldPos, CursorMode mode = SkipCharacters) const;
+ int previousCursorPosition(int oldPos, CursorMode mode = SkipCharacters) const;
+ void draw(QPainter *p, const QPointF &pos, const QVector<FormatRange> &selections = QVector<FormatRange>(),
+ const QRectF &clip = QRectF()) const;
+ void drawCursor(QPainter *p, const QPointF &pos, int cursorPosition) const;
+ void drawCursor(QPainter *p, const QPointF &pos, int cursorPosition, int width) const;
+ QPointF position() const;
+ void setPosition(const QPointF &p);
+ QRectF boundingRect() const;
+ qreal minimumWidth() const;
+ qreal maximumWidth() const;
+ QTextEngine *engine() const { return d; }
+ void setFlags(int flags);
+private:
+ QTextLayout(QTextEngine *e) : d(e) {}
+ QTextLayout(const QTextLayout &); QTextLayout &operator=(const QTextLayout &);
+ friend class QPainter;
+ friend class QPSPrinter;
+ friend class QGraphicsSimpleTextItemPrivate;
+ friend class QGraphicsSimpleTextItem;
+ friend void qt_format_text(const QFont &font, const QRectF &_r, int tf, const QTextOption *, const QString& str,
+ QRectF *brect, int tabstops, int* tabarray, int tabarraylen,
+ QPainter *painter);
+ QTextEngine *d;
+};
+class __attribute__((visibility("default"))) QTextLine
+{
+public:
+ inline QTextLine() : i(0), eng(0) {}
+ inline bool isValid() const { return eng; }
+ QRectF rect() const;
+ qreal x() const;
+ qreal y() const;
+ qreal width() const;
+ qreal ascent() const;
+ qreal descent() const;
+ qreal height() const;
+ qreal naturalTextWidth() const;
+ QRectF naturalTextRect() const;
+ enum Edge {
+ Leading,
+ Trailing
+ };
+ enum CursorPosition {
+ CursorBetweenCharacters,
+ CursorOnCharacter
+ };
+ qreal cursorToX(int *cursorPos, Edge edge = Leading) const;
+ inline qreal cursorToX(int cursorPos, Edge edge = Leading) const { return cursorToX(&cursorPos, edge); }
+ int xToCursor(qreal x, CursorPosition = CursorBetweenCharacters) const;
+ void setLineWidth(qreal width);
+ void setNumColumns(int columns);
+ void setNumColumns(int columns, qreal alignmentWidth);
+ void setPosition(const QPointF &pos);
+ QPointF position() const;
+ int textStart() const;
+ int textLength() const;
+ int lineNumber() const { return i; }
+ void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection = 0) const;
+private:
+ QTextLine(int line, QTextEngine *e) : i(line), eng(e) {}
+ void layout_helper(int numGlyphs);
+ friend class QTextLayout;
+ int i;
+ QTextEngine *eng;
+};
+class __attribute__((visibility("default"))) QTextFormatCollection
+{
+public:
+ QTextFormatCollection() {}
+ ~QTextFormatCollection();
+ QTextFormatCollection(const QTextFormatCollection &rhs);
+ QTextFormatCollection &operator=(const QTextFormatCollection &rhs);
+ QTextFormat objectFormat(int objectIndex) const;
+ void setObjectFormat(int objectIndex, const QTextFormat &format);
+ int objectFormatIndex(int objectIndex) const;
+ void setObjectFormatIndex(int objectIndex, int formatIndex);
+ int createObjectIndex(const QTextFormat &f);
+ int indexForFormat(const QTextFormat &f);
+ bool hasFormatCached(const QTextFormat &format) const;
+ QTextFormat format(int idx) const;
+ inline QTextBlockFormat blockFormat(int index) const
+ { return format(index).toBlockFormat(); }
+ inline QTextCharFormat charFormat(int index) const
+ { return format(index).toCharFormat(); }
+ inline QTextListFormat listFormat(int index) const
+ { return format(index).toListFormat(); }
+ inline QTextTableFormat tableFormat(int index) const
+ { return format(index).toTableFormat(); }
+ inline QTextImageFormat imageFormat(int index) const
+ { return format(index).toImageFormat(); }
+ inline int numFormats() const { return formats.count(); }
+ typedef QVector<QTextFormat> FormatVector;
+ FormatVector formats;
+ QVector<qint32> objFormats;
+ QSet<uint> hashes;
+ inline QFont defaultFont() const { return defaultFnt; }
+ void setDefaultFont(const QFont &f);
+private:
+ QFont defaultFnt;
+};
+namespace QUnicodeTables {
+ struct Properties {
+ ushort category : 8;
+ ushort line_break_class : 8;
+ ushort direction : 8;
+ ushort combiningClass :8;
+ ushort joining : 2;
+ signed short digitValue : 6;
+ ushort unicodeVersion : 4;
+ ushort lowerCaseSpecial : 1;
+ ushort upperCaseSpecial : 1;
+ ushort titleCaseSpecial : 1;
+ ushort caseFoldSpecial : 1;
+ signed short mirrorDiff : 16;
+ signed short lowerCaseDiff : 16;
+ signed short upperCaseDiff : 16;
+ signed short titleCaseDiff : 16;
+ signed short caseFoldDiff : 16;
+ ushort graphemeBreak : 8;
+ ushort wordBreak : 8;
+ ushort sentenceBreak : 8;
+ };
+ __attribute__((visibility("default"))) const Properties* properties(uint ucs4);
+ __attribute__((visibility("default"))) const Properties* properties(ushort ucs2);
+ enum Script {
+ Common,
+ Greek,
+ Cyrillic,
+ Armenian,
+ Hebrew,
+ Arabic,
+ Syriac,
+ Thaana,
+ Devanagari,
+ Bengali,
+ Gurmukhi,
+ Gujarati,
+ Oriya,
+ Tamil,
+ Telugu,
+ Kannada,
+ Malayalam,
+ Sinhala,
+ Thai,
+ Lao,
+ Tibetan,
+ Myanmar,
+ Georgian,
+ Hangul,
+ Ogham,
+ Runic,
+ Khmer,
+ Inherited,
+ ScriptCount = Inherited,
+ Latin = Common,
+ Ethiopic = Common,
+ Cherokee = Common,
+ CanadianAboriginal = Common,
+ Mongolian = Common,
+ Hiragana = Common,
+ Katakana = Common,
+ Bopomofo = Common,
+ Han = Common,
+ Yi = Common,
+ OldItalic = Common,
+ Gothic = Common,
+ Deseret = Common,
+ Tagalog = Common,
+ Hanunoo = Common,
+ Buhid = Common,
+ Tagbanwa = Common,
+ Limbu = Common,
+ TaiLe = Common,
+ LinearB = Common,
+ Ugaritic = Common,
+ Shavian = Common,
+ Osmanya = Common,
+ Cypriot = Common,
+ Braille = Common,
+ Buginese = Common,
+ Coptic = Common,
+ NewTaiLue = Common,
+ Glagolitic = Common,
+ Tifinagh = Common,
+ SylotiNagri = Common,
+ OldPersian = Common,
+ Kharoshthi = Common,
+ Balinese = Common,
+ Cuneiform = Common,
+ Phoenician = Common,
+ PhagsPa = Common,
+ Nko = Common
+ };
+ enum { ScriptSentinel = 32 };
+ enum LineBreakClass {
+ LineBreak_OP, LineBreak_CL, LineBreak_QU, LineBreak_GL, LineBreak_NS,
+ LineBreak_EX, LineBreak_SY, LineBreak_IS, LineBreak_PR, LineBreak_PO,
+ LineBreak_NU, LineBreak_AL, LineBreak_ID, LineBreak_IN, LineBreak_HY,
+ LineBreak_BA, LineBreak_BB, LineBreak_B2, LineBreak_ZW, LineBreak_CM,
+ LineBreak_WJ, LineBreak_H2, LineBreak_H3, LineBreak_JL, LineBreak_JV,
+ LineBreak_JT, LineBreak_SA, LineBreak_SG,
+ LineBreak_SP, LineBreak_CR, LineBreak_LF, LineBreak_BK
+ };
+ __attribute__((visibility("default"))) QUnicodeTables::LineBreakClass lineBreakClass(uint ucs4);
+ inline int lineBreakClass(const QChar &ch) {
+ return QUnicodeTables::lineBreakClass(ch.unicode());
+ }
+ __attribute__((visibility("default"))) int script(uint ucs4);
+ __attribute__((visibility("default"))) inline int script(const QChar &ch) {
+ return script(ch.unicode());
+ }
+ enum GraphemeBreak {
+ GraphemeBreakOther,
+ GraphemeBreakCR,
+ GraphemeBreakLF,
+ GraphemeBreakControl,
+ GraphemeBreakExtend,
+ GraphemeBreakL,
+ GraphemeBreakV,
+ GraphemeBreakT,
+ GraphemeBreakLV,
+ GraphemeBreakLVT
+ };
+ enum WordBreak {
+ WordBreakOther,
+ WordBreakFormat,
+ WordBreakKatakana,
+ WordBreakALetter,
+ WordBreakMidLetter,
+ WordBreakMidNum,
+ WordBreakNumeric,
+ WordBreakExtendNumLet
+ };
+ enum SentenceBreak {
+ SentenceBreakOther,
+ SentenceBreakSep,
+ SentenceBreakFormat,
+ SentenceBreakSp,
+ SentenceBreakLower,
+ SentenceBreakUpper,
+ SentenceBreakOLetter,
+ SentenceBreakNumeric,
+ SentenceBreakATerm,
+ SentenceBreakSTerm,
+ SentenceBreakClose
+ };
+}
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QStringList;
+template <class T> class QList;
+struct QFontDef;
+class QFontEngine;
+class QFontDatabasePrivate;
+class __attribute__((visibility("default"))) QFontDatabase
+{
+ public: static const QMetaObject staticMetaObject; private:
+public:
+ enum WritingSystem {
+ Any,
+ Latin,
+ Greek,
+ Cyrillic,
+ Armenian,
+ Hebrew,
+ Arabic,
+ Syriac,
+ Thaana,
+ Devanagari,
+ Bengali,
+ Gurmukhi,
+ Gujarati,
+ Oriya,
+ Tamil,
+ Telugu,
+ Kannada,
+ Malayalam,
+ Sinhala,
+ Thai,
+ Lao,
+ Tibetan,
+ Myanmar,
+ Georgian,
+ Khmer,
+ SimplifiedChinese,
+ TraditionalChinese,
+ Japanese,
+ Korean,
+ Vietnamese,
+ Symbol,
+ Other = Symbol,
+ Ogham,
+ Runic,
+ WritingSystemsCount
+ };
+ static QList<int> standardSizes();
+ QFontDatabase();
+ QList<WritingSystem> writingSystems() const;
+ QList<WritingSystem> writingSystems(const QString &family) const;
+ QStringList families(WritingSystem writingSystem = Any) const;
+ QStringList styles(const QString &family) const;
+ QList<int> pointSizes(const QString &family, const QString &style = QString());
+ QList<int> smoothSizes(const QString &family, const QString &style);
+ QString styleString(const QFont &font);
+ QString styleString(const QFontInfo &fontInfo);
+ QFont font(const QString &family, const QString &style, int pointSize) const;
+ bool isBitmapScalable(const QString &family, const QString &style = QString()) const;
+ bool isSmoothlyScalable(const QString &family, const QString &style = QString()) const;
+ bool isScalable(const QString &family, const QString &style = QString()) const;
+ bool isFixedPitch(const QString &family, const QString &style = QString()) const;
+ bool italic(const QString &family, const QString &style) const;
+ bool bold(const QString &family, const QString &style) const;
+ int weight(const QString &family, const QString &style) const;
+ static QString writingSystemName(WritingSystem writingSystem);
+ static QString writingSystemSample(WritingSystem writingSystem);
+ static int addApplicationFont(const QString &fileName);
+ static int addApplicationFontFromData(const QByteArray &fontData);
+ static QStringList applicationFontFamilies(int id);
+ static bool removeApplicationFont(int id);
+ static bool removeAllApplicationFonts();
+ static bool supportsThreadedFontRendering();
+private:
+ static void createDatabase();
+ static void parseFontName(const QString &name, QString &foundry, QString &family);
+ static QFontEngine *findFont(int script, const QFontPrivate *fp, const QFontDef &request);
+ static void load(const QFontPrivate *d, int script);
+ friend struct QFontDef;
+ friend class QFontPrivate;
+ friend class QFontDialog;
+ friend class QFontDialogPrivate;
+ friend class QFontEngineMultiXLFD;
+ friend class QFontEngineMultiQWS;
+ QFontDatabasePrivate *d;
+};
+struct QFixed {
+public:
+ QFixed() : val(0) {}
+ QFixed(int i) : val(i<<6) {}
+ QFixed(long i) : val(i<<6) {}
+ QFixed &operator=(int i) { val = (i<<6); return *this; }
+ QFixed &operator=(long i) { val = (i<<6); return *this; }
+ static QFixed fromReal(qreal r) { QFixed f; f.val = (int)(r*qreal(64)); return f; }
+ static QFixed fromFixed(int fixed) { QFixed f; f.val = fixed; return f; }
+ inline int value() const { return val; }
+ inline void setValue(int value) { val = value; }
+ inline int toInt() const { return (((val)+32) & -64)>>6; }
+ inline qreal toReal() const { return ((qreal)val)/(qreal)64; }
+ inline int truncate() const { return val>>6; }
+ inline QFixed round() const { QFixed f; f.val = ((val)+32) & -64; return f; }
+ inline QFixed floor() const { QFixed f; f.val = (val) & -64; return f; }
+ inline QFixed ceil() const { QFixed f; f.val = (val+63) & -64; return f; }
+ inline QFixed operator+(int i) const { QFixed f; f.val = (val + (i<<6)); return f; }
+ inline QFixed operator+(uint i) const { QFixed f; f.val = (val + (i<<6)); return f; }
+ inline QFixed operator+(const QFixed &other) const { QFixed f; f.val = (val + other.val); return f; }
+ inline QFixed &operator+=(int i) { val += (i<<6); return *this; }
+ inline QFixed &operator+=(uint i) { val += (i<<6); return *this; }
+ inline QFixed &operator+=(const QFixed &other) { val += other.val; return *this; }
+ inline QFixed operator-(int i) const { QFixed f; f.val = (val - (i<<6)); return f; }
+ inline QFixed operator-(uint i) const { QFixed f; f.val = (val - (i<<6)); return f; }
+ inline QFixed operator-(const QFixed &other) const { QFixed f; f.val = (val - other.val); return f; }
+ inline QFixed &operator-=(int i) { val -= (i<<6); return *this; }
+ inline QFixed &operator-=(uint i) { val -= (i<<6); return *this; }
+ inline QFixed &operator-=(const QFixed &other) { val -= other.val; return *this; }
+ inline QFixed operator-() const { QFixed f; f.val = -val; return f; }
+ inline bool operator==(const QFixed &other) const { return val == other.val; }
+ inline bool operator!=(const QFixed &other) const { return val != other.val; }
+ inline bool operator<(const QFixed &other) const { return val < other.val; }
+ inline bool operator>(const QFixed &other) const { return val > other.val; }
+ inline bool operator<=(const QFixed &other) const { return val <= other.val; }
+ inline bool operator>=(const QFixed &other) const { return val >= other.val; }
+ inline bool operator!() const { return !val; }
+ inline QFixed &operator/=(int x) { val /= x; return *this; }
+ inline QFixed &operator/=(const QFixed &o) {
+ if (o.val == 0) {
+ val = 0x7FFFFFFFL;
+ } else {
+ bool neg = false;
+ qint64 a = val;
+ qint64 b = o.val;
+ if (a < 0) { a = -a; neg = true; }
+ if (b < 0) { b = -b; neg = !neg; }
+ int res = (int)(((a << 6) + (b >> 1)) / b);
+ val = (neg ? -res : res);
+ }
+ return *this;
+ }
+ inline QFixed operator/(int d) const { QFixed f; f.val = val/d; return f; }
+ inline QFixed operator/(QFixed b) const { QFixed f = *this; return (f /= b); }
+ inline QFixed operator>>(int d) const { QFixed f = *this; f.val >>= d; return f; }
+ inline QFixed &operator*=(int i) { val *= i; return *this; }
+ inline QFixed &operator*=(uint i) { val *= i; return *this; }
+ inline QFixed &operator*=(const QFixed &o) {
+ bool neg = false;
+ qint64 a = val;
+ qint64 b = o.val;
+ if (a < 0) { a = -a; neg = true; }
+ if (b < 0) { b = -b; neg = !neg; }
+ int res = (int)((a * b + 0x20L) >> 6);
+ val = neg ? -res : res;
+ return *this;
+ }
+ inline QFixed operator*(int i) const { QFixed f = *this; return (f *= i); }
+ inline QFixed operator*(uint i) const { QFixed f = *this; return (f *= i); }
+ inline QFixed operator*(const QFixed &o) const { QFixed f = *this; return (f *= o); }
+private:
+ QFixed(qreal i) : val((int)(i*qreal(64))) {}
+ QFixed &operator=(qreal i) { val = (int)(i*qreal(64)); return *this; }
+ inline QFixed operator+(qreal i) const { QFixed f; f.val = (val + (int)(i*qreal(64))); return f; }
+ inline QFixed &operator+=(qreal i) { val += (int)(i*64); return *this; }
+ inline QFixed operator-(qreal i) const { QFixed f; f.val = (val - (int)(i*qreal(64))); return f; }
+ inline QFixed &operator-=(qreal i) { val -= (int)(i*64); return *this; }
+ inline QFixed &operator/=(qreal r) { val = (int)(val/r); return *this; }
+ inline QFixed operator/(qreal d) const { QFixed f; f.val = (int)(val/d); return f; }
+ inline QFixed &operator*=(qreal d) { val = (int) (val*d); return *this; }
+ inline QFixed operator*(qreal d) const { QFixed f = *this; return (f *= d); }
+ int val;
+};
+template <> class QTypeInfo<QFixed> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QFixed)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QFixed"; } };
+inline int qRound(const QFixed &f) { return f.toInt(); }
+inline int qFloor(const QFixed &f) { return f.floor().truncate(); }
+inline QFixed operator*(int i, const QFixed &d) { return d*i; }
+inline QFixed operator+(int i, const QFixed &d) { return d+i; }
+inline QFixed operator-(int i, const QFixed &d) { return -(d-i); }
+inline QFixed operator*(uint i, const QFixed &d) { return d*i; }
+inline QFixed operator+(uint i, const QFixed &d) { return d+i; }
+inline QFixed operator-(uint i, const QFixed &d) { return -(d-i); }
+inline bool operator==(const QFixed &f, int i) { return f.value() == (i<<6); }
+inline bool operator==(int i, const QFixed &f) { return f.value() == (i<<6); }
+inline bool operator!=(const QFixed &f, int i) { return f.value() != (i<<6); }
+inline bool operator!=(int i, const QFixed &f) { return f.value() != (i<<6); }
+inline bool operator<=(const QFixed &f, int i) { return f.value() <= (i<<6); }
+inline bool operator<=(int i, const QFixed &f) { return (i<<6) <= f.value(); }
+inline bool operator>=(const QFixed &f, int i) { return f.value() >= (i<<6); }
+inline bool operator>=(int i, const QFixed &f) { return (i<<6) >= f.value(); }
+inline bool operator<(const QFixed &f, int i) { return f.value() < (i<<6); }
+inline bool operator<(int i, const QFixed &f) { return (i<<6) < f.value(); }
+inline bool operator>(const QFixed &f, int i) { return f.value() > (i<<6); }
+inline bool operator>(int i, const QFixed &f) { return (i<<6) > f.value(); }
+inline QDebug &operator<<(QDebug &dbg, const QFixed &f)
+{ return dbg << f.toReal(); }
+struct QFixedPoint {
+ QFixed x;
+ QFixed y;
+ inline QFixedPoint() {}
+ inline QFixedPoint(const QFixed &_x, const QFixed &_y) : x(_x), y(_y) {}
+ QPointF toPointF() const { return QPointF(x.toReal(), y.toReal()); }
+ static QFixedPoint fromPointF(const QPointF &p) {
+ return QFixedPoint(QFixed::fromReal(p.x()), QFixed::fromReal(p.y()));
+ }
+};
+template <> class QTypeInfo<QFixedPoint> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QFixedPoint)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QFixedPoint"; } };
+inline QFixedPoint operator-(const QFixedPoint &p1, const QFixedPoint &p2)
+{ return QFixedPoint(p1.x - p2.x, p1.y - p2.y); }
+inline QFixedPoint operator+(const QFixedPoint &p1, const QFixedPoint &p2)
+{ return QFixedPoint(p1.x + p2.x, p1.y + p2.y); }
+struct QFixedSize {
+ QFixed width;
+ QFixed height;
+ QSizeF toSizeF() const { return QSizeF(width.toReal(), height.toReal()); }
+ static QFixedSize fromSizeF(const QSizeF &s) {
+ QFixedSize size;
+ size.width = QFixed::fromReal(s.width());
+ size.height = QFixed::fromReal(s.height());
+ return size;
+ }
+};
+template <> class QTypeInfo<QFixedSize> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QFixedSize)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QFixedSize"; } };
+class QFontCache;
+class QFontEngine;
+struct QFontDef
+{
+ inline QFontDef()
+ : pointSize(-1.0), pixelSize(-1),
+ styleStrategy(QFont::PreferDefault), styleHint(QFont::AnyStyle),
+ weight(50), fixedPitch(false), style(QFont::StyleNormal), stretch(100),
+ ignorePitch(true)
+ {
+ }
+ QString family;
+ qreal pointSize;
+ int pixelSize;
+ uint styleStrategy : 16;
+ uint styleHint : 8;
+ uint weight : 7;
+ uint fixedPitch : 1;
+ uint style : 2;
+ uint stretch : 12;
+ uint ignorePitch : 1;
+ uint fixedPitchComputed : 1;
+ int reserved : 16;
+ bool exactMatch(const QFontDef &other) const;
+ bool operator==(const QFontDef &other) const
+ {
+ return pixelSize == other.pixelSize
+ && weight == other.weight
+ && style == other.style
+ && stretch == other.stretch
+ && styleHint == other.styleHint
+ && styleStrategy == other.styleStrategy
+ && ignorePitch == other.ignorePitch && fixedPitch == other.fixedPitch
+ && family == other.family
+ ;
+ }
+ inline bool operator<(const QFontDef &other) const
+ {
+ if (pixelSize != other.pixelSize) return pixelSize < other.pixelSize;
+ if (weight != other.weight) return weight < other.weight;
+ if (style != other.style) return style < other.style;
+ if (stretch != other.stretch) return stretch < other.stretch;
+ if (styleHint != other.styleHint) return styleHint < other.styleHint;
+ if (styleStrategy != other.styleStrategy) return styleStrategy < other.styleStrategy;
+ if (family != other.family) return family < other.family;
+ if (ignorePitch != other.ignorePitch) return ignorePitch < other.ignorePitch;
+ if (fixedPitch != other.fixedPitch) return fixedPitch < other.fixedPitch;
+ return false;
+ }
+};
+class QFontEngineData
+{
+public:
+ QFontEngineData();
+ ~QFontEngineData();
+ QAtomicInt ref;
+ QFontCache *fontCache;
+ QFontEngine *engines[QUnicodeTables::ScriptCount];
+};
+class __attribute__((visibility("default"))) QFontPrivate
+{
+public:
+ QFontPrivate();
+ QFontPrivate(const QFontPrivate &other);
+ ~QFontPrivate();
+ QFontEngine *engineForScript(int script) const;
+ void alterCharForCapitalization(QChar &c) const;
+ QAtomicInt ref;
+ QFontDef request;
+ mutable QFontEngineData *engineData;
+ int dpi;
+ int screen;
+ uint rawMode : 1;
+ uint underline : 1;
+ uint overline : 1;
+ uint strikeOut : 1;
+ uint kerning : 1;
+ uint capital : 3;
+ bool letterSpacingIsAbsolute : 1;
+ QFixed letterSpacing;
+ QFixed wordSpacing;
+ mutable QFontPrivate *scFont;
+ QFont smallCapsFont() const { return QFont(smallCapsFontPrivate()); }
+ QFontPrivate *smallCapsFontPrivate() const;
+ void resolve(uint mask, const QFontPrivate *other);
+private:
+ QFontPrivate &operator=(const QFontPrivate &) { return *this; }
+};
+class QFontCache : public QObject
+{
+ public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
+public:
+ static QFontCache *instance();
+ static void cleanup();
+ QFontCache();
+ ~QFontCache();
+ void clear();
+ void removeEngineForFont(const QByteArray &fontName);
+ struct Key {
+ Key() : script(0), screen(0) { }
+ Key(const QFontDef &d, int c, int s = 0)
+ : def(d), script(c), screen(s) { }
+ QFontDef def;
+ int script;
+ int screen;
+ inline bool operator<(const Key &other) const
+ {
+ if (script != other.script) return script < other.script;
+ if (screen != other.screen) return screen < other.screen;
+ return def < other.def;
+ }
+ inline bool operator==(const Key &other) const
+ { return def == other.def && script == other.script && screen == other.screen; }
+ };
+ typedef QMap<Key,QFontEngineData*> EngineDataCache;
+ EngineDataCache engineDataCache;
+ QFontEngineData *findEngineData(const Key &key) const;
+ void insertEngineData(const Key &key, QFontEngineData *engineData);
+ struct Engine {
+ Engine() : data(0), timestamp(0), hits(0) { }
+ Engine(QFontEngine *d) : data(d), timestamp(0), hits(0) { }
+ QFontEngine *data;
+ uint timestamp;
+ uint hits;
+ };
+ typedef QMap<Key,Engine> EngineCache;
+ EngineCache engineCache;
+ QFontEngine *findEngine(const Key &key);
+ void insertEngine(const Key &key, QFontEngine *engine);
+ void cleanupPrinterFonts();
+ private:
+ void increaseCost(uint cost);
+ void decreaseCost(uint cost);
+ void timerEvent(QTimerEvent *event);
+ static const uint min_cost;
+ uint total_cost, max_cost;
+ uint current_timestamp;
+ bool fast;
+ int timer_id;
+};
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QPainter;
+class QColorGroup;
+class QPalette;
+class QPoint;
+class QColor;
+class QBrush;
+class QRect;
+class QPixmap;
+__attribute__((visibility("default"))) void qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2,
+ const QPalette &pal, bool sunken = true,
+ int lineWidth = 1, int midLineWidth = 0);
+__attribute__((visibility("default"))) void qDrawShadeLine(QPainter *p, const QPoint &p1, const QPoint &p2,
+ const QPalette &pal, bool sunken = true,
+ int lineWidth = 1, int midLineWidth = 0);
+__attribute__((visibility("default"))) void qDrawShadeRect(QPainter *p, int x, int y, int w, int h,
+ const QPalette &pal, bool sunken = false,
+ int lineWidth = 1, int midLineWidth = 0,
+ const QBrush *fill = 0);
+__attribute__((visibility("default"))) void qDrawShadeRect(QPainter *p, const QRect &r,
+ const QPalette &pal, bool sunken = false,
+ int lineWidth = 1, int midLineWidth = 0,
+ const QBrush *fill = 0);
+__attribute__((visibility("default"))) void qDrawShadePanel(QPainter *p, int x, int y, int w, int h,
+ const QPalette &pal, bool sunken = false,
+ int lineWidth = 1, const QBrush *fill = 0);
+__attribute__((visibility("default"))) void qDrawShadePanel(QPainter *p, const QRect &r,
+ const QPalette &pal, bool sunken = false,
+ int lineWidth = 1, const QBrush *fill = 0);
+__attribute__((visibility("default"))) void qDrawWinButton(QPainter *p, int x, int y, int w, int h,
+ const QPalette &pal, bool sunken = false,
+ const QBrush *fill = 0);
+__attribute__((visibility("default"))) void qDrawWinButton(QPainter *p, const QRect &r,
+ const QPalette &pal, bool sunken = false,
+ const QBrush *fill = 0);
+__attribute__((visibility("default"))) void qDrawWinPanel(QPainter *p, int x, int y, int w, int h,
+ const QPalette &pal, bool sunken = false,
+ const QBrush *fill = 0);
+__attribute__((visibility("default"))) void qDrawWinPanel(QPainter *p, const QRect &r,
+ const QPalette &pal, bool sunken = false,
+ const QBrush *fill = 0);
+__attribute__((visibility("default"))) void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &,
+ int lineWidth = 1, const QBrush *fill = 0);
+__attribute__((visibility("default"))) void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &,
+ int lineWidth = 1, const QBrush *fill = 0);
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class __attribute__((visibility("default"))) QFontInfo
+{
+public:
+ QFontInfo(const QFont &);
+ QFontInfo(const QFontInfo &);
+ ~QFontInfo();
+ QFontInfo &operator=(const QFontInfo &);
+ QString family() const;
+ int pixelSize() const;
+ int pointSize() const;
+ qreal pointSizeF() const;
+ bool italic() const;
+ QFont::Style style() const;
+ int weight() const;
+ inline bool bold() const { return weight() > QFont::Normal; }
+ bool underline() const;
+ bool overline() const;
+ bool strikeOut() const;
+ bool fixedPitch() const;
+ QFont::StyleHint styleHint() const;
+ bool rawMode() const;
+ bool exactMatch() const;
+private:
+ QFontPrivate *d;
+};
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QFontEngine;
+class QTextCodec;
+class QRect;
+class __attribute__((visibility("default"))) QFontMetrics
+{
+public:
+ QFontMetrics(const QFont &);
+ QFontMetrics(const QFont &, QPaintDevice *pd);
+ QFontMetrics(const QFontMetrics &);
+ ~QFontMetrics();
+ QFontMetrics &operator=(const QFontMetrics &);
+ int ascent() const;
+ int descent() const;
+ int height() const;
+ int leading() const;
+ int lineSpacing() const;
+ int minLeftBearing() const;
+ int minRightBearing() const;
+ int maxWidth() const;
+ int xHeight() const;
+ int averageCharWidth() const;
+ bool inFont(QChar) const;
+ int leftBearing(QChar) const;
+ int rightBearing(QChar) const;
+ int width(const QString &, int len = -1) const;
+ int width(QChar) const;
+ int charWidth(const QString &str, int pos) const;
+ QRect boundingRect(QChar) const;
+ QRect boundingRect(const QString &text) const;
+ QRect boundingRect(const QRect &r, int flags, const QString &text, int tabstops=0, int *tabarray=0) const;
+ inline QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text,
+ int tabstops=0, int *tabarray=0) const
+ { return boundingRect(QRect(x, y, w, h), flags, text, tabstops, tabarray); }
+ QSize size(int flags, const QString& str, int tabstops=0, int *tabarray=0) const;
+ QRect tightBoundingRect(const QString &text) const;
+ QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags = 0) const;
+ int underlinePos() const;
+ int overlinePos() const;
+ int strikeOutPos() const;
+ int lineWidth() const;
+ bool operator==(const QFontMetrics &other);
+ bool operator==(const QFontMetrics &other) const;
+ inline bool operator !=(const QFontMetrics &other) { return !operator==(other); }
+ inline bool operator !=(const QFontMetrics &other) const { return !operator==(other); }
+private:
+ friend class QFontMetricsF;
+ friend class QStackTextEngine;
+ QFontPrivate *d;
+};
+class __attribute__((visibility("default"))) QFontMetricsF
+{
+public:
+ QFontMetricsF(const QFont &);
+ QFontMetricsF(const QFont &, QPaintDevice *pd);
+ QFontMetricsF(const QFontMetrics &);
+ QFontMetricsF(const QFontMetricsF &);
+ ~QFontMetricsF();
+ QFontMetricsF &operator=(const QFontMetricsF &);
+ QFontMetricsF &operator=(const QFontMetrics &);
+ qreal ascent() const;
+ qreal descent() const;
+ qreal height() const;
+ qreal leading() const;
+ qreal lineSpacing() const;
+ qreal minLeftBearing() const;
+ qreal minRightBearing() const;
+ qreal maxWidth() const;
+ qreal xHeight() const;
+ qreal averageCharWidth() const;
+ bool inFont(QChar) const;
+ qreal leftBearing(QChar) const;
+ qreal rightBearing(QChar) const;
+ qreal width(const QString &string) const;
+ qreal width(QChar) const;
+ QRectF boundingRect(const QString &string) const;
+ QRectF boundingRect(QChar) const;
+ QRectF boundingRect(const QRectF &r, int flags, const QString& string, int tabstops=0, int *tabarray=0) const;
+ QSizeF size(int flags, const QString& str, int tabstops=0, int *tabarray=0) const;
+ QRectF tightBoundingRect(const QString &text) const;
+ QString elidedText(const QString &text, Qt::TextElideMode mode, qreal width, int flags = 0) const;
+ qreal underlinePos() const;
+ qreal overlinePos() const;
+ qreal strikeOutPos() const;
+ qreal lineWidth() const;
+ bool operator==(const QFontMetricsF &other);
+ bool operator==(const QFontMetricsF &other) const;
+ inline bool operator !=(const QFontMetricsF &other) { return !operator==(other); }
+ inline bool operator !=(const QFontMetricsF &other) const { return !operator==(other); }
+private:
+ QFontPrivate *d;
+};
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QBrush;
+class QFontInfo;
+class QFontMetrics;
+class QPaintDevice;
+class QPainterPath;
+class QPainterPrivate;
+class QPen;
+class QPolygon;
+class QTextItem;
+class QMatrix;
+class QTransform;
+class __attribute__((visibility("default"))) QPainter
+{
+ inline QPainterPrivate* d_func() { return reinterpret_cast<QPainterPrivate *>(d_ptr); } inline const QPainterPrivate* d_func() const { return reinterpret_cast<const QPainterPrivate *>(d_ptr); } friend class QPainterPrivate;
+ public: static const QMetaObject staticMetaObject; private:
+public:
+ enum RenderHint {
+ Antialiasing = 0x01,
+ TextAntialiasing = 0x02,
+ SmoothPixmapTransform = 0x04,
+ HighQualityAntialiasing = 0x08,
+ NonCosmeticDefaultPen = 0x10
+ };
+ typedef QFlags<RenderHint> RenderHints;
+ QPainter();
+ explicit QPainter(QPaintDevice *);
+ ~QPainter();
+ QPaintDevice *device() const;
+ bool begin(QPaintDevice *);
+ bool end();
+ bool isActive() const;
+ void initFrom(const QWidget *widget);
+ enum CompositionMode {
+ CompositionMode_SourceOver,
+ CompositionMode_DestinationOver,
+ CompositionMode_Clear,
+ CompositionMode_Source,
+ CompositionMode_Destination,
+ CompositionMode_SourceIn,
+ CompositionMode_DestinationIn,
+ CompositionMode_SourceOut,
+ CompositionMode_DestinationOut,
+ CompositionMode_SourceAtop,
+ CompositionMode_DestinationAtop,
+ CompositionMode_Xor,
+ CompositionMode_Plus,
+ CompositionMode_Multiply,
+ CompositionMode_Screen,
+ CompositionMode_Overlay,
+ CompositionMode_Darken,
+ CompositionMode_Lighten,
+ CompositionMode_ColorDodge,
+ CompositionMode_ColorBurn,
+ CompositionMode_HardLight,
+ CompositionMode_SoftLight,
+ CompositionMode_Difference,
+ CompositionMode_Exclusion,
+ RasterOp_SourceOrDestination,
+ RasterOp_SourceAndDestination,
+ RasterOp_SourceXorDestination,
+ RasterOp_NotSourceAndNotDestination,
+ RasterOp_NotSourceOrNotDestination,
+ RasterOp_NotSourceXorDestination,
+ RasterOp_NotSource,
+ RasterOp_NotSourceAndDestination,
+ RasterOp_SourceAndNotDestination
+ };
+ void setCompositionMode(CompositionMode mode);
+ CompositionMode compositionMode() const;
+ const QFont &font() const;
+ void setFont(const QFont &f);
+ QFontMetrics fontMetrics() const;
+ QFontInfo fontInfo() const;
+ void setPen(const QColor &color);
+ void setPen(const QPen &pen);
+ void setPen(Qt::PenStyle style);
+ const QPen &pen() const;
+ void setBrush(const QBrush &brush);
+ void setBrush(Qt::BrushStyle style);
+ const QBrush &brush() const;
+ void setBackgroundMode(Qt::BGMode mode);
+ Qt::BGMode backgroundMode() const;
+ QPoint brushOrigin() const;
+ inline void setBrushOrigin(int x, int y);
+ inline void setBrushOrigin(const QPoint &);
+ void setBrushOrigin(const QPointF &);
+ void setBackground(const QBrush &bg);
+ const QBrush &background() const;
+ qreal opacity() const;
+ void setOpacity(qreal opacity);
+ QRegion clipRegion() const;
+ QPainterPath clipPath() const;
+ void setClipRect(const QRectF &, Qt::ClipOperation op = Qt::ReplaceClip);
+ void setClipRect(const QRect &, Qt::ClipOperation op = Qt::ReplaceClip);
+ inline void setClipRect(int x, int y, int w, int h, Qt::ClipOperation op = Qt::ReplaceClip);
+ void setClipRegion(const QRegion &, Qt::ClipOperation op = Qt::ReplaceClip);
+ void setClipPath(const QPainterPath &path, Qt::ClipOperation op = Qt::ReplaceClip);
+ void setClipping(bool enable);
+ bool hasClipping() const;
+ void save();
+ void restore();
+ void setMatrix(const QMatrix &matrix, bool combine = false);
+ const QMatrix &matrix() const;
+ const QMatrix &deviceMatrix() const;
+ void resetMatrix();
+ void setTransform(const QTransform &transform, bool combine = false);
+ const QTransform &transform() const;
+ const QTransform &deviceTransform() const;
+ void resetTransform();
+ void setWorldMatrix(const QMatrix &matrix, bool combine = false);
+ const QMatrix &worldMatrix() const;
+ void setWorldTransform(const QTransform &matrix, bool combine = false);
+ const QTransform &worldTransform() const;
+ QMatrix combinedMatrix() const;
+ QTransform combinedTransform() const;
+ void setMatrixEnabled(bool enabled);
+ bool matrixEnabled() const;
+ void setWorldMatrixEnabled(bool enabled);
+ bool worldMatrixEnabled() const;
+ void scale(qreal sx, qreal sy);
+ void shear(qreal sh, qreal sv);
+ void rotate(qreal a);
+ void translate(const QPointF &offset);
+ inline void translate(const QPoint &offset);
+ inline void translate(qreal dx, qreal dy);
+ QRect window() const;
+ void setWindow(const QRect &window);
+ inline void setWindow(int x, int y, int w, int h);
+ QRect viewport() const;
+ void setViewport(const QRect &viewport);
+ inline void setViewport(int x, int y, int w, int h);
+ void setViewTransformEnabled(bool enable);
+ bool viewTransformEnabled() const;
+ void strokePath(const QPainterPath &path, const QPen &pen);
+ void fillPath(const QPainterPath &path, const QBrush &brush);
+ void drawPath(const QPainterPath &path);
+ inline void drawPoint(const QPointF &pt);
+ inline void drawPoint(const QPoint &p);
+ inline void drawPoint(int x, int y);
+ void drawPoints(const QPointF *points, int pointCount);
+ inline void drawPoints(const QPolygonF &points);
+ void drawPoints(const QPoint *points, int pointCount);
+ inline void drawPoints(const QPolygon &points);
+ inline void drawLine(const QLineF &line);
+ inline void drawLine(const QLine &line);
+ inline void drawLine(int x1, int y1, int x2, int y2);
+ inline void drawLine(const QPoint &p1, const QPoint &p2);
+ inline void drawLine(const QPointF &p1, const QPointF &p2);
+ void drawLines(const QLineF *lines, int lineCount);
+ inline void drawLines(const QVector<QLineF> &lines);
+ void drawLines(const QPointF *pointPairs, int lineCount);
+ inline void drawLines(const QVector<QPointF> &pointPairs);
+ void drawLines(const QLine *lines, int lineCount);
+ inline void drawLines(const QVector<QLine> &lines);
+ void drawLines(const QPoint *pointPairs, int lineCount);
+ inline void drawLines(const QVector<QPoint> &pointPairs);
+ inline void drawRect(const QRectF &rect);
+ inline void drawRect(int x1, int y1, int w, int h);
+ inline void drawRect(const QRect &rect);
+ void drawRects(const QRectF *rects, int rectCount);
+ inline void drawRects(const QVector<QRectF> &rectangles);
+ void drawRects(const QRect *rects, int rectCount);
+ inline void drawRects(const QVector<QRect> &rectangles);
+ void drawEllipse(const QRectF &r);
+ void drawEllipse(const QRect &r);
+ inline void drawEllipse(int x, int y, int w, int h);
+ inline void drawEllipse(const QPointF ¢er, qreal rx, qreal ry);
+ inline void drawEllipse(const QPoint ¢er, int rx, int ry);
+ void drawPolyline(const QPointF *points, int pointCount);
+ inline void drawPolyline(const QPolygonF &polyline);
+ void drawPolyline(const QPoint *points, int pointCount);
+ inline void drawPolyline(const QPolygon &polygon);
+ void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule = Qt::OddEvenFill);
+ inline void drawPolygon(const QPolygonF &polygon, Qt::FillRule fillRule = Qt::OddEvenFill);
+ void drawPolygon(const QPoint *points, int pointCount, Qt::FillRule fillRule = Qt::OddEvenFill);
+ inline void drawPolygon(const QPolygon &polygon, Qt::FillRule fillRule = Qt::OddEvenFill);
+ void drawConvexPolygon(const QPointF *points, int pointCount);
+ inline void drawConvexPolygon(const QPolygonF &polygon);
+ void drawConvexPolygon(const QPoint *points, int pointCount);
+ inline void drawConvexPolygon(const QPolygon &polygon);
+ void drawArc(const QRectF &rect, int a, int alen);
+ inline void drawArc(const QRect &, int a, int alen);
+ inline void drawArc(int x, int y, int w, int h, int a, int alen);
+ void drawPie(const QRectF &rect, int a, int alen);
+ inline void drawPie(int x, int y, int w, int h, int a, int alen);
+ inline void drawPie(const QRect &, int a, int alen);
+ void drawChord(const QRectF &rect, int a, int alen);
+ inline void drawChord(int x, int y, int w, int h, int a, int alen);
+ inline void drawChord(const QRect &, int a, int alen);
+ void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius,
+ Qt::SizeMode mode = Qt::AbsoluteSize);
+ inline void drawRoundedRect(int x, int y, int w, int h, qreal xRadius, qreal yRadius,
+ Qt::SizeMode mode = Qt::AbsoluteSize);
+ inline void drawRoundedRect(const QRect &rect, qreal xRadius, qreal yRadius,
+ Qt::SizeMode mode = Qt::AbsoluteSize);
+ void drawRoundRect(const QRectF &r, int xround = 25, int yround = 25);
+ inline void drawRoundRect(int x, int y, int w, int h, int = 25, int = 25);
+ inline void drawRoundRect(const QRect &r, int xround = 25, int yround = 25);
+ void drawTiledPixmap(const QRectF &rect, const QPixmap &pm, const QPointF &offset = QPointF());
+ inline void drawTiledPixmap(int x, int y, int w, int h, const QPixmap &, int sx=0, int sy=0);
+ inline void drawTiledPixmap(const QRect &, const QPixmap &, const QPoint & = QPoint());
+ void drawPicture(const QPointF &p, const QPicture &picture);
+ inline void drawPicture(int x, int y, const QPicture &picture);
+ inline void drawPicture(const QPoint &p, const QPicture &picture);
+ void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect);
+ inline void drawPixmap(const QRect &targetRect, const QPixmap &pixmap, const QRect &sourceRect);
+ inline void drawPixmap(int x, int y, int w, int h, const QPixmap &pm,
+ int sx, int sy, int sw, int sh);
+ inline void drawPixmap(int x, int y, const QPixmap &pm,
+ int sx, int sy, int sw, int sh);
+ inline void drawPixmap(const QPointF &p, const QPixmap &pm, const QRectF &sr);
+ inline void drawPixmap(const QPoint &p, const QPixmap &pm, const QRect &sr);
+ void drawPixmap(const QPointF &p, const QPixmap &pm);
+ inline void drawPixmap(const QPoint &p, const QPixmap &pm);
+ inline void drawPixmap(int x, int y, const QPixmap &pm);
+ inline void drawPixmap(const QRect &r, const QPixmap &pm);
+ inline void drawPixmap(int x, int y, int w, int h, const QPixmap &pm);
+ void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect,
+ Qt::ImageConversionFlags flags = Qt::AutoColor);
+ inline void drawImage(const QRect &targetRect, const QImage &image, const QRect &sourceRect,
+ Qt::ImageConversionFlags flags = Qt::AutoColor);
+ inline void drawImage(const QPointF &p, const QImage &image, const QRectF &sr,
+ Qt::ImageConversionFlags flags = Qt::AutoColor);
+ inline void drawImage(const QPoint &p, const QImage &image, const QRect &sr,
+ Qt::ImageConversionFlags flags = Qt::AutoColor);
+ inline void drawImage(const QRectF &r, const QImage &image);
+ inline void drawImage(const QRect &r, const QImage &image);
+ void drawImage(const QPointF &p, const QImage &image);
+ inline void drawImage(const QPoint &p, const QImage &image);
+ inline void drawImage(int x, int y, const QImage &image, int sx = 0, int sy = 0,
+ int sw = -1, int sh = -1, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ void setLayoutDirection(Qt::LayoutDirection direction);
+ Qt::LayoutDirection layoutDirection() const;
+ void drawText(const QPointF &p, const QString &s);
+ inline void drawText(const QPoint &p, const QString &s);
+ inline void drawText(int x, int y, const QString &s);
+ void drawText(const QPointF &p, const QString &str, int tf, int justificationPadding);
+ void drawText(const QRectF &r, int flags, const QString &text, QRectF *br=0);
+ void drawText(const QRect &r, int flags, const QString &text, QRect *br=0);
+ inline void drawText(int x, int y, int w, int h, int flags, const QString &text, QRect *br=0);
+ void drawText(const QRectF &r, const QString &text, const QTextOption &o = QTextOption());
+ QRectF boundingRect(const QRectF &rect, int flags, const QString &text);
+ QRect boundingRect(const QRect &rect, int flags, const QString &text);
+ inline QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text);
+ QRectF boundingRect(const QRectF &rect, const QString &text, const QTextOption &o = QTextOption());
+ void drawTextItem(const QPointF &p, const QTextItem &ti);
+ inline void drawTextItem(int x, int y, const QTextItem &ti);
+ inline void drawTextItem(const QPoint &p, const QTextItem &ti);
+ void fillRect(const QRectF &, const QBrush &);
+ inline void fillRect(int x, int y, int w, int h, const QBrush &);
+ void fillRect(const QRect &, const QBrush &);
+ void fillRect(const QRectF &, const QColor &color);
+ inline void fillRect(int x, int y, int w, int h, const QColor &color);
+ void fillRect(const QRect &, const QColor &color);
+ inline void fillRect(int x, int y, int w, int h, Qt::GlobalColor c);
+ inline void fillRect(const QRect &r, Qt::GlobalColor c);
+ inline void fillRect(const QRectF &r, Qt::GlobalColor c);
+ inline void fillRect(int x, int y, int w, int h, Qt::BrushStyle style);
+ inline void fillRect(const QRect &r, Qt::BrushStyle style);
+ inline void fillRect(const QRectF &r, Qt::BrushStyle style);
+ void eraseRect(const QRectF &);
+ inline void eraseRect(int x, int y, int w, int h);
+ inline void eraseRect(const QRect &);
+ void setRenderHint(RenderHint hint, bool on = true);
+ void setRenderHints(RenderHints hints, bool on = true);
+ RenderHints renderHints() const;
+ inline bool testRenderHint(RenderHint hint) const { return renderHints() & hint; }
+ QPaintEngine *paintEngine() const;
+ static void setRedirected(const QPaintDevice *device, QPaintDevice *replacement,
+ const QPoint& offset = QPoint());
+ static QPaintDevice *redirected(const QPaintDevice *device, QPoint *offset = 0);
+ static void restoreRedirected(const QPaintDevice *device);
+private:
+ QPainter(const QPainter &); QPainter &operator=(const QPainter &);
+ friend class Q3Painter;
+ QPainterPrivate *d_ptr;
+ friend class QFontEngine;
+ friend class QFontEngineBox;
+ friend class QFontEngineFT;
+ friend class QFontEngineMac;
+ friend class QFontEngineWin;
+ friend class QFontEngineXLFD;
+ friend class QWSManager;
+ friend class QPaintEngine;
+ friend class QOpenGLPaintEngine;
+ friend class QX11PaintEngine;
+ friend class QX11PaintEnginePrivate;
+ friend class QWin32PaintEngine;
+ friend class QWin32PaintEnginePrivate;
+ friend class QRasterPaintEngine;
+ friend class QAlphaPaintEngine;
+ friend class QPreviewPaintEngine;
+};
+inline QFlags<QPainter::RenderHints::enum_type> operator|(QPainter::RenderHints::enum_type f1, QPainter::RenderHints::enum_type f2) { return QFlags<QPainter::RenderHints::enum_type>(f1) | f2; } inline QFlags<QPainter::RenderHints::enum_type> operator|(QPainter::RenderHints::enum_type f1, QFlags<QPainter::RenderHints::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QPainter::RenderHints::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline void QPainter::drawLine(const QLineF &l)
+{
+ drawLines(&l, 1);
+}
+inline void QPainter::drawLine(const QLine &line)
+{
+ drawLines(&line, 1);
+}
+inline void QPainter::drawLine(int x1, int y1, int x2, int y2)
+{
+ QLine l(x1, y1, x2, y2);
+ drawLines(&l, 1);
+}
+inline void QPainter::drawLine(const QPoint &p1, const QPoint &p2)
+{
+ QLine l(p1, p2);
+ drawLines(&l, 1);
+}
+inline void QPainter::drawLine(const QPointF &p1, const QPointF &p2)
+{
+ drawLine(QLineF(p1, p2));
+}
+inline void QPainter::drawLines(const QVector<QLineF> &lines)
+{
+ drawLines(lines.constData(), lines.size());
+}
+inline void QPainter::drawLines(const QVector<QLine> &lines)
+{
+ drawLines(lines.constData(), lines.size());
+}
+inline void QPainter::drawLines(const QVector<QPointF> &pointPairs)
+{
+ drawLines(pointPairs.constData(), pointPairs.size() / 2);
+}
+inline void QPainter::drawLines(const QVector<QPoint> &pointPairs)
+{
+ drawLines(pointPairs.constData(), pointPairs.size() / 2);
+}
+inline void QPainter::drawPolyline(const QPolygonF &polyline)
+{
+ drawPolyline(polyline.constData(), polyline.size());
+}
+inline void QPainter::drawPolyline(const QPolygon &polyline)
+{
+ drawPolyline(polyline.constData(), polyline.size());
+}
+inline void QPainter::drawPolygon(const QPolygonF &polygon, Qt::FillRule fillRule)
+{
+ drawPolygon(polygon.constData(), polygon.size(), fillRule);
+}
+inline void QPainter::drawPolygon(const QPolygon &polygon, Qt::FillRule fillRule)
+{
+ drawPolygon(polygon.constData(), polygon.size(), fillRule);
+}
+inline void QPainter::drawConvexPolygon(const QPolygonF &poly)
+{
+ drawConvexPolygon(poly.constData(), poly.size());
+}
+inline void QPainter::drawConvexPolygon(const QPolygon &poly)
+{
+ drawConvexPolygon(poly.constData(), poly.size());
+}
+inline void QPainter::drawRect(const QRectF &rect)
+{
+ drawRects(&rect, 1);
+}
+inline void QPainter::drawRect(int x, int y, int w, int h)
+{
+ QRect r(x, y, w, h);
+ drawRects(&r, 1);
+}
+inline void QPainter::drawRect(const QRect &r)
+{
+ drawRects(&r, 1);
+}
+inline void QPainter::drawRects(const QVector<QRectF> &rects)
+{
+ drawRects(rects.constData(), rects.size());
+}
+inline void QPainter::drawRects(const QVector<QRect> &rects)
+{
+ drawRects(rects.constData(), rects.size());
+}
+inline void QPainter::drawPoint(const QPointF &p)
+{
+ drawPoints(&p, 1);
+}
+inline void QPainter::drawPoint(int x, int y)
+{
+ QPoint p(x, y);
+ drawPoints(&p, 1);
+}
+inline void QPainter::drawPoint(const QPoint &p)
+{
+ drawPoints(&p, 1);
+}
+inline void QPainter::drawPoints(const QPolygonF &points)
+{
+ drawPoints(points.constData(), points.size());
+}
+inline void QPainter::drawPoints(const QPolygon &points)
+{
+ drawPoints(points.constData(), points.size());
+}
+inline void QPainter::drawRoundRect(int x, int y, int w, int h, int xRnd, int yRnd)
+{
+ drawRoundRect(QRectF(x, y, w, h), xRnd, yRnd);
+}
+inline void QPainter::drawRoundRect(const QRect &rect, int xRnd, int yRnd)
+{
+ drawRoundRect(QRectF(rect), xRnd, yRnd);
+}
+inline void QPainter::drawRoundedRect(int x, int y, int w, int h, qreal xRadius, qreal yRadius,
+ Qt::SizeMode mode)
+{
+ drawRoundedRect(QRectF(x, y, w, h), xRadius, yRadius, mode);
+}
+inline void QPainter::drawRoundedRect(const QRect &rect, qreal xRadius, qreal yRadius,
+ Qt::SizeMode mode)
+{
+ drawRoundedRect(QRectF(rect), xRadius, yRadius, mode);
+}
+inline void QPainter::drawEllipse(int x, int y, int w, int h)
+{
+ drawEllipse(QRect(x, y, w, h));
+}
+inline void QPainter::drawEllipse(const QPointF ¢er, qreal rx, qreal ry)
+{
+ drawEllipse(QRectF(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
+}
+inline void QPainter::drawEllipse(const QPoint ¢er, int rx, int ry)
+{
+ drawEllipse(QRect(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
+}
+inline void QPainter::drawArc(const QRect &r, int a, int alen)
+{
+ drawArc(QRectF(r), a, alen);
+}
+inline void QPainter::drawArc(int x, int y, int w, int h, int a, int alen)
+{
+ drawArc(QRectF(x, y, w, h), a, alen);
+}
+inline void QPainter::drawPie(const QRect &rect, int a, int alen)
+{
+ drawPie(QRectF(rect), a, alen);
+}
+inline void QPainter::drawPie(int x, int y, int w, int h, int a, int alen)
+{
+ drawPie(QRectF(x, y, w, h), a, alen);
+}
+inline void QPainter::drawChord(const QRect &rect, int a, int alen)
+{
+ drawChord(QRectF(rect), a, alen);
+}
+inline void QPainter::drawChord(int x, int y, int w, int h, int a, int alen)
+{
+ drawChord(QRectF(x, y, w, h), a, alen);
+}
+inline void QPainter::setClipRect(int x, int y, int w, int h, Qt::ClipOperation op)
+{
+ setClipRect(QRect(x, y, w, h), op);
+}
+inline void QPainter::eraseRect(const QRect &rect)
+{
+ eraseRect(QRectF(rect));
+}
+inline void QPainter::eraseRect(int x, int y, int w, int h)
+{
+ eraseRect(QRectF(x, y, w, h));
+}
+inline void QPainter::fillRect(int x, int y, int w, int h, const QBrush &b)
+{
+ fillRect(QRect(x, y, w, h), b);
+}
+inline void QPainter::fillRect(int x, int y, int w, int h, const QColor &b)
+{
+ fillRect(QRect(x, y, w, h), b);
+}
+inline void QPainter::fillRect(int x, int y, int w, int h, Qt::GlobalColor c)
+{
+ fillRect(QRect(x, y, w, h), QColor(c));
+}
+inline void QPainter::fillRect(const QRect &r, Qt::GlobalColor c)
+{
+ fillRect(r, QColor(c));
+}
+inline void QPainter::fillRect(const QRectF &r, Qt::GlobalColor c)
+{
+ fillRect(r, QColor(c));
+}
+inline void QPainter::fillRect(int x, int y, int w, int h, Qt::BrushStyle style)
+{
+ fillRect(QRectF(x, y, w, h), QBrush(style));
+}
+inline void QPainter::fillRect(const QRect &r, Qt::BrushStyle style)
+{
+ fillRect(QRectF(r), QBrush(style));
+}
+inline void QPainter::fillRect(const QRectF &r, Qt::BrushStyle style)
+{
+ fillRect(r, QBrush(style));
+}
+inline void QPainter::setBrushOrigin(int x, int y)
+{
+ setBrushOrigin(QPoint(x, y));
+}
+inline void QPainter::setBrushOrigin(const QPoint &p)
+{
+ setBrushOrigin(QPointF(p));
+}
+inline void QPainter::drawTiledPixmap(const QRect &rect, const QPixmap &pm, const QPoint &offset)
+{
+ drawTiledPixmap(QRectF(rect), pm, QPointF(offset));
+}
+inline void QPainter::drawTiledPixmap(int x, int y, int w, int h, const QPixmap &pm, int sx, int sy)
+{
+ drawTiledPixmap(QRectF(x, y, w, h), pm, QPointF(sx, sy));
+}
+inline void QPainter::drawPixmap(const QRect &targetRect, const QPixmap &pixmap, const QRect &sourceRect)
+{
+ drawPixmap(QRectF(targetRect), pixmap, QRectF(sourceRect));
+}
+inline void QPainter::drawPixmap(const QPoint &p, const QPixmap &pm)
+{
+ drawPixmap(QPointF(p), pm);
+}
+inline void QPainter::drawPixmap(const QRect &r, const QPixmap &pm)
+{
+ drawPixmap(QRectF(r), pm, QRectF());
+}
+inline void QPainter::drawPixmap(int x, int y, const QPixmap &pm)
+{
+ drawPixmap(QPointF(x, y), pm);
+}
+inline void QPainter::drawPixmap(int x, int y, int w, int h, const QPixmap &pm)
+{
+ drawPixmap(QRectF(x, y, w, h), pm, QRectF());
+}
+inline void QPainter::drawPixmap(int x, int y, int w, int h, const QPixmap &pm,
+ int sx, int sy, int sw, int sh)
+{
+ drawPixmap(QRectF(x, y, w, h), pm, QRectF(sx, sy, sw, sh));
+}
+inline void QPainter::drawPixmap(int x, int y, const QPixmap &pm,
+ int sx, int sy, int sw, int sh)
+{
+ drawPixmap(QRectF(x, y, -1, -1), pm, QRectF(sx, sy, sw, sh));
+}
+inline void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm, const QRectF &sr)
+{
+ drawPixmap(QRectF(p.x(), p.y(), -1, -1), pm, sr);
+}
+inline void QPainter::drawPixmap(const QPoint &p, const QPixmap &pm, const QRect &sr)
+{
+ drawPixmap(QRectF(p.x(), p.y(), -1, -1), pm, sr);
+}
+inline void QPainter::drawTextItem(int x, int y, const QTextItem &ti)
+{
+ drawTextItem(QPointF(x, y), ti);
+}
+inline void QPainter::drawImage(const QRect &targetRect, const QImage &image, const QRect &sourceRect,
+ Qt::ImageConversionFlags flags)
+{
+ drawImage(QRectF(targetRect), image, QRectF(sourceRect), flags);
+}
+inline void QPainter::drawImage(const QPointF &p, const QImage &image, const QRectF &sr,
+ Qt::ImageConversionFlags flags)
+{
+ drawImage(QRectF(p.x(), p.y(), -1, -1), image, sr, flags);
+}
+inline void QPainter::drawImage(const QPoint &p, const QImage &image, const QRect &sr,
+ Qt::ImageConversionFlags flags)
+{
+ drawImage(QRect(p.x(), p.y(), -1, -1), image, sr, flags);
+}
+inline void QPainter::drawImage(const QRectF &r, const QImage &image)
+{
+ drawImage(r, image, QRect(0, 0, image.width(), image.height()));
+}
+inline void QPainter::drawImage(const QRect &r, const QImage &image)
+{
+ drawImage(r, image, QRectF(0, 0, image.width(), image.height()));
+}
+inline void QPainter::drawImage(const QPoint &p, const QImage &image)
+{
+ drawImage(QPointF(p), image);
+}
+inline void QPainter::drawImage(int x, int y, const QImage &image, int sx, int sy, int sw, int sh,
+ Qt::ImageConversionFlags flags)
+{
+ if (sx == 0 && sy == 0 && sw == -1 && sh == -1 && flags == Qt::AutoColor)
+ drawImage(QPointF(x, y), image);
+ else
+ drawImage(QRectF(x, y, -1, -1), image, QRectF(sx, sy, sw, sh), flags);
+}
+inline void QPainter::drawTextItem(const QPoint &p, const QTextItem &ti)
+{
+ drawTextItem(QPointF(p), ti);
+}
+inline void QPainter::drawText(const QPoint &p, const QString &s)
+{
+ drawText(QPointF(p), s);
+}
+inline void QPainter::drawText(int x, int y, int w, int h, int flags, const QString &str, QRect *br)
+{
+ drawText(QRect(x, y, w, h), flags, str, br);
+}
+inline void QPainter::drawText(int x, int y, const QString &s)
+{
+ drawText(QPointF(x, y), s);
+}
+inline QRect QPainter::boundingRect(int x, int y, int w, int h, int flags, const QString &text)
+{
+ return boundingRect(QRect(x, y, w, h), flags, text);
+}
+inline void QPainter::translate(qreal dx, qreal dy)
+{
+ translate(QPointF(dx, dy));
+}
+inline void QPainter::translate(const QPoint &offset)
+{
+ translate(offset.x(), offset.y());
+}
+inline void QPainter::setViewport(int x, int y, int w, int h)
+{
+ setViewport(QRect(x, y, w, h));
+}
+inline void QPainter::setWindow(int x, int y, int w, int h)
+{
+ setWindow(QRect(x, y, w, h));
+}
+inline void QPainter::drawPicture(int x, int y, const QPicture &p)
+{
+ drawPicture(QPoint(x, y), p);
+}
+inline void QPainter::drawPicture(const QPoint &pt, const QPicture &p)
+{
+ drawPicture(QPointF(pt), p);
+}
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QFontEngine;
+class QLineF;
+class QPaintDevice;
+class QPaintEnginePrivate;
+class QPainterPath;
+class QPointF;
+class QPolygonF;
+class QRectF;
+struct QGlyphLayout;
+class QTextItemInt;
+class QPaintEngineState;
+class __attribute__((visibility("default"))) QTextItem {
+public:
+ enum RenderFlag {
+ RightToLeft = 0x1,
+ Overline = 0x10,
+ Underline = 0x20,
+ StrikeOut = 0x40,
+ Dummy = 0xffffffff
+ };
+ typedef QFlags<RenderFlag> RenderFlags;
+ qreal descent() const;
+ qreal ascent() const;
+ qreal width() const;
+ RenderFlags renderFlags() const;
+ QString text() const;
+ QFont font() const;
+};
+template <> class QTypeInfo<QTextItem> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QTextItem)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QTextItem"; } };
+class __attribute__((visibility("default"))) QPaintEngine
+{
+ inline QPaintEnginePrivate* d_func() { return reinterpret_cast<QPaintEnginePrivate *>(d_ptr); } inline const QPaintEnginePrivate* d_func() const { return reinterpret_cast<const QPaintEnginePrivate *>(d_ptr); } friend class QPaintEnginePrivate;
+public:
+ enum PaintEngineFeature {
+ PrimitiveTransform = 0x00000001,
+ PatternTransform = 0x00000002,
+ PixmapTransform = 0x00000004,
+ PatternBrush = 0x00000008,
+ LinearGradientFill = 0x00000010,
+ RadialGradientFill = 0x00000020,
+ ConicalGradientFill = 0x00000040,
+ AlphaBlend = 0x00000080,
+ PorterDuff = 0x00000100,
+ PainterPaths = 0x00000200,
+ Antialiasing = 0x00000400,
+ BrushStroke = 0x00000800,
+ ConstantOpacity = 0x00001000,
+ MaskedBrush = 0x00002000,
+ PerspectiveTransform = 0x00004000,
+ BlendModes = 0x00008000,
+ ObjectBoundingModeGradients = 0x00010000,
+ RasterOpModes = 0x00020000,
+ PaintOutsidePaintEvent = 0x20000000,
+ AllFeatures = 0xffffffff
+ };
+ typedef QFlags<PaintEngineFeature> PaintEngineFeatures;
+ enum DirtyFlag {
+ DirtyPen = 0x0001,
+ DirtyBrush = 0x0002,
+ DirtyBrushOrigin = 0x0004,
+ DirtyFont = 0x0008,
+ DirtyBackground = 0x0010,
+ DirtyBackgroundMode = 0x0020,
+ DirtyTransform = 0x0040,
+ DirtyClipRegion = 0x0080,
+ DirtyClipPath = 0x0100,
+ DirtyHints = 0x0200,
+ DirtyCompositionMode = 0x0400,
+ DirtyClipEnabled = 0x0800,
+ DirtyOpacity = 0x1000,
+ AllDirty = 0xffff
+ };
+ typedef QFlags<DirtyFlag> DirtyFlags;
+ enum PolygonDrawMode {
+ OddEvenMode,
+ WindingMode,
+ ConvexMode,
+ PolylineMode
+ };
+ explicit QPaintEngine(PaintEngineFeatures features=0);
+ virtual ~QPaintEngine();
+ bool isActive() const { return active; }
+ void setActive(bool newState) { active = newState; }
+ virtual bool begin(QPaintDevice *pdev) = 0;
+ virtual bool end() = 0;
+ virtual void updateState(const QPaintEngineState &state) = 0;
+ virtual void drawRects(const QRect *rects, int rectCount);
+ virtual void drawRects(const QRectF *rects, int rectCount);
+ virtual void drawLines(const QLine *lines, int lineCount);
+ virtual void drawLines(const QLineF *lines, int lineCount);
+ virtual void drawEllipse(const QRectF &r);
+ virtual void drawEllipse(const QRect &r);
+ virtual void drawPath(const QPainterPath &path);
+ virtual void drawPoints(const QPointF *points, int pointCount);
+ virtual void drawPoints(const QPoint *points, int pointCount);
+ virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
+ virtual void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode);
+ virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) = 0;
+ virtual void drawTextItem(const QPointF &p, const QTextItem &textItem);
+ virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
+ virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
+ Qt::ImageConversionFlags flags = Qt::AutoColor);
+ void setPaintDevice(QPaintDevice *device);
+ QPaintDevice *paintDevice() const;
+ void setSystemClip(const QRegion &baseClip);
+ QRegion systemClip() const;
+ void setSystemRect(const QRect &rect);
+ QRect systemRect() const;
+ virtual QPoint coordinateOffset() const;
+ enum Type {
+ X11,
+ Windows,
+ QuickDraw, CoreGraphics, MacPrinter,
+ QWindowSystem,
+ PostScript,
+ OpenGL,
+ Picture,
+ SVG,
+ Raster,
+ Direct3D,
+ Pdf,
+ OpenVG,
+ User = 50,
+ MaxUser = 100
+ };
+ virtual Type type() const = 0;
+ inline void fix_neg_rect(int *x, int *y, int *w, int *h);
+ inline bool testDirty(DirtyFlags df);
+ inline void setDirty(DirtyFlags df);
+ inline void clearDirty(DirtyFlags df);
+ bool hasFeature(PaintEngineFeatures feature) const { return (gccaps & feature) != 0; }
+ QPainter *painter() const;
+ void syncState();
+ inline bool isExtended() const { return extended; }
+protected:
+ QPaintEngine(QPaintEnginePrivate &data, PaintEngineFeatures devcaps=0);
+ QPaintEngineState *state;
+ PaintEngineFeatures gccaps;
+ uint active : 1;
+ uint selfDestruct : 1;
+ uint extended : 1;
+ QPaintEnginePrivate *d_ptr;
+private:
+ void setAutoDestruct(bool autoDestr) { selfDestruct = autoDestr; }
+ bool autoDestruct() const { return selfDestruct; }
+ QPaintEngine(const QPaintEngine &); QPaintEngine &operator=(const QPaintEngine &);
+ friend class QFontEngineBox;
+ friend class QFontEngineMac;
+ friend class QFontEngineWin;
+ friend class QFontEngineQPF1;
+ friend class QFontEngineQPF;
+ friend class QPSPrintEngine;
+ friend class QMacPrintEngine;
+ friend class QMacPrintEnginePrivate;
+ friend class QtopiaPrintEngine;
+ friend class QtopiaPrintEnginePrivate;
+ friend class QProxyFontEngine;
+ friend class QPainter;
+ friend class QPainterPrivate;
+ friend class QWidget;
+ friend class QWidgetPrivate;
+ friend class QWin32PaintEngine;
+ friend class QWin32PaintEnginePrivate;
+ friend class QMacCGContext;
+ friend class QPreviewPaintEngine;
+};
+class __attribute__((visibility("default"))) QPaintEngineState
+{
+public:
+ QPaintEngine::DirtyFlags state() const { return dirtyFlags; }
+ QPen pen() const;
+ QBrush brush() const;
+ QPointF brushOrigin() const;
+ QBrush backgroundBrush() const;
+ Qt::BGMode backgroundMode() const;
+ QFont font() const;
+ QMatrix matrix() const;
+ QTransform transform() const;
+ Qt::ClipOperation clipOperation() const;
+ QRegion clipRegion() const;
+ QPainterPath clipPath() const;
+ bool isClipEnabled() const;
+ QPainter::RenderHints renderHints() const;
+ QPainter::CompositionMode compositionMode() const;
+ qreal opacity() const;
+ QPainter *painter() const;
+ bool brushNeedsResolving() const;
+ bool penNeedsResolving() const;
+protected:
+ friend class QPaintEngine;
+ friend class QRasterPaintEngine;
+ friend class QWidget;
+ friend class QPainter;
+ friend class QPainterPrivate;
+ friend class QMacPrintEnginePrivate;
+ QPaintEngine::DirtyFlags dirtyFlags;
+};
+inline void QPaintEngine::fix_neg_rect(int *x, int *y, int *w, int *h)
+{
+ if (*w < 0) {
+ *w = -*w;
+ *x -= *w - 1;
+ }
+ if (*h < 0) {
+ *h = -*h;
+ *y -= *h - 1;
+ }
+}
+inline bool QPaintEngine::testDirty(DirtyFlags df) {
+ qt_noop();
+ return ((state->dirtyFlags & df) != 0);
+}
+inline void QPaintEngine::setDirty(DirtyFlags df) {
+ qt_noop();
+ state->dirtyFlags |= df;
+}
+inline void QPaintEngine::clearDirty(DirtyFlags df)
+{
+ qt_noop();
+ state->dirtyFlags &= ~static_cast<uint>(df);
+}
+inline QFlags<QTextItem::RenderFlags::enum_type> operator|(QTextItem::RenderFlags::enum_type f1, QTextItem::RenderFlags::enum_type f2) { return QFlags<QTextItem::RenderFlags::enum_type>(f1) | f2; } inline QFlags<QTextItem::RenderFlags::enum_type> operator|(QTextItem::RenderFlags::enum_type f1, QFlags<QTextItem::RenderFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QTextItem::RenderFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<QPaintEngine::PaintEngineFeatures::enum_type> operator|(QPaintEngine::PaintEngineFeatures::enum_type f1, QPaintEngine::PaintEngineFeatures::enum_type f2) { return QFlags<QPaintEngine::PaintEngineFeatures::enum_type>(f1) | f2; } inline QFlags<QPaintEngine::PaintEngineFeatures::enum_type> operator|(QPaintEngine::PaintEngineFeatures::enum_type f1, QFlags<QPaintEngine::PaintEngineFeatures::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QPaintEngine::PaintEngineFeatures::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+inline QFlags<QPaintEngine::DirtyFlags::enum_type> operator|(QPaintEngine::DirtyFlags::enum_type f1, QPaintEngine::DirtyFlags::enum_type f2) { return QFlags<QPaintEngine::DirtyFlags::enum_type>(f1) | f2; } inline QFlags<QPaintEngine::DirtyFlags::enum_type> operator|(QPaintEngine::DirtyFlags::enum_type f1, QFlags<QPaintEngine::DirtyFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QPaintEngine::DirtyFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QTextObjectPrivate;
+class QTextDocument;
+class QTextDocumentPrivate;
+class QTextCursor;
+class QTextBlock;
+class QTextFragment;
+class QTextLayout;
+class QTextList;
+class __attribute__((visibility("default"))) QTextObject : public QObject
+{
+ public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
+protected:
+ explicit QTextObject(QTextDocument *doc);
+ ~QTextObject();
+ void setFormat(const QTextFormat &format);
+public:
+ QTextFormat format() const;
+ int formatIndex() const;
+ QTextDocument *document() const;
+ int objectIndex() const;
+ QTextDocumentPrivate *docHandle() const;
+protected:
+ QTextObject(QTextObjectPrivate &p, QTextDocument *doc);
+private:
+ inline QTextObjectPrivate* d_func() { return reinterpret_cast<QTextObjectPrivate *>(d_ptr); } inline const QTextObjectPrivate* d_func() const { return reinterpret_cast<const QTextObjectPrivate *>(d_ptr); } friend class QTextObjectPrivate;
+ QTextObject(const QTextObject &); QTextObject &operator=(const QTextObject &);
+ friend class QTextDocumentPrivate;
+};
+class QTextBlockGroupPrivate;
+class __attribute__((visibility("default"))) QTextBlockGroup : public QTextObject
+{
+ public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
+protected:
+ explicit QTextBlockGroup(QTextDocument *doc);
+ ~QTextBlockGroup();
+ virtual void blockInserted(const QTextBlock &block);
+ virtual void blockRemoved(const QTextBlock &block);
+ virtual void blockFormatChanged(const QTextBlock &block);
+ QList<QTextBlock> blockList() const;
+protected:
+ QTextBlockGroup(QTextBlockGroupPrivate &p, QTextDocument *doc);
+private:
+ inline QTextBlockGroupPrivate* d_func() { return reinterpret_cast<QTextBlockGroupPrivate *>(d_ptr); } inline const QTextBlockGroupPrivate* d_func() const { return reinterpret_cast<const QTextBlockGroupPrivate *>(d_ptr); } friend class QTextBlockGroupPrivate;
+ QTextBlockGroup(const QTextBlockGroup &); QTextBlockGroup &operator=(const QTextBlockGroup &);
+ friend class QTextDocumentPrivate;
+};
+class __attribute__((visibility("default"))) QTextFrameLayoutData {
+public:
+ virtual ~QTextFrameLayoutData();
+};
+class QTextFramePrivate;
+class __attribute__((visibility("default"))) QTextFrame : public QTextObject
+{
+ public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
+public:
+ explicit QTextFrame(QTextDocument *doc);
+ ~QTextFrame();
+ inline void setFrameFormat(const QTextFrameFormat &format);
+ QTextFrameFormat frameFormat() const { return QTextObject::format().toFrameFormat(); }
+ QTextCursor firstCursorPosition() const;
+ QTextCursor lastCursorPosition() const;
+ int firstPosition() const;
+ int lastPosition() const;
+ QTextFrameLayoutData *layoutData() const;
+ void setLayoutData(QTextFrameLayoutData *data);
+ QList<QTextFrame *> childFrames() const;
+ QTextFrame *parentFrame() const;
+ class __attribute__((visibility("default"))) iterator {
+ QTextFrame *f;
+ int b;
+ int e;
+ QTextFrame *cf;
+ int cb;
+ friend class QTextFrame;
+ friend class QTextTableCell;
+ friend class QTextDocumentLayoutPrivate;
+ iterator(QTextFrame *frame, int block, int begin, int end);
+ public:
+ iterator();
+ iterator(const iterator &o);
+ iterator &operator=(const iterator &o);
+ QTextFrame *parentFrame() const { return f; }
+ QTextFrame *currentFrame() const;
+ QTextBlock currentBlock() const;
+ bool atEnd() const { return !cf && cb == e; }
+ inline bool operator==(const iterator &o) const { return f == o.f && cf == o.cf && cb == o.cb; }
+ inline bool operator!=(const iterator &o) const { return f != o.f || cf != o.cf || cb != o.cb; }
+ iterator &operator++();
+ inline iterator operator++(int) { iterator tmp = *this; operator++(); return tmp; }
+ iterator &operator--();
+ inline iterator operator--(int) { iterator tmp = *this; operator--(); return tmp; }
+ };
+ friend class iterator;
+ typedef iterator Iterator;
+ iterator begin() const;
+ iterator end() const;
+protected:
+ QTextFrame(QTextFramePrivate &p, QTextDocument *doc);
+private:
+ friend class QTextDocumentPrivate;
+ inline QTextFramePrivate* d_func() { return reinterpret_cast<QTextFramePrivate *>(d_ptr); } inline const QTextFramePrivate* d_func() const { return reinterpret_cast<const QTextFramePrivate *>(d_ptr); } friend class QTextFramePrivate;
+ QTextFrame(const QTextFrame &); QTextFrame &operator=(const QTextFrame &);
+};
+template <> class QTypeInfo<QTextFrame::iterator> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QTextFrame::iterator)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QTextFrame::iterator"; } };
+inline void QTextFrame::setFrameFormat(const QTextFrameFormat &aformat)
+{ QTextObject::setFormat(aformat); }
+class __attribute__((visibility("default"))) QTextBlockUserData {
+public:
+ virtual ~QTextBlockUserData();
+};
+class __attribute__((visibility("default"))) QTextBlock
+{
+ friend class QSyntaxHighlighter;
+public:
+ inline QTextBlock(QTextDocumentPrivate *priv, int b) : p(priv), n(b) {}
+ inline QTextBlock() : p(0), n(0) {}
+ inline QTextBlock(const QTextBlock &o) : p(o.p), n(o.n) {}
+ inline QTextBlock &operator=(const QTextBlock &o) { p = o.p; n = o.n; return *this; }
+ inline bool isValid() const { return p != 0 && n != 0; }
+ inline bool operator==(const QTextBlock &o) const { return p == o.p && n == o.n; }
+ inline bool operator!=(const QTextBlock &o) const { return p != o.p || n != o.n; }
+ inline bool operator<(const QTextBlock &o) const { return position() < o.position(); }
+ int position() const;
+ int length() const;
+ bool contains(int position) const;
+ QTextLayout *layout() const;
+ void clearLayout();
+ QTextBlockFormat blockFormat() const;
+ int blockFormatIndex() const;
+ QTextCharFormat charFormat() const;
+ int charFormatIndex() const;
+ QString text() const;
+ const QTextDocument *document() const;
+ QTextList *textList() const;
+ QTextBlockUserData *userData() const;
+ void setUserData(QTextBlockUserData *data);
+ int userState() const;
+ void setUserState(int state);
+ int revision() const;
+ void setRevision(int rev);
+ bool isVisible() const;
+ void setVisible(bool visible);
+ int blockNumber() const;
+ int firstLineNumber() const;
+ void setLineCount(int count);
+ int lineCount() const;
+ class __attribute__((visibility("default"))) iterator {
+ const QTextDocumentPrivate *p;
+ int b;
+ int e;
+ int n;
+ friend class QTextBlock;
+ iterator(const QTextDocumentPrivate *priv, int begin, int end, int f) : p(priv), b(begin), e(end), n(f) {}
+ public:
+ iterator() : p(0), b(0), e(0), n(0) {}
+ iterator(const iterator &o) : p(o.p), b(o.b), e(o.e), n(o.n) {}
+ QTextFragment fragment() const;
+ bool atEnd() const { return n == e; }
+ inline bool operator==(const iterator &o) const { return p == o.p && n == o.n; }
+ inline bool operator!=(const iterator &o) const { return p != o.p || n != o.n; }
+ iterator &operator++();
+ inline iterator operator++(int) { iterator tmp = *this; operator++(); return tmp; }
+ iterator &operator--();
+ inline iterator operator--(int) { iterator tmp = *this; operator--(); return tmp; }
+ };
+ typedef iterator Iterator;
+ iterator begin() const;
+ iterator end() const;
+ QTextBlock next() const;
+ QTextBlock previous() const;
+ inline QTextDocumentPrivate *docHandle() const { return p; }
+ inline int fragmentIndex() const { return n; }
+private:
+ QTextDocumentPrivate *p;
+ int n;
+ friend class QTextDocumentPrivate;
+ friend class QTextLayout;
+};
+template <> class QTypeInfo<QTextBlock> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QTextBlock)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QTextBlock"; } };
+template <> class QTypeInfo<QTextBlock::iterator> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QTextBlock::iterator)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QTextBlock::iterator"; } };
+class __attribute__((visibility("default"))) QTextFragment
+{
+public:
+ inline QTextFragment(const QTextDocumentPrivate *priv, int f, int fe) : p(priv), n(f), ne(fe) {}
+ inline QTextFragment() : p(0), n(0), ne(0) {}
+ inline QTextFragment(const QTextFragment &o) : p(o.p), n(o.n), ne(o.ne) {}
+ inline QTextFragment &operator=(const QTextFragment &o) { p = o.p; n = o.n; ne = o.ne; return *this; }
+ inline bool isValid() const { return p && n; }
+ inline bool operator==(const QTextFragment &o) const { return p == o.p && n == o.n; }
+ inline bool operator!=(const QTextFragment &o) const { return p != o.p || n != o.n; }
+ inline bool operator<(const QTextFragment &o) const { return position() < o.position(); }
+ int position() const;
+ int length() const;
+ bool contains(int position) const;
+ QTextCharFormat charFormat() const;
+ int charFormatIndex() const;
+ QString text() const;
+private:
+ const QTextDocumentPrivate *p;
+ int n;
+ int ne;
+};
+template <> class QTypeInfo<QTextFragment> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QTextFragment)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QTextFragment"; } };
+typedef QtValidLicenseForCoreModule QtCoreModule;
+template <class T>
+class QPointer
+{
+ QObject *o;
+public:
+ inline QPointer() : o(0) {}
+ inline QPointer(T *p) : o(p)
+ { QMetaObject::addGuard(&o); }
+ inline QPointer(const QPointer<T> &p) : o(p.o)
+ { QMetaObject::addGuard(&o); }
+ inline ~QPointer()
+ { QMetaObject::removeGuard(&o); }
+ inline QPointer<T> &operator=(const QPointer<T> &p)
+ { if (this != &p) QMetaObject::changeGuard(&o, p.o); return *this; }
+ inline QPointer<T> &operator=(T* p)
+ { if (o != p) QMetaObject::changeGuard(&o, p); return *this; }
+ inline bool isNull() const
+ { return !o; }
+ inline T* operator->() const
+ { return static_cast<T*>(const_cast<QObject*>(o)); }
+ inline T& operator*() const
+ { return *static_cast<T*>(const_cast<QObject*>(o)); }
+ inline operator T*() const
+ { return static_cast<T*>(const_cast<QObject*>(o)); }
+ inline T* data() const
+ { return static_cast<T*>(const_cast<QObject*>(o)); }
+};
+template <class T>
+inline bool operator==(const T *o, const QPointer<T> &p)
+{ return o == p.operator->(); }
+template<class T>
+inline bool operator==(const QPointer<T> &p, const T *o)
+{ return p.operator->() == o; }
+template <class T>
+inline bool operator==(T *o, const QPointer<T> &p)
+{ return o == p.operator->(); }
+template<class T>
+inline bool operator==(const QPointer<T> &p, T *o)
+{ return p.operator->() == o; }
+template<class T>
+inline bool operator==(const QPointer<T> &p1, const QPointer<T> &p2)
+{ return p1.operator->() == p2.operator->(); }
+template <class T>
+inline bool operator!=(const T *o, const QPointer<T> &p)
+{ return o != p.operator->(); }
+template<class T>
+inline bool operator!= (const QPointer<T> &p, const T *o)
+{ return p.operator->() != o; }
+template <class T>
+inline bool operator!=(T *o, const QPointer<T> &p)
+{ return o != p.operator->(); }
+template<class T>
+inline bool operator!= (const QPointer<T> &p, T *o)
+{ return p.operator->() != o; }
+template<class T>
+inline bool operator!= (const QPointer<T> &p1, const QPointer<T> &p2)
+{ return p1.operator->() != p2.operator->() ; }
+typedef QtValidLicenseForCoreModule QtCoreModule;
+struct QReadWriteLockPrivate;
+class __attribute__((visibility("default"))) QReadWriteLock
+{
+public:
+ enum RecursionMode { NonRecursive, Recursive };
+ QReadWriteLock();
+ QReadWriteLock(RecursionMode recursionMode);
+ ~QReadWriteLock();
+ void lockForRead();
+ bool tryLockForRead();
+ bool tryLockForRead(int timeout);
+ void lockForWrite();
+ bool tryLockForWrite();
+ bool tryLockForWrite(int timeout);
+ void unlock();
+private:
+ QReadWriteLock(const QReadWriteLock &); QReadWriteLock &operator=(const QReadWriteLock &);
+ QReadWriteLockPrivate *d;
+ friend class QWaitCondition;
+};
+class __attribute__((visibility("default"))) QReadLocker
+{
+public:
+ inline QReadLocker(QReadWriteLock *readWriteLock);
+ inline ~QReadLocker()
+ { unlock(); }
+ inline void unlock()
+ {
+ if (q_lock) {
+ if ((q_val & quintptr(1u)) == quintptr(1u)) {
+ q_val &= ~quintptr(1u);
+ q_lock->unlock();
+ }
+ }
+ }
+ inline void relock()
+ {
+ if (q_lock) {
+ if ((q_val & quintptr(1u)) == quintptr(0u)) {
+ q_lock->lockForRead();
+ q_val |= quintptr(1u);
+ }
+ }
+ }
+ inline QReadWriteLock *readWriteLock() const
+ { return reinterpret_cast<QReadWriteLock *>(q_val & ~quintptr(1u)); }
+private:
+ QReadLocker(const QReadLocker &); QReadLocker &operator=(const QReadLocker &);
+ union {
+ QReadWriteLock *q_lock;
+ quintptr q_val;
+ };
+};
+inline QReadLocker::QReadLocker(QReadWriteLock *areadWriteLock)
+ : q_lock(areadWriteLock)
+{
+ qt_noop();
+ relock();
+}
+class __attribute__((visibility("default"))) QWriteLocker
+{
+public:
+ inline QWriteLocker(QReadWriteLock *readWriteLock);
+ inline ~QWriteLocker()
+ { unlock(); }
+ inline void unlock()
+ {
+ if (q_lock) {
+ if ((q_val & quintptr(1u)) == quintptr(1u)) {
+ q_val &= ~quintptr(1u);
+ q_lock->unlock();
+ }
+ }
+ }
+ inline void relock()
+ {
+ if (q_lock) {
+ if ((q_val & quintptr(1u)) == quintptr(0u)) {
+ q_lock->lockForWrite();
+ q_val |= quintptr(1u);
+ }
+ }
+ }
+ inline QReadWriteLock *readWriteLock() const
+ { return reinterpret_cast<QReadWriteLock *>(q_val & ~quintptr(1u)); }
+private:
+ QWriteLocker(const QWriteLocker &); QWriteLocker &operator=(const QWriteLocker &);
+ union{
+ QReadWriteLock *q_lock;
+ quintptr q_val;
+ };
+};
+inline QWriteLocker::QWriteLocker(QReadWriteLock *areadWriteLock)
+ : q_lock(areadWriteLock)
+{
+ qt_noop();
+ relock();
+}
+class QVariant;
+class QThreadData;
+class QObjectConnectionListVector;
+struct QSignalSpyCallbackSet
+{
+ typedef void (*BeginCallback)(QObject *caller, int method_index, void **argv);
+ typedef void (*EndCallback)(QObject *caller, int method_index);
+ BeginCallback signal_begin_callback,
+ slot_begin_callback;
+ EndCallback signal_end_callback,
+ slot_end_callback;
+};
+void __attribute__((visibility("default"))) qt_register_signal_spy_callbacks(const QSignalSpyCallbackSet &callback_set);
+extern QSignalSpyCallbackSet __attribute__((visibility("default"))) qt_signal_spy_callback_set;
+inline QObjectData::~QObjectData() {}
+enum { QObjectPrivateVersion = 0x040501 };
+class __attribute__((visibility("default"))) QObjectPrivate : public QObjectData
+{
+ inline QObject* q_func() { return static_cast<QObject *>(q_ptr); } inline const QObject* q_func() const { return static_cast<const QObject *>(q_ptr); } friend class QObject;
+public:
+ QObjectPrivate(int version = QObjectPrivateVersion);
+ virtual ~QObjectPrivate();
+ QList<QObject *> unused;
+ QThreadData *threadData;
+ void moveToThread_helper();
+ void setThreadData_helper(QThreadData *currentData, QThreadData *targetData);
+ void _q_reregisterTimers(void *pointer);
+ struct Sender
+ {
+ QObject *sender;
+ int signal;
+ int ref;
+ };
+ Sender *currentSender;
+ QObject *currentChildBeingDeleted;
+ bool isSender(const QObject *receiver, const char *signal) const;
+ QObjectList receiverList(const char *signal) const;
+ QObjectList senderList() const;
+ QList<QPointer<QObject> > eventFilters;
+ void setParent_helper(QObject *);
+ void deleteChildren();
+ static void clearGuards(QObject *);
+ struct ExtraData
+ {
+ QVector<QObjectUserData *> userData;
+ QList<QByteArray> propertyNames;
+ QList<QVariant> propertyValues;
+ };
+ ExtraData *extraData;
+ mutable quint32 connectedSignals;
+ QString objectName;
+ struct Connection
+ {
+ QObject *receiver;
+ int method;
+ uint connectionType : 3;
+ QBasicAtomicPointer<int> argumentTypes;
+ };
+ typedef QList<Connection> ConnectionList;
+ QObjectConnectionListVector *connectionLists;
+ void addConnection(int signal, Connection *c);
+ void removeReceiver(int signal, QObject *receiver);
+ void cleanConnectionLists();
+ QList<Sender> senders;
+ void refSender(QObject *sender, int signal);
+ void derefSender(QObject *sender, int signal);
+ void removeSender(QObject *sender, int signal);
+ static Sender *setCurrentSender(QObject *receiver,
+ Sender *sender);
+ static void resetCurrentSender(QObject *receiver,
+ Sender *currentSender,
+ Sender *previousSender);
+ static int *setDeleteWatch(QObjectPrivate *d, int *newWatch);
+ static void resetDeleteWatch(QObjectPrivate *d, int *oldWatch, int deleteWatch);
+ int *deleteWatch;
+ static QObjectPrivate *get(QObject *o) {
+ return o->d_func();
+ }
+};
+template <> class QTypeInfo<QObjectPrivate::Connection> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QObjectPrivate::Connection)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QObjectPrivate::Connection"; } };
+template <> class QTypeInfo<QObjectPrivate::Sender> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QObjectPrivate::Sender)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QObjectPrivate::Sender"; } };
+class QSemaphore;
+class __attribute__((visibility("default"))) QMetaCallEvent : public QEvent
+{
+public:
+ QMetaCallEvent(int id, const QObject *sender, int signalId,
+ int nargs = 0, int *types = 0, void **args = 0, QSemaphore *semaphore = 0);
+ ~QMetaCallEvent();
+ inline int id() const { return id_; }
+ inline const QObject *sender() const { return sender_; }
+ inline int signalId() const { return signalId_; }
+ inline void **args() const { return args_; }
+ virtual int placeMetaCall(QObject *object);
+private:
+ int id_;
+ const QObject *sender_;
+ int signalId_;
+ int nargs_;
+ int *types_;
+ void **args_;
+ QSemaphore *semaphore_;
+};
+class __attribute__((visibility("default"))) QBoolBlocker
+{
+public:
+ inline QBoolBlocker(bool &b, bool value=true):block(b), reset(b){block = value;}
+ inline ~QBoolBlocker(){block = reset; }
+private:
+ bool █
+ bool reset;
+};
+void __attribute__((visibility("default"))) qDeleteInEventHandler(QObject *o);
+int __attribute__((visibility("default"))) qAllocMore(int alloc, int extra);
+template <int N = 1>
+class QFragment
+{
+public:
+ quint32 parent;
+ quint32 left;
+ quint32 right;
+ quint32 color;
+ quint32 size_left_array[N];
+ quint32 size_array[N];
+ enum {size_array_max = N };
+};
+template <class Fragment>
+class QFragmentMapData
+{
+ enum Color { Red, Black };
+public:
+ QFragmentMapData();
+ ~QFragmentMapData();
+ void init();
+ class Header
+ {
+ public:
+ quint32 root;
+ quint32 tag;
+ quint32 freelist;
+ quint32 node_count;
+ quint32 allocated;
+ };
+ enum {fragmentSize = sizeof(Fragment) };
+ int length(uint field = 0) const;
+ inline Fragment *fragment(uint index) {
+ return (fragments + index);
+ }
+ inline const Fragment *fragment(uint index) const {
+ return (fragments + index);
+ }
+ inline Fragment &F(uint index) { return fragments[index] ; }
+ inline const Fragment &F(uint index) const { return fragments[index] ; }
+ inline bool isRoot(uint index) const {
+ return !fragment(index)->parent;
+ }
+ inline uint position(uint node, uint field = 0) const {
+ qt_noop();
+ const Fragment *f = fragment(node);
+ uint offset = f->size_left_array[field];
+ while (f->parent) {
+ uint p = f->parent;
+ f = fragment(p);
+ if (f->right == node)
+ offset += f->size_left_array[field] + f->size_array[field];
+ node = p;
+ }
+ return offset;
+ }
+ inline uint sizeRight(uint node, uint field = 0) const {
+ qt_noop();
+ uint sr = 0;
+ const Fragment *f = fragment(node);
+ node = f->right;
+ while (node) {
+ f = fragment(node);
+ sr += f->size_left_array[field] + f->size_array[field];
+ node = f->right;
+ }
+ return sr;
+ }
+ inline uint sizeLeft(uint node, uint field = 0) const {
+ qt_noop();
+ return fragment(node)->size_left_array[field];
+ }
+ inline uint size(uint node, uint field = 0) const {
+ qt_noop();
+ return fragment(node)->size_array[field];
+ }
+ inline void setSize(uint node, int new_size, uint field = 0) {
+ qt_noop();
+ Fragment *f = fragment(node);
+ int diff = new_size - f->size_array[field];
+ f->size_array[field] = new_size;
+ while (f->parent) {
+ uint p = f->parent;
+ f = fragment(p);
+ if (f->left == node)
+ f->size_left_array[field] += diff;
+ node = p;
+ }
+ }
+ uint findNode(int k, uint field = 0) const;
+ uint insert_single(int key, uint length);
+ uint erase_single(uint f);
+ uint minimum(uint n) const {
+ while (n && fragment(n)->left)
+ n = fragment(n)->left;
+ return n;
+ }
+ uint maximum(uint n) const {
+ while (n && fragment(n)->right)
+ n = fragment(n)->right;
+ return n;
+ }
+ uint next(uint n) const;
+ uint previous(uint n) const;
+ inline uint root() const {
+ qt_noop();
+ return head->root;
+ }
+ inline void setRoot(uint new_root) {
+ qt_noop();
+ head->root = new_root;
+ }
+ union {
+ Header *head;
+ Fragment *fragments;
+ };
+private:
+ void rotateLeft(uint x);
+ void rotateRight(uint x);
+ void rebalance(uint x);
+ void removeAndRebalance(uint z);
+ uint createFragment();
+ void freeFragment(uint f);
+};
+template <class Fragment>
+QFragmentMapData<Fragment>::QFragmentMapData()
+{
+ init();
+}
+template <class Fragment>
+void QFragmentMapData<Fragment>::init()
+{
+ fragments = (Fragment *)malloc(64*fragmentSize);
+ head->tag = (((quint32)'p') << 24) | (((quint32)'m') << 16) | (((quint32)'a') << 8) | 'p';
+ head->root = 0;
+ head->freelist = 1;
+ head->node_count = 0;
+ head->allocated = 64;
+ F(head->freelist).right = 0;
+}
+template <class Fragment>
+QFragmentMapData<Fragment>::~QFragmentMapData()
+{
+ free(head);
+}
+template <class Fragment>
+uint QFragmentMapData<Fragment>::createFragment()
+{
+ qt_noop();
+ uint freePos = head->freelist;
+ if (freePos == head->allocated) {
+ uint needed = qAllocMore((freePos+1)*fragmentSize, 0);
+ qt_noop();
+ fragments = (Fragment *)realloc(fragments, needed);
+ head->allocated = needed/fragmentSize;
+ F(freePos).right = 0;
+ }
+ uint nextPos = F(freePos).right;
+ if (!nextPos) {
+ nextPos = freePos+1;
+ if (nextPos < head->allocated)
+ F(nextPos).right = 0;
+ }
+ head->freelist = nextPos;
+ ++head->node_count;
+ return freePos;
+}
+template <class Fragment>
+void QFragmentMapData<Fragment>::freeFragment(uint i)
+{
+ F(i).right = head->freelist;
+ head->freelist = i;
+ --head->node_count;
+}
+template <class Fragment>
+uint QFragmentMapData<Fragment>::next(uint n) const {
+ qt_noop();
+ if (F(n).right) {
+ n = F(n).right;
+ while (F(n).left)
+ n = F(n).left;
+ } else {
+ uint y = F(n).parent;
+ while (F(n).parent && n == F(y).right) {
+ n = y;
+ y = F(y).parent;
+ }
+ n = y;
+ }
+ return n;
+}
+template <class Fragment>
+uint QFragmentMapData<Fragment>::previous(uint n) const {
+ if (!n)
+ return maximum(root());
+ if (F(n).left) {
+ n = F(n).left;
+ while (F(n).right)
+ n = F(n).right;
+ } else {
+ uint y = F(n).parent;
+ while (F(n).parent && n == F(y).left) {
+ n = y;
+ y = F(y).parent;
+ }
+ n = y;
+ }
+ return n;
+}
+template <class Fragment>
+void QFragmentMapData<Fragment>::rotateLeft(uint x)
+{
+ uint p = F(x).parent;
+ uint y = F(x).right;
+ if (y) {
+ F(x).right = F(y).left;
+ if (F(y).left)
+ F(F(y).left).parent = x;
+ F(y).left = x;
+ F(y).parent = p;
+ } else {
+ F(x).right = 0;
+ }
+ if (!p) {
+ qt_noop();
+ head->root = y;
+ }
+ else if (x == F(p).left)
+ F(p).left = y;
+ else
+ F(p).right = y;
+ F(x).parent = y;
+ for (uint field = 0; field < Fragment::size_array_max; ++field)
+ F(y).size_left_array[field] += F(x).size_left_array[field] + F(x).size_array[field];
+}
+template <class Fragment>
+void QFragmentMapData<Fragment>::rotateRight(uint x)
+{
+ uint y = F(x).left;
+ uint p = F(x).parent;
+ if (y) {
+ F(x).left = F(y).right;
+ if (F(y).right)
+ F(F(y).right).parent = x;
+ F(y).right = x;
+ F(y).parent = p;
+ } else {
+ F(x).left = 0;
+ }
+ if (!p) {
+ qt_noop();
+ head->root = y;
+ }
+ else if (x == F(p).right)
+ F(p).right = y;
+ else
+ F(p).left = y;
+ F(x).parent = y;
+ for (uint field = 0; field < Fragment::size_array_max; ++field)
+ F(x).size_left_array[field] -= F(y).size_left_array[field] + F(y).size_array[field];
+}
+template <class Fragment>
+void QFragmentMapData<Fragment>::rebalance(uint x)
+{
+ F(x).color = Red;
+ while (F(x).parent && F(F(x).parent).color == Red) {
+ uint p = F(x).parent;
+ uint pp = F(p).parent;
+ qt_noop();
+ if (p == F(pp).left) {
+ uint y = F(pp).right;
+ if (y && F(y).color == Red) {
+ F(p).color = Black;
+ F(y).color = Black;
+ F(pp).color = Red;
+ x = pp;
+ } else {
+ if (x == F(p).right) {
+ x = p;
+ rotateLeft(x);
+ p = F(x).parent;
+ pp = F(p).parent;
+ }
+ F(p).color = Black;
+ if (pp) {
+ F(pp).color = Red;
+ rotateRight(pp);
+ }
+ }
+ } else {
+ uint y = F(pp).left;
+ if (y && F(y).color == Red) {
+ F(p).color = Black;
+ F(y).color = Black;
+ F(pp).color = Red;
+ x = pp;
+ } else {
+ if (x == F(p).left) {
+ x = p;
+ rotateRight(x);
+ p = F(x).parent;
+ pp = F(p).parent;
+ }
+ F(p).color = Black;
+ if (pp) {
+ F(pp).color = Red;
+ rotateLeft(pp);
+ }
+ }
+ }
+ }
+ F(root()).color = Black;
+}
+template <class Fragment>
+uint QFragmentMapData<Fragment>::erase_single(uint z)
+{
+ uint w = previous(z);
+ uint y = z;
+ uint x;
+ uint p;
+ if (!F(y).left) {
+ x = F(y).right;
+ } else if (!F(y).right) {
+ x = F(y).left;
+ } else {
+ y = F(y).right;
+ while (F(y).left)
+ y = F(y).left;
+ x = F(y).right;
+ }
+ if (y != z) {
+ F(F(z).left).parent = y;
+ F(y).left = F(z).left;
+ for (uint field = 0; field < Fragment::size_array_max; ++field)
+ F(y).size_left_array[field] = F(z).size_left_array[field];
+ if (y != F(z).right) {
+ p = F(y).parent;
+ if (x)
+ F(x).parent = p;
+ F(p).left = x;
+ F(y).right = F(z).right;
+ F(F(z).right).parent = y;
+ uint n = p;
+ while (n != y) {
+ for (uint field = 0; field < Fragment::size_array_max; ++field)
+ F(n).size_left_array[field] -= F(y).size_array[field];
+ n = F(n).parent;
+ }
+ } else {
+ p = y;
+ }
+ uint zp = F(z).parent;
+ if (!zp) {
+ qt_noop();
+ head->root = y;
+ } else if (F(zp).left == z) {
+ F(zp).left = y;
+ for (uint field = 0; field < Fragment::size_array_max; ++field)
+ F(zp).size_left_array[field] -= F(z).size_array[field];
+ } else {
+ F(zp).right = y;
+ }
+ F(y).parent = zp;
+ uint c = F(y).color;
+ F(y).color = F(z).color;
+ F(z).color = c;
+ y = z;
+ } else {
+ p = F(z).parent;
+ if (x)
+ F(x).parent = p;
+ if (!p) {
+ qt_noop();
+ head->root = x;
+ } else if (F(p).left == z) {
+ F(p).left = x;
+ for (uint field = 0; field < Fragment::size_array_max; ++field)
+ F(p).size_left_array[field] -= F(z).size_array[field];
+ } else {
+ F(p).right = x;
+ }
+ }
+ uint n = z;
+ while (F(n).parent) {
+ uint p = F(n).parent;
+ if (F(p).left == n) {
+ for (uint field = 0; field < Fragment::size_array_max; ++field)
+ F(p).size_left_array[field] -= F(z).size_array[field];
+ }
+ n = p;
+ }
+ freeFragment(z);
+ if (F(y).color != Red) {
+ while (F(x).parent && (x == 0 || F(x).color == Black)) {
+ if (x == F(p).left) {
+ uint w = F(p).right;
+ if (F(w).color == Red) {
+ F(w).color = Black;
+ F(p).color = Red;
+ rotateLeft(p);
+ w = F(p).right;
+ }
+ if ((F(w).left == 0 || F(F(w).left).color == Black) &&
+ (F(w).right == 0 || F(F(w).right).color == Black)) {
+ F(w).color = Red;
+ x = p;
+ p = F(x).parent;
+ } else {
+ if (F(w).right == 0 || F(F(w).right).color == Black) {
+ if (F(w).left)
+ F(F(w).left).color = Black;
+ F(w).color = Red;
+ rotateRight(F(p).right);
+ w = F(p).right;
+ }
+ F(w).color = F(p).color;
+ F(p).color = Black;
+ if (F(w).right)
+ F(F(w).right).color = Black;
+ rotateLeft(p);
+ break;
+ }
+ } else {
+ uint w = F(p).left;
+ if (F(w).color == Red) {
+ F(w).color = Black;
+ F(p).color = Red;
+ rotateRight(p);
+ w = F(p).left;
+ }
+ if ((F(w).right == 0 || F(F(w).right).color == Black) &&
+ (F(w).left == 0 || F(F(w).left).color == Black)) {
+ F(w).color = Red;
+ x = p;
+ p = F(x).parent;
+ } else {
+ if (F(w).left == 0 || F(F(w).left).color == Black) {
+ if (F(w).right)
+ F(F(w).right).color = Black;
+ F(w).color = Red;
+ rotateLeft(F(p).left);
+ w = F(p).left;
+ }
+ F(w).color = F(p).color;
+ F(p).color = Black;
+ if (F(w).left)
+ F(F(w).left).color = Black;
+ rotateRight(p);
+ break;
+ }
+ }
+ }
+ if (x)
+ F(x).color = Black;
+ }
+ return w;
+}
+template <class Fragment>
+uint QFragmentMapData<Fragment>::findNode(int k, uint field) const
+{
+ qt_noop();
+ uint x = root();
+ uint s = k;
+ while (x) {
+ if (sizeLeft(x, field) <= s) {
+ if (s < sizeLeft(x, field) + size(x, field))
+ return x;
+ s -= sizeLeft(x, field) + size(x, field);
+ x = F(x).right;
+ } else {
+ x = F(x).left;
+ }
+ }
+ return 0;
+}
+template <class Fragment>
+uint QFragmentMapData<Fragment>::insert_single(int key, uint length)
+{
+ qt_noop();
+ uint z = createFragment();
+ F(z).left = 0;
+ F(z).right = 0;
+ F(z).size_array[0] = length;
+ for (uint field = 1; field < Fragment::size_array_max; ++field)
+ F(z).size_array[field] = 1;
+ for (uint field = 0; field < Fragment::size_array_max; ++field)
+ F(z).size_left_array[field] = 0;
+ uint y = 0;
+ uint x = root();
+ qt_noop();
+ uint s = key;
+ bool right = false;
+ while (x) {
+ y = x;
+ if (s <= F(x).size_left_array[0]) {
+ x = F(x).left;
+ right = false;
+ } else {
+ s -= F(x).size_left_array[0] + F(x).size_array[0];
+ x = F(x).right;
+ right = true;
+ }
+ }
+ F(z).parent = y;
+ if (!y) {
+ head->root = z;
+ } else if (!right) {
+ F(y).left = z;
+ for (uint field = 0; field < Fragment::size_array_max; ++field)
+ F(y).size_left_array[field] = F(z).size_array[field];
+ } else {
+ F(y).right = z;
+ }
+ while (y && F(y).parent) {
+ uint p = F(y).parent;
+ if (F(p).left == y) {
+ for (uint field = 0; field < Fragment::size_array_max; ++field)
+ F(p).size_left_array[field] += F(z).size_array[field];
+ }
+ y = p;
+ }
+ rebalance(z);
+ return z;
+}
+template <class Fragment>
+int QFragmentMapData<Fragment>::length(uint field) const {
+ uint root = this->root();
+ return root ? sizeLeft(root, field) + size(root, field) + sizeRight(root, field) : 0;
+}
+template <class Fragment>
+class QFragmentMap
+{
+public:
+ class Iterator
+ {
+ public:
+ QFragmentMap *pt;
+ quint32 n;
+ Iterator() : pt(0), n(0) {}
+ Iterator(QFragmentMap *p, int node) : pt(p), n(node) {}
+ Iterator(const Iterator& it) : pt(it.pt), n(it.n) {}
+ inline bool atEnd() const { return !n; }
+ bool operator==(const Iterator& it) const { return pt == it.pt && n == it.n; }
+ bool operator!=(const Iterator& it) const { return pt != it.pt || n != it.n; }
+ bool operator<(const Iterator &it) const { return position() < it.position(); }
+ Fragment *operator*() { qt_noop(); return pt->fragment(n); }
+ const Fragment *operator*() const { qt_noop(); return pt->fragment(n); }
+ Fragment *operator->() { qt_noop(); return pt->fragment(n); }
+ const Fragment *operator->() const { qt_noop(); return pt->fragment(n); }
+ int position() const { qt_noop(); return pt->data.position(n); }
+ const Fragment *value() const { qt_noop(); return pt->fragment(n); }
+ Fragment *value() { qt_noop(); return pt->fragment(n); }
+ Iterator& operator++() {
+ n = pt->data.next(n);
+ return *this;
+ }
+ Iterator& operator--() {
+ n = pt->data.previous(n);
+ return *this;
+ }
+ };
+ class ConstIterator
+ {
+ public:
+ const QFragmentMap *pt;
+ quint32 n;
+ ConstIterator() : pt(0), n(0) {}
+ ConstIterator(const QFragmentMap *p, int node) : pt(p), n(node) {}
+ ConstIterator(const ConstIterator& it) : pt(it.pt), n(it.n) {}
+ ConstIterator(const Iterator& it) : pt(it.pt), n(it.n) {}
+ inline bool atEnd() const { return !n; }
+ bool operator==(const ConstIterator& it) const { return pt == it.pt && n == it.n; }
+ bool operator!=(const ConstIterator& it) const { return pt != it.pt || n != it.n; }
+ bool operator<(const ConstIterator &it) const { return position() < it.position(); }
+ const Fragment *operator*() const { qt_noop(); return pt->fragment(n); }
+ const Fragment *operator->() const { qt_noop(); return pt->fragment(n); }
+ int position() const { qt_noop(); return pt->data.position(n); }
+ int size() const { qt_noop(); return pt->data.size(n); }
+ const Fragment *value() const { qt_noop(); return pt->fragment(n); }
+ ConstIterator& operator++() {
+ n = pt->data.next(n);
+ return *this;
+ }
+ ConstIterator& operator--() {
+ n = pt->data.previous(n);
+ return *this;
+ }
+ };
+ QFragmentMap() {}
+ ~QFragmentMap()
+ {
+ for (Iterator it = begin(); !it.atEnd(); ++it)
+ it.value()->free();
+ }
+ inline void clear() {
+ for (Iterator it = begin(); !it.atEnd(); ++it)
+ it.value()->free();
+ ::free(data.head);
+ data.init();
+ }
+ inline Iterator begin() { return Iterator(this, data.minimum(data.root())); }
+ inline Iterator end() { return Iterator(this, 0); }
+ inline ConstIterator begin() const { return ConstIterator(this, data.minimum(data.root())); }
+ inline ConstIterator end() const { return ConstIterator(this, 0); }
+ inline ConstIterator last() const { return ConstIterator(this, data.maximum(data.root())); }
+ inline bool isEmpty() const { return data.head->node_count == 0; }
+ inline int numNodes() const { return data.head->node_count; }
+ int length(uint field = 0) const { return data.length(field); }
+ Iterator find(int k, uint field = 0) { return Iterator(this, data.findNode(k, field)); }
+ ConstIterator find(int k, uint field = 0) const { return ConstIterator(this, data.findNode(k, field)); }
+ uint findNode(int k, uint field = 0) const { return data.findNode(k, field); }
+ uint insert_single(int key, uint length)
+ {
+ uint f = data.insert_single(key, length);
+ if (f != 0) {
+ Fragment *frag = fragment(f);
+ qt_noop();
+ frag->initialize();
+ }
+ return f;
+ }
+ uint erase_single(uint f)
+ {
+ if (f != 0) {
+ Fragment *frag = fragment(f);
+ qt_noop();
+ frag->free();
+ }
+ return data.erase_single(f);
+ }
+ inline Fragment *fragment(uint index) {
+ qt_noop();
+ return data.fragment(index);
+ }
+ inline const Fragment *fragment(uint index) const {
+ qt_noop();
+ return data.fragment(index);
+ }
+ inline uint position(uint node, uint field = 0) const { return data.position(node, field); }
+ inline uint next(uint n) const { return data.next(n); }
+ inline uint previous(uint n) const { return data.previous(n); }
+ inline uint size(uint node, uint field = 0) const { return data.size(node, field); }
+ inline void setSize(uint node, int new_size, uint field = 0)
+ { data.setSize(node, new_size, field);
+ if (node != 0 && field == 0) {
+ Fragment *frag = fragment(node);
+ qt_noop();
+ frag->invalidate();
+ }
+ }
+ inline int firstNode() const { return data.minimum(data.root()); }
+private:
+ friend class Iterator;
+ friend class ConstIterator;
+ QFragmentMapData<Fragment> data;
+ QFragmentMap(const QFragmentMap& m);
+ QFragmentMap& operator= (const QFragmentMap& m);
+};
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QTextFormatCollection;
+class QTextListFormat;
+class QRect;
+class QPainter;
+class QPrinter;
+class QAbstractTextDocumentLayout;
+class QPoint;
+class QTextCursor;
+class QTextObject;
+class QTextFormat;
+class QTextFrame;
+class QTextBlock;
+class QTextCodec;
+class QUrl;
+class QVariant;
+class QRectF;
+class QTextOption;
+template<typename T> class QVector;
+namespace Qt
+{
+ enum HitTestAccuracy { ExactHit, FuzzyHit };
+ enum WhiteSpaceMode {
+ WhiteSpaceNormal,
+ WhiteSpacePre,
+ WhiteSpaceNoWrap,
+ WhiteSpaceModeUndefined = -1
+ };
+ __attribute__((visibility("default"))) bool mightBeRichText(const QString&);
+ __attribute__((visibility("default"))) QString escape(const QString& plain);
+ __attribute__((visibility("default"))) QString convertFromPlainText(const QString &plain, WhiteSpaceMode mode = WhiteSpacePre);
+ __attribute__((visibility("default"))) QTextCodec *codecForHtml(const QByteArray &ba);
+}
+class __attribute__((visibility("default"))) QAbstractUndoItem
+{
+public:
+ virtual ~QAbstractUndoItem() = 0;
+ virtual void undo() = 0;
+ virtual void redo() = 0;
+};
+inline QAbstractUndoItem::~QAbstractUndoItem()
+{
+}
+class QTextDocumentPrivate;
+class __attribute__((visibility("default"))) QTextDocument : public QObject
+{
+ public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
+public:
+ explicit QTextDocument(QObject *parent = 0);
+ explicit QTextDocument(const QString &text, QObject *parent = 0);
+ ~QTextDocument();
+ QTextDocument *clone(QObject *parent = 0) const;
+ bool isEmpty() const;
+ virtual void clear();
+ void setUndoRedoEnabled(bool enable);
+ bool isUndoRedoEnabled() const;
+ bool isUndoAvailable() const;
+ bool isRedoAvailable() const;
+ int revision() const;
+ void setDocumentLayout(QAbstractTextDocumentLayout *layout);
+ QAbstractTextDocumentLayout *documentLayout() const;
+ enum MetaInformation {
+ DocumentTitle,
+ DocumentUrl
+ };
+ void setMetaInformation(MetaInformation info, const QString &);
+ QString metaInformation(MetaInformation info) const;
+ QString toHtml(const QByteArray &encoding = QByteArray()) const;
+ void setHtml(const QString &html);
+ QString toPlainText() const;
+ void setPlainText(const QString &text);
+ QChar characterAt(int pos) const;
+ enum FindFlag
+ {
+ FindBackward = 0x00001,
+ FindCaseSensitively = 0x00002,
+ FindWholeWords = 0x00004
+ };
+ typedef QFlags<FindFlag> FindFlags;
+ QTextCursor find(const QString &subString, int from = 0, FindFlags options = 0) const;
+ QTextCursor find(const QString &subString, const QTextCursor &from, FindFlags options = 0) const;
+ QTextCursor find(const QRegExp &expr, int from = 0, FindFlags options = 0) const;
+ QTextCursor find(const QRegExp &expr, const QTextCursor &from, FindFlags options = 0) const;
+ QTextFrame *frameAt(int pos) const;
+ QTextFrame *rootFrame() const;
+ QTextObject *object(int objectIndex) const;
+ QTextObject *objectForFormat(const QTextFormat &) const;
+ QTextBlock findBlock(int pos) const;
+ QTextBlock findBlockByNumber(int blockNumber) const;
+ QTextBlock findBlockByLineNumber(int blockNumber) const;
+ QTextBlock begin() const;
+ QTextBlock end() const;
+ QTextBlock firstBlock() const;
+ QTextBlock lastBlock() const;
+ void setPageSize(const QSizeF &size);
+ QSizeF pageSize() const;
+ void setDefaultFont(const QFont &font);
+ QFont defaultFont() const;
+ int pageCount() const;
+ bool isModified() const;
+ void print(QPrinter *printer) const;
+ enum ResourceType {
+ HtmlResource = 1,
+ ImageResource = 2,
+ StyleSheetResource = 3,
+ UserResource = 100
+ };
+ QVariant resource(int type, const QUrl &name) const;
+ void addResource(int type, const QUrl &name, const QVariant &resource);
+ QVector<QTextFormat> allFormats() const;
+ void markContentsDirty(int from, int length);
+ void setUseDesignMetrics(bool b);
+ bool useDesignMetrics() const;
+ void drawContents(QPainter *painter, const QRectF &rect = QRectF());
+ void setTextWidth(qreal width);
+ qreal textWidth() const;
+ qreal idealWidth() const;
+ qreal indentWidth() const;
+ void setIndentWidth(qreal width);
+ qreal documentMargin() const;
+ void setDocumentMargin(qreal margin);
+ void adjustSize();
+ QSizeF size() const;
+ int blockCount() const;
+ int lineCount() const;
+ int characterCount() const;
+ void setDefaultStyleSheet(const QString &sheet);
+ QString defaultStyleSheet() const;
+ void undo(QTextCursor *cursor);
+ void redo(QTextCursor *cursor);
+ int maximumBlockCount() const;
+ void setMaximumBlockCount(int maximum);
+ QTextOption defaultTextOption() const;
+ void setDefaultTextOption(const QTextOption &option);
+protected:
+ void contentsChange(int from, int charsRemoves, int charsAdded);
+ void contentsChanged();
+ void undoAvailable(bool);
+ void redoAvailable(bool);
+ void undoCommandAdded();
+ void modificationChanged(bool m);
+ void cursorPositionChanged(const QTextCursor &cursor);
+ void blockCountChanged(int newBlockCount);
+ void documentLayoutChanged();
+public :
+ void undo();
+ void redo();
+ void appendUndoItem(QAbstractUndoItem *);
+ void setModified(bool m = true);
+protected:
+ virtual QTextObject *createObject(const QTextFormat &f);
+ virtual QVariant loadResource(int type, const QUrl &name);
+ QTextDocument(QTextDocumentPrivate &dd, QObject *parent);
+public:
+ QTextDocumentPrivate *docHandle() const;
+private:
+ QTextDocument(const QTextDocument &); QTextDocument &operator=(const QTextDocument &);
+ inline QTextDocumentPrivate* d_func() { return reinterpret_cast<QTextDocumentPrivate *>(d_ptr); } inline const QTextDocumentPrivate* d_func() const { return reinterpret_cast<const QTextDocumentPrivate *>(d_ptr); } friend class QTextDocumentPrivate;
+ friend class QTextObjectPrivate;
+};
+inline QFlags<QTextDocument::FindFlags::enum_type> operator|(QTextDocument::FindFlags::enum_type f1, QTextDocument::FindFlags::enum_type f2) { return QFlags<QTextDocument::FindFlags::enum_type>(f1) | f2; } inline QFlags<QTextDocument::FindFlags::enum_type> operator|(QTextDocument::FindFlags::enum_type f1, QFlags<QTextDocument::FindFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QTextDocument::FindFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QUrlPrivate;
+class QDataStream;
+class __attribute__((visibility("default"))) QUrl
+{
+public:
+ enum ParsingMode {
+ TolerantMode,
+ StrictMode
+ };
+ enum FormattingOption {
+ None = 0x0,
+ RemoveScheme = 0x1,
+ RemovePassword = 0x2,
+ RemoveUserInfo = RemovePassword | 0x4,
+ RemovePort = 0x8,
+ RemoveAuthority = RemoveUserInfo | RemovePort | 0x10,
+ RemovePath = 0x20,
+ RemoveQuery = 0x40,
+ RemoveFragment = 0x80,
+ StripTrailingSlash = 0x10000
+ };
+ typedef QFlags<FormattingOption> FormattingOptions;
+ QUrl();
+ QUrl(const QString &url);
+ QUrl(const QString &url, ParsingMode mode);
+ QUrl(const QUrl ©);
+ QUrl &operator =(const QUrl ©);
+ QUrl &operator =(const QString &url);
+ ~QUrl();
+ void setUrl(const QString &url);
+ void setUrl(const QString &url, ParsingMode mode);
+ void setEncodedUrl(const QByteArray &url);
+ void setEncodedUrl(const QByteArray &url, ParsingMode mode);
+ bool isValid() const;
+ bool isEmpty() const;
+ void clear();
+ void setScheme(const QString &scheme);
+ QString scheme() const;
+ void setAuthority(const QString &authority);
+ QString authority() const;
+ void setUserInfo(const QString &userInfo);
+ QString userInfo() const;
+ void setUserName(const QString &userName);
+ QString userName() const;
+ void setEncodedUserName(const QByteArray &userName);
+ QByteArray encodedUserName() const;
+ void setPassword(const QString &password);
+ QString password() const;
+ void setEncodedPassword(const QByteArray &password);
+ QByteArray encodedPassword() const;
+ void setHost(const QString &host);
+ QString host() const;
+ void setEncodedHost(const QByteArray &host);
+ QByteArray encodedHost() const;
+ void setPort(int port);
+ int port() const;
+ int port(int defaultPort) const;
+ void setPath(const QString &path);
+ QString path() const;
+ void setEncodedPath(const QByteArray &path);
+ QByteArray encodedPath() const;
+ bool hasQuery() const;
+ void setEncodedQuery(const QByteArray &query);
+ QByteArray encodedQuery() const;
+ void setQueryDelimiters(char valueDelimiter, char pairDelimiter);
+ char queryValueDelimiter() const;
+ char queryPairDelimiter() const;
+ void setQueryItems(const QList<QPair<QString, QString> > &query);
+ void addQueryItem(const QString &key, const QString &value);
+ QList<QPair<QString, QString> > queryItems() const;
+ bool hasQueryItem(const QString &key) const;
+ QString queryItemValue(const QString &key) const;
+ QStringList allQueryItemValues(const QString &key) const;
+ void removeQueryItem(const QString &key);
+ void removeAllQueryItems(const QString &key);
+ void setEncodedQueryItems(const QList<QPair<QByteArray, QByteArray> > &query);
+ void addEncodedQueryItem(const QByteArray &key, const QByteArray &value);
+ QList<QPair<QByteArray, QByteArray> > encodedQueryItems() const;
+ bool hasEncodedQueryItem(const QByteArray &key) const;
+ QByteArray encodedQueryItemValue(const QByteArray &key) const;
+ QList<QByteArray> allEncodedQueryItemValues(const QByteArray &key) const;
+ void removeEncodedQueryItem(const QByteArray &key);
+ void removeAllEncodedQueryItems(const QByteArray &key);
+ void setFragment(const QString &fragment);
+ QString fragment() const;
+ void setEncodedFragment(const QByteArray &fragment);
+ QByteArray encodedFragment() const;
+ bool hasFragment() const;
+ QUrl resolved(const QUrl &relative) const;
+ bool isRelative() const;
+ bool isParentOf(const QUrl &url) const;
+ static QUrl fromLocalFile(const QString &localfile);
+ QString toLocalFile() const;
+ QString toString(FormattingOptions options = None) const;
+ QByteArray toEncoded(FormattingOptions options = None) const;
+ static QUrl fromEncoded(const QByteArray &url);
+ static QUrl fromEncoded(const QByteArray &url, ParsingMode mode);
+ void detach();
+ bool isDetached() const;
+ bool operator <(const QUrl &url) const;
+ bool operator ==(const QUrl &url) const;
+ bool operator !=(const QUrl &url) const;
+ static QString fromPercentEncoding(const QByteArray &);
+ static QByteArray toPercentEncoding(const QString &,
+ const QByteArray &exclude = QByteArray(),
+ const QByteArray &include = QByteArray());
+ static QString fromPunycode(const QByteArray &);
+ static QByteArray toPunycode(const QString &);
+ static QString fromAce(const QByteArray &);
+ static QByteArray toAce(const QString &);
+ static QStringList idnWhitelist();
+ static void setIdnWhitelist(const QStringList &);
+ QString errorString() const;
+protected:
+private:
+ QUrlPrivate *d;
+public:
+ typedef QUrlPrivate * DataPtr;
+ inline DataPtr &data_ptr() { return d; }
+};
+template <> class QTypeInfo<QUrl> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QUrl)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QUrl"; } };
+template <> inline bool qIsDetached<QUrl>(QUrl &t) { return t.isDetached(); } template <typename T> inline void qSwap(T &, T &); template <> inline void qSwap<QUrl>(QUrl &value1, QUrl &value2) { const QUrl::DataPtr t = value1.data_ptr(); value1.data_ptr() = value2.data_ptr(); value2.data_ptr() = t; }
+inline QFlags<QUrl::FormattingOptions::enum_type> operator|(QUrl::FormattingOptions::enum_type f1, QUrl::FormattingOptions::enum_type f2) { return QFlags<QUrl::FormattingOptions::enum_type>(f1) | f2; } inline QFlags<QUrl::FormattingOptions::enum_type> operator|(QUrl::FormattingOptions::enum_type f1, QFlags<QUrl::FormattingOptions::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QUrl::FormattingOptions::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QUrl &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QUrl &);
+__attribute__((visibility("default"))) QDebug operator<<(QDebug, const QUrl &);
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QPalettePrivate;
+class QVariant;
+class __attribute__((visibility("default"))) QPalette
+{
+ public: static const QMetaObject staticMetaObject; private:
+public:
+ QPalette();
+ QPalette(const QColor &button);
+ QPalette(Qt::GlobalColor button);
+ QPalette(const QColor &button, const QColor &window);
+ QPalette(const QBrush &windowText, const QBrush &button, const QBrush &light,
+ const QBrush &dark, const QBrush &mid, const QBrush &text,
+ const QBrush &bright_text, const QBrush &base, const QBrush &window);
+ QPalette(const QColor &windowText, const QColor &window, const QColor &light,
+ const QColor &dark, const QColor &mid, const QColor &text, const QColor &base);
+ QPalette(const QPalette &palette);
+ ~QPalette();
+ QPalette &operator=(const QPalette &palette);
+ operator QVariant() const;
+ enum ColorGroup { Active, Disabled, Inactive, NColorGroups, Current, All, Normal = Active };
+ enum ColorRole { WindowText, Button, Light, Midlight, Dark, Mid,
+ Text, BrightText, ButtonText, Base, Window, Shadow,
+ Highlight, HighlightedText,
+ Link, LinkVisited,
+ AlternateBase,
+ NoRole,
+ ToolTipBase, ToolTipText,
+ NColorRoles = ToolTipText + 1,
+ Foreground = WindowText, Background = Window
+ };
+ inline ColorGroup currentColorGroup() const { return static_cast<ColorGroup>(current_group); }
+ inline void setCurrentColorGroup(ColorGroup cg) { current_group = cg; }
+ inline const QColor &color(ColorGroup cg, ColorRole cr) const
+ { return brush(cg, cr).color(); }
+ const QBrush &brush(ColorGroup cg, ColorRole cr) const;
+ inline void setColor(ColorGroup cg, ColorRole cr, const QColor &color);
+ inline void setColor(ColorRole cr, const QColor &color);
+ inline void setBrush(ColorRole cr, const QBrush &brush);
+ bool isBrushSet(ColorGroup cg, ColorRole cr) const;
+ void setBrush(ColorGroup cg, ColorRole cr, const QBrush &brush);
+ void setColorGroup(ColorGroup cr, const QBrush &windowText, const QBrush &button,
+ const QBrush &light, const QBrush &dark, const QBrush &mid,
+ const QBrush &text, const QBrush &bright_text, const QBrush &base,
+ const QBrush &window);
+ bool isEqual(ColorGroup cr1, ColorGroup cr2) const;
+ inline const QColor &color(ColorRole cr) const { return color(Current, cr); }
+ inline const QBrush &brush(ColorRole cr) const { return brush(Current, cr); }
+ inline const QBrush &foreground() const { return brush(WindowText); }
+ inline const QBrush &windowText() const { return brush(WindowText); }
+ inline const QBrush &button() const { return brush(Button); }
+ inline const QBrush &light() const { return brush(Light); }
+ inline const QBrush &dark() const { return brush(Dark); }
+ inline const QBrush &mid() const { return brush(Mid); }
+ inline const QBrush &text() const { return brush(Text); }
+ inline const QBrush &base() const { return brush(Base); }
+ inline const QBrush &alternateBase() const { return brush(AlternateBase); }
+ inline const QBrush &toolTipBase() const { return brush(ToolTipBase); }
+ inline const QBrush &toolTipText() const { return brush(ToolTipText); }
+ inline const QBrush &background() const { return brush(Window); }
+ inline const QBrush &window() const { return brush(Window); }
+ inline const QBrush &midlight() const { return brush(Midlight); }
+ inline const QBrush &brightText() const { return brush(BrightText); }
+ inline const QBrush &buttonText() const { return brush(ButtonText); }
+ inline const QBrush &shadow() const { return brush(Shadow); }
+ inline const QBrush &highlight() const { return brush(Highlight); }
+ inline const QBrush &highlightedText() const { return brush(HighlightedText); }
+ inline const QBrush &link() const { return brush(Link); }
+ inline const QBrush &linkVisited() const { return brush(LinkVisited); }
+ bool operator==(const QPalette &p) const;
+ inline bool operator!=(const QPalette &p) const { return !(operator==(p)); }
+ bool isCopyOf(const QPalette &p) const;
+ int serialNumber() const;
+ qint64 cacheKey() const;
+ QPalette resolve(const QPalette &) const;
+ inline uint resolve() const { return resolve_mask; }
+ inline void resolve(uint mask) { resolve_mask = mask; }
+private:
+ void setColorGroup(ColorGroup cr, const QBrush &windowText, const QBrush &button,
+ const QBrush &light, const QBrush &dark, const QBrush &mid,
+ const QBrush &text, const QBrush &bright_text,
+ const QBrush &base, const QBrush &alternate_base,
+ const QBrush &window, const QBrush &midlight,
+ const QBrush &button_text, const QBrush &shadow,
+ const QBrush &highlight, const QBrush &highlighted_text,
+ const QBrush &link, const QBrush &link_visited);
+ void setColorGroup(ColorGroup cr, const QBrush &windowText, const QBrush &button,
+ const QBrush &light, const QBrush &dark, const QBrush &mid,
+ const QBrush &text, const QBrush &bright_text,
+ const QBrush &base, const QBrush &alternate_base,
+ const QBrush &window, const QBrush &midlight,
+ const QBrush &button_text, const QBrush &shadow,
+ const QBrush &highlight, const QBrush &highlighted_text,
+ const QBrush &link, const QBrush &link_visited,
+ const QBrush &toolTipBase, const QBrush &toolTipText);
+ void init();
+ void detach();
+ QPalettePrivate *d;
+ uint current_group : 4;
+ uint resolve_mask : 28;
+ friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &s, const QPalette &p);
+};
+inline void QPalette::setColor(ColorGroup acg, ColorRole acr,
+ const QColor &acolor)
+{ setBrush(acg, acr, QBrush(acolor)); }
+inline void QPalette::setColor(ColorRole acr, const QColor &acolor)
+{ setColor(All, acr, acolor); }
+inline void QPalette::setBrush(ColorRole acr, const QBrush &abrush)
+{ setBrush(All, acr, abrush); }
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &ds, const QPalette &p);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &ds, QPalette &p);
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QIconPrivate;
+class QIconEngine;
+class QIconEngineV2;
+class __attribute__((visibility("default"))) QIcon
+{
+public:
+ enum Mode { Normal, Disabled, Active, Selected };
+ enum State { On, Off };
+ QIcon();
+ QIcon(const QPixmap &pixmap);
+ QIcon(const QIcon &other);
+ explicit QIcon(const QString &fileName);
+ explicit QIcon(QIconEngine *engine);
+ explicit QIcon(QIconEngineV2 *engine);
+ ~QIcon();
+ QIcon &operator=(const QIcon &other);
+ operator QVariant() const;
+ QPixmap pixmap(const QSize &size, Mode mode = Normal, State state = Off) const;
+ inline QPixmap pixmap(int w, int h, Mode mode = Normal, State state = Off) const
+ { return pixmap(QSize(w, h), mode, state); }
+ inline QPixmap pixmap(int extent, Mode mode = Normal, State state = Off) const
+ { return pixmap(QSize(extent, extent), mode, state); }
+ QSize actualSize(const QSize &size, Mode mode = Normal, State state = Off) const;
+ void paint(QPainter *painter, const QRect &rect, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off) const;
+ inline void paint(QPainter *painter, int x, int y, int w, int h, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off) const
+ { paint(painter, QRect(x, y, w, h), alignment, mode, state); }
+ bool isNull() const;
+ bool isDetached() const;
+ void detach();
+ int serialNumber() const;
+ qint64 cacheKey() const;
+ void addPixmap(const QPixmap &pixmap, Mode mode = Normal, State state = Off);
+ void addFile(const QString &fileName, const QSize &size = QSize(), Mode mode = Normal, State state = Off);
+ QList<QSize> availableSizes(Mode mode = Normal, State state = Off) const;
+private:
+ QIconPrivate *d;
+ friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QIcon &);
+ friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QIcon &);
+public:
+ typedef QIconPrivate * DataPtr;
+ inline DataPtr &data_ptr() { return d; }
+};
+template <> inline bool qIsDetached<QIcon>(QIcon &t) { return t.isDetached(); } template <typename T> inline void qSwap(T &, T &); template <> inline void qSwap<QIcon>(QIcon &value1, QIcon &value2) { const QIcon::DataPtr t = value1.data_ptr(); value1.data_ptr() = value2.data_ptr(); value2.data_ptr() = t; }
+template <> class QTypeInfo<QIcon> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QIcon)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QIcon"; } };
+__attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QIcon &);
+__attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QIcon &);
+namespace QCss
+{
+enum Property {
+ UnknownProperty,
+ BackgroundColor,
+ Color,
+ Float,
+ Font,
+ FontFamily,
+ FontSize,
+ FontStyle,
+ FontWeight,
+ Margin,
+ MarginBottom,
+ MarginLeft,
+ MarginRight,
+ MarginTop,
+ QtBlockIndent,
+ QtListIndent,
+ QtParagraphType,
+ QtTableType,
+ QtUserState,
+ TextDecoration,
+ TextIndent,
+ TextUnderlineStyle,
+ VerticalAlignment,
+ Whitespace,
+ QtSelectionForeground,
+ QtSelectionBackground,
+ Border,
+ BorderLeft,
+ BorderRight,
+ BorderTop,
+ BorderBottom,
+ Padding,
+ PaddingLeft,
+ PaddingRight,
+ PaddingTop,
+ PaddingBottom,
+ PageBreakBefore,
+ PageBreakAfter,
+ QtAlternateBackground,
+ BorderLeftStyle,
+ BorderRightStyle,
+ BorderTopStyle,
+ BorderBottomStyle,
+ BorderStyles,
+ BorderLeftColor,
+ BorderRightColor,
+ BorderTopColor,
+ BorderBottomColor,
+ BorderColor,
+ BorderLeftWidth,
+ BorderRightWidth,
+ BorderTopWidth,
+ BorderBottomWidth,
+ BorderWidth,
+ BorderTopLeftRadius,
+ BorderTopRightRadius,
+ BorderBottomLeftRadius,
+ BorderBottomRightRadius,
+ BorderRadius,
+ Background,
+ BackgroundOrigin,
+ BackgroundClip,
+ BackgroundRepeat,
+ BackgroundPosition,
+ BackgroundAttachment,
+ BackgroundImage,
+ BorderImage,
+ QtSpacing,
+ Width,
+ Height,
+ MinimumWidth,
+ MinimumHeight,
+ MaximumWidth,
+ MaximumHeight,
+ QtImage,
+ Left,
+ Right,
+ Top,
+ Bottom,
+ QtOrigin,
+ QtPosition,
+ Position,
+ QtStyleFeatures,
+ QtBackgroundRole,
+ ListStyleType,
+ ListStyle,
+ QtImageAlignment,
+ TextAlignment,
+ Outline,
+ OutlineOffset,
+ OutlineWidth,
+ OutlineColor,
+ OutlineStyle,
+ OutlineRadius,
+ OutlineTopLeftRadius,
+ OutlineTopRightRadius,
+ OutlineBottomLeftRadius,
+ OutlineBottomRightRadius,
+ FontVariant,
+ TextTransform,
+ NumProperties
+};
+enum KnownValue {
+ UnknownValue,
+ Value_Normal,
+ Value_Pre,
+ Value_NoWrap,
+ Value_PreWrap,
+ Value_Small,
+ Value_Medium,
+ Value_Large,
+ Value_XLarge,
+ Value_XXLarge,
+ Value_Italic,
+ Value_Oblique,
+ Value_Bold,
+ Value_Underline,
+ Value_Overline,
+ Value_LineThrough,
+ Value_Sub,
+ Value_Super,
+ Value_Left,
+ Value_Right,
+ Value_Top,
+ Value_Bottom,
+ Value_Center,
+ Value_Native,
+ Value_Solid,
+ Value_Dotted,
+ Value_Dashed,
+ Value_DotDash,
+ Value_DotDotDash,
+ Value_Double,
+ Value_Groove,
+ Value_Ridge,
+ Value_Inset,
+ Value_Outset,
+ Value_Wave,
+ Value_Middle,
+ Value_Auto,
+ Value_Always,
+ Value_None,
+ Value_Transparent,
+ Value_Disc,
+ Value_Circle,
+ Value_Square,
+ Value_Decimal,
+ Value_LowerAlpha,
+ Value_UpperAlpha,
+ Value_SmallCaps,
+ Value_Uppercase,
+ Value_Lowercase,
+ Value_FirstColorRole,
+ Value_WindowText = Value_FirstColorRole,
+ Value_Button,
+ Value_Light,
+ Value_Midlight,
+ Value_Dark,
+ Value_Mid,
+ Value_Text,
+ Value_BrightText,
+ Value_ButtonText,
+ Value_Base,
+ Value_Window,
+ Value_Shadow,
+ Value_Highlight,
+ Value_HighlightedText,
+ Value_Link,
+ Value_LinkVisited,
+ Value_AlternateBase,
+ Value_LastColorRole = Value_AlternateBase,
+ Value_Disabled,
+ Value_Active,
+ Value_Selected,
+ Value_On,
+ Value_Off,
+ NumKnownValues
+};
+enum BorderStyle {
+ BorderStyle_Unknown,
+ BorderStyle_None,
+ BorderStyle_Dotted,
+ BorderStyle_Dashed,
+ BorderStyle_Solid,
+ BorderStyle_Double,
+ BorderStyle_DotDash,
+ BorderStyle_DotDotDash,
+ BorderStyle_Groove,
+ BorderStyle_Ridge,
+ BorderStyle_Inset,
+ BorderStyle_Outset,
+ BorderStyle_Native,
+ NumKnownBorderStyles
+};
+enum Edge {
+ TopEdge,
+ RightEdge,
+ BottomEdge,
+ LeftEdge,
+ NumEdges
+};
+enum Corner {
+ TopLeftCorner,
+ TopRightCorner,
+ BottomLeftCorner,
+ BottomRightCorner
+};
+enum TileMode {
+ TileMode_Unknown,
+ TileMode_Round,
+ TileMode_Stretch,
+ TileMode_Repeat,
+ NumKnownTileModes
+};
+enum Repeat {
+ Repeat_Unknown,
+ Repeat_None,
+ Repeat_X,
+ Repeat_Y,
+ Repeat_XY,
+ NumKnownRepeats
+};
+enum Origin {
+ Origin_Unknown,
+ Origin_Padding,
+ Origin_Border,
+ Origin_Content,
+ Origin_Margin,
+ NumKnownOrigins
+};
+enum PositionMode {
+ PositionMode_Unknown,
+ PositionMode_Static,
+ PositionMode_Relative,
+ PositionMode_Absolute,
+ PositionMode_Fixed,
+ NumKnownPositionModes
+};
+enum Attachment {
+ Attachment_Unknown,
+ Attachment_Fixed,
+ Attachment_Scroll,
+ NumKnownAttachments
+};
+enum StyleFeature {
+ StyleFeature_None = 0,
+ StyleFeature_BackgroundColor = 1,
+ StyleFeature_BackgroundGradient = 2,
+ NumKnownStyleFeatures = 4
+};
+struct __attribute__((visibility("default"))) Value
+{
+ enum Type {
+ Unknown,
+ Number,
+ Percentage,
+ Length,
+ String,
+ Identifier,
+ KnownIdentifier,
+ Uri,
+ Color,
+ Function,
+ TermOperatorSlash,
+ TermOperatorComma
+ };
+ inline Value() : type(Unknown) { }
+ Type type;
+ QVariant variant;
+ QString toString() const;
+};
+struct ColorData {
+ ColorData() : type(Invalid) {}
+ ColorData(const QColor &col) : color(col) , type(Color) {}
+ ColorData(QPalette::ColorRole r) : role(r) , type(Role) {}
+ QColor color;
+ QPalette::ColorRole role;
+ enum { Invalid, Color, Role} type;
+};
+struct BrushData {
+ BrushData() : type(Invalid) {}
+ BrushData(const QBrush &br) : brush(br) , type(Brush) {}
+ BrushData(QPalette::ColorRole r) : role(r) , type(Role) {}
+ QBrush brush;
+ QPalette::ColorRole role;
+ enum { Invalid, Brush, Role, DependsOnThePalette } type;
+};
+struct BackgroundData {
+ BrushData brush;
+ QString image;
+ Repeat repeat;
+ Qt::Alignment alignment;
+};
+struct LengthData {
+ qreal number;
+ enum { None, Px, Ex, Em } unit;
+};
+struct BorderData {
+ LengthData width;
+ BorderStyle style;
+ BrushData color;
+};
+struct __attribute__((visibility("default"))) Declaration
+{
+ struct DeclarationData : public QSharedData
+ {
+ inline DeclarationData() : propertyId(UnknownProperty), important(false) {}
+ QString property;
+ Property propertyId;
+ QVector<Value> values;
+ QVariant parsed;
+ bool important;
+ };
+ QExplicitlySharedDataPointer<DeclarationData> d;
+ inline Declaration() : d(new DeclarationData()) {}
+ inline bool isEmpty() const { return d->property.isEmpty() && d->propertyId == UnknownProperty; }
+ QColor colorValue(const QPalette & = QPalette()) const;
+ void colorValues(QColor *c, const QPalette & = QPalette()) const;
+ QBrush brushValue(const QPalette & = QPalette()) const;
+ void brushValues(QBrush *c, const QPalette & = QPalette()) const;
+ BorderStyle styleValue() const;
+ void styleValues(BorderStyle *s) const;
+ Origin originValue() const;
+ Repeat repeatValue() const;
+ Qt::Alignment alignmentValue() const;
+ PositionMode positionValue() const;
+ Attachment attachmentValue() const;
+ int styleFeaturesValue() const;
+ bool intValue(int *i, const char *unit = 0) const;
+ bool realValue(qreal *r, const char *unit = 0) const;
+ QSize sizeValue() const;
+ QRect rectValue() const;
+ QString uriValue() const;
+ QIcon iconValue() const;
+ void borderImageValue(QString *image, int *cuts, TileMode *h, TileMode *v) const;
+};
+const quint64 PseudoClass_Unknown = static_cast<unsigned long long>(0x0000000000000000ULL);
+const quint64 PseudoClass_Enabled = static_cast<unsigned long long>(0x0000000000000001ULL);
+const quint64 PseudoClass_Disabled = static_cast<unsigned long long>(0x0000000000000002ULL);
+const quint64 PseudoClass_Pressed = static_cast<unsigned long long>(0x0000000000000004ULL);
+const quint64 PseudoClass_Focus = static_cast<unsigned long long>(0x0000000000000008ULL);
+const quint64 PseudoClass_Hover = static_cast<unsigned long long>(0x0000000000000010ULL);
+const quint64 PseudoClass_Checked = static_cast<unsigned long long>(0x0000000000000020ULL);
+const quint64 PseudoClass_Unchecked = static_cast<unsigned long long>(0x0000000000000040ULL);
+const quint64 PseudoClass_Indeterminate = static_cast<unsigned long long>(0x0000000000000080ULL);
+const quint64 PseudoClass_Unspecified = static_cast<unsigned long long>(0x0000000000000100ULL);
+const quint64 PseudoClass_Selected = static_cast<unsigned long long>(0x0000000000000200ULL);
+const quint64 PseudoClass_Horizontal = static_cast<unsigned long long>(0x0000000000000400ULL);
+const quint64 PseudoClass_Vertical = static_cast<unsigned long long>(0x0000000000000800ULL);
+const quint64 PseudoClass_Window = static_cast<unsigned long long>(0x0000000000001000ULL);
+const quint64 PseudoClass_Children = static_cast<unsigned long long>(0x0000000000002000ULL);
+const quint64 PseudoClass_Sibling = static_cast<unsigned long long>(0x0000000000004000ULL);
+const quint64 PseudoClass_Default = static_cast<unsigned long long>(0x0000000000008000ULL);
+const quint64 PseudoClass_First = static_cast<unsigned long long>(0x0000000000010000ULL);
+const quint64 PseudoClass_Last = static_cast<unsigned long long>(0x0000000000020000ULL);
+const quint64 PseudoClass_Middle = static_cast<unsigned long long>(0x0000000000040000ULL);
+const quint64 PseudoClass_OnlyOne = static_cast<unsigned long long>(0x0000000000080000ULL);
+const quint64 PseudoClass_PreviousSelected = static_cast<unsigned long long>(0x0000000000100000ULL);
+const quint64 PseudoClass_NextSelected = static_cast<unsigned long long>(0x0000000000200000ULL);
+const quint64 PseudoClass_Flat = static_cast<unsigned long long>(0x0000000000400000ULL);
+const quint64 PseudoClass_Left = static_cast<unsigned long long>(0x0000000000800000ULL);
+const quint64 PseudoClass_Right = static_cast<unsigned long long>(0x0000000001000000ULL);
+const quint64 PseudoClass_Top = static_cast<unsigned long long>(0x0000000002000000ULL);
+const quint64 PseudoClass_Bottom = static_cast<unsigned long long>(0x0000000004000000ULL);
+const quint64 PseudoClass_Exclusive = static_cast<unsigned long long>(0x0000000008000000ULL);
+const quint64 PseudoClass_NonExclusive = static_cast<unsigned long long>(0x0000000010000000ULL);
+const quint64 PseudoClass_Frameless = static_cast<unsigned long long>(0x0000000020000000ULL);
+const quint64 PseudoClass_ReadOnly = static_cast<unsigned long long>(0x0000000040000000ULL);
+const quint64 PseudoClass_Active = static_cast<unsigned long long>(0x0000000080000000ULL);
+const quint64 PseudoClass_Closable = static_cast<unsigned long long>(0x0000000100000000ULL);
+const quint64 PseudoClass_Movable = static_cast<unsigned long long>(0x0000000200000000ULL);
+const quint64 PseudoClass_Floatable = static_cast<unsigned long long>(0x0000000400000000ULL);
+const quint64 PseudoClass_Minimized = static_cast<unsigned long long>(0x0000000800000000ULL);
+const quint64 PseudoClass_Maximized = static_cast<unsigned long long>(0x0000001000000000ULL);
+const quint64 PseudoClass_On = static_cast<unsigned long long>(0x0000002000000000ULL);
+const quint64 PseudoClass_Off = static_cast<unsigned long long>(0x0000004000000000ULL);
+const quint64 PseudoClass_Editable = static_cast<unsigned long long>(0x0000008000000000ULL);
+const quint64 PseudoClass_Item = static_cast<unsigned long long>(0x0000010000000000ULL);
+const quint64 PseudoClass_Closed = static_cast<unsigned long long>(0x0000020000000000ULL);
+const quint64 PseudoClass_Open = static_cast<unsigned long long>(0x0000040000000000ULL);
+const quint64 PseudoClass_EditFocus = static_cast<unsigned long long>(0x0000080000000000ULL);
+const quint64 PseudoClass_Alternate = static_cast<unsigned long long>(0x0000100000000000ULL);
+const quint64 PseudoClass_Any = static_cast<unsigned long long>(0x0000ffffffffffffULL);
+const int NumPseudos = 46;
+struct __attribute__((visibility("default"))) Pseudo
+{
+ Pseudo() : negated(false) { }
+ quint64 type;
+ QString name;
+ QString function;
+ bool negated;
+};
+struct __attribute__((visibility("default"))) AttributeSelector
+{
+ enum ValueMatchType {
+ NoMatch,
+ MatchEqual,
+ MatchContains,
+ MatchBeginsWith
+ };
+ inline AttributeSelector() : valueMatchCriterium(NoMatch) {}
+ QString name;
+ QString value;
+ ValueMatchType valueMatchCriterium;
+};
+struct __attribute__((visibility("default"))) BasicSelector
+{
+ inline BasicSelector() : relationToNext(NoRelation) {}
+ enum Relation {
+ NoRelation,
+ MatchNextSelectorIfAncestor,
+ MatchNextSelectorIfParent,
+ MatchNextSelectorIfPreceeds
+ };
+ QString elementName;
+ QStringList ids;
+ QVector<Pseudo> pseudos;
+ QVector<AttributeSelector> attributeSelectors;
+ Relation relationToNext;
+};
+struct __attribute__((visibility("default"))) Selector
+{
+ QVector<BasicSelector> basicSelectors;
+ int specificity() const;
+ quint64 pseudoClass(quint64 *negated = 0) const;
+ QString pseudoElement() const;
+};
+struct StyleRule;
+struct MediaRule;
+struct PageRule;
+struct ImportRule;
+struct __attribute__((visibility("default"))) ValueExtractor
+{
+ ValueExtractor(const QVector<Declaration> &declarations, const QPalette & = QPalette());
+ bool extractFont(QFont *font, int *fontSizeAdjustment);
+ bool extractBackground(QBrush *, QString *, Repeat *, Qt::Alignment *, QCss::Origin *, QCss::Attachment *,
+ QCss::Origin *);
+ bool extractGeometry(int *w, int *h, int *minw, int *minh, int *maxw, int *maxh);
+ bool extractPosition(int *l, int *t, int *r, int *b, QCss::Origin *, Qt::Alignment *,
+ QCss::PositionMode *, Qt::Alignment *);
+ bool extractBox(int *margins, int *paddings, int *spacing = 0);
+ bool extractBorder(int *borders, QBrush *colors, BorderStyle *Styles, QSize *radii);
+ bool extractOutline(int *borders, QBrush *colors, BorderStyle *Styles, QSize *radii, int *offsets);
+ bool extractPalette(QBrush *fg, QBrush *sfg, QBrush *sbg, QBrush *abg);
+ int extractStyleFeatures();
+ bool extractImage(QIcon *icon, Qt::Alignment *a, QSize *size);
+ int lengthValue(const Declaration &decl);
+private:
+ void extractFont();
+ void borderValue(const Declaration &decl, int *width, QCss::BorderStyle *style, QBrush *color);
+ LengthData lengthValue(const Value& v);
+ void lengthValues(const Declaration &decl, int *m);
+ QSize sizeValue(const Declaration &decl);
+ void sizeValues(const Declaration &decl, QSize *radii);
+ QVector<Declaration> declarations;
+ QFont f;
+ int adjustment;
+ int fontExtracted;
+ QPalette pal;
+};
+struct __attribute__((visibility("default"))) StyleRule
+{
+ StyleRule() : order(0) { }
+ QVector<Selector> selectors;
+ QVector<Declaration> declarations;
+ int order;
+};
+struct __attribute__((visibility("default"))) MediaRule
+{
+ QStringList media;
+ QVector<StyleRule> styleRules;
+};
+struct __attribute__((visibility("default"))) PageRule
+{
+ QString selector;
+ QVector<Declaration> declarations;
+};
+struct __attribute__((visibility("default"))) ImportRule
+{
+ QString href;
+ QStringList media;
+};
+enum StyleSheetOrigin {
+ StyleSheetOrigin_Unspecified,
+ StyleSheetOrigin_UserAgent,
+ StyleSheetOrigin_User,
+ StyleSheetOrigin_Author,
+ StyleSheetOrigin_Inline
+};
+struct __attribute__((visibility("default"))) StyleSheet
+{
+ StyleSheet() : origin(StyleSheetOrigin_Unspecified), depth(0) { }
+ QVector<StyleRule> styleRules;
+ QVector<MediaRule> mediaRules;
+ QVector<PageRule> pageRules;
+ QVector<ImportRule> importRules;
+ StyleSheetOrigin origin;
+ int depth;
+ QMultiHash<QString, StyleRule> nameIndex;
+ QMultiHash<QString, StyleRule> idIndex;
+ void buildIndexes(Qt::CaseSensitivity nameCaseSensitivity = Qt::CaseSensitive);
+};
+class __attribute__((visibility("default"))) StyleSelector
+{
+public:
+ StyleSelector() : nameCaseSensitivity(Qt::CaseSensitive) {}
+ virtual ~StyleSelector();
+ union NodePtr {
+ void *ptr;
+ int id;
+ };
+ QVector<StyleRule> styleRulesForNode(NodePtr node);
+ QVector<Declaration> declarationsForNode(NodePtr node, const char *extraPseudo = 0);
+ virtual bool nodeNameEquals(NodePtr node, const QString& nodeName) const;
+ virtual QString attribute(NodePtr node, const QString &name) const = 0;
+ virtual bool hasAttributes(NodePtr node) const = 0;
+ virtual QStringList nodeIds(NodePtr node) const;
+ virtual QStringList nodeNames(NodePtr node) const = 0;
+ virtual bool isNullNode(NodePtr node) const = 0;
+ virtual NodePtr parentNode(NodePtr node) const = 0;
+ virtual NodePtr previousSiblingNode(NodePtr node) const = 0;
+ virtual NodePtr duplicateNode(NodePtr node) const = 0;
+ virtual void freeNode(NodePtr node) const = 0;
+ QVector<StyleSheet> styleSheets;
+ QString medium;
+ Qt::CaseSensitivity nameCaseSensitivity;
+private:
+ void matchRule(NodePtr node, const StyleRule &rules, StyleSheetOrigin origin,
+ int depth, QMap<uint, StyleRule> *weightedRules);
+ bool selectorMatches(const Selector &rule, NodePtr node);
+ bool basicSelectorMatches(const BasicSelector &rule, NodePtr node);
+};
+enum TokenType {
+ NONE,
+ S,
+ CDO,
+ CDC,
+ INCLUDES,
+ DASHMATCH,
+ LBRACE,
+ PLUS,
+ GREATER,
+ COMMA,
+ STRING,
+ INVALID,
+ IDENT,
+ HASH,
+ ATKEYWORD_SYM,
+ EXCLAMATION_SYM,
+ LENGTH,
+ PERCENTAGE,
+ NUMBER,
+ FUNCTION,
+ COLON,
+ SEMICOLON,
+ RBRACE,
+ SLASH,
+ MINUS,
+ DOT,
+ STAR,
+ LBRACKET,
+ RBRACKET,
+ EQUAL,
+ LPAREN,
+ RPAREN,
+ OR
+};
+struct __attribute__((visibility("default"))) Symbol
+{
+ inline Symbol() : start(0), len(-1) {}
+ TokenType token;
+ QString text;
+ int start, len;
+ QString lexem() const;
+};
+class Scanner
+{
+public:
+ static QString preprocess(const QString &input, bool *hasEscapeSequences = 0);
+ static void scan(const QString &preprocessedInput, QVector<Symbol> *symbols);
+ static const char *tokenName(TokenType t);
+};
+class __attribute__((visibility("default"))) Parser
+{
+public:
+ Parser();
+ Parser(const QString &css, bool file = false);
+ void init(const QString &css, bool file = false);
+ bool parse(StyleSheet *styleSheet, Qt::CaseSensitivity nameCaseSensitivity = Qt::CaseSensitive);
+ Symbol errorSymbol();
+ bool parseImport(ImportRule *importRule);
+ bool parseMedia(MediaRule *mediaRule);
+ bool parseMedium(QStringList *media);
+ bool parsePage(PageRule *pageRule);
+ bool parsePseudoPage(QString *selector);
+ bool parseNextOperator(Value *value);
+ bool parseCombinator(BasicSelector::Relation *relation);
+ bool parseProperty(Declaration *decl);
+ bool parseRuleset(StyleRule *styleRule);
+ bool parseSelector(Selector *sel);
+ bool parseSimpleSelector(BasicSelector *basicSel);
+ bool parseClass(QString *name);
+ bool parseElementName(QString *name);
+ bool parseAttrib(AttributeSelector *attr);
+ bool parsePseudo(Pseudo *pseudo);
+ bool parseNextDeclaration(Declaration *declaration);
+ bool parsePrio(Declaration *declaration);
+ bool parseExpr(QVector<Value> *values);
+ bool parseTerm(Value *value);
+ bool parseFunction(QString *name, QString *args);
+ bool parseHexColor(QColor *col);
+ bool testAndParseUri(QString *uri);
+ inline bool testRuleset() { return testSelector(); }
+ inline bool testSelector() { return testSimpleSelector(); }
+ inline bool parseNextSelector(Selector *sel) { if (!testSelector()) return recordError(); return parseSelector(sel); }
+ bool testSimpleSelector();
+ inline bool parseNextSimpleSelector(BasicSelector *basicSel) { if (!testSimpleSelector()) return recordError(); return parseSimpleSelector(basicSel); }
+ inline bool testElementName() { return test(IDENT) || test(STAR); }
+ inline bool testClass() { return test(DOT); }
+ inline bool testAttrib() { return test(LBRACKET); }
+ inline bool testPseudo() { return test(COLON); }
+ inline bool testMedium() { return test(IDENT); }
+ inline bool parseNextMedium(QStringList *media) { if (!testMedium()) return recordError(); return parseMedium(media); }
+ inline bool testPseudoPage() { return test(COLON); }
+ inline bool testImport() { return testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("import")); }
+ inline bool testMedia() { return testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("media")); }
+ inline bool testPage() { return testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("page")); }
+ inline bool testCombinator() { return test(PLUS) || test(GREATER) || test(S); }
+ inline bool testProperty() { return test(IDENT); }
+ bool testTerm();
+ inline bool testExpr() { return testTerm(); }
+ inline bool parseNextExpr(QVector<Value> *values) { if (!testExpr()) return recordError(); return parseExpr(values); }
+ bool testPrio();
+ inline bool testHexColor() { return test(HASH); }
+ inline bool testFunction() { return test(FUNCTION); }
+ inline bool parseNextFunction(QString *name, QString *args) { if (!testFunction()) return recordError(); return parseFunction(name, args); }
+ inline bool lookupElementName() const { return lookup() == IDENT || lookup() == STAR; }
+ inline void skipSpace() { while (test(S)) {}; }
+ inline bool hasNext() const { return index < symbols.count(); }
+ inline TokenType next() { return symbols.at(index++).token; }
+ bool next(TokenType t);
+ bool test(TokenType t);
+ inline void prev() { index--; }
+ inline const Symbol &symbol() const { return symbols.at(index - 1); }
+ inline QString lexem() const { return symbol().lexem(); }
+ QString unquotedLexem() const;
+ QString lexemUntil(TokenType t);
+ bool until(TokenType target, TokenType target2 = NONE);
+ inline TokenType lookup() const {
+ return (index - 1) < symbols.count() ? symbols.at(index - 1).token : NONE;
+ }
+ bool testTokenAndEndsWith(TokenType t, const QLatin1String &str);
+ inline bool recordError() { errorIndex = index; return false; }
+ QVector<Symbol> symbols;
+ int index;
+ int errorIndex;
+ bool hasEscapeSequences;
+ QString sourcePath;
+};
+}
+ template <> struct QMetaTypeId< QCss::BackgroundData > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = { (0) }; if (!metatype_id) metatype_id = qRegisterMetaType< QCss::BackgroundData >("QCss::BackgroundData"); return metatype_id; } };
+ template <> struct QMetaTypeId< QCss::LengthData > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = { (0) }; if (!metatype_id) metatype_id = qRegisterMetaType< QCss::LengthData >("QCss::LengthData"); return metatype_id; } };
+ template <> struct QMetaTypeId< QCss::BorderData > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = { (0) }; if (!metatype_id) metatype_id = qRegisterMetaType< QCss::BorderData >("QCss::BorderData"); return metatype_id; } };
+class QTextFormatCollection;
+class QTextFormat;
+class QTextBlockFormat;
+class QTextCursorPrivate;
+class QAbstractTextDocumentLayout;
+class QTextDocument;
+class QTextFrame;
+class QTextFragmentData : public QFragment<>
+{
+public:
+ inline void initialize() {}
+ inline void invalidate() const {}
+ inline void free() {}
+ int stringPosition;
+ int format;
+};
+class QTextBlockData : public QFragment<3>
+{
+public:
+ inline void initialize()
+ { layout = 0; userData = 0; userState = -1; revision = 0; hidden = 0; }
+ void invalidate() const;
+ inline void free()
+ { delete layout; layout = 0; delete userData; userData = 0; }
+ mutable int format;
+ mutable QTextLayout *layout;
+ mutable QTextBlockUserData *userData;
+ mutable int userState;
+ mutable int revision : 31;
+ mutable uint hidden : 1;
+};
+class QAbstractUndoItem;
+class QTextUndoCommand
+{
+public:
+ enum Command {
+ Inserted = 0,
+ Removed = 1,
+ CharFormatChanged = 2,
+ BlockFormatChanged = 3,
+ BlockInserted = 4,
+ BlockRemoved = 5,
+ BlockAdded = 6,
+ BlockDeleted = 7,
+ GroupFormatChange = 8,
+ Custom = 256
+ };
+ enum Operation {
+ KeepCursor = 0,
+ MoveCursor = 1
+ };
+ quint16 command;
+ quint8 block;
+ quint8 operation;
+ int format;
+ quint32 strPos;
+ quint32 pos;
+ union {
+ int blockFormat;
+ quint32 length;
+ QAbstractUndoItem *custom;
+ int objectIndex;
+ };
+ quint32 revision;
+ bool tryMerge(const QTextUndoCommand &other);
+};
+template <> class QTypeInfo<QTextUndoCommand> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QTextUndoCommand)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QTextUndoCommand"; } };
+class QTextDocumentPrivate : public QObjectPrivate
+{
+ inline QTextDocument* q_func() { return static_cast<QTextDocument *>(q_ptr); } inline const QTextDocument* q_func() const { return static_cast<const QTextDocument *>(q_ptr); } friend class QTextDocument;
+public:
+ typedef QFragmentMap<QTextFragmentData> FragmentMap;
+ typedef FragmentMap::ConstIterator FragmentIterator;
+ typedef QFragmentMap<QTextBlockData> BlockMap;
+ QTextDocumentPrivate();
+ ~QTextDocumentPrivate();
+ void init();
+ void clear();
+ void setLayout(QAbstractTextDocumentLayout *layout);
+ void insert(int pos, const QString &text, int format);
+ void insert(int pos, int strPos, int strLength, int format);
+ int insertBlock(int pos, int blockFormat, int charFormat, QTextUndoCommand::Operation = QTextUndoCommand::MoveCursor);
+ int insertBlock(const QChar &blockSeparator, int pos, int blockFormat, int charFormat,
+ QTextUndoCommand::Operation op = QTextUndoCommand::MoveCursor);
+ void move(int from, int to, int length, QTextUndoCommand::Operation = QTextUndoCommand::MoveCursor);
+ void remove(int pos, int length, QTextUndoCommand::Operation = QTextUndoCommand::MoveCursor);
+ void aboutToRemoveCell(int cursorFrom, int cursorEnd);
+ QTextFrame *insertFrame(int start, int end, const QTextFrameFormat &format);
+ void removeFrame(QTextFrame *frame);
+ enum FormatChangeMode { MergeFormat, SetFormat, SetFormatAndPreserveObjectIndices };
+ void setCharFormat(int pos, int length, const QTextCharFormat &newFormat, FormatChangeMode mode = SetFormat);
+ void setBlockFormat(const QTextBlock &from, const QTextBlock &to,
+ const QTextBlockFormat &newFormat, FormatChangeMode mode = SetFormat);
+ void emitUndoAvailable(bool available);
+ void emitRedoAvailable(bool available);
+ int undoRedo(bool undo);
+ inline void undo() { undoRedo(true); }
+ inline void redo() { undoRedo(false); }
+ void appendUndoItem(QAbstractUndoItem *);
+ inline void beginEditBlock() { editBlock++; }
+ void joinPreviousEditBlock();
+ void endEditBlock();
+ inline bool isInEditBlock() const { return editBlock; }
+ void enableUndoRedo(bool enable);
+ inline bool isUndoRedoEnabled() const { return undoEnabled; }
+ inline bool isUndoAvailable() const { return undoEnabled && undoState > 0; }
+ inline bool isRedoAvailable() const { return undoEnabled && undoState < undoStack.size(); }
+ inline QString buffer() const { return text; }
+ QString plainText() const;
+ inline int length() const { return fragments.length(); }
+ inline QTextFormatCollection *formatCollection() { return &formats; }
+ inline const QTextFormatCollection *formatCollection() const { return &formats; }
+ inline QAbstractTextDocumentLayout *layout() const { return lout; }
+ inline FragmentIterator find(int pos) const { return fragments.find(pos); }
+ inline FragmentIterator begin() const { return fragments.begin(); }
+ inline FragmentIterator end() const { return fragments.end(); }
+ inline QTextBlock blocksBegin() const { return QTextBlock(const_cast<QTextDocumentPrivate *>(this), blocks.firstNode()); }
+ inline QTextBlock blocksEnd() const { return QTextBlock(const_cast<QTextDocumentPrivate *>(this), 0); }
+ inline QTextBlock blocksFind(int pos) const { return QTextBlock(const_cast<QTextDocumentPrivate *>(this), blocks.findNode(pos)); }
+ int blockCharFormatIndex(int node) const;
+ inline int numBlocks() const { return blocks.numNodes(); }
+ const BlockMap &blockMap() const { return blocks; }
+ const FragmentMap &fragmentMap() const { return fragments; }
+ BlockMap &blockMap() { return blocks; }
+ FragmentMap &fragmentMap() { return fragments; }
+ static const QTextBlockData *block(const QTextBlock &it) { return it.p->blocks.fragment(it.n); }
+ int nextCursorPosition(int position, QTextLayout::CursorMode mode) const;
+ int previousCursorPosition(int position, QTextLayout::CursorMode mode) const;
+ void changeObjectFormat(QTextObject *group, int format);
+ void setModified(bool m);
+ inline bool isModified() const { return modified; }
+ inline QFont defaultFont() const { return formats.defaultFont(); }
+ inline void setDefaultFont(const QFont &f) { formats.setDefaultFont(f); }
+private:
+ bool split(int pos);
+ bool unite(uint f);
+ void truncateUndoStack();
+ void insert_string(int pos, uint strPos, uint length, int format, QTextUndoCommand::Operation op);
+ int insert_block(int pos, uint strPos, int format, int blockformat, QTextUndoCommand::Operation op, int command);
+ int remove_string(int pos, uint length, QTextUndoCommand::Operation op);
+ int remove_block(int pos, int *blockformat, int command, QTextUndoCommand::Operation op);
+ void insert_frame(QTextFrame *f);
+ void scan_frames(int pos, int charsRemoved, int charsAdded);
+ static void clearFrame(QTextFrame *f);
+ void adjustDocumentChangesAndCursors(int from, int addedOrRemoved, QTextUndoCommand::Operation op);
+ bool wasUndoAvailable;
+ bool wasRedoAvailable;
+public:
+ void documentChange(int from, int length);
+ inline void addCursor(QTextCursorPrivate *c) { cursors.append(c); }
+ inline void removeCursor(QTextCursorPrivate *c) { cursors.removeAll(c); changedCursors.removeAll(c); }
+ QTextFrame *frameAt(int pos) const;
+ QTextFrame *rootFrame() const;
+ QTextObject *objectForIndex(int objectIndex) const;
+ QTextObject *objectForFormat(int formatIndex) const;
+ QTextObject *objectForFormat(const QTextFormat &f) const;
+ QTextObject *createObject(const QTextFormat &newFormat, int objectIndex = -1);
+ void deleteObject(QTextObject *object);
+ QTextDocument *document() { return q_func(); }
+ const QTextDocument *document() const { return q_func(); }
+ bool ensureMaximumBlockCount();
+private:
+ QTextDocumentPrivate(const QTextDocumentPrivate& m);
+ QTextDocumentPrivate& operator= (const QTextDocumentPrivate& m);
+ void appendUndoItem(const QTextUndoCommand &c);
+ void contentsChanged();
+ void compressPieceTable();
+ QString text;
+ uint unreachableCharacterCount;
+ QVector<QTextUndoCommand> undoStack;
+ bool undoEnabled;
+ int undoState;
+ int modifiedState;
+ bool modified;
+ int editBlock;
+ int docChangeFrom;
+ int docChangeOldLength;
+ int docChangeLength;
+ bool framesDirty;
+ QTextFormatCollection formats;
+ mutable QTextFrame *rtFrame;
+ QAbstractTextDocumentLayout *lout;
+ FragmentMap fragments;
+ BlockMap blocks;
+ int initialBlockCharFormatIndex;
+ QList<QTextCursorPrivate*> cursors;
+ QList<QTextCursorPrivate*> changedCursors;
+ QMap<int, QTextObject *> objects;
+ QMap<QUrl, QVariant> resources;
+ QMap<QUrl, QVariant> cachedResources;
+ QString defaultStyleSheet;
+ int lastBlockCount;
+public:
+ QTextOption defaultTextOption;
+ QCss::StyleSheet parsedDefaultStyleSheet;
+ int maximumBlockCount;
+ bool needsEnsureMaximumBlockCount;
+ bool inContentsChange;
+ QSizeF pageSize;
+ QString title;
+ QString url;
+ qreal indentWidth;
+ qreal documentMargin;
+ void mergeCachedResources(const QTextDocumentPrivate *priv);
+ friend class QTextHtmlExporter;
+ friend class QTextCursor;
+};
+class QTextTable;
+class QTextHtmlExporter
+{
+public:
+ QTextHtmlExporter(const QTextDocument *_doc);
+ enum ExportMode {
+ ExportEntireDocument,
+ ExportFragment
+ };
+ QString toHtml(const QByteArray &encoding, ExportMode mode = ExportEntireDocument);
+private:
+ enum StyleMode { EmitStyleTag, OmitStyleTag };
+ enum FrameType { TextFrame, TableFrame, RootFrame };
+ void emitFrame(QTextFrame::Iterator frameIt);
+ void emitTextFrame(const QTextFrame *frame);
+ void emitBlock(const QTextBlock &block);
+ void emitTable(const QTextTable *table);
+ void emitFragment(const QTextFragment &fragment);
+ void emitBlockAttributes(const QTextBlock &block);
+ bool emitCharFormatStyle(const QTextCharFormat &format);
+ void emitTextLength(const char *attribute, const QTextLength &length);
+ void emitAlignment(Qt::Alignment alignment);
+ void emitFloatStyle(QTextFrameFormat::Position pos, StyleMode mode = EmitStyleTag);
+ void emitMargins(const QString &top, const QString &bottom, const QString &left, const QString &right);
+ void emitAttribute(const char *attribute, const QString &value);
+ void emitFrameStyle(const QTextFrameFormat &format, FrameType frameType);
+ void emitBorderStyle(QTextFrameFormat::BorderStyle style);
+ void emitPageBreakPolicy(QTextFormat::PageBreakFlags policy);
+ void emitFontFamily(const QString &family);
+ void emitBackgroundAttribute(const QTextFormat &format);
+ QString findUrlForImage(const QTextDocument *doc, qint64 cacheKey, bool isPixmap);
+ QString html;
+ QTextCharFormat defaultCharFormat;
+ const QTextDocument *doc;
+ bool fragmentMarkers;
+};
+extern "C" {
+typedef char hb_int8;
+typedef unsigned char hb_uint8;
+typedef short hb_int16;
+typedef unsigned short hb_uint16;
+typedef int hb_int32;
+typedef unsigned int hb_uint32;
+typedef hb_uint8 HB_Bool;
+typedef hb_uint8 HB_Byte;
+typedef hb_uint16 HB_UShort;
+typedef hb_uint32 HB_UInt;
+typedef hb_int8 HB_Char;
+typedef hb_int16 HB_Short;
+typedef hb_int32 HB_Int;
+typedef hb_uint16 HB_UChar16;
+typedef hb_uint32 HB_UChar32;
+typedef hb_uint32 HB_Glyph;
+typedef hb_int32 HB_Fixed;
+typedef hb_int32 HB_16Dot16;
+typedef void * HB_Pointer;
+typedef hb_uint32 HB_Tag;
+typedef enum {
+ HB_Err_Ok = 0x0000,
+ HB_Err_Not_Covered = 0xFFFF,
+ HB_Err_Invalid_Argument = 0x1A66,
+ HB_Err_Invalid_SubTable_Format = 0x157F,
+ HB_Err_Invalid_SubTable = 0x1570,
+ HB_Err_Read_Error = 0x6EAD,
+ HB_Err_Out_Of_Memory = 0xDEAD
+} HB_Error;
+typedef struct {
+ HB_Fixed x;
+ HB_Fixed y;
+} HB_FixedPoint;
+typedef struct HB_Font_ *HB_Font;
+typedef struct HB_StreamRec_ *HB_Stream;
+typedef struct HB_FaceRec_ *HB_Face;
+}
+extern "C" {
+struct HB_LangSys_
+{
+ HB_UShort LookupOrderOffset;
+ HB_UShort ReqFeatureIndex;
+ HB_UShort FeatureCount;
+ HB_UShort* FeatureIndex;
+};
+typedef struct HB_LangSys_ HB_LangSys;
+struct HB_LangSysRecord_
+{
+ HB_UInt LangSysTag;
+ HB_LangSys LangSys;
+};
+typedef struct HB_LangSysRecord_ HB_LangSysRecord;
+struct HB_ScriptTable_
+{
+ HB_LangSys DefaultLangSys;
+ HB_UShort LangSysCount;
+ HB_LangSysRecord* LangSysRecord;
+};
+typedef struct HB_ScriptTable_ HB_ScriptTable;
+struct HB_ScriptRecord_
+{
+ HB_UInt ScriptTag;
+ HB_ScriptTable Script;
+};
+typedef struct HB_ScriptRecord_ HB_ScriptRecord;
+struct HB_ScriptList_
+{
+ HB_UShort ScriptCount;
+ HB_ScriptRecord* ScriptRecord;
+};
+typedef struct HB_ScriptList_ HB_ScriptList;
+struct HB_Feature_
+{
+ HB_UShort FeatureParams;
+ HB_UShort LookupListCount;
+ HB_UShort* LookupListIndex;
+};
+typedef struct HB_Feature_ HB_Feature;
+struct HB_FeatureRecord_
+{
+ HB_UInt FeatureTag;
+ HB_Feature Feature;
+};
+typedef struct HB_FeatureRecord_ HB_FeatureRecord;
+struct HB_FeatureList_
+{
+ HB_UShort FeatureCount;
+ HB_FeatureRecord* FeatureRecord;
+ HB_UShort* ApplyOrder;
+ HB_UShort ApplyCount;
+};
+typedef struct HB_FeatureList_ HB_FeatureList;
+typedef struct HB_SubTable_ HB_SubTable;
+struct HB_Lookup_
+{
+ HB_UShort LookupType;
+ HB_UShort LookupFlag;
+ HB_UShort SubTableCount;
+ HB_SubTable* SubTable;
+};
+typedef struct HB_Lookup_ HB_Lookup;
+struct HB_LookupList_
+{
+ HB_UShort LookupCount;
+ HB_Lookup* Lookup;
+ HB_UInt* Properties;
+};
+typedef struct HB_LookupList_ HB_LookupList;
+struct HB_CoverageFormat1_
+{
+ HB_UShort GlyphCount;
+ HB_UShort* GlyphArray;
+};
+typedef struct HB_CoverageFormat1_ HB_CoverageFormat1;
+struct HB_RangeRecord_
+{
+ HB_UShort Start;
+ HB_UShort End;
+ HB_UShort StartCoverageIndex;
+};
+typedef struct HB_RangeRecord_ HB_RangeRecord;
+struct HB_CoverageFormat2_
+{
+ HB_UShort RangeCount;
+ HB_RangeRecord* RangeRecord;
+};
+typedef struct HB_CoverageFormat2_ HB_CoverageFormat2;
+struct HB_Coverage_
+{
+ HB_UShort CoverageFormat;
+ union
+ {
+ HB_CoverageFormat1 cf1;
+ HB_CoverageFormat2 cf2;
+ } cf;
+};
+typedef struct HB_Coverage_ HB_Coverage;
+struct HB_ClassDefFormat1_
+{
+ HB_UShort StartGlyph;
+ HB_UShort GlyphCount;
+ HB_UShort* ClassValueArray;
+};
+typedef struct HB_ClassDefFormat1_ HB_ClassDefFormat1;
+struct HB_ClassRangeRecord_
+{
+ HB_UShort Start;
+ HB_UShort End;
+ HB_UShort Class;
+};
+typedef struct HB_ClassRangeRecord_ HB_ClassRangeRecord;
+struct HB_ClassDefFormat2_
+{
+ HB_UShort ClassRangeCount;
+ HB_ClassRangeRecord* ClassRangeRecord;
+};
+typedef struct HB_ClassDefFormat2_ HB_ClassDefFormat2;
+struct HB_ClassDefinition_
+{
+ HB_Bool loaded;
+ HB_UShort ClassFormat;
+ union
+ {
+ HB_ClassDefFormat1 cd1;
+ HB_ClassDefFormat2 cd2;
+ } cd;
+};
+typedef struct HB_ClassDefinition_ HB_ClassDefinition;
+struct HB_Device_
+{
+ HB_UShort StartSize;
+ HB_UShort EndSize;
+ HB_UShort DeltaFormat;
+ HB_UShort* DeltaValue;
+};
+typedef struct HB_Device_ HB_Device;
+enum HB_Type_
+{
+ HB_Type_GSUB,
+ HB_Type_GPOS
+};
+typedef enum HB_Type_ HB_Type;
+}
+extern "C" {
+typedef struct HB_StreamRec_
+{
+ HB_Byte* base;
+ HB_UInt size;
+ HB_UInt pos;
+ HB_Byte* cursor;
+} HB_StreamRec;
+}
+extern "C" {
+typedef struct HB_AttachPoint_ HB_AttachPoint;
+struct HB_AttachList_
+{
+ HB_Bool loaded;
+ HB_Coverage Coverage;
+ HB_UShort GlyphCount;
+ HB_AttachPoint* AttachPoint;
+};
+typedef struct HB_AttachList_ HB_AttachList;
+typedef struct HB_LigGlyph_ HB_LigGlyph;
+struct HB_LigCaretList_
+{
+ HB_Bool loaded;
+ HB_Coverage Coverage;
+ HB_UShort LigGlyphCount;
+ HB_LigGlyph* LigGlyph;
+};
+typedef struct HB_LigCaretList_ HB_LigCaretList;
+struct HB_GDEFHeader_
+{
+ HB_UInt offset;
+ HB_16Dot16 Version;
+ HB_ClassDefinition GlyphClassDef;
+ HB_AttachList AttachList;
+ HB_LigCaretList LigCaretList;
+ HB_UInt MarkAttachClassDef_offset;
+ HB_ClassDefinition MarkAttachClassDef;
+ HB_UShort LastGlyph;
+ HB_UShort** NewGlyphClasses;
+};
+typedef struct HB_GDEFHeader_ HB_GDEFHeader;
+typedef struct HB_GDEFHeader_* HB_GDEF;
+HB_Error HB_New_GDEF_Table( HB_GDEFHeader** retptr );
+HB_Error HB_Load_GDEF_Table( HB_Stream stream,
+ HB_GDEFHeader** gdef );
+HB_Error HB_Done_GDEF_Table ( HB_GDEFHeader* gdef );
+HB_Error HB_GDEF_Get_Glyph_Property( HB_GDEFHeader* gdef,
+ HB_UShort glyphID,
+ HB_UShort* property );
+HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
+ HB_UShort num_glyphs,
+ HB_UShort glyph_count,
+ HB_UShort* glyph_array,
+ HB_UShort* class_array );
+}
+extern "C" {
+typedef struct HB_GlyphItemRec_ {
+ HB_UInt gindex;
+ HB_UInt properties;
+ HB_UInt cluster;
+ HB_UShort component;
+ HB_UShort ligID;
+ HB_UShort gproperties;
+} HB_GlyphItemRec, *HB_GlyphItem;
+typedef struct HB_PositionRec_ {
+ HB_Fixed x_pos;
+ HB_Fixed y_pos;
+ HB_Fixed x_advance;
+ HB_Fixed y_advance;
+ HB_UShort back;
+ HB_Bool new_advance;
+ HB_Short cursive_chain;
+} HB_PositionRec, *HB_Position;
+typedef struct HB_BufferRec_{
+ HB_UInt allocated;
+ HB_UInt in_length;
+ HB_UInt out_length;
+ HB_UInt in_pos;
+ HB_UInt out_pos;
+ HB_Bool separate_out;
+ HB_GlyphItem in_string;
+ HB_GlyphItem out_string;
+ HB_GlyphItem alt_string;
+ HB_Position positions;
+ HB_UShort max_ligID;
+} HB_BufferRec, *HB_Buffer;
+HB_Error
+hb_buffer_new( HB_Buffer *buffer );
+void
+hb_buffer_free( HB_Buffer buffer );
+void
+hb_buffer_clear( HB_Buffer buffer );
+HB_Error
+hb_buffer_add_glyph( HB_Buffer buffer,
+ HB_UInt glyph_index,
+ HB_UInt properties,
+ HB_UInt cluster );
+}
+extern "C" {
+typedef HB_Error (*HB_MMFunction)(HB_Font font,
+ HB_UShort metric_id,
+ HB_Fixed* metric_value,
+ void* data );
+struct HB_GPOSHeader_
+{
+ HB_16Dot16 Version;
+ HB_ScriptList ScriptList;
+ HB_FeatureList FeatureList;
+ HB_LookupList LookupList;
+ HB_GDEFHeader* gdef;
+ HB_MMFunction mmfunc;
+ void* data;
+};
+typedef struct HB_GPOSHeader_ HB_GPOSHeader;
+typedef HB_GPOSHeader* HB_GPOS;
+HB_Error HB_Load_GPOS_Table( HB_Stream stream,
+ HB_GPOSHeader** gpos,
+ HB_GDEFHeader* gdef,
+ HB_Stream gdefStream );
+HB_Error HB_Done_GPOS_Table( HB_GPOSHeader* gpos );
+HB_Error HB_GPOS_Select_Script( HB_GPOSHeader* gpos,
+ HB_UInt script_tag,
+ HB_UShort* script_index );
+HB_Error HB_GPOS_Select_Language( HB_GPOSHeader* gpos,
+ HB_UInt language_tag,
+ HB_UShort script_index,
+ HB_UShort* language_index,
+ HB_UShort* req_feature_index );
+HB_Error HB_GPOS_Select_Feature( HB_GPOSHeader* gpos,
+ HB_UInt feature_tag,
+ HB_UShort script_index,
+ HB_UShort language_index,
+ HB_UShort* feature_index );
+HB_Error HB_GPOS_Query_Scripts( HB_GPOSHeader* gpos,
+ HB_UInt** script_tag_list );
+HB_Error HB_GPOS_Query_Languages( HB_GPOSHeader* gpos,
+ HB_UShort script_index,
+ HB_UInt** language_tag_list );
+HB_Error HB_GPOS_Query_Features( HB_GPOSHeader* gpos,
+ HB_UShort script_index,
+ HB_UShort language_index,
+ HB_UInt** feature_tag_list );
+HB_Error HB_GPOS_Add_Feature( HB_GPOSHeader* gpos,
+ HB_UShort feature_index,
+ HB_UInt property );
+HB_Error HB_GPOS_Clear_Features( HB_GPOSHeader* gpos );
+HB_Error HB_GPOS_Register_MM_Function( HB_GPOSHeader* gpos,
+ HB_MMFunction mmfunc,
+ void* data );
+HB_Error HB_GPOS_Apply_String( HB_Font font,
+ HB_GPOSHeader* gpos,
+ HB_UShort load_flags,
+ HB_Buffer buffer,
+ HB_Bool dvi,
+ HB_Bool r2l );
+}
+extern "C" {
+typedef HB_UShort (*HB_AltFunction)(HB_UInt pos,
+ HB_UShort glyphID,
+ HB_UShort num_alternates,
+ HB_UShort* alternates,
+ void* data );
+struct HB_GSUBHeader_
+{
+ HB_UInt offset;
+ HB_16Dot16 Version;
+ HB_ScriptList ScriptList;
+ HB_FeatureList FeatureList;
+ HB_LookupList LookupList;
+ HB_GDEFHeader* gdef;
+ HB_AltFunction altfunc;
+ void* data;
+};
+typedef struct HB_GSUBHeader_ HB_GSUBHeader;
+typedef HB_GSUBHeader* HB_GSUB;
+HB_Error HB_Load_GSUB_Table( HB_Stream stream,
+ HB_GSUBHeader** gsub,
+ HB_GDEFHeader* gdef,
+ HB_Stream gdefStream );
+HB_Error HB_Done_GSUB_Table( HB_GSUBHeader* gsub );
+HB_Error HB_GSUB_Select_Script( HB_GSUBHeader* gsub,
+ HB_UInt script_tag,
+ HB_UShort* script_index );
+HB_Error HB_GSUB_Select_Language( HB_GSUBHeader* gsub,
+ HB_UInt language_tag,
+ HB_UShort script_index,
+ HB_UShort* language_index,
+ HB_UShort* req_feature_index );
+HB_Error HB_GSUB_Select_Feature( HB_GSUBHeader* gsub,
+ HB_UInt feature_tag,
+ HB_UShort script_index,
+ HB_UShort language_index,
+ HB_UShort* feature_index );
+HB_Error HB_GSUB_Query_Scripts( HB_GSUBHeader* gsub,
+ HB_UInt** script_tag_list );
+HB_Error HB_GSUB_Query_Languages( HB_GSUBHeader* gsub,
+ HB_UShort script_index,
+ HB_UInt** language_tag_list );
+HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub,
+ HB_UShort script_index,
+ HB_UShort language_index,
+ HB_UInt** feature_tag_list );
+HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub,
+ HB_UShort feature_index,
+ HB_UInt property );
+HB_Error HB_GSUB_Clear_Features( HB_GSUBHeader* gsub );
+HB_Error HB_GSUB_Register_Alternate_Function( HB_GSUBHeader* gsub,
+ HB_AltFunction altfunc,
+ void* data );
+HB_Error HB_GSUB_Apply_String( HB_GSUBHeader* gsub,
+ HB_Buffer buffer );
+}
+extern "C" {
+typedef enum {
+ HB_LineBreak_OP, HB_LineBreak_CL, HB_LineBreak_QU, HB_LineBreak_GL, HB_LineBreak_NS,
+ HB_LineBreak_EX, HB_LineBreak_SY, HB_LineBreak_IS, HB_LineBreak_PR, HB_LineBreak_PO,
+ HB_LineBreak_NU, HB_LineBreak_AL, HB_LineBreak_ID, HB_LineBreak_IN, HB_LineBreak_HY,
+ HB_LineBreak_BA, HB_LineBreak_BB, HB_LineBreak_B2, HB_LineBreak_ZW, HB_LineBreak_CM,
+ HB_LineBreak_WJ, HB_LineBreak_H2, HB_LineBreak_H3, HB_LineBreak_JL, HB_LineBreak_JV,
+ HB_LineBreak_JT, HB_LineBreak_SA, HB_LineBreak_SG,
+ HB_LineBreak_SP, HB_LineBreak_CR, HB_LineBreak_LF, HB_LineBreak_BK
+} HB_LineBreakClass;
+typedef enum
+{
+ HB_NoCategory,
+ HB_Mark_NonSpacing,
+ HB_Mark_SpacingCombining,
+ HB_Mark_Enclosing,
+ HB_Number_DecimalDigit,
+ HB_Number_Letter,
+ HB_Number_Other,
+ HB_Separator_Space,
+ HB_Separator_Line,
+ HB_Separator_Paragraph,
+ HB_Other_Control,
+ HB_Other_Format,
+ HB_Other_Surrogate,
+ HB_Other_PrivateUse,
+ HB_Other_NotAssigned,
+ HB_Letter_Uppercase,
+ HB_Letter_Lowercase,
+ HB_Letter_Titlecase,
+ HB_Letter_Modifier,
+ HB_Letter_Other,
+ HB_Punctuation_Connector,
+ HB_Punctuation_Dash,
+ HB_Punctuation_Open,
+ HB_Punctuation_Close,
+ HB_Punctuation_InitialQuote,
+ HB_Punctuation_FinalQuote,
+ HB_Punctuation_Other,
+ HB_Symbol_Math,
+ HB_Symbol_Currency,
+ HB_Symbol_Modifier,
+ HB_Symbol_Other
+} HB_CharCategory;
+typedef enum
+{
+ HB_Grapheme_Other,
+ HB_Grapheme_CR,
+ HB_Grapheme_LF,
+ HB_Grapheme_Control,
+ HB_Grapheme_Extend,
+ HB_Grapheme_L,
+ HB_Grapheme_V,
+ HB_Grapheme_T,
+ HB_Grapheme_LV,
+ HB_Grapheme_LVT
+} HB_GraphemeClass;
+typedef enum
+{
+ HB_Word_Other,
+ HB_Word_Format,
+ HB_Word_Katakana,
+ HB_Word_ALetter,
+ HB_Word_MidLetter,
+ HB_Word_MidNum,
+ HB_Word_Numeric,
+ HB_Word_ExtendNumLet
+} HB_WordClass;
+typedef enum
+{
+ HB_Sentence_Other,
+ HB_Sentence_Sep,
+ HB_Sentence_Format,
+ HB_Sentence_Sp,
+ HB_Sentence_Lower,
+ HB_Sentence_Upper,
+ HB_Sentence_OLetter,
+ HB_Sentence_Numeric,
+ HB_Sentence_ATerm,
+ HB_Sentence_STerm,
+ HB_Sentence_Close
+} HB_SentenceClass;
+HB_GraphemeClass HB_GetGraphemeClass(HB_UChar32 ch);
+HB_WordClass HB_GetWordClass(HB_UChar32 ch);
+HB_SentenceClass HB_GetSentenceClass(HB_UChar32 ch);
+HB_LineBreakClass HB_GetLineBreakClass(HB_UChar32 ch);
+void HB_GetGraphemeAndLineBreakClass(HB_UChar32 ch, HB_GraphemeClass *grapheme, HB_LineBreakClass *lineBreak);
+void HB_GetUnicodeCharProperties(HB_UChar32 ch, HB_CharCategory *category, int *combiningClass);
+HB_CharCategory HB_GetUnicodeCharCategory(HB_UChar32 ch);
+int HB_GetUnicodeCharCombiningClass(HB_UChar32 ch);
+HB_UChar16 HB_GetMirroredChar(HB_UChar16 ch);
+void *HB_Library_Resolve(const char *library, const char *symbol);
+void *HB_TextCodecForMib(int mib);
+char *HB_TextCodec_ConvertFromUnicode(void *codec, const HB_UChar16 *unicode, hb_uint32 length, hb_uint32 *outputLength);
+void HB_TextCodec_FreeResult(char *);
+}
+extern "C" {
+ HB_Pointer
+_hb_alloc( size_t size,
+ HB_Error *perror_ );
+ HB_Pointer
+_hb_realloc( HB_Pointer block,
+ size_t new_size,
+ HB_Error *perror_ );
+ void
+_hb_free( HB_Pointer block );
+ HB_Error
+_hb_err (HB_Error code);
+}
+extern "C" {
+ void
+_hb_close_stream( HB_Stream stream );
+ HB_Int
+_hb_stream_pos( HB_Stream stream );
+ HB_Error
+_hb_stream_seek( HB_Stream stream,
+ HB_UInt pos );
+ HB_Error
+_hb_stream_frame_enter( HB_Stream stream,
+ HB_UInt size );
+ void
+_hb_stream_frame_exit( HB_Stream stream );
+}
+extern "C" {
+typedef enum {
+ HB_Script_Common,
+ HB_Script_Greek,
+ HB_Script_Cyrillic,
+ HB_Script_Armenian,
+ HB_Script_Hebrew,
+ HB_Script_Arabic,
+ HB_Script_Syriac,
+ HB_Script_Thaana,
+ HB_Script_Devanagari,
+ HB_Script_Bengali,
+ HB_Script_Gurmukhi,
+ HB_Script_Gujarati,
+ HB_Script_Oriya,
+ HB_Script_Tamil,
+ HB_Script_Telugu,
+ HB_Script_Kannada,
+ HB_Script_Malayalam,
+ HB_Script_Sinhala,
+ HB_Script_Thai,
+ HB_Script_Lao,
+ HB_Script_Tibetan,
+ HB_Script_Myanmar,
+ HB_Script_Georgian,
+ HB_Script_Hangul,
+ HB_Script_Ogham,
+ HB_Script_Runic,
+ HB_Script_Khmer,
+ HB_Script_Inherited,
+ HB_ScriptCount = HB_Script_Inherited
+} HB_Script;
+typedef struct
+{
+ hb_uint32 pos;
+ hb_uint32 length;
+ HB_Script script;
+ hb_uint8 bidiLevel;
+} HB_ScriptItem;
+typedef enum {
+ HB_NoBreak,
+ HB_SoftHyphen,
+ HB_Break,
+ HB_ForcedBreak
+} HB_LineBreakType;
+typedef struct {
+ unsigned lineBreakType :2;
+ unsigned whiteSpace :1;
+ unsigned charStop :1;
+ unsigned wordBoundary :1;
+ unsigned sentenceBoundary :1;
+ unsigned unused :2;
+} HB_CharAttributes;
+void HB_GetCharAttributes(const HB_UChar16 *string, hb_uint32 stringLength,
+ const HB_ScriptItem *items, hb_uint32 numItems,
+ HB_CharAttributes *attributes);
+void HB_GetWordBoundaries(const HB_UChar16 *string, hb_uint32 stringLength,
+ const HB_ScriptItem *items, hb_uint32 numItems,
+ HB_CharAttributes *attributes);
+void HB_GetSentenceBoundaries(const HB_UChar16 *string, hb_uint32 stringLength,
+ const HB_ScriptItem *items, hb_uint32 numItems,
+ HB_CharAttributes *attributes);
+typedef enum {
+ HB_LeftToRight = 0,
+ HB_RightToLeft = 1
+} HB_StringToGlyphsFlags;
+typedef enum {
+ HB_ShaperFlag_Default = 0,
+ HB_ShaperFlag_NoKerning = 1,
+ HB_ShaperFlag_UseDesignMetrics = 2
+} HB_ShaperFlag;
+typedef enum {
+ HB_NoJustification= 0,
+ HB_Arabic_Space = 1,
+ HB_Character = 2,
+ HB_Space = 4,
+ HB_Arabic_Normal = 7,
+ HB_Arabic_Waw = 8,
+ HB_Arabic_BaRa = 9,
+ HB_Arabic_Alef = 10,
+ HB_Arabic_HaaDal = 11,
+ HB_Arabic_Seen = 12,
+ HB_Arabic_Kashida = 13
+} HB_JustificationClass;
+typedef struct {
+ unsigned justification :4;
+ unsigned clusterStart :1;
+ unsigned mark :1;
+ unsigned zeroWidth :1;
+ unsigned dontPrint :1;
+ unsigned combiningClass :8;
+} HB_GlyphAttributes;
+typedef struct HB_FaceRec_ {
+ HB_Bool isSymbolFont;
+ HB_GDEF gdef;
+ HB_GSUB gsub;
+ HB_GPOS gpos;
+ HB_Bool supported_scripts[HB_ScriptCount];
+ HB_Buffer buffer;
+ HB_Script current_script;
+ int current_flags;
+ HB_Bool has_opentype_kerning;
+ HB_Bool glyphs_substituted;
+ HB_GlyphAttributes *tmpAttributes;
+ unsigned int *tmpLogClusters;
+ int length;
+ int orig_nglyphs;
+} HB_FaceRec;
+typedef HB_Error (*HB_GetFontTableFunc)(void *font, HB_Tag tag, HB_Byte *buffer, HB_UInt *length);
+HB_Face HB_NewFace(void *font, HB_GetFontTableFunc tableFunc);
+void HB_FreeFace(HB_Face face);
+typedef struct {
+ HB_Fixed x, y;
+ HB_Fixed width, height;
+ HB_Fixed xOffset, yOffset;
+} HB_GlyphMetrics;
+typedef enum {
+ HB_FontAscent
+} HB_FontMetric;
+typedef struct {
+ HB_Bool (*convertStringToGlyphIndices)(HB_Font font, const HB_UChar16 *string, hb_uint32 length, HB_Glyph *glyphs, hb_uint32 *numGlyphs, HB_Bool rightToLeft);
+ void (*getGlyphAdvances)(HB_Font font, const HB_Glyph *glyphs, hb_uint32 numGlyphs, HB_Fixed *advances, int flags );
+ HB_Bool (*canRender)(HB_Font font, const HB_UChar16 *string, hb_uint32 length);
+ HB_Error (*getPointInOutline)(HB_Font font, HB_Glyph glyph, int flags , hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints);
+ void (*getGlyphMetrics)(HB_Font font, HB_Glyph glyph, HB_GlyphMetrics *metrics);
+ HB_Fixed (*getFontMetric)(HB_Font font, HB_FontMetric metric);
+} HB_FontClass;
+typedef struct HB_Font_ {
+ const HB_FontClass *klass;
+ HB_UShort x_ppem, y_ppem;
+ HB_16Dot16 x_scale, y_scale;
+ void *userData;
+} HB_FontRec;
+typedef struct {
+ const HB_UChar16 *string;
+ hb_uint32 stringLength;
+ HB_ScriptItem item;
+ HB_Font font;
+ HB_Face face;
+ int shaperFlags;
+ HB_Bool glyphIndicesPresent;
+ hb_uint32 initialGlyphCount;
+ hb_uint32 num_glyphs;
+ HB_Glyph *glyphs;
+ HB_GlyphAttributes *attributes;
+ HB_Fixed *advances;
+ HB_FixedPoint *offsets;
+ unsigned short *log_clusters;
+ HB_Bool kerning_applied;
+} HB_ShaperItem;
+HB_Bool HB_ShapeItem(HB_ShaperItem *item);
+}
+__attribute__((visibility("default"))) void qGetCharAttributes(const HB_UChar16 *string, hb_uint32 stringLength,
+ const HB_ScriptItem *items, hb_uint32 numItems,
+ HB_CharAttributes *attributes);
+__attribute__((visibility("default"))) HB_Bool qShapeItem(HB_ShaperItem *item);
+__attribute__((visibility("default"))) HB_Face qHBNewFace(void *font, HB_GetFontTableFunc tableFunc);
+__attribute__((visibility("default"))) void qHBFreeFace(HB_Face);
+template <> class QTypeInfo<HB_GlyphAttributes> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(HB_GlyphAttributes)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "HB_GlyphAttributes"; } };
+template <> class QTypeInfo<HB_FixedPoint> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(HB_FixedPoint)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "HB_FixedPoint"; } };
+class QFontPrivate;
+class QFontEngine;
+class QString;
+class QPainter;
+class QAbstractTextDocumentLayout;
+struct glyph_metrics_t
+{
+ inline glyph_metrics_t()
+ : x(100000), y(100000) {}
+ inline glyph_metrics_t(QFixed _x, QFixed _y, QFixed _width, QFixed _height, QFixed _xoff, QFixed _yoff)
+ : x(_x),
+ y(_y),
+ width(_width),
+ height(_height),
+ xoff(_xoff),
+ yoff(_yoff)
+ {}
+ QFixed x;
+ QFixed y;
+ QFixed width;
+ QFixed height;
+ QFixed xoff;
+ QFixed yoff;
+ glyph_metrics_t transformed(const QTransform &xform) const;
+};
+template <> class QTypeInfo<glyph_metrics_t> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(glyph_metrics_t)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "glyph_metrics_t"; } };
+struct QScriptAnalysis
+{
+ enum Flags {
+ None = 0,
+ Lowercase = 1,
+ Uppercase = 2,
+ SmallCaps = 3,
+ LineOrParagraphSeparator = 4,
+ Space = 5,
+ SpaceTabOrObject = Space,
+ Tab = 6,
+ TabOrObject = Tab,
+ Object = 7
+ };
+ unsigned short script : 8;
+ unsigned short bidiLevel : 6;
+ unsigned short flags : 3;
+ inline bool operator == (const QScriptAnalysis &other) const {
+ return script == other.script && bidiLevel == other.bidiLevel && flags == other.flags;
+ }
+};
+template <> class QTypeInfo<QScriptAnalysis> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QScriptAnalysis)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QScriptAnalysis"; } };
+struct QGlyphJustification
+{
+ inline QGlyphJustification()
+ : type(0), nKashidas(0), space_18d6(0)
+ {}
+ enum JustificationType {
+ JustifyNone,
+ JustifySpace,
+ JustifyKashida
+ };
+ uint type :2;
+ uint nKashidas : 6;
+ uint space_18d6 : 24;
+};
+template <> class QTypeInfo<QGlyphJustification> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QGlyphJustification)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QGlyphJustification"; } };
+struct QGlyphLayoutInstance
+{
+ QFixedPoint offset;
+ QFixedPoint advance;
+ HB_Glyph glyph;
+ QGlyphJustification justification;
+ HB_GlyphAttributes attributes;
+};
+struct QGlyphLayout
+{
+ QFixedPoint *offsets;
+ HB_Glyph *glyphs;
+ QFixed *advances_x;
+ QFixed *advances_y;
+ QGlyphJustification *justifications;
+ HB_GlyphAttributes *attributes;
+ int numGlyphs;
+ inline QGlyphLayout() : numGlyphs(0) {}
+ inline explicit QGlyphLayout(char *address, int totalGlyphs)
+ {
+ offsets = reinterpret_cast<QFixedPoint *>(address);
+ int offset = totalGlyphs * sizeof(HB_FixedPoint);
+ glyphs = reinterpret_cast<HB_Glyph *>(address + offset);
+ offset += totalGlyphs * sizeof(HB_Glyph);
+ advances_x = reinterpret_cast<QFixed *>(address + offset);
+ offset += totalGlyphs * sizeof(QFixed);
+ advances_y = reinterpret_cast<QFixed *>(address + offset);
+ offset += totalGlyphs * sizeof(QFixed);
+ justifications = reinterpret_cast<QGlyphJustification *>(address + offset);
+ offset += totalGlyphs * sizeof(QGlyphJustification);
+ attributes = reinterpret_cast<HB_GlyphAttributes *>(address + offset);
+ numGlyphs = totalGlyphs;
+ }
+ inline QGlyphLayout mid(int position, int n = -1) const {
+ QGlyphLayout copy = *this;
+ copy.glyphs += position;
+ copy.advances_x += position;
+ copy.advances_y += position;
+ copy.offsets += position;
+ copy.justifications += position;
+ copy.attributes += position;
+ if (n == -1)
+ copy.numGlyphs -= position;
+ else
+ copy.numGlyphs = n;
+ return copy;
+ }
+ static inline int spaceNeededForGlyphLayout(int totalGlyphs) {
+ return totalGlyphs * (sizeof(HB_Glyph) + sizeof(HB_GlyphAttributes)
+ + sizeof(QFixed) + sizeof(QFixed) + sizeof(QFixedPoint)
+ + sizeof(QGlyphJustification));
+ }
+ inline QFixed effectiveAdvance(int item) const
+ { return (advances_x[item] + QFixed::fromFixed(justifications[item].space_18d6)) * !attributes[item].dontPrint; }
+ inline QGlyphLayoutInstance instance(int position) const {
+ QGlyphLayoutInstance g;
+ g.offset.x = offsets[position].x;
+ g.offset.y = offsets[position].y;
+ g.glyph = glyphs[position];
+ g.advance.x = advances_x[position];
+ g.advance.y = advances_y[position];
+ g.justification = justifications[position];
+ g.attributes = attributes[position];
+ return g;
+ }
+ inline void setInstance(int position, const QGlyphLayoutInstance &g) {
+ offsets[position].x = g.offset.x;
+ offsets[position].y = g.offset.y;
+ glyphs[position] = g.glyph;
+ advances_x[position] = g.advance.x;
+ advances_y[position] = g.advance.y;
+ justifications[position] = g.justification;
+ attributes[position] = g.attributes;
+ }
+ inline void clear(int first = 0, int last = -1) {
+ if (last == -1)
+ last = numGlyphs;
+ if (first == 0 && last == numGlyphs
+ && reinterpret_cast<char *>(offsets + numGlyphs) == reinterpret_cast<char *>(glyphs)) {
+ memset(offsets, 0, spaceNeededForGlyphLayout(numGlyphs));
+ } else {
+ const int num = last - first;
+ memset(offsets + first, 0, num * sizeof(QFixedPoint));
+ memset(glyphs + first, 0, num * sizeof(HB_Glyph));
+ memset(advances_x + first, 0, num * sizeof(QFixed));
+ memset(advances_y + first, 0, num * sizeof(QFixed));
+ memset(justifications + first, 0, num * sizeof(QGlyphJustification));
+ memset(attributes + first, 0, num * sizeof(HB_GlyphAttributes));
+ }
+ }
+ inline char *data() {
+ return reinterpret_cast<char *>(offsets);
+ }
+ void grow(char *address, int totalGlyphs);
+};
+class QVarLengthGlyphLayoutArray : private QVarLengthArray<void *>, public QGlyphLayout
+{
+private:
+ typedef QVarLengthArray<void *> Array;
+public:
+ QVarLengthGlyphLayoutArray(int totalGlyphs)
+ : Array(spaceNeededForGlyphLayout(totalGlyphs) / sizeof(void *) + 1)
+ , QGlyphLayout(reinterpret_cast<char *>(Array::data()), totalGlyphs)
+ {
+ memset(Array::data(), 0, Array::size() * sizeof(void *));
+ }
+ void resize(int totalGlyphs)
+ {
+ Array::resize(spaceNeededForGlyphLayout(totalGlyphs) / sizeof(void *) + 1);
+ *((QGlyphLayout *)this) = QGlyphLayout(reinterpret_cast<char *>(Array::data()), totalGlyphs);
+ memset(Array::data(), 0, Array::size() * sizeof(void *));
+ }
+};
+template <int N> struct QGlyphLayoutArray : public QGlyphLayout
+{
+public:
+ QGlyphLayoutArray()
+ : QGlyphLayout(reinterpret_cast<char *>(buffer), N)
+ {
+ memset(buffer, 0, sizeof(buffer));
+ }
+private:
+ void *buffer[(N * (sizeof(HB_Glyph) + sizeof(HB_GlyphAttributes)
+ + sizeof(QFixed) + sizeof(QFixed) + sizeof(QFixedPoint)
+ + sizeof(QGlyphJustification)))
+ / sizeof(void *) + 1];
+};
+struct QScriptItem;
+class QTextItemInt : public QTextItem
+{
+public:
+ inline QTextItemInt()
+ : justified(false), underlineStyle(QTextCharFormat::NoUnderline), num_chars(0), chars(0),
+ logClusters(0), f(0), fontEngine(0)
+ {}
+ QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat());
+ QTextItemInt midItem(QFontEngine *fontEngine, int firstGlyphIndex, int numGlyphs) const;
+ QFixed descent;
+ QFixed ascent;
+ QFixed width;
+ RenderFlags flags;
+ bool justified;
+ QTextCharFormat::UnderlineStyle underlineStyle;
+ const QTextCharFormat charFormat;
+ int num_chars;
+ const QChar *chars;
+ const unsigned short *logClusters;
+ const QFont *f;
+ QGlyphLayout glyphs;
+ QFontEngine *fontEngine;
+};
+inline bool qIsControlChar(ushort uc)
+{
+ return uc >= 0x200b && uc <= 0x206f
+ && (uc <= 0x200f
+ || (uc >= 0x2028 && uc <= 0x202f )
+ || uc >= 0x206a );
+}
+struct QScriptItem
+{
+ inline QScriptItem()
+ : position(0),
+ num_glyphs(0), descent(-1), ascent(-1), width(-1),
+ glyph_data_offset(0) {}
+ inline QScriptItem(int p, const QScriptAnalysis &a)
+ : position(p), analysis(a),
+ num_glyphs(0), descent(-1), ascent(-1), width(-1),
+ glyph_data_offset(0) {}
+ int position;
+ QScriptAnalysis analysis;
+ unsigned short num_glyphs;
+ QFixed descent;
+ QFixed ascent;
+ QFixed width;
+ int glyph_data_offset;
+ QFixed height() const { return ascent + descent + 1; }
+};
+template <> class QTypeInfo<QScriptItem> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QScriptItem)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QScriptItem"; } };
+typedef QVector<QScriptItem> QScriptItemArray;
+struct QScriptLine
+{
+ QScriptLine()
+ : from(0), length(0),
+ justified(0), gridfitted(0),
+ hasTrailingSpaces(0) {}
+ QFixed descent;
+ QFixed ascent;
+ QFixed x;
+ QFixed y;
+ QFixed width;
+ QFixed textWidth;
+ int from;
+ signed int length : 29;
+ mutable uint justified : 1;
+ mutable uint gridfitted : 1;
+ uint hasTrailingSpaces : 1;
+ QFixed height() const { return ascent + descent + 1; }
+ void setDefaultHeight(QTextEngine *eng);
+ void operator+=(const QScriptLine &other);
+};
+template <> class QTypeInfo<QScriptLine> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QScriptLine)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QScriptLine"; } };
+inline void QScriptLine::operator+=(const QScriptLine &other)
+{
+ descent = qMax(descent, other.descent);
+ ascent = qMax(ascent, other.ascent);
+ textWidth += other.textWidth;
+ length += other.length;
+}
+typedef QVector<QScriptLine> QScriptLineArray;
+class QFontPrivate;
+class QTextFormatCollection;
+class __attribute__((visibility("default"))) QTextEngine {
+public:
+ struct LayoutData {
+ LayoutData(const QString &str, void **stack_memory, int mem_size);
+ LayoutData();
+ ~LayoutData();
+ mutable QScriptItemArray items;
+ int allocated;
+ int available_glyphs;
+ void **memory;
+ unsigned short *logClustersPtr;
+ QGlyphLayout glyphLayout;
+ mutable int used;
+ uint hasBidi : 1;
+ uint inLayout : 1;
+ uint memory_on_stack : 1;
+ bool haveCharAttributes;
+ QString string;
+ void reallocate(int totalGlyphs);
+ };
+ QTextEngine(LayoutData *data);
+ QTextEngine();
+ QTextEngine(const QString &str, const QFont &f);
+ ~QTextEngine();
+ enum Mode {
+ WidthOnly = 0x07
+ };
+ enum ShaperFlag {
+ RightToLeft = 0x0001,
+ DesignMetrics = 0x0002,
+ GlyphIndicesOnly = 0x0004
+ };
+ typedef QFlags<ShaperFlag> ShaperFlags;
+ void invalidate();
+ void clearLineData();
+ void validate() const;
+ void itemize() const;
+ static void bidiReorder(int numRuns, const quint8 *levels, int *visualOrder);
+ const HB_CharAttributes *attributes() const;
+ void shape(int item) const;
+ void justify(const QScriptLine &si);
+ QFixed width(int charFrom, int numChars) const;
+ glyph_metrics_t boundingBox(int from, int len) const;
+ glyph_metrics_t tightBoundingBox(int from, int len) const;
+ int length(int item) const {
+ const QScriptItem &si = layoutData->items[item];
+ int from = si.position;
+ item++;
+ return (item < layoutData->items.size() ? layoutData->items[item].position : layoutData->string.length()) - from;
+ }
+ int length(const QScriptItem *si) const {
+ int end;
+ if (si + 1 < layoutData->items.constData()+ layoutData->items.size())
+ end = (si+1)->position;
+ else
+ end = layoutData->string.length();
+ return end - si->position;
+ }
+ QFontEngine *fontEngine(const QScriptItem &si, QFixed *ascent = 0, QFixed *descent = 0) const;
+ QFont font(const QScriptItem &si) const;
+ inline QFont font() const { return fnt; }
+ inline unsigned short *logClusters(const QScriptItem *si) const
+ { return layoutData->logClustersPtr+si->position; }
+ inline QGlyphLayout availableGlyphs(const QScriptItem *si) const {
+ return layoutData->glyphLayout.mid(si->glyph_data_offset);
+ }
+ inline QGlyphLayout shapedGlyphs(const QScriptItem *si) const {
+ return layoutData->glyphLayout.mid(si->glyph_data_offset, si->num_glyphs);
+ }
+ inline void ensureSpace(int nGlyphs) const {
+ if (layoutData->glyphLayout.numGlyphs - layoutData->used < nGlyphs)
+ layoutData->reallocate((((layoutData->used + nGlyphs)*3/2 + 15) >> 4) << 4);
+ }
+ void freeMemory();
+ int findItem(int strPos) const;
+ inline QTextFormatCollection *formats() const {
+ return block.docHandle()->formatCollection();
+ }
+ QTextCharFormat format(const QScriptItem *si) const;
+ inline QAbstractTextDocumentLayout *docLayout() const {
+ return block.docHandle()->document()->documentLayout();
+ }
+ int formatIndex(const QScriptItem *si) const;
+ QFixed calculateTabWidth(int index, QFixed x) const;
+ mutable QScriptLineArray lines;
+ QString text;
+ QFont fnt;
+ QTextBlock block;
+ QTextOption option;
+ QFixed minWidth;
+ QFixed maxWidth;
+ QPointF position;
+ uint ignoreBidi : 1;
+ uint cacheGlyphs : 1;
+ uint stackEngine : 1;
+ uint forceJustification : 1;
+ int *underlinePositions;
+ mutable LayoutData *layoutData;
+ inline bool hasFormats() const { return (block.docHandle() || specialData); }
+ struct SpecialData {
+ int preeditPosition;
+ QString preeditText;
+ QList<QTextLayout::FormatRange> addFormats;
+ QVector<int> addFormatIndices;
+ QVector<int> resolvedFormatIndices;
+ };
+ SpecialData *specialData;
+ bool atWordSeparator(int position) const;
+ bool atSpace(int position) const;
+ void indexAdditionalFormats();
+ QString elidedText(Qt::TextElideMode mode, const QFixed &width, int flags = 0) const;
+ void shapeLine(const QScriptLine &line);
+private:
+ void setBoundary(int strPos) const;
+ void addRequiredBoundaries() const;
+ void shapeText(int item) const;
+ void shapeTextWithHarfbuzz(int item) const;
+ void splitItem(int item, int pos) const;
+ void resolveAdditionalFormats() const;
+};
+class QStackTextEngine : public QTextEngine {
+public:
+ enum { MemSize = 256*40/sizeof(void *) };
+ QStackTextEngine(const QString &string, const QFont &f);
+ LayoutData _layoutData;
+ void *_memory[MemSize];
+};
+inline QFlags<QTextEngine::ShaperFlags::enum_type> operator|(QTextEngine::ShaperFlags::enum_type f1, QTextEngine::ShaperFlags::enum_type f2) { return QFlags<QTextEngine::ShaperFlags::enum_type>(f1) | f2; } inline QFlags<QTextEngine::ShaperFlags::enum_type> operator|(QTextEngine::ShaperFlags::enum_type f1, QFlags<QTextEngine::ShaperFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QTextEngine::ShaperFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
+class __attribute__((visibility("default"))) QFontEngineGlyphCache
+{
+public:
+ QFontEngineGlyphCache(const QTransform &matrix) : m_transform(matrix) { }
+ enum Type {
+ Raster_RGBMask,
+ Raster_A8,
+ Raster_Mono
+ };
+ virtual ~QFontEngineGlyphCache();
+ QTransform m_transform;
+};
+typedef QHash<void *, QList<QFontEngineGlyphCache *> > GlyphPointerHash;
+typedef QHash<int, QList<QFontEngineGlyphCache *> > GlyphIntHash;
+struct glyph_metrics_t;
+typedef unsigned int glyph_t;
+class QChar;
+class QPainterPath;
+class QTextEngine;
+struct QGlyphLayout;
+class __attribute__((visibility("default"))) QFontEngine : public QObject
+{
+ public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
+public:
+ enum Type {
+ Box,
+ Multi,
+ XLFD,
+ Win,
+ Mac,
+ Freetype,
+ QPF1,
+ QPF2,
+ Proxy,
+ TestFontEngine = 0x1000
+ };
+ QFontEngine();
+ virtual ~QFontEngine();
+ struct Properties {
+ QByteArray postscriptName;
+ QByteArray copyright;
+ QRectF boundingBox;
+ QFixed emSquare;
+ QFixed ascent;
+ QFixed descent;
+ QFixed leading;
+ QFixed italicAngle;
+ QFixed capHeight;
+ QFixed lineWidth;
+ };
+ virtual Properties properties() const;
+ virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics);
+ QByteArray getSfntTable(uint ) const;
+ virtual bool getSfntTableData(uint , uchar * , uint * ) const { return false; }
+ struct FaceId {
+ FaceId() : index(0), encoding(0) {}
+ QByteArray filename;
+ int index;
+ int encoding;
+ };
+ virtual FaceId faceId() const { return FaceId(); }
+ enum SynthesizedFlags {
+ SynthesizedItalic = 0x1,
+ SynthesizedBold = 0x2,
+ SynthesizedStretch = 0x4
+ };
+ virtual int synthesized() const { return 0; }
+ virtual QFixed emSquareSize() const { return ascent(); }
+ virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const = 0;
+ virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const {}
+ virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const;
+ virtual void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si) = 0;
+ virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
+ QPainterPath *path, QTextItem::RenderFlags flags);
+ void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags,
+ QVarLengthArray<glyph_t> &glyphs_out, QVarLengthArray<QFixedPoint> &positions);
+ virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags);
+ void addBitmapFontToPath(qreal x, qreal y, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags);
+ virtual QImage alphaMapForGlyph(glyph_t) = 0;
+ virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t);
+ virtual QImage alphaRGBMapForGlyph(glyph_t, int margin, const QTransform &t);
+ virtual void removeGlyphFromCache(glyph_t);
+ virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) = 0;
+ virtual glyph_metrics_t boundingBox(glyph_t glyph) = 0;
+ virtual glyph_metrics_t boundingBox(glyph_t glyph, const QTransform &matrix);
+ glyph_metrics_t tightBoundingBox(const QGlyphLayout &glyphs);
+ virtual QFixed ascent() const = 0;
+ virtual QFixed descent() const = 0;
+ virtual QFixed leading() const = 0;
+ virtual QFixed xHeight() const;
+ virtual QFixed averageCharWidth() const;
+ virtual QFixed lineThickness() const;
+ virtual QFixed underlinePosition() const;
+ virtual qreal maxCharWidth() const = 0;
+ virtual qreal minLeftBearing() const { return qreal(); }
+ virtual qreal minRightBearing() const { return qreal(); }
+ virtual const char *name() const = 0;
+ virtual bool canRender(const QChar *string, int len) = 0;
+ virtual Type type() const = 0;
+ virtual int glyphCount() const;
+ HB_Font harfbuzzFont() const;
+ HB_Face harfbuzzFace() const;
+ virtual HB_Error getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints);
+ void setGlyphCache(void *key, QFontEngineGlyphCache *data);
+ void setGlyphCache(QFontEngineGlyphCache::Type key, QFontEngineGlyphCache *data);
+ QFontEngineGlyphCache *glyphCache(void *key, const QTransform &transform) const;
+ QFontEngineGlyphCache *glyphCache(QFontEngineGlyphCache::Type key, const QTransform &transform) const;
+ static const uchar *getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize);
+ static quint32 getTrueTypeGlyphIndex(const uchar *cmap, uint unicode);
+ QAtomicInt ref;
+ QFontDef fontDef;
+ uint cache_cost;
+ int cache_count;
+ uint fsType : 16;
+ bool symbol;
+ mutable HB_FontRec hbFont;
+ mutable HB_Face hbFace;
+ struct KernPair {
+ uint left_right;
+ QFixed adjust;
+ inline bool operator<(const KernPair &other) const
+ {
+ return left_right < other.left_right;
+ }
+ };
+ QVector<KernPair> kerning_pairs;
+ void loadKerningPairs(QFixed scalingFactor);
+ int glyphFormat;
+private:
+ void expireGlyphCache();
+ GlyphPointerHash m_glyphPointerHash;
+ GlyphIntHash m_glyphIntHash;
+ mutable QList<QFontEngineGlyphCache*> m_glyphCacheQueue;
+};
+inline bool operator ==(const QFontEngine::FaceId &f1, const QFontEngine::FaceId &f2)
+{
+ return (f1.index == f2.index) && (f1.encoding == f2.encoding) && (f1.filename == f2.filename);
+}
+inline uint qHash(const QFontEngine::FaceId &f)
+{
+ return qHash((f.index << 16) + f.encoding) + qHash(f.filename);
+}
+class QGlyph;
+class QFontEngineQPF1Data;
+class QFontEngineQPF1 : public QFontEngine
+{
+public:
+ QFontEngineQPF1(const QFontDef&, const QString &fn);
+ ~QFontEngineQPF1();
+ virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const;
+ virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
+ virtual void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si);
+ virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags);
+ virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
+ virtual glyph_metrics_t boundingBox(glyph_t glyph);
+ virtual QFixed ascent() const;
+ virtual QFixed descent() const;
+ virtual QFixed leading() const;
+ virtual qreal maxCharWidth() const;
+ virtual qreal minLeftBearing() const;
+ virtual qreal minRightBearing() const;
+ virtual QFixed underlinePosition() const;
+ virtual QFixed lineThickness() const;
+ virtual Type type() const;
+ virtual bool canRender(const QChar *string, int len);
+ inline const char *name() const { return 0; }
+ virtual QImage alphaMapForGlyph(glyph_t);
+ QFontEngineQPF1Data *d;
+};
+class QFontEngineBox : public QFontEngine
+{
+public:
+ QFontEngineBox(int size);
+ ~QFontEngineBox();
+ virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const;
+ virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
+ void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si);
+ virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags);
+ virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
+ virtual glyph_metrics_t boundingBox(glyph_t glyph);
+ virtual QFixed ascent() const;
+ virtual QFixed descent() const;
+ virtual QFixed leading() const;
+ virtual qreal maxCharWidth() const;
+ virtual qreal minLeftBearing() const { return 0; }
+ virtual qreal minRightBearing() const { return 0; }
+ virtual QImage alphaMapForGlyph(glyph_t);
+ virtual const char *name() const;
+ virtual bool canRender(const QChar *string, int len);
+ virtual Type type() const;
+ inline int size() const { return _size; }
+private:
+ friend class QFontPrivate;
+ int _size;
+};
+class __attribute__((visibility("default"))) QFontEngineMulti : public QFontEngine
+{
+public:
+ explicit QFontEngineMulti(int engineCount);
+ ~QFontEngineMulti();
+ virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs,
+ QTextEngine::ShaperFlags flags) const;
+ virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
+ virtual glyph_metrics_t boundingBox(glyph_t glyph);
+ virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
+ virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const;
+ virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags);
+ virtual QFixed ascent() const;
+ virtual QFixed descent() const;
+ virtual QFixed leading() const;
+ virtual QFixed xHeight() const;
+ virtual QFixed averageCharWidth() const;
+ virtual QImage alphaMapForGlyph(glyph_t);
+ virtual QFixed lineThickness() const;
+ virtual QFixed underlinePosition() const;
+ virtual qreal maxCharWidth() const;
+ virtual qreal minLeftBearing() const;
+ virtual qreal minRightBearing() const;
+ virtual inline Type type() const
+ { return QFontEngine::Multi; }
+ virtual bool canRender(const QChar *string, int len);
+ inline virtual const char *name() const
+ { return "Multi"; }
+ QFontEngine *engine(int at) const;
+protected:
+ friend class QPSPrintEnginePrivate;
+ friend class QPSPrintEngineFontMulti;
+ virtual void loadEngine(int at) = 0;
+ QVector<QFontEngine *> engines;
+};
+class QTestFontEngine : public QFontEngineBox
+{
+public:
+ QTestFontEngine(int size) : QFontEngineBox(size) {}
+ virtual Type type() const { return TestFontEngine; }
+};
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QVariant;
+class __attribute__((visibility("default"))) QBitmap : public QPixmap
+{
+public:
+ QBitmap();
+ QBitmap(const QPixmap &);
+ QBitmap(int w, int h);
+ explicit QBitmap(const QSize &);
+ explicit QBitmap(const QString &fileName, const char *format=0);
+ ~QBitmap();
+ QBitmap &operator=(const QPixmap &);
+ operator QVariant() const;
+ inline void clear() { fill(Qt::color0); }
+ static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ static QBitmap fromData(const QSize &size, const uchar *bits,
+ QImage::Format monoFormat = QImage::Format_MonoLSB);
+ QBitmap transformed(const QMatrix &) const;
+ QBitmap transformed(const QTransform &matrix) const;
+};
+template <> inline bool qIsDetached<QBitmap>(QBitmap &t) { return t.isDetached(); } template <typename T> inline void qSwap(T &, T &); template <> inline void qSwap<QBitmap>(QBitmap &value1, QBitmap &value2) { const QBitmap::DataPtr t = value1.data_ptr(); value1.data_ptr() = value2.data_ptr(); value2.data_ptr() = t; }
+template <typename Type> class QDataBuffer
+{
+public:
+ QDataBuffer(int res = 64)
+ {
+ capacity = res;
+ buffer = (Type*) qMalloc(capacity * sizeof(Type));
+ siz = 0;
+ }
+ ~QDataBuffer()
+ {
+ qFree(buffer);
+ }
+ inline void reset() { siz = 0; }
+ inline bool isEmpty() const { return siz==0; }
+ inline int size() const { return siz; }
+ inline Type *data() const { return buffer; }
+ inline Type &at(int i) { qt_noop(); return buffer[i]; }
+ inline const Type &at(int i) const { qt_noop(); return buffer[i]; }
+ inline const Type &last() const { qt_noop(); return buffer[siz-1]; }
+ inline const Type &first() const { qt_noop(); return buffer[0]; }
+ inline void add(const Type &t) {
+ reserve(siz + 1);
+ buffer[siz] = t;
+ ++siz;
+ }
+ inline void resize(int size) {
+ reserve(size);
+ siz = size;
+ }
+ inline void reserve(int size) {
+ if (size > capacity) {
+ while (capacity < size)
+ capacity *= 2;
+ buffer = (Type*) qRealloc(buffer, capacity * sizeof(Type));
+ }
+ }
+ inline void shrink(int size) {
+ capacity = size;
+ buffer = (Type*) qRealloc(buffer, capacity * sizeof(Type));
+ }
+ inline void swap(QDataBuffer<Type> &other) {
+ qSwap(capacity, other.capacity);
+ qSwap(siz, other.siz);
+ qSwap(buffer, other.buffer);
+ }
+ inline QDataBuffer &operator<<(const Type &t) { add(t); return *this; }
+private:
+ int capacity;
+ int siz;
+ Type *buffer;
+};
+static const union { unsigned char c[8]; double d; } qt_be_inf_bytes = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
+static const union { unsigned char c[8]; double d; } qt_le_inf_bytes = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
+static const union { unsigned char c[8]; double d; } qt_armfpa_inf_bytes = { { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 } };
+static inline double qt_inf()
+{
+ return (QSysInfo::ByteOrder == QSysInfo::BigEndian
+ ? qt_be_inf_bytes.d
+ : qt_le_inf_bytes.d);
+}
+static const union { unsigned char c[8]; double d; } qt_be_snan_bytes = { { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 } };
+static const union { unsigned char c[8]; double d; } qt_le_snan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f } };
+static const union { unsigned char c[8]; double d; } qt_armfpa_snan_bytes = { { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 } };
+static inline double qt_snan()
+{
+ return (QSysInfo::ByteOrder == QSysInfo::BigEndian
+ ? qt_be_snan_bytes.d
+ : qt_le_snan_bytes.d);
+}
+static const union { unsigned char c[8]; double d; } qt_be_qnan_bytes = { { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 } };
+static const union { unsigned char c[8]; double d; } qt_le_qnan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0xff } };
+static const union { unsigned char c[8]; double d; } qt_armfpa_qnan_bytes = { { 0, 0, 0xf8, 0xff, 0, 0, 0, 0 } };
+static inline double qt_qnan()
+{
+ return (QSysInfo::ByteOrder == QSysInfo::BigEndian
+ ? qt_be_qnan_bytes.d
+ : qt_le_qnan_bytes.d);
+}
+static inline bool qt_is_inf(double d)
+{
+ uchar *ch = (uchar *)&d;
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ return (ch[0] & 0x7f) == 0x7f && ch[1] == 0xf0;
+ } else {
+ return (ch[7] & 0x7f) == 0x7f && ch[6] == 0xf0;
+ }
+}
+static inline bool qt_is_nan(double d)
+{
+ uchar *ch = (uchar *)&d;
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ return (ch[0] & 0x7f) == 0x7f && ch[1] > 0xf0;
+ } else {
+ return (ch[7] & 0x7f) == 0x7f && ch[6] > 0xf0;
+ }
+}
+static inline bool qt_is_finite(double d)
+{
+ uchar *ch = (uchar *)&d;
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0xf0) != 0xf0;
+ } else {
+ return (ch[7] & 0x7f) != 0x7f || (ch[6] & 0xf0) != 0xf0;
+ }
+}
+static inline bool qt_is_inf(float d)
+{
+ uchar *ch = (uchar *)&d;
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ return (ch[0] & 0x7f) == 0x7f && ch[1] == 0x80;
+ } else {
+ return (ch[3] & 0x7f) == 0x7f && ch[2] == 0x80;
+ }
+}
+static inline bool qt_is_nan(float d)
+{
+ uchar *ch = (uchar *)&d;
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ return (ch[0] & 0x7f) == 0x7f && ch[1] > 0x80;
+ } else {
+ return (ch[3] & 0x7f) == 0x7f && ch[2] > 0x80;
+ }
+}
+static inline bool qt_is_finite(float d)
+{
+ uchar *ch = (uchar *)&d;
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
+ return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0x80) != 0x80;
+ } else {
+ return (ch[3] & 0x7f) != 0x7f || (ch[2] & 0x80) != 0x80;
+ }
+}
+typedef qreal qfixed;
+struct qfixed2d
+{
+ qfixed x;
+ qfixed y;
+ bool operator==(const qfixed2d &other) const { return qFuzzyCompare(x, other.x)
+ && qFuzzyCompare(y, other.y); }
+};
+QPointF qt_curves_for_arc(const QRectF &rect, qreal startAngle, qreal sweepLength,
+ QPointF *controlPoints, int *point_count);
+qreal qt_t_for_arc_angle(qreal angle);
+typedef void (*qStrokerMoveToHook)(qfixed x, qfixed y, void *data);
+typedef void (*qStrokerLineToHook)(qfixed x, qfixed y, void *data);
+typedef void (*qStrokerCubicToHook)(qfixed c1x, qfixed c1y,
+ qfixed c2x, qfixed c2y,
+ qfixed ex, qfixed ey,
+ void *data);
+class __attribute__((visibility("default"))) QStrokerOps
+{
+public:
+ struct Element {
+ QPainterPath::ElementType type;
+ qfixed x;
+ qfixed y;
+ inline bool isMoveTo() const { return type == QPainterPath::MoveToElement; }
+ inline bool isLineTo() const { return type == QPainterPath::LineToElement; }
+ inline bool isCurveTo() const { return type == QPainterPath::CurveToElement; }
+ operator qfixed2d () { qfixed2d pt = { x, y }; return pt; }
+ };
+ QStrokerOps();
+ virtual ~QStrokerOps();
+ void setMoveToHook(qStrokerMoveToHook moveToHook) { m_moveTo = moveToHook; }
+ void setLineToHook(qStrokerLineToHook lineToHook) { m_lineTo = lineToHook; }
+ void setCubicToHook(qStrokerCubicToHook cubicToHook) { m_cubicTo = cubicToHook; }
+ virtual void begin(void *customData);
+ virtual void end();
+ inline void moveTo(qfixed x, qfixed y);
+ inline void lineTo(qfixed x, qfixed y);
+ inline void cubicTo(qfixed x1, qfixed y1, qfixed x2, qfixed y2, qfixed ex, qfixed ey);
+ void strokePath(const QPainterPath &path, void *data, const QTransform &matrix);
+ void strokePolygon(const QPointF *points, int pointCount, bool implicit_close,
+ void *data, const QTransform &matrix);
+ void strokeEllipse(const QRectF &ellipse, void *data, const QTransform &matrix);
+ QRectF clipRect() const { return m_clip_rect; }
+ void setClipRect(const QRectF &clip) { m_clip_rect = clip; }
+protected:
+ inline void emitMoveTo(qfixed x, qfixed y);
+ inline void emitLineTo(qfixed x, qfixed y);
+ inline void emitCubicTo(qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey);
+ virtual void processCurrentSubpath() = 0;
+ QDataBuffer<Element> m_elements;
+ QRectF m_clip_rect;
+private:
+ void *m_customData;
+ qStrokerMoveToHook m_moveTo;
+ qStrokerLineToHook m_lineTo;
+ qStrokerCubicToHook m_cubicTo;
+};
+class __attribute__((visibility("default"))) QStroker : public QStrokerOps
+{
+public:
+ enum LineJoinMode {
+ FlatJoin,
+ SquareJoin,
+ MiterJoin,
+ RoundJoin,
+ RoundCap,
+ SvgMiterJoin
+ };
+ QStroker();
+ ~QStroker();
+ void setStrokeWidth(qfixed width) { m_strokeWidth = width; }
+ qfixed strokeWidth() const { return m_strokeWidth; }
+ void setCapStyle(Qt::PenCapStyle capStyle) { m_capStyle = joinModeForCap(capStyle); }
+ Qt::PenCapStyle capStyle() const { return capForJoinMode(m_capStyle); }
+ LineJoinMode capStyleMode() const { return m_capStyle; }
+ void setJoinStyle(Qt::PenJoinStyle style) { m_joinStyle = joinModeForJoin(style); }
+ Qt::PenJoinStyle joinStyle() const { return joinForJoinMode(m_joinStyle); }
+ LineJoinMode joinStyleMode() const { return m_joinStyle; }
+ void setMiterLimit(qfixed length) { m_miterLimit = length; }
+ qfixed miterLimit() const { return m_miterLimit; }
+ void setCurveThreshold(qfixed threshold) { m_curveThreshold = threshold; }
+ qfixed curveThreshold() const { return m_curveThreshold; }
+ void joinPoints(qfixed x, qfixed y, const QLineF &nextLine, LineJoinMode join);
+ inline void emitMoveTo(qfixed x, qfixed y);
+ inline void emitLineTo(qfixed x, qfixed y);
+ inline void emitCubicTo(qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey);
+protected:
+ static Qt::PenCapStyle capForJoinMode(LineJoinMode mode);
+ static LineJoinMode joinModeForCap(Qt::PenCapStyle);
+ static Qt::PenJoinStyle joinForJoinMode(LineJoinMode mode);
+ static LineJoinMode joinModeForJoin(Qt::PenJoinStyle joinStyle);
+ virtual void processCurrentSubpath();
+ qfixed m_strokeWidth;
+ qfixed m_miterLimit;
+ qfixed m_curveThreshold;
+ LineJoinMode m_capStyle;
+ LineJoinMode m_joinStyle;
+ qfixed m_back1X;
+ qfixed m_back1Y;
+ qfixed m_back2X;
+ qfixed m_back2Y;
+};
+class __attribute__((visibility("default"))) QDashStroker : public QStrokerOps
+{
+public:
+ QDashStroker(QStroker *stroker);
+ QStroker *stroker() const { return m_stroker; }
+ static QVector<qfixed> patternForStyle(Qt::PenStyle style);
+ void setDashPattern(const QVector<qfixed> &dashPattern) { m_dashPattern = dashPattern; }
+ QVector<qfixed> dashPattern() const { return m_dashPattern; }
+ void setDashOffset(qreal offset) { m_dashOffset = offset; }
+ qreal dashOffset() const { return m_dashOffset; }
+ virtual void begin(void *data);
+ virtual void end();
+protected:
+ virtual void processCurrentSubpath();
+ QStroker *m_stroker;
+ QVector<qfixed> m_dashPattern;
+ qreal m_dashOffset;
+};
+inline void QStrokerOps::emitMoveTo(qfixed x, qfixed y)
+{
+ qt_noop();
+ m_moveTo(x, y, m_customData);
+}
+inline void QStrokerOps::emitLineTo(qfixed x, qfixed y)
+{
+ qt_noop();
+ m_lineTo(x, y, m_customData);
+}
+inline void QStrokerOps::emitCubicTo(qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey)
+{
+ qt_noop();
+ m_cubicTo(c1x, c1y, c2x, c2y, ex, ey, m_customData);
+}
+inline void QStrokerOps::moveTo(qfixed x, qfixed y)
+{
+ if (m_elements.size()>1)
+ processCurrentSubpath();
+ m_elements.reset();
+ Element e = { QPainterPath::MoveToElement, x, y };
+ m_elements.add(e);
+}
+inline void QStrokerOps::lineTo(qfixed x, qfixed y)
+{
+ Element e = { QPainterPath::LineToElement, x, y };
+ m_elements.add(e);
+}
+inline void QStrokerOps::cubicTo(qfixed x1, qfixed y1, qfixed x2, qfixed y2, qfixed ex, qfixed ey)
+{
+ Element c1 = { QPainterPath::CurveToElement, x1, y1 };
+ Element c2 = { QPainterPath::CurveToDataElement, x2, y2 };
+ Element e = { QPainterPath::CurveToDataElement, ex, ey };
+ m_elements.add(c1);
+ m_elements.add(c2);
+ m_elements.add(e);
+}
+inline void QStroker::emitMoveTo(qfixed x, qfixed y)
+{
+ m_back2X = m_back1X;
+ m_back2Y = m_back1Y;
+ m_back1X = x;
+ m_back1Y = y;
+ QStrokerOps::emitMoveTo(x, y);
+}
+inline void QStroker::emitLineTo(qfixed x, qfixed y)
+{
+ m_back2X = m_back1X;
+ m_back2Y = m_back1Y;
+ m_back1X = x;
+ m_back1Y = y;
+ QStrokerOps::emitLineTo(x, y);
+}
+inline void QStroker::emitCubicTo(qfixed c1x, qfixed c1y,
+ qfixed c2x, qfixed c2y,
+ qfixed ex, qfixed ey)
+{
+ if (c2x == ex && c2y == ey) {
+ if (c1x == ex && c1y == ey) {
+ m_back2X = m_back1X;
+ m_back2Y = m_back1Y;
+ } else {
+ m_back2X = c1x;
+ m_back2Y = c1y;
+ }
+ } else {
+ m_back2X = c2x;
+ m_back2Y = c2y;
+ }
+ m_back1X = ex;
+ m_back1Y = ey;
+ QStrokerOps::emitCubicTo(c1x, c1y, c2x, c2y, ex, ey);
+}
+inline void QDashStroker::begin(void *data)
+{
+ qt_noop();
+ m_stroker->begin(data);
+ QStrokerOps::begin(data);
+}
+inline void QDashStroker::end()
+{
+ qt_noop();
+ QStrokerOps::end();
+ m_stroker->end();
+}
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class QPrinterPrivate;
+class QPaintEngine;
+class QPrintEngine;
+class QPrinterInfo;
+class __attribute__((visibility("default"))) QPrinter : public QPaintDevice
+{
+ inline QPrinterPrivate* d_func() { return reinterpret_cast<QPrinterPrivate *>(d_ptr); } inline const QPrinterPrivate* d_func() const { return reinterpret_cast<const QPrinterPrivate *>(d_ptr); } friend class QPrinterPrivate;
+public:
+ enum PrinterMode { ScreenResolution, PrinterResolution, HighResolution };
+ explicit QPrinter(PrinterMode mode = ScreenResolution);
+ explicit QPrinter(const QPrinterInfo& printer, PrinterMode mode = ScreenResolution);
+ ~QPrinter();
+ int devType() const;
+ enum Orientation { Portrait, Landscape };
+ enum PageSize { A4, B5, Letter, Legal, Executive,
+ A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1,
+ B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E,
+ DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom, NPaperSize = Custom };
+ typedef PageSize PaperSize;
+ enum PageOrder { FirstPageFirst,
+ LastPageFirst };
+ enum ColorMode { GrayScale,
+ Color };
+ enum PaperSource { OnlyOne,
+ Lower,
+ Middle,
+ Manual,
+ Envelope,
+ EnvelopeManual,
+ Auto,
+ Tractor,
+ SmallFormat,
+ LargeFormat,
+ LargeCapacity,
+ Cassette,
+ FormSource,
+ MaxPageSource
+ };
+ enum PrinterState { Idle,
+ Active,
+ Aborted,
+ Error };
+ enum OutputFormat { NativeFormat, PdfFormat, PostScriptFormat };
+ enum PrintRange { AllPages, Selection, PageRange };
+ enum Unit {
+ Millimeter,
+ Point,
+ Inch,
+ Pica,
+ Didot,
+ Cicero,
+ DevicePixel
+ };
+ enum DuplexMode {
+ DuplexNone = 0,
+ DuplexAuto,
+ DuplexLongSide,
+ DuplexShortSide
+ };
+ void setOutputFormat(OutputFormat format);
+ OutputFormat outputFormat() const;
+ void setPrinterName(const QString &);
+ QString printerName() const;
+ bool isValid() const;
+ void setOutputFileName(const QString &);
+ QString outputFileName()const;
+ void setPrintProgram(const QString &);
+ QString printProgram() const;
+ void setDocName(const QString &);
+ QString docName() const;
+ void setCreator(const QString &);
+ QString creator() const;
+ void setOrientation(Orientation);
+ Orientation orientation() const;
+ void setPageSize(PageSize);
+ PageSize pageSize() const;
+ void setPaperSize(PaperSize);
+ PaperSize paperSize() const;
+ void setPaperSize(const QSizeF &paperSize, Unit unit);
+ QSizeF paperSize(Unit unit) const;
+ void setPageOrder(PageOrder);
+ PageOrder pageOrder() const;
+ void setResolution(int);
+ int resolution() const;
+ void setColorMode(ColorMode);
+ ColorMode colorMode() const;
+ void setCollateCopies(bool collate);
+ bool collateCopies() const;
+ void setFullPage(bool);
+ bool fullPage() const;
+ void setNumCopies(int);
+ int numCopies() const;
+ void setPaperSource(PaperSource);
+ PaperSource paperSource() const;
+ void setDuplex(DuplexMode duplex);
+ DuplexMode duplex() const;
+ QList<int> supportedResolutions() const;
+ void setFontEmbeddingEnabled(bool enable);
+ bool fontEmbeddingEnabled() const;
+ void setDoubleSidedPrinting(bool enable);
+ bool doubleSidedPrinting() const;
+ QRect paperRect() const;
+ QRect pageRect() const;
+ QRectF paperRect(Unit) const;
+ QRectF pageRect(Unit) const;
+ QString printerSelectionOption() const;
+ void setPrinterSelectionOption(const QString &);
+ bool newPage();
+ bool abort();
+ PrinterState printerState() const;
+ QPaintEngine *paintEngine() const;
+ QPrintEngine *printEngine() const;
+ void setFromTo(int fromPage, int toPage);
+ int fromPage() const;
+ int toPage() const;
+ void setPrintRange(PrintRange range);
+ PrintRange printRange() const;
+ void setPageMargins(qreal left, qreal top, qreal right, qreal bottom, Unit unit);
+ void getPageMargins(qreal *left, qreal *top, qreal *right, qreal *bottom, Unit unit) const;
+protected:
+ int metric(PaintDeviceMetric) const;
+ void setEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine);
+private:
+ void init(PrinterMode mode);
+ QPrinter(const QPrinter &); QPrinter &operator=(const QPrinter &);
+ QPrinterPrivate *d_ptr;
+ friend class QPrintDialogPrivate;
+ friend class QAbstractPrintDialog;
+ friend class QAbstractPrintDialogPrivate;
+ friend class QPrintPreviewWidgetPrivate;
+ friend class QTextDocument;
+ friend class QPageSetupWidget;
+};
+class QFontSubset
+{
+public:
+ QFontSubset(QFontEngine *fe, int obj_id = 0)
+ : object_id(obj_id), noEmbed(false), fontEngine(fe), downloaded_glyphs(0), standard_font(false)
+ { fontEngine->ref.ref(); addGlyph(0); }
+ ~QFontSubset() {
+ if (!fontEngine->ref.deref())
+ delete fontEngine;
+ }
+ QByteArray toTruetype() const;
+ QByteArray toType1() const;
+ QByteArray type1AddedGlyphs() const;
+ QByteArray widthArray() const;
+ QByteArray createToUnicodeMap() const;
+ QVector<int> getReverseMap() const;
+ QByteArray glyphName(unsigned int glyph, const QVector<int> reverseMap) const;
+ static QByteArray glyphName(unsigned short unicode, bool symbol);
+ int addGlyph(int index);
+ const int object_id;
+ bool noEmbed;
+ QFontEngine *fontEngine;
+ QList<int> glyph_indices;
+ mutable int downloaded_glyphs;
+ mutable bool standard_font;
+ int nGlyphs() const { return glyph_indices.size(); }
+ mutable QFixed emSquare;
+ mutable QVector<QFixed> widths;
+};
+class QPaintDevice;
+class QPaintEnginePrivate
+{
+ inline QPaintEngine* q_func() { return static_cast<QPaintEngine *>(q_ptr); } inline const QPaintEngine* q_func() const { return static_cast<const QPaintEngine *>(q_ptr); } friend class QPaintEngine;
+public:
+ QPaintEnginePrivate() : pdev(0), q_ptr(0), currentClipWidget(0), hasSystemTransform(0),
+ hasSystemViewport(0) {}
+ virtual ~QPaintEnginePrivate() { }
+ QPaintDevice *pdev;
+ QPaintEngine *q_ptr;
+ QRegion systemClip;
+ QRegion systemViewport;
+ QTransform systemTransform;
+ QWidget *currentClipWidget;
+ uint hasSystemTransform : 1;
+ uint hasSystemViewport : 1;
+ inline void transformSystemClip()
+ {
+ if (systemClip.isEmpty())
+ return;
+ if (systemTransform.type() <= QTransform::TxTranslate)
+ systemClip.translate(qRound(systemTransform.dx()), qRound(systemTransform.dy()));
+ else
+ systemClip = systemTransform.map(systemClip);
+ if (hasSystemViewport) {
+ systemClip &= systemViewport;
+ if (systemClip.isEmpty()) {
+ systemClip = QRect(systemViewport.boundingRect().topLeft(), QSize(1, 1));
+ }
+ }
+ }
+ inline void setSystemTransform(const QTransform &xform)
+ {
+ systemTransform = xform;
+ if ((hasSystemTransform = !xform.isIdentity()))
+ transformSystemClip();
+ systemStateChanged();
+ }
+ inline void setSystemViewport(const QRegion ®ion)
+ {
+ systemViewport = region;
+ hasSystemViewport = !systemViewport.isEmpty();
+ }
+ virtual void systemStateChanged() { }
+ void drawBoxTextItem(const QPointF &p, const QTextItemInt &ti);
+private:
+ QRect systemRect;
+};
+class QAlphaPaintEnginePrivate;
+class QAlphaPaintEngine : public QPaintEngine
+{
+ inline QAlphaPaintEnginePrivate* d_func() { return reinterpret_cast<QAlphaPaintEnginePrivate *>(d_ptr); } inline const QAlphaPaintEnginePrivate* d_func() const { return reinterpret_cast<const QAlphaPaintEnginePrivate *>(d_ptr); } friend class QAlphaPaintEnginePrivate;
+public:
+ ~QAlphaPaintEngine();
+ virtual bool begin(QPaintDevice *pdev);
+ virtual bool end();
+ virtual void updateState(const QPaintEngineState &state);
+ virtual void drawPath(const QPainterPath &path);
+ virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
+ virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr);
+ virtual void drawImage(const QRectF &r, const QImage &image, const QRectF &sr);
+ virtual void drawTextItem(const QPointF &p, const QTextItem &textItem);
+ virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
+protected:
+ QAlphaPaintEngine(QAlphaPaintEnginePrivate &data, PaintEngineFeatures devcaps = 0);
+ QRegion alphaClipping() const;
+ bool continueCall() const;
+ void flushAndInit(bool init = true);
+ void cleanUp();
+};
+class QAlphaPaintEnginePrivate : public QPaintEnginePrivate
+{
+ inline QAlphaPaintEngine* q_func() { return static_cast<QAlphaPaintEngine *>(q_ptr); } inline const QAlphaPaintEngine* q_func() const { return static_cast<const QAlphaPaintEngine *>(q_ptr); } friend class QAlphaPaintEngine;
+public:
+ QAlphaPaintEnginePrivate();
+ ~QAlphaPaintEnginePrivate();
+ int m_pass;
+ QPicture *m_pic;
+ QPaintEngine *m_picengine;
+ QPainter *m_picpainter;
+ QPaintEngine::PaintEngineFeatures m_savedcaps;
+ QPaintDevice *m_pdev;
+ QRegion m_alphargn;
+ QRegion m_cliprgn;
+ bool m_hasalpha;
+ bool m_alphaPen;
+ bool m_alphaBrush;
+ bool m_alphaOpacity;
+ bool m_advancedPen;
+ bool m_advancedBrush;
+ bool m_complexTransform;
+ bool m_emulateProjectiveTransforms;
+ bool m_continueCall;
+ QTransform m_transform;
+ QPen m_pen;
+ void addAlphaRect(const QRectF &rect);
+ QRectF addPenWidth(const QPainterPath &path);
+ void drawAlphaImage(const QRectF &rect);
+ QRect toRect(const QRectF &rect) const;
+ bool fullyContained(const QRectF &rect) const;
+ void resetState(QPainter *p);
+};
+typedef QtValidLicenseForGuiModule QtGuiModule;
+class __attribute__((visibility("default"))) QPrintEngine
+{
+public:
+ virtual ~QPrintEngine() {}
+ enum PrintEnginePropertyKey {
+ PPK_CollateCopies,
+ PPK_ColorMode,
+ PPK_Creator,
+ PPK_DocumentName,
+ PPK_FullPage,
+ PPK_NumberOfCopies,
+ PPK_Orientation,
+ PPK_OutputFileName,
+ PPK_PageOrder,
+ PPK_PageRect,
+ PPK_PageSize,
+ PPK_PaperRect,
+ PPK_PaperSource,
+ PPK_PrinterName,
+ PPK_PrinterProgram,
+ PPK_Resolution,
+ PPK_SelectionOption,
+ PPK_SupportedResolutions,
+ PPK_WindowsPageSize,
+ PPK_FontEmbedding,
+ PPK_SuppressSystemPrintStatus,
+ PPK_Duplex,
+ PPK_PaperSources,
+ PPK_CustomPaperSize,
+ PPK_PageMargins,
+ PPK_PaperSize = PPK_PageSize,
+ PPK_CustomBase = 0xff00
+ };
+ virtual void setProperty(PrintEnginePropertyKey key, const QVariant &value) = 0;
+ virtual QVariant property(PrintEnginePropertyKey key) const = 0;
+ virtual bool newPage() = 0;
+ virtual bool abort() = 0;
+ virtual int metric(QPaintDevice::PaintDeviceMetric) const = 0;
+ virtual QPrinter::PrinterState printerState() const = 0;
+};
+typedef QtValidLicenseForCoreModule QtCoreModule;
+class QObject;
+class QBufferPrivate;
+class __attribute__((visibility("default"))) QBuffer : public QIODevice
+{
+ public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
+public:
+ explicit QBuffer(QObject *parent = 0);
+ QBuffer(QByteArray *buf, QObject *parent = 0);
+ ~QBuffer();
+ QByteArray &buffer();
+ const QByteArray &buffer() const;
+ void setBuffer(QByteArray *a);
+ void setData(const QByteArray &data);
+ inline void setData(const char *data, int len);
+ const QByteArray &data() const;
+ bool open(OpenMode openMode);
+ void close();
+ qint64 size() const;
+ qint64 pos() const;
+ bool seek(qint64 off);
+ bool atEnd() const;
+ bool canReadLine() const;
+protected:
+ void connectNotify(const char*);
+ void disconnectNotify(const char*);
+ qint64 readData(char *data, qint64 maxlen);
+ qint64 writeData(const char *data, qint64 len);
+private:
+ inline QBufferPrivate* d_func() { return reinterpret_cast<QBufferPrivate *>(d_ptr); } inline const QBufferPrivate* d_func() const { return reinterpret_cast<const QBufferPrivate *>(d_ptr); } friend class QBufferPrivate;
+ QBuffer(const QBuffer &); QBuffer &operator=(const QBuffer &);
+};
+inline void QBuffer::setData(const char *adata, int alen)
+{ setData(QByteArray(adata, alen)); }
+const char *qt_real_to_string(qreal val, char *buf);
+const char *qt_int_to_string(int val, char *buf);
+namespace QPdf {
+ class ByteStream
+ {
+ public:
+ explicit ByteStream(bool fileBacking = false);
+ explicit ByteStream(QByteArray *ba, bool fileBacking = false);
+ ~ByteStream();
+ ByteStream &operator <<(char chr);
+ ByteStream &operator <<(const char *str);
+ ByteStream &operator <<(const QByteArray &str);
+ ByteStream &operator <<(const ByteStream &src);
+ ByteStream &operator <<(qreal val);
+ ByteStream &operator <<(int val);
+ ByteStream &operator <<(const QPointF &p);
+ QIODevice *stream();
+ void clear();
+ static inline int maxMemorySize() { return 100000000; }
+ static inline int chunkSize() { return 10000000; }
+ protected:
+ void constructor_helper(QIODevice *dev);
+ void constructor_helper(QByteArray *ba);
+ private:
+ void prepareBuffer();
+ private:
+ QIODevice *dev;
+ QByteArray ba;
+ bool fileBackingEnabled;
+ bool fileBackingActive;
+ bool handleDirty;
+ };
+ enum PathFlags {
+ ClipPath,
+ FillPath,
+ StrokePath,
+ FillAndStrokePath
+ };
+ QByteArray generatePath(const QPainterPath &path, const QTransform &matrix, PathFlags flags);
+ QByteArray generateMatrix(const QTransform &matrix);
+ QByteArray generateDashes(const QPen &pen);
+ QByteArray patternForBrush(const QBrush &b);
+ struct Stroker {
+ Stroker();
+ void setPen(const QPen &pen);
+ void strokePath(const QPainterPath &path);
+ ByteStream *stream;
+ bool first;
+ QTransform matrix;
+ bool cosmeticPen;
+ private:
+ QStroker basicStroker;
+ QDashStroker dashStroker;
+ QStrokerOps *stroker;
+ };
+ QByteArray ascii85Encode(const QByteArray &input);
+ const char *toHex(ushort u, char *buffer);
+ const char *toHex(uchar u, char *buffer);
+ struct PaperSize {
+ int width, height;
+ };
+ PaperSize paperSize(QPrinter::PaperSize paperSize);
+ const char *paperSizeToString(QPrinter::PaperSize paperSize);
+ QByteArray stripSpecialCharacters(const QByteArray &string);
+};
+class QPdfPage : public QPdf::ByteStream
+{
+public:
+ QPdfPage();
+ QVector<uint> images;
+ QVector<uint> graphicStates;
+ QVector<uint> patterns;
+ QVector<uint> fonts;
+ QVector<uint> annotations;
+ void streamImage(int w, int h, int object);
+ QSize pageSize;
+private:
+};
+class QPdfBaseEnginePrivate;
+class QPdfBaseEngine : public QAlphaPaintEngine, public QPrintEngine
+{
+ inline QPdfBaseEnginePrivate* d_func() { return reinterpret_cast<QPdfBaseEnginePrivate *>(d_ptr); } inline const QPdfBaseEnginePrivate* d_func() const { return reinterpret_cast<const QPdfBaseEnginePrivate *>(d_ptr); } friend class QPdfBaseEnginePrivate;
+public:
+ QPdfBaseEngine(QPdfBaseEnginePrivate &d, PaintEngineFeatures f);
+ ~QPdfBaseEngine() {}
+ bool begin(QPaintDevice *pdev);
+ bool end();
+ void drawPoints(const QPointF *points, int pointCount);
+ void drawLines(const QLineF *lines, int lineCount);
+ void drawRects(const QRectF *rects, int rectCount);
+ void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
+ void drawPath (const QPainterPath & path);
+ void drawTextItem(const QPointF &p, const QTextItem &textItem);
+ void updateState(const QPaintEngineState &state);
+ int metric(QPaintDevice::PaintDeviceMetric metricType) const;
+ bool newPage();
+ void setProperty(PrintEnginePropertyKey key, const QVariant &value);
+ QVariant property(PrintEnginePropertyKey key) const;
+ void setPen();
+ virtual void setBrush() = 0;
+ void setupGraphicsState(QPaintEngine::DirtyFlags flags);
+private:
+ void updateClipPath(const QPainterPath & path, Qt::ClipOperation op);
+ friend int qt_printerRealNumCopies(QPaintEngine *);
+};
+class QPdfBaseEnginePrivate : public QAlphaPaintEnginePrivate
+{
+ inline QPdfBaseEngine* q_func() { return static_cast<QPdfBaseEngine *>(q_ptr); } inline const QPdfBaseEngine* q_func() const { return static_cast<const QPdfBaseEngine *>(q_ptr); } friend class QPdfBaseEngine;
+public:
+ QPdfBaseEnginePrivate(QPrinter::PrinterMode m);
+ ~QPdfBaseEnginePrivate();
+ bool openPrintDevice();
+ void closePrintDevice();
+ virtual void drawTextItem(const QPointF &p, const QTextItemInt &ti);
+ inline uint requestObject() { return currentObject++; }
+ QRect paperRect() const;
+ QRect pageRect() const;
+ bool postscript;
+ int currentObject;
+ QPdfPage* currentPage;
+ QPdf::Stroker stroker;
+ QPointF brushOrigin;
+ QBrush brush;
+ QPen pen;
+ QList<QPainterPath> clips;
+ bool clipEnabled;
+ bool allClipped;
+ bool hasPen;
+ bool hasBrush;
+ bool simplePen;
+ qreal opacity;
+ bool useAlphaEngine;
+ QHash<QFontEngine::FaceId, QFontSubset *> fonts;
+ QPaintDevice *pdev;
+ QIODevice *outDevice;
+ int fd;
+ QString outputFileName;
+ QString printerName;
+ QString printProgram;
+ QString selectionOption;
+ QString title;
+ QString creator;
+ QPrinter::DuplexMode duplex;
+ bool collate;
+ bool fullPage;
+ bool embedFonts;
+ int copies;
+ int resolution;
+ QPrinter::PageOrder pageOrder;
+ QPrinter::Orientation orientation;
+ QPrinter::PaperSize paperSize;
+ QPrinter::ColorMode colorMode;
+ QPrinter::PaperSource paperSource;
+ QStringList cupsOptions;
+ QRect cupsPaperRect;
+ QRect cupsPageRect;
+ QString cupsStringPageSize;
+ QSizeF customPaperSize;
+ bool hasCustomPageMargins;
+ qreal leftMargin, topMargin, rightMargin, bottomMargin;
+};
+extern "C" {
+typedef double float_t;
+typedef double double_t;
+extern double acos (double __x) throw (); extern double __acos (double __x) throw ();
+extern double asin (double __x) throw (); extern double __asin (double __x) throw ();
+extern double atan (double __x) throw (); extern double __atan (double __x) throw ();
+extern double atan2 (double __y, double __x) throw (); extern double __atan2 (double __y, double __x) throw ();
+extern double cos (double __x) throw (); extern double __cos (double __x) throw ();
+extern double sin (double __x) throw (); extern double __sin (double __x) throw ();
+extern double tan (double __x) throw (); extern double __tan (double __x) throw ();
+extern double cosh (double __x) throw (); extern double __cosh (double __x) throw ();
+extern double sinh (double __x) throw (); extern double __sinh (double __x) throw ();
+extern double tanh (double __x) throw (); extern double __tanh (double __x) throw ();
+extern double acosh (double __x) throw (); extern double __acosh (double __x) throw ();
+extern double asinh (double __x) throw (); extern double __asinh (double __x) throw ();
+extern double atanh (double __x) throw (); extern double __atanh (double __x) throw ();
+extern double exp (double __x) throw (); extern double __exp (double __x) throw ();
+extern double frexp (double __x, int *__exponent) throw (); extern double __frexp (double __x, int *__exponent) throw ();
+extern double ldexp (double __x, int __exponent) throw (); extern double __ldexp (double __x, int __exponent) throw ();
+extern double log (double __x) throw (); extern double __log (double __x) throw ();
+extern double log10 (double __x) throw (); extern double __log10 (double __x) throw ();
+extern double modf (double __x, double *__iptr) throw (); extern double __modf (double __x, double *__iptr) throw ();
+extern double expm1 (double __x) throw (); extern double __expm1 (double __x) throw ();
+extern double log1p (double __x) throw (); extern double __log1p (double __x) throw ();
+extern double logb (double __x) throw (); extern double __logb (double __x) throw ();
+extern double exp2 (double __x) throw (); extern double __exp2 (double __x) throw ();
+extern double log2 (double __x) throw (); extern double __log2 (double __x) throw ();
+extern double pow (double __x, double __y) throw (); extern double __pow (double __x, double __y) throw ();
+extern double sqrt (double __x) throw (); extern double __sqrt (double __x) throw ();
+extern double hypot (double __x, double __y) throw (); extern double __hypot (double __x, double __y) throw ();
+extern double cbrt (double __x) throw (); extern double __cbrt (double __x) throw ();
+extern double ceil (double __x) throw () __attribute__ ((__const__)); extern double __ceil (double __x) throw () __attribute__ ((__const__));
+extern double fabs (double __x) throw () __attribute__ ((__const__)); extern double __fabs (double __x) throw () __attribute__ ((__const__));
+extern double floor (double __x) throw () __attribute__ ((__const__)); extern double __floor (double __x) throw () __attribute__ ((__const__));
+extern double fmod (double __x, double __y) throw (); extern double __fmod (double __x, double __y) throw ();
+extern int __isinf (double __value) throw () __attribute__ ((__const__));
+extern int __finite (double __value) throw () __attribute__ ((__const__));
+extern int isinf (double __value) throw () __attribute__ ((__const__));
+extern int finite (double __value) throw () __attribute__ ((__const__));
+extern double drem (double __x, double __y) throw (); extern double __drem (double __x, double __y) throw ();
+extern double significand (double __x) throw (); extern double __significand (double __x) throw ();
+extern double copysign (double __x, double __y) throw () __attribute__ ((__const__)); extern double __copysign (double __x, double __y) throw () __attribute__ ((__const__));
+extern double nan (__const char *__tagb) throw () __attribute__ ((__const__)); extern double __nan (__const char *__tagb) throw () __attribute__ ((__const__));
+extern int __isnan (double __value) throw () __attribute__ ((__const__));
+extern int isnan (double __value) throw () __attribute__ ((__const__));
+extern double j0 (double) throw (); extern double __j0 (double) throw ();
+extern double j1 (double) throw (); extern double __j1 (double) throw ();
+extern double jn (int, double) throw (); extern double __jn (int, double) throw ();
+extern double y0 (double) throw (); extern double __y0 (double) throw ();
+extern double y1 (double) throw (); extern double __y1 (double) throw ();
+extern double yn (int, double) throw (); extern double __yn (int, double) throw ();
+extern double erf (double) throw (); extern double __erf (double) throw ();
+extern double erfc (double) throw (); extern double __erfc (double) throw ();
+extern double lgamma (double) throw (); extern double __lgamma (double) throw ();
+extern double tgamma (double) throw (); extern double __tgamma (double) throw ();
+extern double gamma (double) throw (); extern double __gamma (double) throw ();
+extern double lgamma_r (double, int *__signgamp) throw (); extern double __lgamma_r (double, int *__signgamp) throw ();
+extern double rint (double __x) throw (); extern double __rint (double __x) throw ();
+extern double nextafter (double __x, double __y) throw () __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) throw () __attribute__ ((__const__));
+extern double nexttoward (double __x, long double __y) throw () __attribute__ ((__const__)); extern double __nexttoward (double __x, long double __y) throw () __attribute__ ((__const__));
+extern double remainder (double __x, double __y) throw (); extern double __remainder (double __x, double __y) throw ();
+extern double scalbn (double __x, int __n) throw (); extern double __scalbn (double __x, int __n) throw ();
+extern int ilogb (double __x) throw (); extern int __ilogb (double __x) throw ();
+extern double scalbln (double __x, long int __n) throw (); extern double __scalbln (double __x, long int __n) throw ();
+extern double nearbyint (double __x) throw (); extern double __nearbyint (double __x) throw ();
+extern double round (double __x) throw () __attribute__ ((__const__)); extern double __round (double __x) throw () __attribute__ ((__const__));
+extern double trunc (double __x) throw () __attribute__ ((__const__)); extern double __trunc (double __x) throw () __attribute__ ((__const__));
+extern double remquo (double __x, double __y, int *__quo) throw (); extern double __remquo (double __x, double __y, int *__quo) throw ();
+extern long int lrint (double __x) throw (); extern long int __lrint (double __x) throw ();
+extern long long int llrint (double __x) throw (); extern long long int __llrint (double __x) throw ();
+extern long int lround (double __x) throw (); extern long int __lround (double __x) throw ();
+extern long long int llround (double __x) throw (); extern long long int __llround (double __x) throw ();
+extern double fdim (double __x, double __y) throw (); extern double __fdim (double __x, double __y) throw ();
+extern double fmax (double __x, double __y) throw (); extern double __fmax (double __x, double __y) throw ();
+extern double fmin (double __x, double __y) throw (); extern double __fmin (double __x, double __y) throw ();
+extern int __fpclassify (double __value) throw ()
+ __attribute__ ((__const__));
+extern int __signbit (double __value) throw ()
+ __attribute__ ((__const__));
+extern double fma (double __x, double __y, double __z) throw (); extern double __fma (double __x, double __y, double __z) throw ();
+extern double scalb (double __x, double __n) throw (); extern double __scalb (double __x, double __n) throw ();
+extern float acosf (float __x) throw (); extern float __acosf (float __x) throw ();
+extern float asinf (float __x) throw (); extern float __asinf (float __x) throw ();
+extern float atanf (float __x) throw (); extern float __atanf (float __x) throw ();
+extern float atan2f (float __y, float __x) throw (); extern float __atan2f (float __y, float __x) throw ();
+extern float cosf (float __x) throw (); extern float __cosf (float __x) throw ();
+extern float sinf (float __x) throw (); extern float __sinf (float __x) throw ();
+extern float tanf (float __x) throw (); extern float __tanf (float __x) throw ();
+extern float coshf (float __x) throw (); extern float __coshf (float __x) throw ();
+extern float sinhf (float __x) throw (); extern float __sinhf (float __x) throw ();
+extern float tanhf (float __x) throw (); extern float __tanhf (float __x) throw ();
+extern float acoshf (float __x) throw (); extern float __acoshf (float __x) throw ();
+extern float asinhf (float __x) throw (); extern float __asinhf (float __x) throw ();
+extern float atanhf (float __x) throw (); extern float __atanhf (float __x) throw ();
+extern float expf (float __x) throw (); extern float __expf (float __x) throw ();
+extern float frexpf (float __x, int *__exponent) throw (); extern float __frexpf (float __x, int *__exponent) throw ();
+extern float ldexpf (float __x, int __exponent) throw (); extern float __ldexpf (float __x, int __exponent) throw ();
+extern float logf (float __x) throw (); extern float __logf (float __x) throw ();
+extern float log10f (float __x) throw (); extern float __log10f (float __x) throw ();
+extern float modff (float __x, float *__iptr) throw (); extern float __modff (float __x, float *__iptr) throw ();
+extern float expm1f (float __x) throw (); extern float __expm1f (float __x) throw ();
+extern float log1pf (float __x) throw (); extern float __log1pf (float __x) throw ();
+extern float logbf (float __x) throw (); extern float __logbf (float __x) throw ();
+extern float exp2f (float __x) throw (); extern float __exp2f (float __x) throw ();
+extern float log2f (float __x) throw (); extern float __log2f (float __x) throw ();
+extern float powf (float __x, float __y) throw (); extern float __powf (float __x, float __y) throw ();
+extern float sqrtf (float __x) throw (); extern float __sqrtf (float __x) throw ();
+extern float hypotf (float __x, float __y) throw (); extern float __hypotf (float __x, float __y) throw ();
+extern float cbrtf (float __x) throw (); extern float __cbrtf (float __x) throw ();
+extern float ceilf (float __x) throw () __attribute__ ((__const__)); extern float __ceilf (float __x) throw () __attribute__ ((__const__));
+extern float fabsf (float __x) throw () __attribute__ ((__const__)); extern float __fabsf (float __x) throw () __attribute__ ((__const__));
+extern float floorf (float __x) throw () __attribute__ ((__const__)); extern float __floorf (float __x) throw () __attribute__ ((__const__));
+extern float fmodf (float __x, float __y) throw (); extern float __fmodf (float __x, float __y) throw ();
+extern int __isinff (float __value) throw () __attribute__ ((__const__));
+extern int __finitef (float __value) throw () __attribute__ ((__const__));
+extern int isinff (float __value) throw () __attribute__ ((__const__));
+extern int finitef (float __value) throw () __attribute__ ((__const__));
+extern float dremf (float __x, float __y) throw (); extern float __dremf (float __x, float __y) throw ();
+extern float significandf (float __x) throw (); extern float __significandf (float __x) throw ();
+extern float copysignf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) throw () __attribute__ ((__const__));
+extern float nanf (__const char *__tagb) throw () __attribute__ ((__const__)); extern float __nanf (__const char *__tagb) throw () __attribute__ ((__const__));
+extern int __isnanf (float __value) throw () __attribute__ ((__const__));
+extern int isnanf (float __value) throw () __attribute__ ((__const__));
+extern float j0f (float) throw (); extern float __j0f (float) throw ();
+extern float j1f (float) throw (); extern float __j1f (float) throw ();
+extern float jnf (int, float) throw (); extern float __jnf (int, float) throw ();
+extern float y0f (float) throw (); extern float __y0f (float) throw ();
+extern float y1f (float) throw (); extern float __y1f (float) throw ();
+extern float ynf (int, float) throw (); extern float __ynf (int, float) throw ();
+extern float erff (float) throw (); extern float __erff (float) throw ();
+extern float erfcf (float) throw (); extern float __erfcf (float) throw ();
+extern float lgammaf (float) throw (); extern float __lgammaf (float) throw ();
+extern float tgammaf (float) throw (); extern float __tgammaf (float) throw ();
+extern float gammaf (float) throw (); extern float __gammaf (float) throw ();
+extern float lgammaf_r (float, int *__signgamp) throw (); extern float __lgammaf_r (float, int *__signgamp) throw ();
+extern float rintf (float __x) throw (); extern float __rintf (float __x) throw ();
+extern float nextafterf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) throw () __attribute__ ((__const__));
+extern float nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__)); extern float __nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__));
+extern float remainderf (float __x, float __y) throw (); extern float __remainderf (float __x, float __y) throw ();
+extern float scalbnf (float __x, int __n) throw (); extern float __scalbnf (float __x, int __n) throw ();
+extern int ilogbf (float __x) throw (); extern int __ilogbf (float __x) throw ();
+extern float scalblnf (float __x, long int __n) throw (); extern float __scalblnf (float __x, long int __n) throw ();
+extern float nearbyintf (float __x) throw (); extern float __nearbyintf (float __x) throw ();
+extern float roundf (float __x) throw () __attribute__ ((__const__)); extern float __roundf (float __x) throw () __attribute__ ((__const__));
+extern float truncf (float __x) throw () __attribute__ ((__const__)); extern float __truncf (float __x) throw () __attribute__ ((__const__));
+extern float remquof (float __x, float __y, int *__quo) throw (); extern float __remquof (float __x, float __y, int *__quo) throw ();
+extern long int lrintf (float __x) throw (); extern long int __lrintf (float __x) throw ();
+extern long long int llrintf (float __x) throw (); extern long long int __llrintf (float __x) throw ();
+extern long int lroundf (float __x) throw (); extern long int __lroundf (float __x) throw ();
+extern long long int llroundf (float __x) throw (); extern long long int __llroundf (float __x) throw ();
+extern float fdimf (float __x, float __y) throw (); extern float __fdimf (float __x, float __y) throw ();
+extern float fmaxf (float __x, float __y) throw (); extern float __fmaxf (float __x, float __y) throw ();
+extern float fminf (float __x, float __y) throw (); extern float __fminf (float __x, float __y) throw ();
+extern int __fpclassifyf (float __value) throw ()
+ __attribute__ ((__const__));
+extern int __signbitf (float __value) throw ()
+ __attribute__ ((__const__));
+extern float fmaf (float __x, float __y, float __z) throw (); extern float __fmaf (float __x, float __y, float __z) throw ();
+extern float scalbf (float __x, float __n) throw (); extern float __scalbf (float __x, float __n) throw ();
+extern int signgam;
+enum
+ {
+ FP_NAN,
+ FP_INFINITE,
+ FP_ZERO,
+ FP_SUBNORMAL,
+ FP_NORMAL
+ };
+typedef enum
+{
+ _IEEE_ = -1,
+ _SVID_,
+ _XOPEN_,
+ _POSIX_,
+ _ISOC_
+} _LIB_VERSION_TYPE;
+extern _LIB_VERSION_TYPE _LIB_VERSION;
+struct __exception
+ {
+ int type;
+ char *name;
+ double arg1;
+ double arg2;
+ double retval;
+ };
+extern int matherr (struct __exception *__exc) throw ();
+}
+typedef QtValidLicenseForCoreModule QtCoreModule;
+inline int qCeil(qreal v)
+{
+ if (sizeof(qreal) == sizeof(float))
+ return int(ceilf(v));
+ else
+ return int(ceil(v));
+}
+inline int qFloor(qreal v)
+{
+ if (sizeof(qreal) == sizeof(float))
+ return int(floorf(v));
+ else
+ return int(floor(v));
+}
+inline qreal qSin(qreal v)
+{
+ if (sizeof(qreal) == sizeof(float))
+ return sinf(v);
+ else
+ return sin(v);
+}
+inline qreal qCos(qreal v)
+{
+ if (sizeof(qreal) == sizeof(float))
+ return cosf(v);
+ else
+ return cos(v);
+}
+inline qreal qAcos(qreal v)
+{
+ if (sizeof(qreal) == sizeof(float))
+ return acosf(v);
+ else
+ return acos(v);
+}
+inline qreal qSqrt(qreal v)
+{
+ if (sizeof(qreal) == sizeof(float))
+ return sqrtf(v);
+ else
+ return sqrt(v);
+}
+inline qreal qLn(qreal v)
+{
+ if (sizeof(qreal) == sizeof(float))
+ return logf(v);
+ else
+ return log(v);
+}
+inline qreal qPow(qreal x, qreal y)
+{
+ if (sizeof(qreal) == sizeof(float))
+ return powf(x, y);
+ else
+ return pow(x, y);
+}
+typedef QtValidLicenseForCoreModule QtCoreModule;
+inline void qbswap_helper(const uchar *src, uchar *dest, int size)
+{
+ for (int i = 0; i < size ; ++i) dest[i] = src[size - 1 - i];
+}
+template <typename T> inline void qbswap(const T src, uchar *dest)
+{
+ qbswap_helper(reinterpret_cast<const uchar *>(&src), dest, sizeof(T));
+}
+template <typename T> inline void qToUnaligned(const T src, uchar *dest)
+{
+ qMemCopy(dest, &src, sizeof(T));
+}
+template <typename T> inline T qFromLittleEndian(const uchar *src);
+template <> inline quint64 qFromLittleEndian<quint64>(const uchar *src)
+{
+ return 0
+ | src[0]
+ | src[1] * static_cast<unsigned long long>(0x0000000000000100ULL)
+ | src[2] * static_cast<unsigned long long>(0x0000000000010000ULL)
+ | src[3] * static_cast<unsigned long long>(0x0000000001000000ULL)
+ | src[4] * static_cast<unsigned long long>(0x0000000100000000ULL)
+ | src[5] * static_cast<unsigned long long>(0x0000010000000000ULL)
+ | src[6] * static_cast<unsigned long long>(0x0001000000000000ULL)
+ | src[7] * static_cast<unsigned long long>(0x0100000000000000ULL);
+}
+template <> inline quint32 qFromLittleEndian<quint32>(const uchar *src)
+{
+ return 0
+ | src[0]
+ | src[1] * quint32(0x00000100)
+ | src[2] * quint32(0x00010000)
+ | src[3] * quint32(0x01000000);
+}
+template <> inline quint16 qFromLittleEndian<quint16>(const uchar *src)
+{
+ return 0
+ | src[0]
+ | src[1] * 0x0100;
+}
+template <> inline qint64 qFromLittleEndian<qint64>(const uchar *src)
+{ return static_cast<qint64>(qFromLittleEndian<quint64>(src)); }
+template <> inline qint32 qFromLittleEndian<qint32>(const uchar *src)
+{ return static_cast<qint32>(qFromLittleEndian<quint32>(src)); }
+template <> inline qint16 qFromLittleEndian<qint16>(const uchar *src)
+{ return static_cast<qint16>(qFromLittleEndian<quint16>(src)); }
+template <class T> inline T qFromBigEndian(const uchar *src);
+template<>
+inline quint64 qFromBigEndian<quint64>(const uchar *src)
+{
+ return 0
+ | src[7]
+ | src[6] * static_cast<unsigned long long>(0x0000000000000100ULL)
+ | src[5] * static_cast<unsigned long long>(0x0000000000010000ULL)
+ | src[4] * static_cast<unsigned long long>(0x0000000001000000ULL)
+ | src[3] * static_cast<unsigned long long>(0x0000000100000000ULL)
+ | src[2] * static_cast<unsigned long long>(0x0000010000000000ULL)
+ | src[1] * static_cast<unsigned long long>(0x0001000000000000ULL)
+ | src[0] * static_cast<unsigned long long>(0x0100000000000000ULL);
+}
+template<>
+inline quint32 qFromBigEndian<quint32>(const uchar *src)
+{
+ return 0
+ | src[3]
+ | src[2] * quint32(0x00000100)
+ | src[1] * quint32(0x00010000)
+ | src[0] * quint32(0x01000000);
+}
+template<>
+inline quint16 qFromBigEndian<quint16>(const uchar *src)
+{
+ return 0
+ | src[1]
+ | src[0] * quint16(0x0100);
+}
+template <> inline qint64 qFromBigEndian<qint64>(const uchar *src)
+{ return static_cast<qint64>(qFromBigEndian<quint64>(src)); }
+template <> inline qint32 qFromBigEndian<qint32>(const uchar *src)
+{ return static_cast<qint32>(qFromBigEndian<quint32>(src)); }
+template <> inline qint16 qFromBigEndian<qint16>(const uchar *src)
+{ return static_cast<qint16>(qFromBigEndian<quint16>(src)); }
+template <typename T> T qbswap(T source);
+template <> inline quint64 qbswap<quint64>(quint64 source)
+{
+ return 0
+ | ((source & static_cast<unsigned long long>(0x00000000000000ffULL)) << 56)
+ | ((source & static_cast<unsigned long long>(0x000000000000ff00ULL)) << 40)
+ | ((source & static_cast<unsigned long long>(0x0000000000ff0000ULL)) << 24)
+ | ((source & static_cast<unsigned long long>(0x00000000ff000000ULL)) << 8)
+ | ((source & static_cast<unsigned long long>(0x000000ff00000000ULL)) >> 8)
+ | ((source & static_cast<unsigned long long>(0x0000ff0000000000ULL)) >> 24)
+ | ((source & static_cast<unsigned long long>(0x00ff000000000000ULL)) >> 40)
+ | ((source & static_cast<unsigned long long>(0xff00000000000000ULL)) >> 56);
+}
+template <> inline quint32 qbswap<quint32>(quint32 source)
+{
+ return 0
+ | ((source & 0x000000ff) << 24)
+ | ((source & 0x0000ff00) << 8)
+ | ((source & 0x00ff0000) >> 8)
+ | ((source & 0xff000000) >> 24);
+}
+template <> inline quint16 qbswap<quint16>(quint16 source)
+{
+ return 0
+ | ((source & 0x00ff) << 8)
+ | ((source & 0xff00) >> 8);
+}
+template <> inline qint64 qbswap<qint64>(qint64 source)
+{
+ return qbswap<quint64>(quint64(source));
+}
+template <> inline qint32 qbswap<qint32>(qint32 source)
+{
+ return qbswap<quint32>(quint32(source));
+}
+template <> inline qint16 qbswap<qint16>(qint16 source)
+{
+ return qbswap<quint16>(quint16(source));
+}
+template <typename T> inline T qToBigEndian(T source)
+{ return qbswap<T>(source); }
+template <typename T> inline T qFromBigEndian(T source)
+{ return qbswap<T>(source); }
+template <typename T> inline T qToLittleEndian(T source)
+{ return source; }
+template <typename T> inline T qFromLittleEndian(T source)
+{ return source; }
+template <typename T> inline void qToBigEndian(T src, uchar *dest)
+{ qbswap<T>(src, dest); }
+template <typename T> inline void qToLittleEndian(T src, uchar *dest)
+{ qToUnaligned<T>(src, dest); }
+static inline bool qtransform_equals_no_translate(const QTransform &a, const QTransform &b)
+{
+ if (a.type() <= QTransform::TxTranslate && b.type() <= QTransform::TxTranslate) {
+ return true;
+ } else {
+ qt_noop();
+ qt_noop();
+ return a.m11() == b.m11()
+ && a.m12() == b.m12()
+ && a.m21() == b.m21()
+ && a.m22() == b.m22();
+ }
+}
+QFontEngineGlyphCache::~QFontEngineGlyphCache()
+{
+}
+static HB_Bool hb_stringToGlyphs(HB_Font font, const HB_UChar16 *string, hb_uint32 length, HB_Glyph *glyphs, hb_uint32 *numGlyphs, HB_Bool rightToLeft)
+{
+ QFontEngine *fe = (QFontEngine *)font->userData;
+ QVarLengthGlyphLayoutArray qglyphs(*numGlyphs);
+ QTextEngine::ShaperFlags shaperFlags(QTextEngine::GlyphIndicesOnly);
+ if (rightToLeft)
+ shaperFlags |= QTextEngine::RightToLeft;
+ int nGlyphs = *numGlyphs;
+ bool result = fe->stringToCMap(reinterpret_cast<const QChar *>(string), length, &qglyphs, &nGlyphs, shaperFlags);
+ *numGlyphs = nGlyphs;
+ if (!result)
+ return false;
+ for (hb_uint32 i = 0; i < *numGlyphs; ++i)
+ glyphs[i] = qglyphs.glyphs[i];
+ return true;
+}
+static void hb_getAdvances(HB_Font font, const HB_Glyph *glyphs, hb_uint32 numGlyphs, HB_Fixed *advances, int flags)
+{
+ QFontEngine *fe = (QFontEngine *)font->userData;
+ QVarLengthGlyphLayoutArray qglyphs(numGlyphs);
+ for (hb_uint32 i = 0; i < numGlyphs; ++i)
+ qglyphs.glyphs[i] = glyphs[i];
+ fe->recalcAdvances(&qglyphs, flags & HB_ShaperFlag_UseDesignMetrics ? QFlags<QTextEngine::ShaperFlag>(QTextEngine::DesignMetrics) : QFlags<QTextEngine::ShaperFlag>(0));
+ for (hb_uint32 i = 0; i < numGlyphs; ++i)
+ advances[i] = qglyphs.advances_x[i].value();
+}
+static HB_Bool hb_canRender(HB_Font font, const HB_UChar16 *string, hb_uint32 length)
+{
+ QFontEngine *fe = (QFontEngine *)font->userData;
+ return fe->canRender(reinterpret_cast<const QChar *>(string), length);
+}
+static void hb_getGlyphMetrics(HB_Font font, HB_Glyph glyph, HB_GlyphMetrics *metrics)
+{
+ QFontEngine *fe = (QFontEngine *)font->userData;
+ glyph_metrics_t m = fe->boundingBox(glyph);
+ metrics->x = m.x.value();
+ metrics->y = m.y.value();
+ metrics->width = m.width.value();
+ metrics->height = m.height.value();
+ metrics->xOffset = m.xoff.value();
+ metrics->yOffset = m.yoff.value();
+}
+static HB_Fixed hb_getFontMetric(HB_Font font, HB_FontMetric metric)
+{
+ if (metric == HB_FontAscent) {
+ QFontEngine *fe = (QFontEngine *)font->userData;
+ return fe->ascent().value();
+ }
+ return 0;
+}
+HB_Error QFontEngine::getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints)
+{
+ (void)glyph;
+ (void)flags;
+ (void)point;
+ (void)xpos;
+ (void)ypos;
+ (void)nPoints;
+ return HB_Err_Not_Covered;
+}
+static HB_Error hb_getPointInOutline(HB_Font font, HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints)
+{
+ QFontEngine *fe = (QFontEngine *)font->userData;
+ return fe->getPointInOutline(glyph, flags, point, xpos, ypos, nPoints);
+}
+static const HB_FontClass hb_fontClass = {
+ hb_stringToGlyphs, hb_getAdvances, hb_canRender, hb_getPointInOutline,
+ hb_getGlyphMetrics, hb_getFontMetric
+};
+static HB_Error hb_getSFntTable(void *font, HB_Tag tableTag, HB_Byte *buffer, HB_UInt *length)
+{
+ QFontEngine *fe = (QFontEngine *)font;
+ if (!fe->getSfntTableData(tableTag, buffer, length))
+ return HB_Err_Invalid_Argument;
+ return HB_Err_Ok;
+}
+QFontEngine::QFontEngine()
+ : QObject()
+{
+ ref = 0;
+ cache_count = 0;
+ fsType = 0;
+ symbol = false;
+ memset(&hbFont, 0, sizeof(hbFont));
+ hbFont.klass = &hb_fontClass;
+ hbFont.userData = this;
+ hbFace = 0;
+ glyphFormat = -1;
+}
+QFontEngine::~QFontEngine()
+{
+ for (GlyphPointerHash::iterator it = m_glyphPointerHash.begin(), end = m_glyphPointerHash.end();
+ it != end; ++it) {
+ for (QList<QFontEngineGlyphCache*>::iterator it2 = it.value().begin(), end2 = it.value().end();
+ it2 != end2; ++it2)
+ delete *it2;
+ }
+ m_glyphPointerHash.clear();
+ for (GlyphIntHash::iterator it = m_glyphIntHash.begin(), end = m_glyphIntHash.end();
+ it != end; ++it) {
+ for (QList<QFontEngineGlyphCache*>::iterator it2 = it.value().begin(), end2 = it.value().end();
+ it2 != end2; ++it2)
+ delete *it2;
+ }
+ m_glyphIntHash.clear();
+ qHBFreeFace(hbFace);
+}
+QFixed QFontEngine::lineThickness() const
+{
+ int score = fontDef.weight * fontDef.pixelSize;
+ int lw = score / 700;
+ if (lw < 2 && score >= 1050) lw = 2;
+ if (lw == 0) lw = 1;
+ return lw;
+}
+QFixed QFontEngine::underlinePosition() const
+{
+ return ((lineThickness() * 2) + 3) / 6;
+}
+HB_Font QFontEngine::harfbuzzFont() const
+{
+ if (!hbFont.x_ppem) {
+ QFixed emSquare = emSquareSize();
+ hbFont.x_ppem = fontDef.pixelSize;
+ hbFont.y_ppem = fontDef.pixelSize * fontDef.stretch / 100;
+ hbFont.x_scale = (QFixed(hbFont.x_ppem * (1 << 16)) / emSquare).value();
+ hbFont.y_scale = (QFixed(hbFont.y_ppem * (1 << 16)) / emSquare).value();
+ }
+ return &hbFont;
+}
+HB_Face QFontEngine::harfbuzzFace() const
+{
+ if (!hbFace)
+ hbFace = qHBNewFace(const_cast<QFontEngine *>(this), hb_getSFntTable);
+ return hbFace;
+}
+glyph_metrics_t QFontEngine::boundingBox(glyph_t glyph, const QTransform &matrix)
+{
+ glyph_metrics_t metrics = boundingBox(glyph);
+ if (matrix.type() > QTransform::TxTranslate) {
+ return metrics.transformed(matrix);
+ }
+ return metrics;
+}
+QFixed QFontEngine::xHeight() const
+{
+ QGlyphLayoutArray<8> glyphs;
+ int nglyphs = 7;
+ QChar x((ushort)'x');
+ stringToCMap(&x, 1, &glyphs, &nglyphs, QTextEngine::GlyphIndicesOnly);
+ glyph_metrics_t bb = const_cast<QFontEngine *>(this)->boundingBox(glyphs.glyphs[0]);
+ return bb.height;
+}
+QFixed QFontEngine::averageCharWidth() const
+{
+ QGlyphLayoutArray<8> glyphs;
+ int nglyphs = 7;
+ QChar x((ushort)'x');
+ stringToCMap(&x, 1, &glyphs, &nglyphs, QTextEngine::GlyphIndicesOnly);
+ glyph_metrics_t bb = const_cast<QFontEngine *>(this)->boundingBox(glyphs.glyphs[0]);
+ return bb.xoff;
+}
+void QFontEngine::getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags,
+ QVarLengthArray<glyph_t> &glyphs_out, QVarLengthArray<QFixedPoint> &positions)
+{
+ QFixed xpos;
+ QFixed ypos;
+ const bool transform = matrix.m11() != 1.
+ || matrix.m12() != 0.
+ || matrix.m21() != 0.
+ || matrix.m22() != 1.;
+ if (!transform) {
+ xpos = QFixed::fromReal(matrix.dx());
+ ypos = QFixed::fromReal(matrix.dy());
+ }
+ int current = 0;
+ if (flags & QTextItem::RightToLeft) {
+ int i = glyphs.numGlyphs;
+ int totalKashidas = 0;
+ while(i--) {
+ xpos += glyphs.advances_x[i] + QFixed::fromFixed(glyphs.justifications[i].space_18d6);
+ ypos += glyphs.advances_y[i];
+ totalKashidas += glyphs.justifications[i].nKashidas;
+ }
+ positions.resize(glyphs.numGlyphs+totalKashidas);
+ glyphs_out.resize(glyphs.numGlyphs+totalKashidas);
+ i = 0;
+ while(i < glyphs.numGlyphs) {
+ if (glyphs.attributes[i].dontPrint) {
+ ++i;
+ continue;
+ }
+ xpos -= glyphs.advances_x[i];
+ ypos -= glyphs.advances_y[i];
+ QFixed gpos_x = xpos + glyphs.offsets[i].x;
+ QFixed gpos_y = ypos + glyphs.offsets[i].y;
+ if (transform) {
+ QPointF gpos(gpos_x.toReal(), gpos_y.toReal());
+ gpos = gpos * matrix;
+ gpos_x = QFixed::fromReal(gpos.x());
+ gpos_y = QFixed::fromReal(gpos.y());
+ }
+ positions[current].x = gpos_x;
+ positions[current].y = gpos_y;
+ glyphs_out[current] = glyphs.glyphs[i];
+ ++current;
+ if (glyphs.justifications[i].nKashidas) {
+ QChar ch(0x640);
+ QGlyphLayoutArray<8> g;
+ int nglyphs = 7;
+ stringToCMap(&ch, 1, &g, &nglyphs, 0);
+ for (uint k = 0; k < glyphs.justifications[i].nKashidas; ++k) {
+ xpos -= g.advances_x[0];
+ ypos -= g.advances_y[0];
+ QFixed gpos_x = xpos + glyphs.offsets[i].x;
+ QFixed gpos_y = ypos + glyphs.offsets[i].y;
+ if (transform) {
+ QPointF gpos(gpos_x.toReal(), gpos_y.toReal());
+ gpos = gpos * matrix;
+ gpos_x = QFixed::fromReal(gpos.x());
+ gpos_y = QFixed::fromReal(gpos.y());
+ }
+ positions[current].x = gpos_x;
+ positions[current].y = gpos_y;
+ glyphs_out[current] = g.glyphs[0];
+ ++current;
+ }
+ } else {
+ xpos -= QFixed::fromFixed(glyphs.justifications[i].space_18d6);
+ }
+ ++i;
+ }
+ } else {
+ positions.resize(glyphs.numGlyphs);
+ glyphs_out.resize(glyphs.numGlyphs);
+ int i = 0;
+ if (!transform) {
+ while (i < glyphs.numGlyphs) {
+ if (!glyphs.attributes[i].dontPrint) {
+ positions[current].x = xpos + glyphs.offsets[i].x;
+ positions[current].y = ypos + glyphs.offsets[i].y;
+ glyphs_out[current] = glyphs.glyphs[i];
+ xpos += glyphs.advances_x[i] + QFixed::fromFixed(glyphs.justifications[i].space_18d6);
+ ypos += glyphs.advances_y[i];
+ ++current;
+ }
+ ++i;
+ }
+ } else {
+ positions.resize(glyphs.numGlyphs);
+ glyphs_out.resize(glyphs.numGlyphs);
+ int i = 0;
+ while (i < glyphs.numGlyphs) {
+ if (!glyphs.attributes[i].dontPrint) {
+ QFixed gpos_x = xpos + glyphs.offsets[i].x;
+ QFixed gpos_y = ypos + glyphs.offsets[i].y;
+ QPointF gpos(gpos_x.toReal(), gpos_y.toReal());
+ gpos = gpos * matrix;
+ positions[current].x = QFixed::fromReal(gpos.x());
+ positions[current].y = QFixed::fromReal(gpos.y());
+ glyphs_out[current] = glyphs.glyphs[i];
+ xpos += glyphs.advances_x[i] + QFixed::fromFixed(glyphs.justifications[i].space_18d6);
+ ypos += glyphs.advances_y[i];
+ ++current;
+ }
+ ++i;
+ }
+ }
+ }
+ positions.resize(current);
+ glyphs_out.resize(current);
+ qt_noop();
+}
+glyph_metrics_t QFontEngine::tightBoundingBox(const QGlyphLayout &glyphs)
+{
+ glyph_metrics_t overall;
+ QFixed ymax = 0;
+ QFixed xmax = 0;
+ for (int i = 0; i < glyphs.numGlyphs; i++) {
+ glyph_metrics_t bb = boundingBox(glyphs.glyphs[i]);
+ QFixed x = overall.xoff + glyphs.offsets[i].x + bb.x;
+ QFixed y = overall.yoff + glyphs.offsets[i].y + bb.y;
+ overall.x = qMin(overall.x, x);
+ overall.y = qMin(overall.y, y);
+ xmax = qMax(xmax, x + bb.width);
+ ymax = qMax(ymax, y + bb.height);
+ overall.xoff += bb.xoff;
+ overall.yoff += bb.yoff;
+ }
+ overall.height = qMax(overall.height, ymax - overall.y);
+ overall.width = xmax - overall.x;
+ return overall;
+}
+void QFontEngine::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path,
+ QTextItem::RenderFlags flags)
+{
+ if (!glyphs.numGlyphs)
+ return;
+ QVarLengthArray<QFixedPoint> positions;
+ QVarLengthArray<glyph_t> positioned_glyphs;
+ QTransform matrix;
+ matrix.translate(x, y);
+ getGlyphPositions(glyphs, matrix, flags, positioned_glyphs, positions);
+ addGlyphsToPath(positioned_glyphs.data(), positions.data(), positioned_glyphs.size(), path, flags);
+}
+enum { EdgeRight = 0x1,
+ EdgeDown = 0x2,
+ EdgeLeft = 0x4,
+ EdgeUp = 0x8
+};
+static void collectSingleContour(qreal x0, qreal y0, uint *grid, int x, int y, int w, int h, QPainterPath *path)
+{
+ (void)h;;
+ path->moveTo(x + x0, y + y0);
+ while (grid[(y)*(w+1) + (x)]) {
+ if (grid[(y)*(w+1) + (x)] & EdgeRight) {
+ while (grid[(y)*(w+1) + (x)] & EdgeRight) {
+ grid[(y)*(w+1) + (x)] &= ~EdgeRight;
+ ++x;
+ }
+ qt_noop();
+ path->lineTo(x + x0, y + y0);
+ continue;
+ }
+ if (grid[(y)*(w+1) + (x)] & EdgeDown) {
+ while (grid[(y)*(w+1) + (x)] & EdgeDown) {
+ grid[(y)*(w+1) + (x)] &= ~EdgeDown;
+ ++y;
+ }
+ qt_noop();
+ path->lineTo(x + x0, y + y0);
+ continue;
+ }
+ if (grid[(y)*(w+1) + (x)] & EdgeLeft) {
+ while (grid[(y)*(w+1) + (x)] & EdgeLeft) {
+ grid[(y)*(w+1) + (x)] &= ~EdgeLeft;
+ --x;
+ }
+ qt_noop();
+ path->lineTo(x + x0, y + y0);
+ continue;
+ }
+ if (grid[(y)*(w+1) + (x)] & EdgeUp) {
+ while (grid[(y)*(w+1) + (x)] & EdgeUp) {
+ grid[(y)*(w+1) + (x)] &= ~EdgeUp;
+ --y;
+ }
+ qt_noop();
+ path->lineTo(x + x0, y + y0);
+ continue;
+ }
+ }
+ path->closeSubpath();
+}
+void qt_addBitmapToPath(qreal x0, qreal y0, const uchar *image_data, int bpl, int w, int h, QPainterPath *path)
+{
+ uint *grid = new uint[(w+1)*(h+1)];
+ for (int y = 0; y <= h; ++y) {
+ for (int x = 0; x <= w; ++x) {
+ bool topLeft = (x == 0)|(y == 0) ? false : (*(image_data + (y - 1)*bpl + ((x - 1) >> 3)) & (0x80 >> ((x - 1) & 7)));
+ bool topRight = (x == w)|(y == 0) ? false : (*(image_data + (y - 1)*bpl + ((x) >> 3)) & (0x80 >> ((x) & 7)));
+ bool bottomLeft = (x == 0)|(y == h) ? false : (*(image_data + (y)*bpl + ((x - 1) >> 3)) & (0x80 >> ((x - 1) & 7)));
+ bool bottomRight = (x == w)|(y == h) ? false : (*(image_data + (y)*bpl + ((x) >> 3)) & (0x80 >> ((x) & 7)));
+ grid[(y)*(w+1) + (x)] = 0;
+ if ((!topRight) & bottomRight)
+ grid[(y)*(w+1) + (x)] |= EdgeRight;
+ if ((!bottomRight) & bottomLeft)
+ grid[(y)*(w+1) + (x)] |= EdgeDown;
+ if ((!bottomLeft) & topLeft)
+ grid[(y)*(w+1) + (x)] |= EdgeLeft;
+ if ((!topLeft) & topRight)
+ grid[(y)*(w+1) + (x)] |= EdgeUp;
+ }
+ }
+ for (int y = 0; y < h; ++y) {
+ for (int x = 0; x < w; ++x) {
+ if (!grid[(y)*(w+1) + (x)])
+ continue;
+ collectSingleContour(x0, y0, grid, x, y, w, h, path);
+ }
+ }
+ delete [] grid;
+}
+void QFontEngine::addBitmapFontToPath(qreal x, qreal y, const QGlyphLayout &glyphs,
+ QPainterPath *path, QTextItem::RenderFlags flags)
+{
+ (void)flags;;
+ QFixed advanceX = QFixed::fromReal(x);
+ QFixed advanceY = QFixed::fromReal(y);
+ for (int i=0; i < glyphs.numGlyphs; ++i) {
+ glyph_metrics_t metrics = boundingBox(glyphs.glyphs[i]);
+ if (metrics.width.value() == 0 || metrics.height.value() == 0) {
+ advanceX += glyphs.advances_x[i];
+ advanceY += glyphs.advances_y[i];
+ continue;
+ }
+ const QImage alphaMask = alphaMapForGlyph(glyphs.glyphs[i]);
+ const int w = alphaMask.width();
+ const int h = alphaMask.height();
+ const int srcBpl = alphaMask.bytesPerLine();
+ QImage bitmap;
+ if (alphaMask.depth() == 1) {
+ bitmap = alphaMask;
+ } else {
+ bitmap = QImage(w, h, QImage::Format_Mono);
+ const uchar *imageData = alphaMask.bits();
+ const int destBpl = bitmap.bytesPerLine();
+ uchar *bitmapData = bitmap.bits();
+ for (int yi = 0; yi < h; ++yi) {
+ const uchar *src = imageData + yi*srcBpl;
+ uchar *dst = bitmapData + yi*destBpl;
+ for (int xi = 0; xi < w; ++xi) {
+ const int byte = xi / 8;
+ const int bit = xi % 8;
+ if (bit == 0)
+ dst[byte] = 0;
+ if (src[xi])
+ dst[byte] |= 128 >> bit;
+ }
+ }
+ }
+ const uchar *bitmap_data = bitmap.bits();
+ QFixedPoint offset = glyphs.offsets[i];
+ advanceX += offset.x;
+ advanceY += offset.y;
+ qt_addBitmapToPath((advanceX + metrics.x).toReal(), (advanceY + metrics.y).toReal(), bitmap_data, bitmap.bytesPerLine(), w, h, path);
+ advanceX += glyphs.advances_x[i];
+ advanceY += glyphs.advances_y[i];
+ }
+}
+void QFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nGlyphs,
+ QPainterPath *path, QTextItem::RenderFlags flags)
+{
+ qreal x = positions[0].x.toReal();
+ qreal y = positions[0].y.toReal();
+ QVarLengthGlyphLayoutArray g(nGlyphs);
+ for (int i = 0; i < nGlyphs; ++i) {
+ g.glyphs[i] = glyphs[i];
+ if (i < nGlyphs - 1) {
+ g.advances_x[i] = positions[i+1].x - positions[i].x;
+ g.advances_y[i] = positions[i+1].y - positions[i].y;
+ } else {
+ g.advances_x[i] = QFixed::fromReal(maxCharWidth());
+ g.advances_y[i] = 0;
+ }
+ }
+ addBitmapFontToPath(x, y, g, path, flags);
+}
+QImage QFontEngine::alphaMapForGlyph(glyph_t glyph, const QTransform &t)
+{
+ QImage i = alphaMapForGlyph(glyph);
+ if (t.type() > QTransform::TxTranslate)
+ i = i.transformed(t);
+ qt_noop();
+ return i;
+}
+QImage QFontEngine::alphaRGBMapForGlyph(glyph_t glyph, int , const QTransform &t)
+{
+ QImage alphaMask = alphaMapForGlyph(glyph, t);
+ QImage rgbMask(alphaMask.width(), alphaMask.height(), QImage::Format_RGB32);
+ for (int y=0; y<alphaMask.height(); ++y) {
+ uint *dst = (uint *) rgbMask.scanLine(y);
+ uchar *src = (uchar *) alphaMask.scanLine(y);
+ for (int x=0; x<alphaMask.width(); ++x)
+ dst[x] = qRgb(src[x], src[x], src[x]);
+ }
+ return rgbMask;
+}
+void QFontEngine::removeGlyphFromCache(glyph_t)
+{
+}
+QFontEngine::Properties QFontEngine::properties() const
+{
+ Properties p;
+ QByteArray psname = QPdf::stripSpecialCharacters(fontDef.family.toUtf8());
+ psname += '-';
+ psname += QByteArray::number(fontDef.style);
+ psname += '-';
+ psname += QByteArray::number(fontDef.weight);
+ p.postscriptName = psname;
+ p.ascent = ascent();
+ p.descent = descent();
+ p.leading = leading();
+ p.emSquare = p.ascent;
+ p.boundingBox = QRectF(0, -p.ascent.toReal(), maxCharWidth(), (p.ascent + p.descent).toReal());
+ p.italicAngle = 0;
+ p.capHeight = p.ascent;
+ p.lineWidth = lineThickness();
+ return p;
+}
+void QFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics)
+{
+ *metrics = boundingBox(glyph);
+ QFixedPoint p;
+ p.x = 0;
+ p.y = 0;
+ addGlyphsToPath(&glyph, &p, 1, path, QFlag(0));
+}
+QByteArray QFontEngine::getSfntTable(uint tag) const
+{
+ QByteArray table;
+ uint len = 0;
+ if (!getSfntTableData(tag, 0, &len))
+ return table;
+ if (!len)
+ return table;
+ table.resize(len);
+ if (!getSfntTableData(tag, reinterpret_cast<uchar *>(table.data()), &len))
+ return QByteArray();
+ return table;
+}
+void QFontEngine::expireGlyphCache()
+{
+ if (m_glyphCacheQueue.count() > 10) {
+ QFontEngineGlyphCache *old = m_glyphCacheQueue.takeFirst();
+ for (GlyphPointerHash::iterator i = m_glyphPointerHash.begin(); i != m_glyphPointerHash.end(); ++i) {
+ QList<QFontEngineGlyphCache *> list = i.value();
+ if (list.removeAll(old)) {
+ if (list.isEmpty())
+ m_glyphPointerHash.remove(i.key());
+ else
+ m_glyphPointerHash.insert(i.key(), list);
+ break;
+ }
+ }
+ for (GlyphIntHash::iterator i = m_glyphIntHash.begin(); i != m_glyphIntHash.end(); ++i) {
+ QList<QFontEngineGlyphCache *> list = i.value();
+ if (list.removeAll(old)) {
+ if (list.isEmpty())
+ m_glyphIntHash.remove(i.key());
+ else
+ m_glyphIntHash.insert(i.key(), list);
+ break;
+ }
+ }
+ delete old;
+ }
+}
+void QFontEngine::setGlyphCache(void *key, QFontEngineGlyphCache *data)
+{
+ qt_noop();
+ QList<QFontEngineGlyphCache*> items = m_glyphPointerHash.value(key);
+ for (QList<QFontEngineGlyphCache*>::iterator it = items.begin(), end = items.end(); it != end; ++it) {
+ QFontEngineGlyphCache *c = *it;
+ if (qtransform_equals_no_translate(c->m_transform, data->m_transform)) {
+ if (c == data)
+ return;
+ items.removeAll(c);
+ delete c;
+ break;
+ }
+ }
+ items.append(data);
+ m_glyphPointerHash.insert(key, items);
+ m_glyphCacheQueue.append(data);
+ expireGlyphCache();
+}
+void QFontEngine::setGlyphCache(QFontEngineGlyphCache::Type key, QFontEngineGlyphCache *data)
+{
+ qt_noop();
+ QList<QFontEngineGlyphCache*> items = m_glyphIntHash.value(key);
+ for (QList<QFontEngineGlyphCache*>::iterator it = items.begin(), end = items.end(); it != end; ++it) {
+ QFontEngineGlyphCache *c = *it;
+ if (qtransform_equals_no_translate(c->m_transform, data->m_transform)) {
+ if (c == data)
+ return;
+ items.removeAll(c);
+ delete c;
+ break;
+ }
+ }
+ items.append(data);
+ m_glyphIntHash.insert(key, items);
+ m_glyphCacheQueue.append(data);
+ expireGlyphCache();
+}
+QFontEngineGlyphCache *QFontEngine::glyphCache(void *key, const QTransform &transform) const
+{
+ QList<QFontEngineGlyphCache*> items = m_glyphPointerHash.value(key);
+ for (QList<QFontEngineGlyphCache*>::iterator it = items.begin(), end = items.end(); it != end; ++it) {
+ QFontEngineGlyphCache *c = *it;
+ if (qtransform_equals_no_translate(c->m_transform, transform)) {
+ m_glyphCacheQueue.removeAll(c);
+ m_glyphCacheQueue.append(c);
+ return c;
+ }
+ }
+ return 0;
+}
+QFontEngineGlyphCache *QFontEngine::glyphCache(QFontEngineGlyphCache::Type key, const QTransform &transform) const
+{
+ QList<QFontEngineGlyphCache*> items = m_glyphIntHash.value(key);
+ for (QList<QFontEngineGlyphCache*>::iterator it = items.begin(), end = items.end(); it != end; ++it) {
+ QFontEngineGlyphCache *c = *it;
+ if (qtransform_equals_no_translate(c->m_transform, transform)) {
+ m_glyphCacheQueue.removeAll(c);
+ m_glyphCacheQueue.append(c);
+ return c;
+ }
+ }
+ return 0;
+}
+static inline QFixed kerning(int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
+{
+ uint left_right = (left << 16) + right;
+ left = 0, right = numPairs - 1;
+ while (left <= right) {
+ int middle = left + ( ( right - left ) >> 1 );
+ if(pairs[middle].left_right == left_right)
+ return pairs[middle].adjust;
+ if (pairs[middle].left_right < left_right)
+ left = middle + 1;
+ else
+ right = middle - 1;
+ }
+ return 0;
+}
+void QFontEngine::doKerning(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const
+{
+ int numPairs = kerning_pairs.size();
+ if(!numPairs)
+ return;
+ const KernPair *pairs = kerning_pairs.constData();
+ if(flags & QTextEngine::DesignMetrics) {
+ for(int i = 0; i < glyphs->numGlyphs - 1; ++i)
+ glyphs->advances_x[i] += kerning(glyphs->glyphs[i], glyphs->glyphs[i+1] , pairs, numPairs);
+ } else {
+ for(int i = 0; i < glyphs->numGlyphs - 1; ++i)
+ glyphs->advances_x[i] += qRound(kerning(glyphs->glyphs[i], glyphs->glyphs[i+1] , pairs, numPairs));
+ }
+}
+void QFontEngine::loadKerningPairs(QFixed scalingFactor)
+{
+ kerning_pairs.clear();
+ QByteArray tab = getSfntTable(( (((quint32)('k')) << 24) | (((quint32)('e')) << 16) | (((quint32)('r')) << 8) | ((quint32)('n')) ));
+ if (tab.isEmpty())
+ return;
+ const uchar *table = reinterpret_cast<const uchar *>(tab.constData());
+ unsigned short version = qFromBigEndian<quint16>(table);
+ if (version != 0) {
+ return;
+ }
+ unsigned short numTables = qFromBigEndian<quint16>(table + 2);
+ {
+ int offset = 4;
+ for(int i = 0; i < numTables; ++i) {
+ if (offset + 6 > tab.size()) {
+ goto end;
+ }
+ const uchar *header = table + offset;
+ ushort version = qFromBigEndian<quint16>(header);
+ ushort length = qFromBigEndian<quint16>(header+2);
+ ushort coverage = qFromBigEndian<quint16>(header+4);
+ if(version == 0 && coverage == 0x0001) {
+ if (offset + length > tab.size()) {
+ goto end;
+ }
+ const uchar *data = table + offset + 6;
+ ushort nPairs = qFromBigEndian<quint16>(data);
+ if(nPairs * 6 + 8 > length - 6) {
+ goto end;
+ }
+ int off = 8;
+ for(int i = 0; i < nPairs; ++i) {
+ QFontEngine::KernPair p;
+ p.left_right = (((uint)qFromBigEndian<quint16>(data+off)) << 16) + qFromBigEndian<quint16>(data+off+2);
+ p.adjust = QFixed(((int)(short)qFromBigEndian<quint16>(data+off+4))) / scalingFactor;
+ kerning_pairs.append(p);
+ off += 6;
+ }
+ }
+ offset += length;
+ }
+ }
+end:
+ qSort(kerning_pairs);
+}
+int QFontEngine::glyphCount() const
+{
+ QByteArray maxpTable = getSfntTable(( (((quint32)('m')) << 24) | (((quint32)('a')) << 16) | (((quint32)('x')) << 8) | ((quint32)('p')) ));
+ if (maxpTable.size() < 6)
+ return 0;
+ return qFromBigEndian<quint16>(reinterpret_cast<const uchar *>(maxpTable.constData() + 4));
+}
+const uchar *QFontEngine::getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize)
+{
+ const uchar *header = table;
+ if (tableSize < 4)
+ return 0;
+ const uchar *endPtr = table + tableSize;
+ if (qFromBigEndian<quint16>(header) != 0)
+ return 0;
+ unsigned short numTables = qFromBigEndian<quint16>(header + 2);
+ const uchar *maps = table + 4;
+ if (maps + 8 * numTables > endPtr)
+ return 0;
+ int tableToUse = -1;
+ int score = 0;
+ for (int n = 0; n < numTables; ++n) {
+ const quint16 platformId = qFromBigEndian<quint16>(maps + 8 * n);
+ const quint16 platformSpecificId = qFromBigEndian<quint16>(maps + 8 * n + 2);
+ switch (platformId) {
+ case 0:
+ if (score < 4 &&
+ (platformSpecificId == 0 ||
+ platformSpecificId == 2 ||
+ platformSpecificId == 3)) {
+ tableToUse = n;
+ score = 4;
+ } else if (score < 3 && platformSpecificId == 1) {
+ tableToUse = n;
+ score = 3;
+ }
+ break;
+ case 1:
+ if (score < 2 && platformSpecificId == 0) {
+ tableToUse = n;
+ score = 2;
+ }
+ break;
+ case 3:
+ switch (platformSpecificId) {
+ case 0:
+ if (score < 1) {
+ tableToUse = n;
+ score = 1;
+ }
+ break;
+ case 1:
+ if (score < 5) {
+ tableToUse = n;
+ score = 5;
+ }
+ break;
+ case 0xa:
+ if (score < 6) {
+ tableToUse = n;
+ score = 6;
+ }
+ break;
+ default:
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ if(tableToUse < 0)
+ return 0;
+ *isSymbolFont = (score == 1);
+ unsigned int unicode_table = qFromBigEndian<quint32>(maps + 8*tableToUse + 4);
+ if (!unicode_table || unicode_table + 8 > tableSize)
+ return 0;
+ header = table + unicode_table;
+ unsigned short format = qFromBigEndian<quint16>(header);
+ unsigned int length;
+ if(format < 8)
+ length = qFromBigEndian<quint16>(header + 2);
+ else
+ length = qFromBigEndian<quint32>(header + 4);
+ if (table + unicode_table + length > endPtr)
+ return 0;
+ *cmapSize = length;
+ return table + unicode_table;
+}
+quint32 QFontEngine::getTrueTypeGlyphIndex(const uchar *cmap, uint unicode)
+{
+ unsigned short format = qFromBigEndian<quint16>(cmap);
+ if (format == 0) {
+ if (unicode < 256)
+ return (int) *(cmap+6+unicode);
+ } else if (format == 4) {
+ if(unicode >= 0xffff)
+ return 0;
+ quint16 segCountX2 = qFromBigEndian<quint16>(cmap + 6);
+ const unsigned char *ends = cmap + 14;
+ quint16 endIndex = 0;
+ int i = 0;
+ for (; i < segCountX2/2 && (endIndex = qFromBigEndian<quint16>(ends + 2*i)) < unicode; i++) {}
+ const unsigned char *idx = ends + segCountX2 + 2 + 2*i;
+ quint16 startIndex = qFromBigEndian<quint16>(idx);
+ if (startIndex > unicode)
+ return 0;
+ idx += segCountX2;
+ qint16 idDelta = (qint16)qFromBigEndian<quint16>(idx);
+ idx += segCountX2;
+ quint16 idRangeoffset_t = (quint16)qFromBigEndian<quint16>(idx);
+ quint16 glyphIndex;
+ if (idRangeoffset_t) {
+ quint16 id = qFromBigEndian<quint16>(idRangeoffset_t + 2*(unicode - startIndex) + idx);
+ if (id)
+ glyphIndex = (idDelta + id) % 0x10000;
+ else
+ glyphIndex = 0;
+ } else {
+ glyphIndex = (idDelta + unicode) % 0x10000;
+ }
+ return glyphIndex;
+ } else if (format == 6) {
+ quint16 tableSize = qFromBigEndian<quint16>(cmap + 2);
+ quint16 firstCode6 = qFromBigEndian<quint16>(cmap + 6);
+ if (unicode < firstCode6)
+ return 0;
+ quint16 entryCount6 = qFromBigEndian<quint16>(cmap + 8);
+ if (entryCount6 * 2 + 10 > tableSize)
+ return 0;
+ quint16 sentinel6 = firstCode6 + entryCount6;
+ if (unicode >= sentinel6)
+ return 0;
+ quint16 entryIndex6 = unicode - firstCode6;
+ return qFromBigEndian<quint16>(cmap + 10 + (entryIndex6 * 2));
+ } else if (format == 12) {
+ quint32 nGroups = qFromBigEndian<quint32>(cmap + 12);
+ cmap += 16;
+ int left = 0, right = nGroups - 1;
+ while (left <= right) {
+ int middle = left + ( ( right - left ) >> 1 );
+ quint32 startCharCode = qFromBigEndian<quint32>(cmap + 12*middle);
+ if(unicode < startCharCode)
+ right = middle - 1;
+ else {
+ quint32 endCharCode = qFromBigEndian<quint32>(cmap + 12*middle + 4);
+ if(unicode <= endCharCode)
+ return qFromBigEndian<quint32>(cmap + 12*middle + 8) + unicode - startCharCode;
+ left = middle + 1;
+ }
+ }
+ } else {
+ qDebug("cmap table of format %d not implemented", format);
+ }
+ return 0;
+}
+QFontEngineBox::QFontEngineBox(int size)
+ : _size(size)
+{
+ cache_cost = sizeof(QFontEngineBox);
+}
+QFontEngineBox::~QFontEngineBox()
+{
+}
+bool QFontEngineBox::stringToCMap(const QChar *, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags) const
+{
+ if (*nglyphs < len) {
+ *nglyphs = len;
+ return false;
+ }
+ for (int i = 0; i < len; i++) {
+ glyphs->glyphs[i] = 0;
+ glyphs->advances_x[i] = _size;
+ glyphs->advances_y[i] = 0;
+ }
+ *nglyphs = len;
+ glyphs->numGlyphs = len;
+ return true;
+}
+void QFontEngineBox::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags) const
+{
+ for (int i = 0; i < glyphs->numGlyphs; i++) {
+ glyphs->advances_x[i] = _size;
+ glyphs->advances_y[i] = 0;
+ }
+}
+void QFontEngineBox::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags)
+{
+ if (!glyphs.numGlyphs)
+ return;
+ QVarLengthArray<QFixedPoint> positions;
+ QVarLengthArray<glyph_t> positioned_glyphs;
+ QTransform matrix;
+ matrix.translate(x, y - _size);
+ getGlyphPositions(glyphs, matrix, flags, positioned_glyphs, positions);
+ QSize s(_size - 3, _size - 3);
+ for (int k = 0; k < positions.size(); k++)
+ path->addRect(QRectF(positions[k].toPointF(), s));
+}
+glyph_metrics_t QFontEngineBox::boundingBox(const QGlyphLayout &glyphs)
+{
+ glyph_metrics_t overall;
+ overall.width = _size*glyphs.numGlyphs;
+ overall.height = _size;
+ overall.xoff = overall.width;
+ return overall;
+}
+void QFontEngineBox::draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &ti)
+{
+ if (!ti.glyphs.numGlyphs)
+ return;
+ QSize s(_size - 3, _size - 3);
+ QVarLengthArray<QFixedPoint> positions;
+ QVarLengthArray<glyph_t> glyphs;
+ QTransform matrix;
+ matrix.translate(x, y - _size);
+ ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
+ if (glyphs.size() == 0)
+ return;
+ QPainter *painter = p->painter();
+ painter->save();
+ painter->setBrush(Qt::NoBrush);
+ QPen pen = painter->pen();
+ pen.setWidthF(lineThickness().toReal());
+ painter->setPen(pen);
+ for (int k = 0; k < positions.size(); k++)
+ painter->drawRect(QRectF(positions[k].toPointF(), s));
+ painter->restore();
+}
+glyph_metrics_t QFontEngineBox::boundingBox(glyph_t)
+{
+ return glyph_metrics_t(0, -_size, _size, _size, _size, 0);
+}
+QFixed QFontEngineBox::ascent() const
+{
+ return _size;
+}
+QFixed QFontEngineBox::descent() const
+{
+ return 0;
+}
+QFixed QFontEngineBox::leading() const
+{
+ QFixed l = _size * QFixed::fromReal(qreal(0.15));
+ return l.ceil();
+}
+qreal QFontEngineBox::maxCharWidth() const
+{
+ return _size;
+}
+const char *QFontEngineBox::name() const
+{
+ return "null";
+}
+bool QFontEngineBox::canRender(const QChar *, int)
+{
+ return true;
+}
+QFontEngine::Type QFontEngineBox::type() const
+{
+ return Box;
+}
+QImage QFontEngineBox::alphaMapForGlyph(glyph_t)
+{
+ QImage image(_size, _size, QImage::Format_Indexed8);
+ QVector<QRgb> colors(256);
+ for (int i=0; i<256; ++i)
+ colors[i] = qRgba(0, 0, 0, i);
+ image.setColorTable(colors);
+ image.fill(0);
+ for (int i=2; i <= _size-3; ++i) {
+ image.setPixel(i, 2, 255);
+ image.setPixel(i, _size-3, 255);
+ image.setPixel(2, i, 255);
+ image.setPixel(_size-3, i, 255);
+ }
+ return image;
+}
+static inline uchar highByte(glyph_t glyph)
+{ return glyph >> 24; }
+static inline glyph_t stripped(glyph_t glyph)
+{ return glyph & 0x00ffffff; }
+QFontEngineMulti::QFontEngineMulti(int engineCount)
+{
+ engines.fill(0, engineCount);
+ cache_cost = 0;
+}
+QFontEngineMulti::~QFontEngineMulti()
+{
+ for (int i = 0; i < engines.size(); ++i) {
+ QFontEngine *fontEngine = engines.at(i);
+ if (fontEngine) {
+ fontEngine->ref.deref();
+ if (fontEngine->cache_count == 0 && fontEngine->ref == 0)
+ delete fontEngine;
+ }
+ }
+}
+bool QFontEngineMulti::stringToCMap(const QChar *str, int len,
+ QGlyphLayout *glyphs, int *nglyphs,
+ QTextEngine::ShaperFlags flags) const
+{
+ int ng = *nglyphs;
+ if (!engine(0)->stringToCMap(str, len, glyphs, &ng, flags))
+ return false;
+ int glyph_pos = 0;
+ for (int i = 0; i < len; ++i) {
+ bool surrogate = (str[i].unicode() >= 0xd800 && str[i].unicode() < 0xdc00 && i < len-1
+ && str[i+1].unicode() >= 0xdc00 && str[i+1].unicode() < 0xe000);
+ if (glyphs->glyphs[glyph_pos] == 0) {
+ QGlyphLayoutInstance tmp = glyphs->instance(glyph_pos);
+ for (int x = 1; x < engines.size(); ++x) {
+ QFontEngine *engine = engines.at(x);
+ if (!engine) {
+ const_cast<QFontEngineMulti *>(this)->loadEngine(x);
+ engine = engines.at(x);
+ }
+ qt_noop();
+ if (engine->type() == Box)
+ continue;
+ glyphs->advances_x[glyph_pos] = glyphs->advances_y[glyph_pos] = 0;
+ glyphs->offsets[glyph_pos] = QFixedPoint();
+ int num = 2;
+ QGlyphLayout offs = glyphs->mid(glyph_pos, num);
+ engine->stringToCMap(str + i, surrogate ? 2 : 1, &offs, &num, flags);
+ qt_noop();
+ if (glyphs->glyphs[glyph_pos]) {
+ glyphs->glyphs[glyph_pos] |= (x << 24);
+ break;
+ }
+ }
+ if (!glyphs->glyphs[glyph_pos]) {
+ glyphs->setInstance(glyph_pos, tmp);
+ }
+ }
+ if (surrogate)
+ ++i;
+ ++glyph_pos;
+ }
+ *nglyphs = ng;
+ glyphs->numGlyphs = ng;
+ return true;
+}
+glyph_metrics_t QFontEngineMulti::boundingBox(const QGlyphLayout &glyphs)
+{
+ if (glyphs.numGlyphs <= 0)
+ return glyph_metrics_t();
+ glyph_metrics_t overall;
+ int which = highByte(glyphs.glyphs[0]);
+ int start = 0;
+ int end, i;
+ for (end = 0; end < glyphs.numGlyphs; ++end) {
+ const int e = highByte(glyphs.glyphs[end]);
+ if (e == which)
+ continue;
+ for (i = start; i < end; ++i)
+ glyphs.glyphs[i] = stripped(glyphs.glyphs[i]);
+ const glyph_metrics_t gm = engine(which)->boundingBox(glyphs.mid(start, end - start));
+ overall.x = qMin(overall.x, gm.x);
+ overall.y = qMin(overall.y, gm.y);
+ overall.width = overall.xoff + gm.width;
+ overall.height = qMax(overall.height + overall.y, gm.height + gm.y) -
+ qMin(overall.y, gm.y);
+ overall.xoff += gm.xoff;
+ overall.yoff += gm.yoff;
+ const int hi = which << 24;
+ for (i = start; i < end; ++i)
+ glyphs.glyphs[i] = hi | glyphs.glyphs[i];
+ start = end;
+ which = e;
+ }
+ for (i = start; i < end; ++i)
+ glyphs.glyphs[i] = stripped(glyphs.glyphs[i]);
+ const glyph_metrics_t gm = engine(which)->boundingBox(glyphs.mid(start, end - start));
+ overall.x = qMin(overall.x, gm.x);
+ overall.y = qMin(overall.y, gm.y);
+ overall.width = overall.xoff + gm.width;
+ overall.height = qMax(overall.height + overall.y, gm.height + gm.y) -
+ qMin(overall.y, gm.y);
+ overall.xoff += gm.xoff;
+ overall.yoff += gm.yoff;
+ const int hi = which << 24;
+ for (i = start; i < end; ++i)
+ glyphs.glyphs[i] = hi | glyphs.glyphs[i];
+ return overall;
+}
+void QFontEngineMulti::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs,
+ QPainterPath *path, QTextItem::RenderFlags flags)
+{
+ if (glyphs.numGlyphs <= 0)
+ return;
+ int which = highByte(glyphs.glyphs[0]);
+ int start = 0;
+ int end, i;
+ if (flags & QTextItem::RightToLeft) {
+ for (int gl = 0; gl < glyphs.numGlyphs; gl++) {
+ x += glyphs.advances_x[gl].toReal();
+ y += glyphs.advances_y[gl].toReal();
+ }
+ }
+ for (end = 0; end < glyphs.numGlyphs; ++end) {
+ const int e = highByte(glyphs.glyphs[end]);
+ if (e == which)
+ continue;
+ if (flags & QTextItem::RightToLeft) {
+ for (i = start; i < end; ++i) {
+ x -= glyphs.advances_x[i].toReal();
+ y -= glyphs.advances_y[i].toReal();
+ }
+ }
+ for (i = start; i < end; ++i)
+ glyphs.glyphs[i] = stripped(glyphs.glyphs[i]);
+ engine(which)->addOutlineToPath(x, y, glyphs.mid(start, end - start), path, flags);
+ const int hi = which << 24;
+ for (i = start; i < end; ++i)
+ glyphs.glyphs[i] = hi | glyphs.glyphs[i];
+ if (!(flags & QTextItem::RightToLeft)) {
+ for (i = start; i < end; ++i) {
+ x += glyphs.advances_x[i].toReal();
+ y += glyphs.advances_y[i].toReal();
+ }
+ }
+ start = end;
+ which = e;
+ }
+ if (flags & QTextItem::RightToLeft) {
+ for (i = start; i < end; ++i) {
+ x -= glyphs.advances_x[i].toReal();
+ y -= glyphs.advances_y[i].toReal();
+ }
+ }
+ for (i = start; i < end; ++i)
+ glyphs.glyphs[i] = stripped(glyphs.glyphs[i]);
+ engine(which)->addOutlineToPath(x, y, glyphs.mid(start, end - start), path, flags);
+ const int hi = which << 24;
+ for (i = start; i < end; ++i)
+ glyphs.glyphs[i] = hi | glyphs.glyphs[i];
+}
+void QFontEngineMulti::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const
+{
+ if (glyphs->numGlyphs <= 0)
+ return;
+ int which = highByte(glyphs->glyphs[0]);
+ int start = 0;
+ int end, i;
+ for (end = 0; end < glyphs->numGlyphs; ++end) {
+ const int e = highByte(glyphs->glyphs[end]);
+ if (e == which)
+ continue;
+ for (i = start; i < end; ++i)
+ glyphs->glyphs[i] = stripped(glyphs->glyphs[i]);
+ QGlyphLayout offs = glyphs->mid(start, end - start);
+ engine(which)->recalcAdvances(&offs, flags);
+ const int hi = which << 24;
+ for (i = start; i < end; ++i)
+ glyphs->glyphs[i] = hi | glyphs->glyphs[i];
+ start = end;
+ which = e;
+ }
+ for (i = start; i < end; ++i)
+ glyphs->glyphs[i] = stripped(glyphs->glyphs[i]);
+ QGlyphLayout offs = glyphs->mid(start, end - start);
+ engine(which)->recalcAdvances(&offs, flags);
+ const int hi = which << 24;
+ for (i = start; i < end; ++i)
+ glyphs->glyphs[i] = hi | glyphs->glyphs[i];
+}
+void QFontEngineMulti::doKerning(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const
+{
+ if (glyphs->numGlyphs <= 0)
+ return;
+ int which = highByte(glyphs->glyphs[0]);
+ int start = 0;
+ int end, i;
+ for (end = 0; end < glyphs->numGlyphs; ++end) {
+ const int e = highByte(glyphs->glyphs[end]);
+ if (e == which)
+ continue;
+ for (i = start; i < end; ++i)
+ glyphs->glyphs[i] = stripped(glyphs->glyphs[i]);
+ QGlyphLayout offs = glyphs->mid(start, end - start);
+ engine(which)->doKerning(&offs, flags);
+ const int hi = which << 24;
+ for (i = start; i < end; ++i)
+ glyphs->glyphs[i] = hi | glyphs->glyphs[i];
+ start = end;
+ which = e;
+ }
+ for (i = start; i < end; ++i)
+ glyphs->glyphs[i] = stripped(glyphs->glyphs[i]);
+ QGlyphLayout offs = glyphs->mid(start, end - start);
+ engine(which)->doKerning(&offs, flags);
+ const int hi = which << 24;
+ for (i = start; i < end; ++i)
+ glyphs->glyphs[i] = hi | glyphs->glyphs[i];
+}
+glyph_metrics_t QFontEngineMulti::boundingBox(glyph_t glyph)
+{
+ const int which = highByte(glyph);
+ qt_noop();
+ return engine(which)->boundingBox(stripped(glyph));
+}
+QFixed QFontEngineMulti::ascent() const
+{ return engine(0)->ascent(); }
+QFixed QFontEngineMulti::descent() const
+{ return engine(0)->descent(); }
+QFixed QFontEngineMulti::leading() const
+{
+ return engine(0)->leading();
+}
+QFixed QFontEngineMulti::xHeight() const
+{
+ return engine(0)->xHeight();
+}
+QFixed QFontEngineMulti::averageCharWidth() const
+{
+ return engine(0)->averageCharWidth();
+}
+QFixed QFontEngineMulti::lineThickness() const
+{
+ return engine(0)->lineThickness();
+}
+QFixed QFontEngineMulti::underlinePosition() const
+{
+ return engine(0)->underlinePosition();
+}
+qreal QFontEngineMulti::maxCharWidth() const
+{
+ return engine(0)->maxCharWidth();
+}
+qreal QFontEngineMulti::minLeftBearing() const
+{
+ return engine(0)->minLeftBearing();
+}
+qreal QFontEngineMulti::minRightBearing() const
+{
+ return engine(0)->minRightBearing();
+}
+bool QFontEngineMulti::canRender(const QChar *string, int len)
+{
+ if (engine(0)->canRender(string, len))
+ return true;
+ QVarLengthGlyphLayoutArray glyphs(len);
+ int nglyphs = len;
+ if (stringToCMap(string, len, &glyphs, &nglyphs, QTextEngine::GlyphIndicesOnly) == false) {
+ glyphs.resize(nglyphs);
+ stringToCMap(string, len, &glyphs, &nglyphs, QTextEngine::GlyphIndicesOnly);
+ }
+ bool allExist = true;
+ for (int i = 0; i < nglyphs; i++) {
+ if (!glyphs.glyphs[i]) {
+ allExist = false;
+ break;
+ }
+ }
+ return allExist;
+}
+QFontEngine *QFontEngineMulti::engine(int at) const
+{
+ qt_noop();
+ return engines.at(at);
+}
+QImage QFontEngineMulti::alphaMapForGlyph(glyph_t)
+{
+ qt_noop();
+ return QImage();
+}