1 typedef long int ptrdiff_t;
2 typedef long unsigned int size_t;
3 typedef signed char qint8;
4 typedef unsigned char quint8;
6 typedef unsigned short quint16;
8 typedef unsigned int quint32;
9 typedef long long qint64;
10 typedef unsigned long long quint64;
11 typedef qint64 qlonglong;
12 typedef quint64 qulonglong;
13 template <int> class QUintForSize { private: typedef void Type; };
14 template <> class QUintForSize<4> { public: typedef quint32 Type; };
15 template <> class QUintForSize<8> { public: typedef quint64 Type; };
16 template <typename T> class QUintForType : public QUintForSize<sizeof(T)> { };
17 typedef QUintForType<void *>::Type quintptr;
18 template <int> class QIntForSize { private: typedef void Type; };
19 template <> class QIntForSize<4> { public: typedef qint32 Type; };
20 template <> class QIntForSize<8> { public: typedef qint64 Type; };
21 template <typename T> class QIntForType : public QIntForSize<sizeof(T)> { };
22 typedef QIntForType<void *>::Type qptrdiff;
23 typedef unsigned char uchar;
24 typedef unsigned short ushort;
25 typedef unsigned int uint;
26 typedef unsigned long ulong;
27 typedef int QNoImplicitBoolCast;
30 inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
31 inline int qRound(qreal d)
32 { return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); }
33 inline qint64 qRound64(qreal d)
34 { return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); }
36 inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; }
38 inline const T &qMax(const T &a, const T &b) { if (a < b) return b; return a; }
40 inline const T &qBound(const T &min, const T &val, const T &max)
41 { return qMax(min, qMin(max, val)); }
44 class __attribute__((visibility("default"))) QSysInfo {
47 WordSize = (sizeof(void *)<<3)
52 , ByteOrder = LittleEndian
55 __attribute__((visibility("default"))) const char *qVersion();
56 __attribute__((visibility("default"))) bool qSharedBuild();
57 __attribute__((visibility("default"))) void qDebug(const char *, ...)
58 __attribute__ ((format (printf, 1, 2)))
60 __attribute__((visibility("default"))) void qWarning(const char *, ...)
61 __attribute__ ((format (printf, 1, 2)))
64 __attribute__((visibility("default"))) QString qt_error_string(int errorCode = -1);
65 __attribute__((visibility("default"))) void qCritical(const char *, ...)
66 __attribute__ ((format (printf, 1, 2)))
68 __attribute__((visibility("default"))) void qFatal(const char *, ...)
69 __attribute__ ((format (printf, 1, 2)))
71 __attribute__((visibility("default"))) void qErrnoWarning(int code, const char *msg, ...);
72 __attribute__((visibility("default"))) void qErrnoWarning(const char *msg, ...);
75 __attribute__((visibility("default"))) inline QDebug qDebug();
76 __attribute__((visibility("default"))) inline QDebug qWarning();
77 __attribute__((visibility("default"))) inline QDebug qCritical();
78 inline void qt_noop() {}
79 __attribute__((visibility("default"))) void qt_assert(const char *assertion, const char *file, int line);
80 __attribute__((visibility("default"))) void qt_assert_x(const char *where, const char *what, const char *file, int line);
81 __attribute__((visibility("default"))) void qt_check_pointer(const char *, int);
82 enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg = QtCriticalMsg };
83 __attribute__((visibility("default"))) void qt_message_output(QtMsgType, const char *buf);
84 typedef void (*QtMsgHandler)(QtMsgType, const char *);
85 __attribute__((visibility("default"))) QtMsgHandler qInstallMsgHandler(QtMsgHandler);
86 template <typename T> class QBasicAtomicPointer;
91 QBasicAtomicPointer<T> pointer;
95 class QGlobalStaticDeleter
98 QGlobalStatic<T> &globalStatic;
99 QGlobalStaticDeleter(QGlobalStatic<T> &_globalStatic)
100 : globalStatic(_globalStatic)
102 inline ~QGlobalStaticDeleter()
104 delete globalStatic.pointer;
105 globalStatic.pointer = 0;
106 globalStatic.destroyed = true;
113 inline explicit QBool(bool B) : b(B) {}
114 inline operator const void *() const
115 { return b ? static_cast<const void *>(this) : static_cast<const void *>(0); }
117 inline bool operator==(QBool b1, bool b2) { return !b1 == !b2; }
118 inline bool operator==(bool b1, QBool b2) { return !b1 == !b2; }
119 inline bool operator==(QBool b1, QBool b2) { return !b1 == !b2; }
120 inline bool operator!=(QBool b1, bool b2) { return !b1 != !b2; }
121 inline bool operator!=(bool b1, QBool b2) { return !b1 != !b2; }
122 inline bool operator!=(QBool b1, QBool b2) { return !b1 != !b2; }
123 static inline bool qFuzzyCompare(double p1, double p2)
125 return (qAbs(p1 - p2) <= 0.000000000001 * qMin(qAbs(p1), qAbs(p2)));
127 static inline bool qFuzzyCompare(float p1, float p2)
129 return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2)));
131 static inline bool qIsNull(double d)
139 return val.u == quint64(0);
141 static inline bool qIsNull(float f)
151 template <typename T> inline bool qIsDetached(T &) { return true; }
152 template <typename T>
160 isLarge = (sizeof(T)>sizeof(void*)),
164 template <typename T>
178 Q_PRIMITIVE_TYPE = 0x1,
180 Q_MOVABLE_TYPE = 0x2,
183 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"; } };
184 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"; } };
185 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"; } };
186 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"; } };
187 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"; } };
188 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"; } };
189 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"; } };
190 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"; } };
191 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"; } };
192 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"; } };
193 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"; } };
194 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"; } };
195 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"; } };
196 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"; } };
197 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"; } };
198 __attribute__((visibility("default"))) void *qMalloc(size_t size);
199 __attribute__((visibility("default"))) void qFree(void *ptr);
200 __attribute__((visibility("default"))) void *qRealloc(void *ptr, size_t size);
201 __attribute__((visibility("default"))) void *qMemCopy(void *dest, const void *src, size_t n);
202 __attribute__((visibility("default"))) void *qMemSet(void *dest, int c, size_t n);
203 class __attribute__((visibility("default"))) QFlag
208 inline operator int() const { return i; }
210 inline QFlag::QFlag(int ai) : i(ai) {}
211 class __attribute__((visibility("default"))) QIncompatibleFlag
215 inline explicit QIncompatibleFlag(int i);
216 inline operator int() const { return i; }
218 inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {}
219 template<typename Enum>
225 typedef Enum enum_type;
226 inline QFlags(const QFlags &f) : i(f.i) {}
227 inline QFlags(Enum f) : i(f) {}
228 inline QFlags(Zero = 0) : i(0) {}
229 inline QFlags(QFlag f) : i(f) {}
230 inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; }
231 inline QFlags &operator&=(int mask) { i &= mask; return *this; }
232 inline QFlags &operator&=(uint mask) { i &= mask; return *this; }
233 inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; }
234 inline QFlags &operator|=(Enum f) { i |= f; return *this; }
235 inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; }
236 inline QFlags &operator^=(Enum f) { i ^= f; return *this; }
237 inline operator int() const { return i; }
238 inline QFlags operator|(QFlags f) const { QFlags g; g.i = i | f.i; return g; }
239 inline QFlags operator|(Enum f) const { QFlags g; g.i = i | f; return g; }
240 inline QFlags operator^(QFlags f) const { QFlags g; g.i = i ^ f.i; return g; }
241 inline QFlags operator^(Enum f) const { QFlags g; g.i = i ^ f; return g; }
242 inline QFlags operator&(int mask) const { QFlags g; g.i = i & mask; return g; }
243 inline QFlags operator&(uint mask) const { QFlags g; g.i = i & mask; return g; }
244 inline QFlags operator&(Enum f) const { QFlags g; g.i = i & f; return g; }
245 inline QFlags operator~() const { QFlags g; g.i = ~i; return g; }
246 inline bool operator!() const { return !i; }
247 inline bool testFlag(Enum f) const { return (i & f) == f; }
249 template <typename T>
250 class QForeachContainer {
252 inline QForeachContainer(const T& t) : c(t), brk(0), i(c.begin()), e(c.end()) { }
255 typename T::const_iterator i, e;
258 __attribute__((visibility("default"))) QByteArray qgetenv(const char *varName);
259 __attribute__((visibility("default"))) bool qputenv(const char *varName, const QByteArray& value);
260 inline int qIntCast(double f) { return int(f); }
261 inline int qIntCast(float f) { return int(f); }
262 __attribute__((visibility("default"))) void qsrand(uint seed);
263 __attribute__((visibility("default"))) int qrand();
264 enum QtValidLicenseForCoreModule { LicensedCore = true };
265 enum QtValidLicenseForGuiModule { LicensedGui = true };
266 enum QtValidLicenseForNetworkModule { LicensedNetwork = true };
267 enum QtValidLicenseForOpenGLModule { LicensedOpenGL = true };
268 enum QtValidLicenseForSqlModule { LicensedSql = true };
269 enum QtValidLicenseForXmlModule { LicensedXml = true };
270 enum QtValidLicenseForXmlPatternsModule { LicensedXmlPatterns = true };
271 enum QtValidLicenseForHelpModule { LicensedHelp = true };
272 enum QtValidLicenseForScriptModule { LicensedScript = true };
273 enum QtValidLicenseForScriptToolsModule { LicensedScriptTools = true };
274 enum QtValidLicenseForQt3SupportLightModule { LicensedQt3SupportLight = true };
275 enum QtValidLicenseForQt3SupportModule { LicensedQt3Support = true };
276 enum QtValidLicenseForSvgModule { LicensedSvg = true };
277 enum QtValidLicenseForTestModule { LicensedTest = true };
278 enum QtValidLicenseForDBusModule { LicensedDBus = true };
279 typedef QtValidLicenseForCoreModule QtCoreModule;
280 namespace QAlgorithmsPrivate {
281 template <typename RandomAccessIterator, typename T, typename LessThan>
282 void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan);
283 template <typename RandomAccessIterator, typename T>
284 inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy);
285 template <typename RandomAccessIterator, typename T, typename LessThan>
286 void qStableSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan);
287 template <typename RandomAccessIterator, typename T>
288 inline void qStableSortHelper(RandomAccessIterator, RandomAccessIterator, const T &);
289 template <typename RandomAccessIterator, typename T, typename LessThan>
290 RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan);
291 template <typename RandomAccessIterator, typename T, typename LessThan>
292 RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan);
293 template <typename RandomAccessIterator, typename T, typename LessThan>
294 RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan);
296 template <typename InputIterator, typename OutputIterator>
297 inline OutputIterator qCopy(InputIterator begin, InputIterator end, OutputIterator dest)
303 template <typename BiIterator1, typename BiIterator2>
304 inline BiIterator2 qCopyBackward(BiIterator1 begin, BiIterator1 end, BiIterator2 dest)
310 template <typename InputIterator1, typename InputIterator2>
311 inline bool qEqual(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2)
313 for (; first1 != last1; ++first1, ++first2)
314 if (!(*first1 == *first2))
318 template <typename ForwardIterator, typename T>
319 inline void qFill(ForwardIterator first, ForwardIterator last, const T &val)
321 for (; first != last; ++first)
324 template <typename Container, typename T>
325 inline void qFill(Container &container, const T &val)
327 qFill(container.begin(), container.end(), val);
329 template <typename InputIterator, typename T>
330 inline InputIterator qFind(InputIterator first, InputIterator last, const T &val)
332 while (first != last && !(*first == val))
336 template <typename Container, typename T>
337 inline typename Container::const_iterator qFind(const Container &container, const T &val)
339 return qFind(container.constBegin(), container.constEnd(), val);
341 template <typename InputIterator, typename T, typename Size>
342 inline void qCount(InputIterator first, InputIterator last, const T &value, Size &n)
344 for (; first != last; ++first)
348 template <typename Container, typename T, typename Size>
349 inline void qCount(const Container &container, const T &value, Size &n)
351 qCount(container.constBegin(), container.constEnd(), value, n);
353 template <typename T>
354 inline void qSwap(T &value1, T &value2)
360 template <typename T>
364 inline bool operator()(const T &t1, const T &t2) const
369 template <typename T>
373 inline bool operator()(const T &t1, const T &t2) const
378 template <typename RandomAccessIterator>
379 inline void qSort(RandomAccessIterator start, RandomAccessIterator end)
382 QAlgorithmsPrivate::qSortHelper(start, end, *start);
384 template <typename RandomAccessIterator, typename LessThan>
385 inline void qSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan)
388 QAlgorithmsPrivate::qSortHelper(start, end, *start, lessThan);
390 template<typename Container>
391 inline void qSort(Container &c)
394 QAlgorithmsPrivate::qSortHelper(c.begin(), c.end(), *c.begin());
396 template <typename RandomAccessIterator>
397 inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end)
400 QAlgorithmsPrivate::qStableSortHelper(start, end, *start);
402 template <typename RandomAccessIterator, typename LessThan>
403 inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan)
406 QAlgorithmsPrivate::qStableSortHelper(start, end, *start, lessThan);
408 template<typename Container>
409 inline void qStableSort(Container &c)
412 QAlgorithmsPrivate::qStableSortHelper(c.begin(), c.end(), *c.begin());
414 template <typename RandomAccessIterator, typename T>
415 RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
417 RandomAccessIterator middle;
422 middle = begin + half;
423 if (*middle < value) {
432 template <typename RandomAccessIterator, typename T, typename LessThan>
433 RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
435 return QAlgorithmsPrivate::qLowerBoundHelper(begin, end, value, lessThan);
437 template <typename Container, typename T>
438 typename Container::const_iterator qLowerBound(const Container &container, const T &value)
440 return QAlgorithmsPrivate::qLowerBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
442 template <typename RandomAccessIterator, typename T>
443 RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
445 RandomAccessIterator middle;
450 middle = begin + half;
451 if (value < *middle) {
460 template <typename RandomAccessIterator, typename T, typename LessThan>
461 RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
463 return QAlgorithmsPrivate::qUpperBoundHelper(begin, end, value, lessThan);
465 template <typename Container, typename T>
466 typename Container::const_iterator qUpperBound(const Container &container, const T &value)
468 return QAlgorithmsPrivate::qUpperBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
470 template <typename RandomAccessIterator, typename T>
471 RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
474 qint64 r = end - begin - 1;
477 qint64 i = (l + r + 1) / 2;
479 if (value < begin[i])
485 if (begin[i] < value || value < begin[i])
490 template <typename RandomAccessIterator, typename T, typename LessThan>
491 RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
493 return QAlgorithmsPrivate::qBinaryFindHelper(begin, end, value, lessThan);
495 template <typename Container, typename T>
496 typename Container::const_iterator qBinaryFind(const Container &container, const T &value)
498 return QAlgorithmsPrivate::qBinaryFindHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
500 template <typename ForwardIterator>
501 void qDeleteAll(ForwardIterator begin, ForwardIterator end)
503 while (begin != end) {
508 template <typename Container>
509 inline void qDeleteAll(const Container &c)
511 qDeleteAll(c.begin(), c.end());
513 namespace QAlgorithmsPrivate {
514 template <typename RandomAccessIterator, typename T, typename LessThan>
515 void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan)
518 int span = end - start;
522 RandomAccessIterator low = start, high = end - 1;
523 RandomAccessIterator pivot = start + span / 2;
524 if (lessThan(*end, *start))
528 if (lessThan(*pivot, *start))
529 qSwap(*pivot, *start);
530 if (lessThan(*end, *pivot))
536 while (low < high && lessThan(*low, *end))
538 while (high > low && lessThan(*end, *high))
548 if (lessThan(*low, *end))
551 qSortHelper(start, low, t, lessThan);
556 template <typename RandomAccessIterator, typename T>
557 inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy)
559 qSortHelper(begin, end, dummy, qLess<T>());
561 template <typename RandomAccessIterator>
562 void qReverse(RandomAccessIterator begin, RandomAccessIterator end)
566 qSwap(*begin++, *end--);
568 template <typename RandomAccessIterator>
569 void qRotate(RandomAccessIterator begin, RandomAccessIterator middle, RandomAccessIterator end)
571 qReverse(begin, middle);
572 qReverse(middle, end);
573 qReverse(begin, end);
575 template <typename RandomAccessIterator, typename T, typename LessThan>
576 void qMerge(RandomAccessIterator begin, RandomAccessIterator pivot, RandomAccessIterator end, T &t, LessThan lessThan)
578 const int len1 = pivot - begin;
579 const int len2 = end - pivot;
580 if (len1 == 0 || len2 == 0)
582 if (len1 + len2 == 2) {
583 if (lessThan(*(begin + 1), *(begin)))
584 qSwap(*begin, *(begin + 1));
587 RandomAccessIterator firstCut;
588 RandomAccessIterator secondCut;
591 const int len1Half = len1 / 2;
592 firstCut = begin + len1Half;
593 secondCut = qLowerBound(pivot, end, *firstCut, lessThan);
594 len2Half = secondCut - pivot;
597 secondCut = pivot + len2Half;
598 firstCut = qUpperBound(begin, pivot, *secondCut, lessThan);
600 qRotate(firstCut, pivot, secondCut);
601 const RandomAccessIterator newPivot = firstCut + len2Half;
602 qMerge(begin, firstCut, newPivot, t, lessThan);
603 qMerge(newPivot, secondCut, end, t, lessThan);
605 template <typename RandomAccessIterator, typename T, typename LessThan>
606 void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &t, LessThan lessThan)
608 const int span = end - begin;
611 const RandomAccessIterator middle = begin + span / 2;
612 qStableSortHelper(begin, middle, t, lessThan);
613 qStableSortHelper(middle, end, t, lessThan);
614 qMerge(begin, middle, end, t, lessThan);
616 template <typename RandomAccessIterator, typename T>
617 inline void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy)
619 qStableSortHelper(begin, end, dummy, qLess<T>());
621 template <typename RandomAccessIterator, typename T, typename LessThan>
622 RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
624 RandomAccessIterator middle;
629 middle = begin + half;
630 if (lessThan(*middle, value)) {
639 template <typename RandomAccessIterator, typename T, typename LessThan>
640 RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
642 RandomAccessIterator middle;
647 middle = begin + half;
648 if (lessThan(value, *middle)) {
657 template <typename RandomAccessIterator, typename T, typename LessThan>
658 RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
661 qint64 r = end - begin - 1;
664 qint64 i = (l + r + 1) / 2;
666 if (lessThan(value, begin[i]))
672 if (lessThan(begin[i], value) || lessThan(value, begin[i]))
678 typedef QtValidLicenseForCoreModule QtCoreModule;
679 class __attribute__((visibility("default"))) QBasicAtomicInt
682 volatile int _q_value;
683 inline bool operator==(int value) const
685 return _q_value == value;
687 inline bool operator!=(int value) const
689 return _q_value != value;
691 inline bool operator!() const
693 return _q_value == 0;
695 inline operator int() const
699 inline QBasicAtomicInt &operator=(int value)
704 static bool isReferenceCountingNative();
705 static bool isReferenceCountingWaitFree();
708 static bool isTestAndSetNative();
709 static bool isTestAndSetWaitFree();
710 bool testAndSetRelaxed(int expectedValue, int newValue);
711 bool testAndSetAcquire(int expectedValue, int newValue);
712 bool testAndSetRelease(int expectedValue, int newValue);
713 bool testAndSetOrdered(int expectedValue, int newValue);
714 static bool isFetchAndStoreNative();
715 static bool isFetchAndStoreWaitFree();
716 int fetchAndStoreRelaxed(int newValue);
717 int fetchAndStoreAcquire(int newValue);
718 int fetchAndStoreRelease(int newValue);
719 int fetchAndStoreOrdered(int newValue);
720 static bool isFetchAndAddNative();
721 static bool isFetchAndAddWaitFree();
722 int fetchAndAddRelaxed(int valueToAdd);
723 int fetchAndAddAcquire(int valueToAdd);
724 int fetchAndAddRelease(int valueToAdd);
725 int fetchAndAddOrdered(int valueToAdd);
727 template <typename T>
728 class QBasicAtomicPointer
731 T * volatile _q_value;
732 inline bool operator==(T *value) const
734 return _q_value == value;
736 inline bool operator!=(T *value) const
738 return !operator==(value);
740 inline bool operator!() const
742 return operator==(0);
744 inline operator T *() const
748 inline T *operator->() const
752 inline QBasicAtomicPointer<T> &operator=(T *value)
757 static bool isTestAndSetNative();
758 static bool isTestAndSetWaitFree();
759 bool testAndSetRelaxed(T *expectedValue, T *newValue);
760 bool testAndSetAcquire(T *expectedValue, T *newValue);
761 bool testAndSetRelease(T *expectedValue, T *newValue);
762 bool testAndSetOrdered(T *expectedValue, T *newValue);
763 static bool isFetchAndStoreNative();
764 static bool isFetchAndStoreWaitFree();
765 T *fetchAndStoreRelaxed(T *newValue);
766 T *fetchAndStoreAcquire(T *newValue);
767 T *fetchAndStoreRelease(T *newValue);
768 T *fetchAndStoreOrdered(T *newValue);
769 static bool isFetchAndAddNative();
770 static bool isFetchAndAddWaitFree();
771 T *fetchAndAddRelaxed(qptrdiff valueToAdd);
772 T *fetchAndAddAcquire(qptrdiff valueToAdd);
773 T *fetchAndAddRelease(qptrdiff valueToAdd);
774 T *fetchAndAddOrdered(qptrdiff valueToAdd);
776 inline bool QBasicAtomicInt::isReferenceCountingNative()
778 inline bool QBasicAtomicInt::isReferenceCountingWaitFree()
780 inline bool QBasicAtomicInt::isTestAndSetNative()
782 inline bool QBasicAtomicInt::isTestAndSetWaitFree()
784 inline bool QBasicAtomicInt::isFetchAndStoreNative()
786 inline bool QBasicAtomicInt::isFetchAndStoreWaitFree()
788 inline bool QBasicAtomicInt::isFetchAndAddNative()
790 inline bool QBasicAtomicInt::isFetchAndAddWaitFree()
792 template <typename T>
793 inline bool QBasicAtomicPointer<T>::isTestAndSetNative()
795 template <typename T>
796 inline bool QBasicAtomicPointer<T>::isTestAndSetWaitFree()
798 template <typename T>
799 inline bool QBasicAtomicPointer<T>::isFetchAndStoreNative()
801 template <typename T>
802 inline bool QBasicAtomicPointer<T>::isFetchAndStoreWaitFree()
804 template <typename T>
805 inline bool QBasicAtomicPointer<T>::isFetchAndAddNative()
807 template <typename T>
808 inline bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
810 __attribute__((visibility("default"))) bool QBasicAtomicInt_testAndSetOrdered(volatile int *, int, int);
811 __attribute__((visibility("default"))) int QBasicAtomicInt_fetchAndStoreOrdered(volatile int *, int);
812 __attribute__((visibility("default"))) int QBasicAtomicInt_fetchAndAddOrdered(volatile int *, int);
813 __attribute__((visibility("default"))) bool QBasicAtomicPointer_testAndSetOrdered(void * volatile *, void *, void *);
814 __attribute__((visibility("default"))) void *QBasicAtomicPointer_fetchAndStoreOrdered(void * volatile *, void *);
815 __attribute__((visibility("default"))) void *QBasicAtomicPointer_fetchAndAddOrdered(void * volatile *, qptrdiff);
816 inline bool QBasicAtomicInt::ref()
818 return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, 1) != -1;
820 inline bool QBasicAtomicInt::deref()
822 return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, -1) != 1;
824 inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue)
826 return QBasicAtomicInt_testAndSetOrdered(&_q_value, expectedValue, newValue);
828 inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue)
830 return testAndSetOrdered(expectedValue, newValue);
832 inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue)
834 return testAndSetOrdered(expectedValue, newValue);
836 inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
838 return testAndSetOrdered(expectedValue, newValue);
840 inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
842 return QBasicAtomicInt_fetchAndStoreOrdered(&_q_value, newValue);
844 inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
846 return fetchAndStoreOrdered(newValue);
848 inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue)
850 return fetchAndStoreOrdered(newValue);
852 inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue)
854 return fetchAndStoreOrdered(newValue);
856 inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd)
858 return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, valueToAdd);
860 inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd)
862 return fetchAndAddOrdered(valueToAdd);
864 inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd)
866 return fetchAndAddOrdered(valueToAdd);
868 inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd)
870 return fetchAndAddOrdered(valueToAdd);
872 template <typename T>
873 inline bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValue, T *newValue)
875 union { T * volatile * typed; void * volatile * voidp; } pointer;
876 pointer.typed = &_q_value;
877 return QBasicAtomicPointer_testAndSetOrdered(pointer.voidp, expectedValue, newValue);
879 template <typename T>
880 inline bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
882 return testAndSetOrdered(expectedValue, newValue);
884 template <typename T>
885 inline bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
887 return testAndSetOrdered(expectedValue, newValue);
889 template <typename T>
890 inline bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
892 return testAndSetOrdered(expectedValue, newValue);
894 template <typename T>
895 inline T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
897 union { T * volatile * typed; void * volatile * voidp; } pointer;
898 union { T *typed; void *voidp; } returnValue;
899 pointer.typed = &_q_value;
900 returnValue.voidp = QBasicAtomicPointer_fetchAndStoreOrdered(pointer.voidp, newValue);
901 return returnValue.typed;
903 template <typename T>
904 inline T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
906 return fetchAndStoreOrdered(newValue);
908 template <typename T>
909 inline T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
911 return fetchAndStoreOrdered(newValue);
913 template <typename T>
914 inline T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
916 return fetchAndStoreOrdered(newValue);
918 template <typename T>
919 inline T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
921 union { T * volatile *typed; void * volatile *voidp; } pointer;
922 union { T *typed; void *voidp; } returnValue;
923 pointer.typed = &_q_value;
924 returnValue.voidp = QBasicAtomicPointer_fetchAndAddOrdered(pointer.voidp, valueToAdd * sizeof(T));
925 return returnValue.typed;
927 template <typename T>
928 inline T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
930 return fetchAndAddOrdered(valueToAdd);
932 template <typename T>
933 inline T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
935 return fetchAndAddOrdered(valueToAdd);
937 template <typename T>
938 inline T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
940 return fetchAndAddOrdered(valueToAdd);
942 typedef QtValidLicenseForCoreModule QtCoreModule;
943 class __attribute__((visibility("default"))) QAtomicInt : public QBasicAtomicInt
946 inline QAtomicInt(int value = 0)
950 inline QAtomicInt(const QAtomicInt &other)
952 _q_value = other._q_value;
954 inline QAtomicInt &operator=(int value)
956 (void) QBasicAtomicInt::operator=(value);
959 inline QAtomicInt &operator=(const QAtomicInt &other)
961 (void) QBasicAtomicInt::operator=(other);
965 template <typename T>
966 class QAtomicPointer : public QBasicAtomicPointer<T>
969 inline QAtomicPointer(T *value = 0)
971 QBasicAtomicPointer<T>::_q_value = value;
973 inline QAtomicPointer(const QAtomicPointer<T> &other)
975 QBasicAtomicPointer<T>::_q_value = other._q_value;
977 inline QAtomicPointer<T> &operator=(T *value)
979 (void) QBasicAtomicPointer<T>::operator=(value);
982 inline QAtomicPointer<T> &operator=(const QAtomicPointer<T> &other)
984 (void) QBasicAtomicPointer<T>::operator=(other);
988 template <typename T>
989 inline void qAtomicAssign(T *&d, T *x)
998 template <typename T>
999 inline void qAtomicDetach(T *&d)
1005 if (!x->ref.deref())
1008 typedef QtValidLicenseForCoreModule QtCoreModule;
1013 inline explicit QLatin1Char(char c) : ch(c) {}
1014 inline char toLatin1() const { return ch; }
1015 inline ushort unicode() const { return ushort(uchar(ch)); }
1019 class __attribute__((visibility("default"))) QChar {
1022 __attribute__ ((__deprecated__)) QChar(char c);
1023 __attribute__ ((__deprecated__)) QChar(uchar c);
1024 QChar(QLatin1Char ch);
1025 QChar(uchar c, uchar r);
1026 inline QChar(ushort rc) : ucs(rc){}
1030 enum SpecialCharacter {
1033 ReplacementCharacter = 0xfffd,
1034 ObjectReplacementCharacter = 0xfffc,
1035 ByteOrderMark = 0xfeff,
1036 ByteOrderSwapped = 0xfffe,
1037 ParagraphSeparator = 0x2029,
1038 LineSeparator = 0x2028
1040 QChar(SpecialCharacter sc);
1045 Mark_SpacingCombining,
1047 Number_DecimalDigit,
1052 Separator_Paragraph,
1063 Punctuation_Connector,
1067 Punctuation_InitialQuote,
1068 Punctuation_FinalQuote,
1074 Punctuation_Dask = Punctuation_Dash
1078 DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON,
1079 DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN
1104 OtherJoining, Dual, Right, Center
1108 Combining_BelowLeftAttached = 200,
1109 Combining_BelowAttached = 202,
1110 Combining_BelowRightAttached = 204,
1111 Combining_LeftAttached = 208,
1112 Combining_RightAttached = 210,
1113 Combining_AboveLeftAttached = 212,
1114 Combining_AboveAttached = 214,
1115 Combining_AboveRightAttached = 216,
1116 Combining_BelowLeft = 218,
1117 Combining_Below = 220,
1118 Combining_BelowRight = 222,
1119 Combining_Left = 224,
1120 Combining_Right = 226,
1121 Combining_AboveLeft = 228,
1122 Combining_Above = 230,
1123 Combining_AboveRight = 232,
1124 Combining_DoubleBelow = 233,
1125 Combining_DoubleAbove = 234,
1126 Combining_IotaSubscript = 240
1128 enum UnicodeVersion {
1140 Category category() const;
1141 Direction direction() const;
1142 Joining joining() const;
1143 bool hasMirrored() const;
1144 unsigned char combiningClass() const;
1145 QChar mirroredChar() const;
1146 QString decomposition() const;
1147 Decomposition decompositionTag() const;
1148 int digitValue() const;
1149 QChar toLower() const;
1150 QChar toUpper() const;
1151 QChar toTitleCase() const;
1152 QChar toCaseFolded() const;
1153 UnicodeVersion unicodeVersion() const;
1154 char toAscii() const;
1155 inline char toLatin1() const;
1156 inline ushort unicode() const { return ucs; }
1157 inline ushort &unicode() { return const_cast<ushort&>(ucs); }
1158 static QChar fromAscii(char c);
1159 static QChar fromLatin1(char c);
1160 inline bool isNull() const { return ucs == 0; }
1161 bool isPrint() const;
1162 bool isPunct() const;
1163 bool isSpace() const;
1164 bool isMark() const;
1165 bool isLetter() const;
1166 bool isNumber() const;
1167 bool isLetterOrNumber() const;
1168 bool isDigit() const;
1169 bool isSymbol() const;
1170 inline bool isLower() const { return category() == Letter_Lowercase; }
1171 inline bool isUpper() const { return category() == Letter_Uppercase; }
1172 inline bool isTitleCase() const { return category() == Letter_Titlecase; }
1173 inline bool isHighSurrogate() const {
1174 return ((ucs & 0xfc00) == 0xd800);
1176 inline bool isLowSurrogate() const {
1177 return ((ucs & 0xfc00) == 0xdc00);
1179 inline uchar cell() const { return uchar(ucs & 0xff); }
1180 inline uchar row() const { return uchar((ucs>>8)&0xff); }
1181 inline void setCell(uchar cell);
1182 inline void setRow(uchar row);
1183 static inline uint surrogateToUcs4(ushort high, ushort low) {
1184 return (uint(high)<<10) + low - 0x35fdc00;
1186 static inline uint surrogateToUcs4(QChar high, QChar low) {
1187 return (uint(high.ucs)<<10) + low.ucs - 0x35fdc00;
1189 static inline ushort highSurrogate(uint ucs4) {
1190 return (ucs4>>10) + 0xd7c0;
1192 static inline ushort lowSurrogate(uint ucs4) {
1193 return ucs4%0x400 + 0xdc00;
1195 static Category category(uint ucs4);
1196 static Category category(ushort ucs2);
1197 static Direction direction(uint ucs4);
1198 static Direction direction(ushort ucs2);
1199 static Joining joining(uint ucs4);
1200 static Joining joining(ushort ucs2);
1201 static unsigned char combiningClass(uint ucs4);
1202 static unsigned char combiningClass(ushort ucs2);
1203 static uint mirroredChar(uint ucs4);
1204 static ushort mirroredChar(ushort ucs2);
1205 static Decomposition decompositionTag(uint ucs4);
1206 static int digitValue(uint ucs4);
1207 static int digitValue(ushort ucs2);
1208 static uint toLower(uint ucs4);
1209 static ushort toLower(ushort ucs2);
1210 static uint toUpper(uint ucs4);
1211 static ushort toUpper(ushort ucs2);
1212 static uint toTitleCase(uint ucs4);
1213 static ushort toTitleCase(ushort ucs2);
1214 static uint toCaseFolded(uint ucs4);
1215 static ushort toCaseFolded(ushort ucs2);
1216 static UnicodeVersion unicodeVersion(uint ucs4);
1217 static UnicodeVersion unicodeVersion(ushort ucs2);
1218 static QString decomposition(uint ucs4);
1223 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"; } };
1224 inline QChar::QChar() : ucs(0) {}
1225 inline char QChar::toLatin1() const { return ucs > 0xff ? '\0' : char(ucs); }
1226 inline QChar QChar::fromLatin1(char c) { return QChar(ushort(uchar(c))); }
1227 inline QChar::QChar(uchar c, uchar r) : ucs((r << 8) | c){}
1228 inline QChar::QChar(short rc) : ucs(ushort(rc)){}
1229 inline QChar::QChar(uint rc) : ucs(ushort(rc & 0xffff)){}
1230 inline QChar::QChar(int rc) : ucs(ushort(rc & 0xffff)){}
1231 inline QChar::QChar(SpecialCharacter s) : ucs(ushort(s)) {}
1232 inline QChar::QChar(QLatin1Char ch) : ucs(ch.unicode()) {}
1233 inline void QChar::setCell(uchar acell)
1234 { ucs = (ucs & 0xff00) + acell; }
1235 inline void QChar::setRow(uchar arow)
1236 { ucs = (ushort(arow)<<8) + (ucs&0xff); }
1237 inline bool operator==(QChar c1, QChar c2) { return c1.unicode() == c2.unicode(); }
1238 inline bool operator!=(QChar c1, QChar c2) { return c1.unicode() != c2.unicode(); }
1239 inline bool operator<=(QChar c1, QChar c2) { return c1.unicode() <= c2.unicode(); }
1240 inline bool operator>=(QChar c1, QChar c2) { return c1.unicode() >= c2.unicode(); }
1241 inline bool operator<(QChar c1, QChar c2) { return c1.unicode() < c2.unicode(); }
1242 inline bool operator>(QChar c1, QChar c2) { return c1.unicode() > c2.unicode(); }
1243 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QChar &);
1244 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QChar &);
1246 struct bidirectional_iterator_tag;
1247 struct random_access_iterator_tag;
1249 typedef QtValidLicenseForCoreModule QtCoreModule;
1250 namespace std __attribute__ ((__visibility__ ("default"))) {
1252 namespace std __attribute__ ((__visibility__ ("default"))) {
1256 namespace std __attribute__ ((__visibility__ ("default"))) {
1257 struct input_iterator_tag {};
1258 struct output_iterator_tag {};
1259 struct forward_iterator_tag : public input_iterator_tag {};
1260 struct bidirectional_iterator_tag : public forward_iterator_tag {};
1261 struct random_access_iterator_tag : public bidirectional_iterator_tag {};
1262 template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
1263 typename _Pointer = _Tp*, typename _Reference = _Tp&>
1266 typedef _Category iterator_category;
1267 typedef _Tp value_type;
1268 typedef _Distance difference_type;
1269 typedef _Pointer pointer;
1270 typedef _Reference reference;
1272 template<typename _Iterator>
1273 struct iterator_traits
1275 typedef typename _Iterator::iterator_category iterator_category;
1276 typedef typename _Iterator::value_type value_type;
1277 typedef typename _Iterator::difference_type difference_type;
1278 typedef typename _Iterator::pointer pointer;
1279 typedef typename _Iterator::reference reference;
1281 template<typename _Tp>
1282 struct iterator_traits<_Tp*>
1284 typedef random_access_iterator_tag iterator_category;
1285 typedef _Tp value_type;
1286 typedef ptrdiff_t difference_type;
1287 typedef _Tp* pointer;
1288 typedef _Tp& reference;
1290 template<typename _Tp>
1291 struct iterator_traits<const _Tp*>
1293 typedef random_access_iterator_tag iterator_category;
1294 typedef _Tp value_type;
1295 typedef ptrdiff_t difference_type;
1296 typedef const _Tp* pointer;
1297 typedef const _Tp& reference;
1299 template<typename _Iter>
1300 inline typename iterator_traits<_Iter>::iterator_category
1301 __iterator_category(const _Iter&)
1302 { return typename iterator_traits<_Iter>::iterator_category(); }
1304 namespace std __attribute__ ((__visibility__ ("default"))) {
1305 template<typename _InputIterator>
1306 inline typename iterator_traits<_InputIterator>::difference_type
1307 __distance(_InputIterator __first, _InputIterator __last,
1310 typename iterator_traits<_InputIterator>::difference_type __n = 0;
1311 while (__first != __last)
1318 template<typename _RandomAccessIterator>
1319 inline typename iterator_traits<_RandomAccessIterator>::difference_type
1320 __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
1321 random_access_iterator_tag)
1323 return __last - __first;
1325 template<typename _InputIterator>
1326 inline typename iterator_traits<_InputIterator>::difference_type
1327 distance(_InputIterator __first, _InputIterator __last)
1329 return std::__distance(__first, __last,
1330 std::__iterator_category(__first));
1332 template<typename _InputIterator, typename _Distance>
1334 __advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
1339 template<typename _BidirectionalIterator, typename _Distance>
1341 __advance(_BidirectionalIterator& __i, _Distance __n,
1342 bidirectional_iterator_tag)
1351 template<typename _RandomAccessIterator, typename _Distance>
1353 __advance(_RandomAccessIterator& __i, _Distance __n,
1354 random_access_iterator_tag)
1358 template<typename _InputIterator, typename _Distance>
1360 advance(_InputIterator& __i, _Distance __n)
1362 typename iterator_traits<_InputIterator>::difference_type __d = __n;
1363 std::__advance(__i, __d, std::__iterator_category(__i));
1366 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
1367 template<typename _Iterator, typename _Container>
1368 class __normal_iterator;
1370 namespace std __attribute__ ((__visibility__ ("default"))) {
1371 struct __true_type { };
1372 struct __false_type { };
1375 { typedef __false_type __type; };
1377 struct __truth_type<true>
1378 { typedef __true_type __type; };
1379 template<class _Sp, class _Tp>
1382 enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
1383 typedef typename __truth_type<__value>::__type __type;
1385 template<class _Sp, class _Tp>
1388 enum { __value = bool(_Sp::__value) && bool(_Tp::__value) };
1389 typedef typename __truth_type<__value>::__type __type;
1391 template<typename, typename>
1394 enum { __value = 0 };
1395 typedef __false_type __type;
1397 template<typename _Tp>
1398 struct __are_same<_Tp, _Tp>
1400 enum { __value = 1 };
1401 typedef __true_type __type;
1403 template<typename _Tp>
1406 enum { __value = 0 };
1407 typedef __false_type __type;
1410 struct __is_void<void>
1412 enum { __value = 1 };
1413 typedef __true_type __type;
1415 template<typename _Tp>
1418 enum { __value = 0 };
1419 typedef __false_type __type;
1422 struct __is_integer<bool>
1424 enum { __value = 1 };
1425 typedef __true_type __type;
1428 struct __is_integer<char>
1430 enum { __value = 1 };
1431 typedef __true_type __type;
1434 struct __is_integer<signed char>
1436 enum { __value = 1 };
1437 typedef __true_type __type;
1440 struct __is_integer<unsigned char>
1442 enum { __value = 1 };
1443 typedef __true_type __type;
1446 struct __is_integer<short>
1448 enum { __value = 1 };
1449 typedef __true_type __type;
1452 struct __is_integer<unsigned short>
1454 enum { __value = 1 };
1455 typedef __true_type __type;
1458 struct __is_integer<int>
1460 enum { __value = 1 };
1461 typedef __true_type __type;
1464 struct __is_integer<unsigned int>
1466 enum { __value = 1 };
1467 typedef __true_type __type;
1470 struct __is_integer<long>
1472 enum { __value = 1 };
1473 typedef __true_type __type;
1476 struct __is_integer<unsigned long>
1478 enum { __value = 1 };
1479 typedef __true_type __type;
1482 struct __is_integer<long long>
1484 enum { __value = 1 };
1485 typedef __true_type __type;
1488 struct __is_integer<unsigned long long>
1490 enum { __value = 1 };
1491 typedef __true_type __type;
1493 template<typename _Tp>
1494 struct __is_floating
1496 enum { __value = 0 };
1497 typedef __false_type __type;
1500 struct __is_floating<float>
1502 enum { __value = 1 };
1503 typedef __true_type __type;
1506 struct __is_floating<double>
1508 enum { __value = 1 };
1509 typedef __true_type __type;
1512 struct __is_floating<long double>
1514 enum { __value = 1 };
1515 typedef __true_type __type;
1517 template<typename _Tp>
1520 enum { __value = 0 };
1521 typedef __false_type __type;
1523 template<typename _Tp>
1524 struct __is_pointer<_Tp*>
1526 enum { __value = 1 };
1527 typedef __true_type __type;
1529 template<typename _Tp>
1530 struct __is_normal_iterator
1532 enum { __value = 0 };
1533 typedef __false_type __type;
1535 template<typename _Iterator, typename _Container>
1536 struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
1539 enum { __value = 1 };
1540 typedef __true_type __type;
1542 template<typename _Tp>
1543 struct __is_arithmetic
1544 : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
1546 template<typename _Tp>
1547 struct __is_fundamental
1548 : public __traitor<__is_void<_Tp>, __is_arithmetic<_Tp> >
1550 template<typename _Tp>
1552 : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
1554 template<typename _Tp>
1557 enum { __value = 0 };
1558 typedef __false_type __type;
1561 struct __is_char<char>
1563 enum { __value = 1 };
1564 typedef __true_type __type;
1566 template<typename _Tp>
1569 enum { __value = 0 };
1570 typedef __false_type __type;
1573 struct __is_byte<char>
1575 enum { __value = 1 };
1576 typedef __true_type __type;
1579 struct __is_byte<signed char>
1581 enum { __value = 1 };
1582 typedef __true_type __type;
1585 struct __is_byte<unsigned char>
1587 enum { __value = 1 };
1588 typedef __true_type __type;
1590 template<typename _Tp>
1591 struct __is_move_iterator
1593 enum { __value = 0 };
1594 typedef __false_type __type;
1597 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
1598 template<bool, typename>
1601 template<typename _Tp>
1602 struct __enable_if<true, _Tp>
1603 { typedef _Tp __type; };
1604 template<bool _Cond, typename _Iftrue, typename _Iffalse>
1605 struct __conditional_type
1606 { typedef _Iftrue __type; };
1607 template<typename _Iftrue, typename _Iffalse>
1608 struct __conditional_type<false, _Iftrue, _Iffalse>
1609 { typedef _Iffalse __type; };
1610 template<typename _Tp>
1611 struct __add_unsigned
1614 typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
1616 typedef typename __if_type::__type __type;
1619 struct __add_unsigned<char>
1620 { typedef unsigned char __type; };
1622 struct __add_unsigned<signed char>
1623 { typedef unsigned char __type; };
1625 struct __add_unsigned<short>
1626 { typedef unsigned short __type; };
1628 struct __add_unsigned<int>
1629 { typedef unsigned int __type; };
1631 struct __add_unsigned<long>
1632 { typedef unsigned long __type; };
1634 struct __add_unsigned<long long>
1635 { typedef unsigned long long __type; };
1637 struct __add_unsigned<bool>;
1639 struct __add_unsigned<wchar_t>;
1640 template<typename _Tp>
1641 struct __remove_unsigned
1644 typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
1646 typedef typename __if_type::__type __type;
1649 struct __remove_unsigned<char>
1650 { typedef signed char __type; };
1652 struct __remove_unsigned<unsigned char>
1653 { typedef signed char __type; };
1655 struct __remove_unsigned<unsigned short>
1656 { typedef short __type; };
1658 struct __remove_unsigned<unsigned int>
1659 { typedef int __type; };
1661 struct __remove_unsigned<unsigned long>
1662 { typedef long __type; };
1664 struct __remove_unsigned<unsigned long long>
1665 { typedef long long __type; };
1667 struct __remove_unsigned<bool>;
1669 struct __remove_unsigned<wchar_t>;
1670 template<typename _Type>
1672 __is_null_pointer(_Type* __ptr)
1673 { return __ptr == 0; }
1674 template<typename _Type>
1676 __is_null_pointer(_Type)
1678 template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
1680 { typedef double __type; };
1681 template<typename _Tp>
1682 struct __promote<_Tp, false>
1683 { typedef _Tp __type; };
1684 template<typename _Tp, typename _Up>
1688 typedef typename __promote<_Tp>::__type __type1;
1689 typedef typename __promote<_Up>::__type __type2;
1691 typedef __typeof__(__type1() + __type2()) __type;
1693 template<typename _Tp, typename _Up, typename _Vp>
1697 typedef typename __promote<_Tp>::__type __type1;
1698 typedef typename __promote<_Up>::__type __type2;
1699 typedef typename __promote<_Vp>::__type __type3;
1701 typedef __typeof__(__type1() + __type2() + __type3()) __type;
1703 template<typename _Tp, typename _Up, typename _Vp, typename _Wp>
1707 typedef typename __promote<_Tp>::__type __type1;
1708 typedef typename __promote<_Up>::__type __type2;
1709 typedef typename __promote<_Vp>::__type __type3;
1710 typedef typename __promote<_Wp>::__type __type4;
1712 typedef __typeof__(__type1() + __type2() + __type3() + __type4()) __type;
1715 namespace std __attribute__ ((__visibility__ ("default"))) {
1716 template<typename _Tp>
1718 swap(_Tp& __a, _Tp& __b)
1725 namespace std __attribute__ ((__visibility__ ("default"))) {
1726 template<typename _Iterator>
1727 class reverse_iterator
1728 : public iterator<typename iterator_traits<_Iterator>::iterator_category,
1729 typename iterator_traits<_Iterator>::value_type,
1730 typename iterator_traits<_Iterator>::difference_type,
1731 typename iterator_traits<_Iterator>::pointer,
1732 typename iterator_traits<_Iterator>::reference>
1737 typedef _Iterator iterator_type;
1738 typedef typename iterator_traits<_Iterator>::difference_type
1740 typedef typename iterator_traits<_Iterator>::reference reference;
1741 typedef typename iterator_traits<_Iterator>::pointer pointer;
1743 reverse_iterator() : current() { }
1745 reverse_iterator(iterator_type __x) : current(__x) { }
1746 reverse_iterator(const reverse_iterator& __x)
1747 : current(__x.current) { }
1748 template<typename _Iter>
1749 reverse_iterator(const reverse_iterator<_Iter>& __x)
1750 : current(__x.base()) { }
1757 _Iterator __tmp = current;
1762 { return &(operator*()); }
1772 reverse_iterator __tmp = *this;
1785 reverse_iterator __tmp = *this;
1790 operator+(difference_type __n) const
1791 { return reverse_iterator(current - __n); }
1793 operator+=(difference_type __n)
1799 operator-(difference_type __n) const
1800 { return reverse_iterator(current + __n); }
1802 operator-=(difference_type __n)
1808 operator[](difference_type __n) const
1809 { return *(*this + __n); }
1811 template<typename _Iterator>
1813 operator==(const reverse_iterator<_Iterator>& __x,
1814 const reverse_iterator<_Iterator>& __y)
1815 { return __x.base() == __y.base(); }
1816 template<typename _Iterator>
1818 operator<(const reverse_iterator<_Iterator>& __x,
1819 const reverse_iterator<_Iterator>& __y)
1820 { return __y.base() < __x.base(); }
1821 template<typename _Iterator>
1823 operator!=(const reverse_iterator<_Iterator>& __x,
1824 const reverse_iterator<_Iterator>& __y)
1825 { return !(__x == __y); }
1826 template<typename _Iterator>
1828 operator>(const reverse_iterator<_Iterator>& __x,
1829 const reverse_iterator<_Iterator>& __y)
1830 { return __y < __x; }
1831 template<typename _Iterator>
1833 operator<=(const reverse_iterator<_Iterator>& __x,
1834 const reverse_iterator<_Iterator>& __y)
1835 { return !(__y < __x); }
1836 template<typename _Iterator>
1838 operator>=(const reverse_iterator<_Iterator>& __x,
1839 const reverse_iterator<_Iterator>& __y)
1840 { return !(__x < __y); }
1841 template<typename _Iterator>
1842 inline typename reverse_iterator<_Iterator>::difference_type
1843 operator-(const reverse_iterator<_Iterator>& __x,
1844 const reverse_iterator<_Iterator>& __y)
1845 { return __y.base() - __x.base(); }
1846 template<typename _Iterator>
1847 inline reverse_iterator<_Iterator>
1848 operator+(typename reverse_iterator<_Iterator>::difference_type __n,
1849 const reverse_iterator<_Iterator>& __x)
1850 { return reverse_iterator<_Iterator>(__x.base() - __n); }
1851 template<typename _IteratorL, typename _IteratorR>
1853 operator==(const reverse_iterator<_IteratorL>& __x,
1854 const reverse_iterator<_IteratorR>& __y)
1855 { return __x.base() == __y.base(); }
1856 template<typename _IteratorL, typename _IteratorR>
1858 operator<(const reverse_iterator<_IteratorL>& __x,
1859 const reverse_iterator<_IteratorR>& __y)
1860 { return __y.base() < __x.base(); }
1861 template<typename _IteratorL, typename _IteratorR>
1863 operator!=(const reverse_iterator<_IteratorL>& __x,
1864 const reverse_iterator<_IteratorR>& __y)
1865 { return !(__x == __y); }
1866 template<typename _IteratorL, typename _IteratorR>
1868 operator>(const reverse_iterator<_IteratorL>& __x,
1869 const reverse_iterator<_IteratorR>& __y)
1870 { return __y < __x; }
1871 template<typename _IteratorL, typename _IteratorR>
1873 operator<=(const reverse_iterator<_IteratorL>& __x,
1874 const reverse_iterator<_IteratorR>& __y)
1875 { return !(__y < __x); }
1876 template<typename _IteratorL, typename _IteratorR>
1878 operator>=(const reverse_iterator<_IteratorL>& __x,
1879 const reverse_iterator<_IteratorR>& __y)
1880 { return !(__x < __y); }
1881 template<typename _IteratorL, typename _IteratorR>
1882 inline typename reverse_iterator<_IteratorL>::difference_type
1883 operator-(const reverse_iterator<_IteratorL>& __x,
1884 const reverse_iterator<_IteratorR>& __y)
1885 { return __y.base() - __x.base(); }
1886 template<typename _Container>
1887 class back_insert_iterator
1888 : public iterator<output_iterator_tag, void, void, void, void>
1891 _Container* container;
1893 typedef _Container container_type;
1895 back_insert_iterator(_Container& __x) : container(&__x) { }
1896 back_insert_iterator&
1897 operator=(typename _Container::const_reference __value)
1899 container->push_back(__value);
1902 back_insert_iterator&
1905 back_insert_iterator&
1908 back_insert_iterator
1912 template<typename _Container>
1913 inline back_insert_iterator<_Container>
1914 back_inserter(_Container& __x)
1915 { return back_insert_iterator<_Container>(__x); }
1916 template<typename _Container>
1917 class front_insert_iterator
1918 : public iterator<output_iterator_tag, void, void, void, void>
1921 _Container* container;
1923 typedef _Container container_type;
1924 explicit front_insert_iterator(_Container& __x) : container(&__x) { }
1925 front_insert_iterator&
1926 operator=(typename _Container::const_reference __value)
1928 container->push_front(__value);
1931 front_insert_iterator&
1934 front_insert_iterator&
1937 front_insert_iterator
1941 template<typename _Container>
1942 inline front_insert_iterator<_Container>
1943 front_inserter(_Container& __x)
1944 { return front_insert_iterator<_Container>(__x); }
1945 template<typename _Container>
1946 class insert_iterator
1947 : public iterator<output_iterator_tag, void, void, void, void>
1950 _Container* container;
1951 typename _Container::iterator iter;
1953 typedef _Container container_type;
1954 insert_iterator(_Container& __x, typename _Container::iterator __i)
1955 : container(&__x), iter(__i) {}
1957 operator=(typename _Container::const_reference __value)
1959 iter = container->insert(iter, __value);
1973 template<typename _Container, typename _Iterator>
1974 inline insert_iterator<_Container>
1975 inserter(_Container& __x, _Iterator __i)
1977 return insert_iterator<_Container>(__x,
1978 typename _Container::iterator(__i));
1981 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
1982 using std::iterator_traits;
1983 using std::iterator;
1984 template<typename _Iterator, typename _Container>
1985 class __normal_iterator
1988 _Iterator _M_current;
1990 typedef _Iterator iterator_type;
1991 typedef typename iterator_traits<_Iterator>::iterator_category
1993 typedef typename iterator_traits<_Iterator>::value_type value_type;
1994 typedef typename iterator_traits<_Iterator>::difference_type
1996 typedef typename iterator_traits<_Iterator>::reference reference;
1997 typedef typename iterator_traits<_Iterator>::pointer pointer;
1998 __normal_iterator() : _M_current(_Iterator()) { }
2000 __normal_iterator(const _Iterator& __i) : _M_current(__i) { }
2001 template<typename _Iter>
2002 __normal_iterator(const __normal_iterator<_Iter,
2003 typename __enable_if<
2004 (std::__are_same<_Iter, typename _Container::pointer>::__value),
2005 _Container>::__type>& __i)
2006 : _M_current(__i.base()) { }
2009 { return *_M_current; }
2012 { return _M_current; }
2021 { return __normal_iterator(_M_current++); }
2030 { return __normal_iterator(_M_current--); }
2032 operator[](const difference_type& __n) const
2033 { return _M_current[__n]; }
2035 operator+=(const difference_type& __n)
2036 { _M_current += __n; return *this; }
2038 operator+(const difference_type& __n) const
2039 { return __normal_iterator(_M_current + __n); }
2041 operator-=(const difference_type& __n)
2042 { _M_current -= __n; return *this; }
2044 operator-(const difference_type& __n) const
2045 { return __normal_iterator(_M_current - __n); }
2048 { return _M_current; }
2050 template<typename _IteratorL, typename _IteratorR, typename _Container>
2052 operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
2053 const __normal_iterator<_IteratorR, _Container>& __rhs)
2054 { return __lhs.base() == __rhs.base(); }
2055 template<typename _Iterator, typename _Container>
2057 operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
2058 const __normal_iterator<_Iterator, _Container>& __rhs)
2059 { return __lhs.base() == __rhs.base(); }
2060 template<typename _IteratorL, typename _IteratorR, typename _Container>
2062 operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
2063 const __normal_iterator<_IteratorR, _Container>& __rhs)
2064 { return __lhs.base() != __rhs.base(); }
2065 template<typename _Iterator, typename _Container>
2067 operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
2068 const __normal_iterator<_Iterator, _Container>& __rhs)
2069 { return __lhs.base() != __rhs.base(); }
2070 template<typename _IteratorL, typename _IteratorR, typename _Container>
2072 operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
2073 const __normal_iterator<_IteratorR, _Container>& __rhs)
2074 { return __lhs.base() < __rhs.base(); }
2075 template<typename _Iterator, typename _Container>
2077 operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
2078 const __normal_iterator<_Iterator, _Container>& __rhs)
2079 { return __lhs.base() < __rhs.base(); }
2080 template<typename _IteratorL, typename _IteratorR, typename _Container>
2082 operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
2083 const __normal_iterator<_IteratorR, _Container>& __rhs)
2084 { return __lhs.base() > __rhs.base(); }
2085 template<typename _Iterator, typename _Container>
2087 operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
2088 const __normal_iterator<_Iterator, _Container>& __rhs)
2089 { return __lhs.base() > __rhs.base(); }
2090 template<typename _IteratorL, typename _IteratorR, typename _Container>
2092 operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
2093 const __normal_iterator<_IteratorR, _Container>& __rhs)
2094 { return __lhs.base() <= __rhs.base(); }
2095 template<typename _Iterator, typename _Container>
2097 operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
2098 const __normal_iterator<_Iterator, _Container>& __rhs)
2099 { return __lhs.base() <= __rhs.base(); }
2100 template<typename _IteratorL, typename _IteratorR, typename _Container>
2102 operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
2103 const __normal_iterator<_IteratorR, _Container>& __rhs)
2104 { return __lhs.base() >= __rhs.base(); }
2105 template<typename _Iterator, typename _Container>
2107 operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
2108 const __normal_iterator<_Iterator, _Container>& __rhs)
2109 { return __lhs.base() >= __rhs.base(); }
2110 template<typename _IteratorL, typename _IteratorR, typename _Container>
2111 inline typename __normal_iterator<_IteratorL, _Container>::difference_type
2112 operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
2113 const __normal_iterator<_IteratorR, _Container>& __rhs)
2114 { return __lhs.base() - __rhs.base(); }
2115 template<typename _Iterator, typename _Container>
2116 inline typename __normal_iterator<_Iterator, _Container>::difference_type
2117 operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
2118 const __normal_iterator<_Iterator, _Container>& __rhs)
2119 { return __lhs.base() - __rhs.base(); }
2120 template<typename _Iterator, typename _Container>
2121 inline __normal_iterator<_Iterator, _Container>
2122 operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
2123 __n, const __normal_iterator<_Iterator, _Container>& __i)
2124 { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
2126 namespace std __attribute__ ((__visibility__ ("default"))) {
2127 template<typename _Alloc>
2129 template<class _CharT>
2131 template<typename _CharT, typename _Traits = char_traits<_CharT>,
2132 typename _Alloc = allocator<_CharT> >
2134 template<> struct char_traits<char>;
2135 typedef basic_string<char> string;
2144 namespace std __attribute__ ((__visibility__ ("default"))) {
2147 typedef signed char int8_t;
2148 typedef short int int16_t;
2149 typedef int int32_t;
2151 typedef long long int int64_t;
2152 typedef unsigned char uint8_t;
2153 typedef unsigned short int uint16_t;
2154 typedef unsigned int uint32_t;
2156 typedef unsigned long long int uint64_t;
2157 typedef signed char int_least8_t;
2158 typedef short int int_least16_t;
2159 typedef int int_least32_t;
2161 typedef long long int int_least64_t;
2162 typedef unsigned char uint_least8_t;
2163 typedef unsigned short int uint_least16_t;
2164 typedef unsigned int uint_least32_t;
2166 typedef unsigned long long int uint_least64_t;
2167 typedef signed char int_fast8_t;
2168 typedef int int_fast16_t;
2169 typedef int int_fast32_t;
2171 typedef long long int int_fast64_t;
2172 typedef unsigned char uint_fast8_t;
2173 typedef unsigned int uint_fast16_t;
2174 typedef unsigned int uint_fast32_t;
2176 typedef unsigned long long int uint_fast64_t;
2177 typedef int intptr_t;
2178 typedef unsigned int uintptr_t;
2180 typedef long long int intmax_t;
2182 typedef unsigned long long int uintmax_t;
2183 namespace std __attribute__ ((__visibility__ ("default"))) {
2184 typedef int64_t streamoff;
2185 typedef ptrdiff_t streamsize;
2186 template<typename _StateT>
2194 : _M_off(0), _M_state() { }
2195 fpos(streamoff __off)
2196 : _M_off(__off), _M_state() { }
2197 operator streamoff() const { return _M_off; }
2200 { _M_state = __st; }
2203 { return _M_state; }
2205 operator+=(streamoff __off)
2211 operator-=(streamoff __off)
2217 operator+(streamoff __off) const
2224 operator-(streamoff __off) const
2231 operator-(const fpos& __other) const
2232 { return _M_off - __other._M_off; }
2234 template<typename _StateT>
2236 operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
2237 { return streamoff(__lhs) == streamoff(__rhs); }
2238 template<typename _StateT>
2240 operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
2241 { return streamoff(__lhs) != streamoff(__rhs); }
2242 typedef fpos<mbstate_t> streampos;
2243 typedef fpos<mbstate_t> wstreampos;
2245 namespace std __attribute__ ((__visibility__ ("default"))) {
2246 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2248 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2249 class basic_streambuf;
2250 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2251 class basic_istream;
2252 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2253 class basic_ostream;
2254 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2255 class basic_iostream;
2256 template<typename _CharT, typename _Traits = char_traits<_CharT>,
2257 typename _Alloc = allocator<_CharT> >
2258 class basic_stringbuf;
2259 template<typename _CharT, typename _Traits = char_traits<_CharT>,
2260 typename _Alloc = allocator<_CharT> >
2261 class basic_istringstream;
2262 template<typename _CharT, typename _Traits = char_traits<_CharT>,
2263 typename _Alloc = allocator<_CharT> >
2264 class basic_ostringstream;
2265 template<typename _CharT, typename _Traits = char_traits<_CharT>,
2266 typename _Alloc = allocator<_CharT> >
2267 class basic_stringstream;
2268 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2269 class basic_filebuf;
2270 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2271 class basic_ifstream;
2272 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2273 class basic_ofstream;
2274 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2275 class basic_fstream;
2276 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2277 class istreambuf_iterator;
2278 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2279 class ostreambuf_iterator;
2281 typedef basic_ios<char> ios;
2282 typedef basic_streambuf<char> streambuf;
2283 typedef basic_istream<char> istream;
2284 typedef basic_ostream<char> ostream;
2285 typedef basic_iostream<char> iostream;
2286 typedef basic_stringbuf<char> stringbuf;
2287 typedef basic_istringstream<char> istringstream;
2288 typedef basic_ostringstream<char> ostringstream;
2289 typedef basic_stringstream<char> stringstream;
2290 typedef basic_filebuf<char> filebuf;
2291 typedef basic_ifstream<char> ifstream;
2292 typedef basic_ofstream<char> ofstream;
2293 typedef basic_fstream<char> fstream;
2301 exception() throw() { }
2302 virtual ~exception() throw();
2303 virtual const char* what() const throw();
2305 class bad_exception : public exception
2308 bad_exception() throw() { }
2309 virtual ~bad_exception() throw();
2310 virtual const char* what() const throw();
2312 typedef void (*terminate_handler) ();
2313 typedef void (*unexpected_handler) ();
2314 terminate_handler set_terminate(terminate_handler) throw();
2315 void terminate() __attribute__ ((__noreturn__));
2316 unexpected_handler set_unexpected(unexpected_handler) throw();
2317 void unexpected() __attribute__ ((__noreturn__));
2318 bool uncaught_exception() throw();
2320 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
2321 void __verbose_terminate_handler ();
2324 namespace std __attribute__ ((__visibility__ ("default"))) {
2326 __throw_bad_exception(void) __attribute__((__noreturn__));
2328 __throw_bad_alloc(void) __attribute__((__noreturn__));
2330 __throw_bad_cast(void) __attribute__((__noreturn__));
2332 __throw_bad_typeid(void) __attribute__((__noreturn__));
2334 __throw_logic_error(const char*) __attribute__((__noreturn__));
2336 __throw_domain_error(const char*) __attribute__((__noreturn__));
2338 __throw_invalid_argument(const char*) __attribute__((__noreturn__));
2340 __throw_length_error(const char*) __attribute__((__noreturn__));
2342 __throw_out_of_range(const char*) __attribute__((__noreturn__));
2344 __throw_runtime_error(const char*) __attribute__((__noreturn__));
2346 __throw_range_error(const char*) __attribute__((__noreturn__));
2348 __throw_overflow_error(const char*) __attribute__((__noreturn__));
2350 __throw_underflow_error(const char*) __attribute__((__noreturn__));
2352 __throw_ios_failure(const char*) __attribute__((__noreturn__));
2354 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
2355 template<typename _Value>
2356 struct __numeric_traits_integer
2358 static const _Value __min = (((_Value)(-1) < 0) ? (_Value)1 << (sizeof(_Value) * 8 - ((_Value)(-1) < 0)) : (_Value)0);
2359 static const _Value __max = (((_Value)(-1) < 0) ? (((((_Value)1 << ((sizeof(_Value) * 8 - ((_Value)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(_Value)0);
2360 static const bool __is_signed = ((_Value)(-1) < 0);
2361 static const int __digits = (sizeof(_Value) * 8 - ((_Value)(-1) < 0));
2363 template<typename _Value>
2364 const _Value __numeric_traits_integer<_Value>::__min;
2365 template<typename _Value>
2366 const _Value __numeric_traits_integer<_Value>::__max;
2367 template<typename _Value>
2368 const bool __numeric_traits_integer<_Value>::__is_signed;
2369 template<typename _Value>
2370 const int __numeric_traits_integer<_Value>::__digits;
2371 template<typename _Value>
2372 struct __numeric_traits_floating
2374 static const int __max_digits10 = (2 + (std::__are_same<_Value, float>::__value ? 24 : std::__are_same<_Value, double>::__value ? 53 : 53) * 3010 / 10000);
2375 static const bool __is_signed = true;
2376 static const int __digits10 = (std::__are_same<_Value, float>::__value ? 6 : std::__are_same<_Value, double>::__value ? 15 : 15);
2377 static const int __max_exponent10 = (std::__are_same<_Value, float>::__value ? 38 : std::__are_same<_Value, double>::__value ? 308 : 308);
2379 template<typename _Value>
2380 const int __numeric_traits_floating<_Value>::__max_digits10;
2381 template<typename _Value>
2382 const bool __numeric_traits_floating<_Value>::__is_signed;
2383 template<typename _Value>
2384 const int __numeric_traits_floating<_Value>::__digits10;
2385 template<typename _Value>
2386 const int __numeric_traits_floating<_Value>::__max_exponent10;
2387 template<typename _Value>
2388 struct __numeric_traits
2389 : public __conditional_type<std::__is_integer<_Value>::__value,
2390 __numeric_traits_integer<_Value>,
2391 __numeric_traits_floating<_Value> >::__type
2394 namespace std __attribute__ ((__visibility__ ("default"))) {
2395 template<class _T1, class _T2>
2398 typedef _T1 first_type;
2399 typedef _T2 second_type;
2403 : first(), second() { }
2404 pair(const _T1& __a, const _T2& __b)
2405 : first(__a), second(__b) { }
2406 template<class _U1, class _U2>
2407 pair(const pair<_U1, _U2>& __p)
2409 second(__p.second) { }
2411 template<class _T1, class _T2>
2413 operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
2414 { return __x.first == __y.first && __x.second == __y.second; }
2415 template<class _T1, class _T2>
2417 operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
2418 { return __x.first < __y.first
2419 || (!(__y.first < __x.first) && __x.second < __y.second); }
2420 template<class _T1, class _T2>
2422 operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
2423 { return !(__x == __y); }
2424 template<class _T1, class _T2>
2426 operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
2427 { return __y < __x; }
2428 template<class _T1, class _T2>
2430 operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
2431 { return !(__y < __x); }
2432 template<class _T1, class _T2>
2434 operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
2435 { return !(__x < __y); }
2436 template<class _T1, class _T2>
2437 inline pair<_T1, _T2>
2438 make_pair(_T1 __x, _T2 __y)
2439 { return pair<_T1, _T2>(__x, __y); }
2443 namespace __debug { }
2445 namespace __gnu_debug
2447 using namespace std::__debug;
2449 namespace std __attribute__ ((__visibility__ ("default"))) {
2450 template<bool _BoolType>
2453 template<typename _ForwardIterator1, typename _ForwardIterator2>
2455 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
2457 typedef typename iterator_traits<_ForwardIterator1>::value_type
2459 _ValueType1 __tmp = (*__a);
2465 struct __iter_swap<true>
2467 template<typename _ForwardIterator1, typename _ForwardIterator2>
2469 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
2474 template<typename _ForwardIterator1, typename _ForwardIterator2>
2476 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
2478 typedef typename iterator_traits<_ForwardIterator1>::value_type
2480 typedef typename iterator_traits<_ForwardIterator2>::value_type
2482 typedef typename iterator_traits<_ForwardIterator1>::reference
2484 typedef typename iterator_traits<_ForwardIterator2>::reference
2486 std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value
2487 && __are_same<_ValueType1&, _ReferenceType1>::__value
2488 && __are_same<_ValueType2&, _ReferenceType2>::__value>::
2489 iter_swap(__a, __b);
2491 template<typename _ForwardIterator1, typename _ForwardIterator2>
2493 swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
2494 _ForwardIterator2 __first2)
2497 for (; __first1 != __last1; ++__first1, ++__first2)
2498 std::iter_swap(__first1, __first2);
2501 template<typename _Tp>
2503 min(const _Tp& __a, const _Tp& __b)
2509 template<typename _Tp>
2511 max(const _Tp& __a, const _Tp& __b)
2517 template<typename _Tp, typename _Compare>
2519 min(const _Tp& __a, const _Tp& __b, _Compare __comp)
2521 if (__comp(__b, __a))
2525 template<typename _Tp, typename _Compare>
2527 max(const _Tp& __a, const _Tp& __b, _Compare __comp)
2529 if (__comp(__a, __b))
2533 template<typename _Iterator,
2534 bool _IsNormal = __is_normal_iterator<_Iterator>::__value>
2541 template<typename _Iterator>
2542 struct __niter_base<_Iterator, true>
2544 static typename _Iterator::iterator_type
2546 { return __it.base(); }
2548 template<typename _Iterator,
2549 bool _IsMove = __is_move_iterator<_Iterator>::__value>
2556 template<typename _Iterator>
2557 struct __miter_base<_Iterator, true>
2559 static typename _Iterator::iterator_type
2561 { return __it.base(); }
2563 template<bool, bool, typename>
2566 template<typename _II, typename _OI>
2568 __copy_m(_II __first, _II __last, _OI __result)
2570 for (; __first != __last; ++__result, ++__first)
2571 *__result = *__first;
2576 struct __copy_move<false, false, random_access_iterator_tag>
2578 template<typename _II, typename _OI>
2580 __copy_m(_II __first, _II __last, _OI __result)
2582 typedef typename iterator_traits<_II>::difference_type _Distance;
2583 for(_Distance __n = __last - __first; __n > 0; --__n)
2585 *__result = *__first;
2592 template<bool _IsMove>
2593 struct __copy_move<_IsMove, true, random_access_iterator_tag>
2595 template<typename _Tp>
2597 __copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)
2599 __builtin_memmove(__result, __first,
2600 sizeof(_Tp) * (__last - __first));
2601 return __result + (__last - __first);
2604 template<bool _IsMove, typename _II, typename _OI>
2606 __copy_move_a(_II __first, _II __last, _OI __result)
2608 typedef typename iterator_traits<_II>::value_type _ValueTypeI;
2609 typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
2610 typedef typename iterator_traits<_II>::iterator_category _Category;
2611 const bool __simple = (__is_pod(_ValueTypeI)
2612 && __is_pointer<_II>::__value
2613 && __is_pointer<_OI>::__value
2614 && __are_same<_ValueTypeI, _ValueTypeO>::__value);
2615 return std::__copy_move<_IsMove, __simple,
2616 _Category>::__copy_m(__first, __last, __result);
2618 template<typename _CharT>
2620 template<typename _CharT, typename _Traits>
2621 class istreambuf_iterator;
2622 template<typename _CharT, typename _Traits>
2623 class ostreambuf_iterator;
2624 template<bool _IsMove, typename _CharT>
2625 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
2626 ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
2627 __copy_move_a2(_CharT*, _CharT*,
2628 ostreambuf_iterator<_CharT, char_traits<_CharT> >);
2629 template<bool _IsMove, typename _CharT>
2630 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
2631 ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
2632 __copy_move_a2(const _CharT*, const _CharT*,
2633 ostreambuf_iterator<_CharT, char_traits<_CharT> >);
2634 template<bool _IsMove, typename _CharT>
2635 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
2637 __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,
2638 istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);
2639 template<bool _IsMove, typename _II, typename _OI>
2641 __copy_move_a2(_II __first, _II __last, _OI __result)
2643 return _OI(std::__copy_move_a<_IsMove>
2644 (std::__niter_base<_II>::__b(__first),
2645 std::__niter_base<_II>::__b(__last),
2646 std::__niter_base<_OI>::__b(__result)));
2648 template<typename _II, typename _OI>
2650 copy(_II __first, _II __last, _OI __result)
2653 return (std::__copy_move_a2<__is_move_iterator<_II>::__value>
2654 (std::__miter_base<_II>::__b(__first),
2655 std::__miter_base<_II>::__b(__last), __result));
2657 template<bool, bool, typename>
2658 struct __copy_move_backward
2660 template<typename _BI1, typename _BI2>
2662 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
2664 while (__first != __last)
2665 *--__result = *--__last;
2670 struct __copy_move_backward<false, false, random_access_iterator_tag>
2672 template<typename _BI1, typename _BI2>
2674 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
2676 typename iterator_traits<_BI1>::difference_type __n;
2677 for (__n = __last - __first; __n > 0; --__n)
2678 *--__result = *--__last;
2682 template<bool _IsMove>
2683 struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
2685 template<typename _Tp>
2687 __copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
2689 const ptrdiff_t _Num = __last - __first;
2690 __builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
2691 return __result - _Num;
2694 template<bool _IsMove, typename _BI1, typename _BI2>
2696 __copy_move_backward_a(_BI1 __first, _BI1 __last, _BI2 __result)
2698 typedef typename iterator_traits<_BI1>::value_type _ValueType1;
2699 typedef typename iterator_traits<_BI2>::value_type _ValueType2;
2700 typedef typename iterator_traits<_BI1>::iterator_category _Category;
2701 const bool __simple = (__is_pod(_ValueType1)
2702 && __is_pointer<_BI1>::__value
2703 && __is_pointer<_BI2>::__value
2704 && __are_same<_ValueType1, _ValueType2>::__value);
2705 return std::__copy_move_backward<_IsMove, __simple,
2706 _Category>::__copy_move_b(__first,
2710 template<bool _IsMove, typename _BI1, typename _BI2>
2712 __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
2714 return _BI2(std::__copy_move_backward_a<_IsMove>
2715 (std::__niter_base<_BI1>::__b(__first),
2716 std::__niter_base<_BI1>::__b(__last),
2717 std::__niter_base<_BI2>::__b(__result)));
2719 template<typename _BI1, typename _BI2>
2721 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
2724 return (std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value>
2725 (std::__miter_base<_BI1>::__b(__first),
2726 std::__miter_base<_BI1>::__b(__last), __result));
2728 template<typename _ForwardIterator, typename _Tp>
2730 __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
2731 __fill_a(_ForwardIterator __first, _ForwardIterator __last,
2734 for (; __first != __last; ++__first)
2737 template<typename _ForwardIterator, typename _Tp>
2739 __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type
2740 __fill_a(_ForwardIterator __first, _ForwardIterator __last,
2743 const _Tp __tmp = __value;
2744 for (; __first != __last; ++__first)
2747 template<typename _Tp>
2749 __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
2750 __fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)
2752 const _Tp __tmp = __c;
2753 __builtin_memset(__first, static_cast<unsigned char>(__tmp),
2756 template<typename _ForwardIterator, typename _Tp>
2758 fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
2761 std::__fill_a(std::__niter_base<_ForwardIterator>::__b(__first),
2762 std::__niter_base<_ForwardIterator>::__b(__last), __value);
2764 template<typename _OutputIterator, typename _Size, typename _Tp>
2766 __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
2767 __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
2769 for (; __n > 0; --__n, ++__first)
2773 template<typename _OutputIterator, typename _Size, typename _Tp>
2775 __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type
2776 __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
2778 const _Tp __tmp = __value;
2779 for (; __n > 0; --__n, ++__first)
2783 template<typename _Size, typename _Tp>
2785 __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, _Tp*>::__type
2786 __fill_n_a(_Tp* __first, _Size __n, const _Tp& __c)
2788 std::__fill_a(__first, __first + __n, __c);
2789 return __first + __n;
2791 template<typename _OI, typename _Size, typename _Tp>
2793 fill_n(_OI __first, _Size __n, const _Tp& __value)
2795 return _OI(std::__fill_n_a(std::__niter_base<_OI>::__b(__first),
2798 template<bool _BoolType>
2801 template<typename _II1, typename _II2>
2803 equal(_II1 __first1, _II1 __last1, _II2 __first2)
2805 for (; __first1 != __last1; ++__first1, ++__first2)
2806 if (!(*__first1 == *__first2))
2812 struct __equal<true>
2814 template<typename _Tp>
2816 equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)
2818 return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
2819 * (__last1 - __first1));
2822 template<typename _II1, typename _II2>
2824 __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
2826 typedef typename iterator_traits<_II1>::value_type _ValueType1;
2827 typedef typename iterator_traits<_II2>::value_type _ValueType2;
2828 const bool __simple = (__is_integer<_ValueType1>::__value
2829 && __is_pointer<_II1>::__value
2830 && __is_pointer<_II2>::__value
2831 && __are_same<_ValueType1, _ValueType2>::__value);
2832 return std::__equal<__simple>::equal(__first1, __last1, __first2);
2834 template<typename, typename>
2837 template<typename _II1, typename _II2>
2839 __newlast1(_II1, _II1 __last1, _II2, _II2)
2841 template<typename _II>
2843 __cnd2(_II __first, _II __last)
2844 { return __first != __last; }
2847 struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag>
2849 template<typename _RAI1, typename _RAI2>
2851 __newlast1(_RAI1 __first1, _RAI1 __last1,
2852 _RAI2 __first2, _RAI2 __last2)
2854 const typename iterator_traits<_RAI1>::difference_type
2855 __diff1 = __last1 - __first1;
2856 const typename iterator_traits<_RAI2>::difference_type
2857 __diff2 = __last2 - __first2;
2858 return __diff2 < __diff1 ? __first1 + __diff2 : __last1;
2860 template<typename _RAI>
2865 template<bool _BoolType>
2866 struct __lexicographical_compare
2868 template<typename _II1, typename _II2>
2869 static bool __lc(_II1, _II1, _II2, _II2);
2871 template<bool _BoolType>
2872 template<typename _II1, typename _II2>
2874 __lexicographical_compare<_BoolType>::
2875 __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
2877 typedef typename iterator_traits<_II1>::iterator_category _Category1;
2878 typedef typename iterator_traits<_II2>::iterator_category _Category2;
2879 typedef std::__lc_rai<_Category1, _Category2> __rai_type;
2880 __last1 = __rai_type::__newlast1(__first1, __last1,
2882 for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
2883 ++__first1, ++__first2)
2885 if (*__first1 < *__first2)
2887 if (*__first2 < *__first1)
2890 return __first1 == __last1 && __first2 != __last2;
2893 struct __lexicographical_compare<true>
2895 template<typename _Tp, typename _Up>
2897 __lc(const _Tp* __first1, const _Tp* __last1,
2898 const _Up* __first2, const _Up* __last2)
2900 const size_t __len1 = __last1 - __first1;
2901 const size_t __len2 = __last2 - __first2;
2902 const int __result = __builtin_memcmp(__first1, __first2,
2903 std::min(__len1, __len2));
2904 return __result != 0 ? __result < 0 : __len1 < __len2;
2907 template<typename _II1, typename _II2>
2909 __lexicographical_compare_aux(_II1 __first1, _II1 __last1,
2910 _II2 __first2, _II2 __last2)
2912 typedef typename iterator_traits<_II1>::value_type _ValueType1;
2913 typedef typename iterator_traits<_II2>::value_type _ValueType2;
2914 const bool __simple =
2915 (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value
2916 && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
2917 && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed
2918 && __is_pointer<_II1>::__value
2919 && __is_pointer<_II2>::__value);
2920 return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
2924 namespace std __attribute__ ((__visibility__ ("default"))) {
2925 template<typename _II1, typename _II2>
2927 equal(_II1 __first1, _II1 __last1, _II2 __first2)
2930 return std::__equal_aux(std::__niter_base<_II1>::__b(__first1),
2931 std::__niter_base<_II1>::__b(__last1),
2932 std::__niter_base<_II2>::__b(__first2));
2934 template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
2936 equal(_IIter1 __first1, _IIter1 __last1,
2937 _IIter2 __first2, _BinaryPredicate __binary_pred)
2940 for (; __first1 != __last1; ++__first1, ++__first2)
2941 if (!bool(__binary_pred(*__first1, *__first2)))
2945 template<typename _II1, typename _II2>
2947 lexicographical_compare(_II1 __first1, _II1 __last1,
2948 _II2 __first2, _II2 __last2)
2950 typedef typename iterator_traits<_II1>::value_type _ValueType1;
2951 typedef typename iterator_traits<_II2>::value_type _ValueType2;
2954 return std::__lexicographical_compare_aux
2955 (std::__niter_base<_II1>::__b(__first1),
2956 std::__niter_base<_II1>::__b(__last1),
2957 std::__niter_base<_II2>::__b(__first2),
2958 std::__niter_base<_II2>::__b(__last2));
2960 template<typename _II1, typename _II2, typename _Compare>
2962 lexicographical_compare(_II1 __first1, _II1 __last1,
2963 _II2 __first2, _II2 __last2, _Compare __comp)
2965 typedef typename iterator_traits<_II1>::iterator_category _Category1;
2966 typedef typename iterator_traits<_II2>::iterator_category _Category2;
2967 typedef std::__lc_rai<_Category1, _Category2> __rai_type;
2970 __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
2971 for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
2972 ++__first1, ++__first2)
2974 if (__comp(*__first1, *__first2))
2976 if (__comp(*__first2, *__first1))
2979 return __first1 == __last1 && __first2 != __last2;
2981 template<typename _InputIterator1, typename _InputIterator2>
2982 pair<_InputIterator1, _InputIterator2>
2983 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
2984 _InputIterator2 __first2)
2987 while (__first1 != __last1 && *__first1 == *__first2)
2992 return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
2994 template<typename _InputIterator1, typename _InputIterator2,
2995 typename _BinaryPredicate>
2996 pair<_InputIterator1, _InputIterator2>
2997 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
2998 _InputIterator2 __first2, _BinaryPredicate __binary_pred)
3001 while (__first1 != __last1 && bool(__binary_pred(*__first1, *__first2)))
3006 return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
3010 typedef unsigned short __kernel_dev_t;
3011 typedef unsigned long __kernel_ino_t;
3012 typedef unsigned short __kernel_mode_t;
3013 typedef unsigned short __kernel_nlink_t;
3014 typedef long __kernel_off_t;
3015 typedef int __kernel_pid_t;
3016 typedef unsigned int __kernel_ipc_pid_t;
3017 typedef unsigned int __kernel_uid_t;
3018 typedef unsigned int __kernel_gid_t;
3019 typedef unsigned int __kernel_size_t;
3020 typedef int __kernel_ssize_t;
3021 typedef int __kernel_ptrdiff_t;
3022 typedef long __kernel_time_t;
3023 typedef long __kernel_suseconds_t;
3024 typedef long __kernel_clock_t;
3025 typedef int __kernel_daddr_t;
3026 typedef char * __kernel_caddr_t;
3027 typedef unsigned short __kernel_uid16_t;
3028 typedef unsigned short __kernel_gid16_t;
3029 typedef unsigned int __kernel_uid32_t;
3030 typedef unsigned int __kernel_gid32_t;
3031 typedef unsigned short __kernel_old_uid_t;
3032 typedef unsigned short __kernel_old_gid_t;
3033 typedef long long __kernel_loff_t;
3034 typedef __kernel_dev_t __kernel_old_dev_t;
3038 typedef unsigned char __u_char;
3039 typedef unsigned short int __u_short;
3040 typedef unsigned int __u_int;
3041 typedef unsigned long int __u_long;
3042 typedef signed char __int8_t;
3043 typedef unsigned char __uint8_t;
3044 typedef signed short int __int16_t;
3045 typedef unsigned short int __uint16_t;
3046 typedef signed int __int32_t;
3047 typedef unsigned int __uint32_t;
3048 __extension__ typedef signed long long int __int64_t;
3049 __extension__ typedef unsigned long long int __uint64_t;
3050 __extension__ typedef long long int __quad_t;
3051 __extension__ typedef unsigned long long int __u_quad_t;
3052 __extension__ typedef __u_quad_t __dev_t;
3053 __extension__ typedef unsigned int __uid_t;
3054 __extension__ typedef unsigned int __gid_t;
3055 __extension__ typedef unsigned long int __ino_t;
3056 __extension__ typedef __u_quad_t __ino64_t;
3057 __extension__ typedef unsigned int __mode_t;
3058 __extension__ typedef unsigned int __nlink_t;
3059 __extension__ typedef long int __off_t;
3060 __extension__ typedef __quad_t __off64_t;
3061 __extension__ typedef int __pid_t;
3062 __extension__ typedef struct { int __val[2]; } __fsid_t;
3063 __extension__ typedef long int __clock_t;
3064 __extension__ typedef unsigned long int __rlim_t;
3065 __extension__ typedef __u_quad_t __rlim64_t;
3066 __extension__ typedef unsigned int __id_t;
3067 __extension__ typedef long int __time_t;
3068 __extension__ typedef unsigned int __useconds_t;
3069 __extension__ typedef long int __suseconds_t;
3070 __extension__ typedef int __daddr_t;
3071 __extension__ typedef long int __swblk_t;
3072 __extension__ typedef int __key_t;
3073 __extension__ typedef int __clockid_t;
3074 __extension__ typedef void * __timer_t;
3075 __extension__ typedef long int __blksize_t;
3076 __extension__ typedef long int __blkcnt_t;
3077 __extension__ typedef __quad_t __blkcnt64_t;
3078 __extension__ typedef unsigned long int __fsblkcnt_t;
3079 __extension__ typedef __u_quad_t __fsblkcnt64_t;
3080 __extension__ typedef unsigned long int __fsfilcnt_t;
3081 __extension__ typedef __u_quad_t __fsfilcnt64_t;
3082 __extension__ typedef long int __ssize_t;
3083 typedef __off64_t __loff_t;
3084 typedef __quad_t *__qaddr_t;
3085 typedef char *__caddr_t;
3086 __extension__ typedef int __intptr_t;
3087 __extension__ typedef unsigned int __socklen_t;
3088 typedef __kernel_ipc_pid_t __ipc_pid_t;
3089 struct __sched_param
3091 int __sched_priority;
3093 struct _pthread_fastlock
3098 typedef struct _pthread_descr_struct *_pthread_descr;
3099 typedef struct __pthread_attr_s
3103 struct __sched_param __schedparam;
3107 int __stackaddr_set;
3113 struct _pthread_fastlock __c_lock;
3114 _pthread_descr __c_waiting;
3119 } pthread_condattr_t;
3120 typedef unsigned int pthread_key_t;
3125 _pthread_descr __m_owner;
3127 struct _pthread_fastlock __m_lock;
3132 } pthread_mutexattr_t;
3133 typedef int pthread_once_t;
3134 typedef struct _pthread_rwlock_t
3136 struct _pthread_fastlock __rw_lock;
3138 _pthread_descr __rw_writer;
3139 _pthread_descr __rw_read_waiting;
3140 _pthread_descr __rw_write_waiting;
3148 } pthread_rwlockattr_t;
3149 typedef volatile int pthread_spinlock_t;
3151 struct _pthread_fastlock __ba_lock;
3154 _pthread_descr __ba_waiting;
3155 } pthread_barrier_t;
3158 } pthread_barrierattr_t;
3159 typedef unsigned long int pthread_t;
3160 typedef struct __STDIO_FILE_STRUCT FILE;
3161 typedef struct __STDIO_FILE_STRUCT __FILE;
3169 int __sched_priority;
3172 extern int clone (int (*__fn) (void *__arg), void *__child_stack,
3173 int __flags, void *__arg, ...) throw ();
3175 typedef unsigned long int __cpu_mask;
3178 __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
3181 extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
3183 extern int sched_getparam (__pid_t __pid, struct sched_param *__param) throw ();
3184 extern int sched_setscheduler (__pid_t __pid, int __policy,
3185 __const struct sched_param *__param) throw ();
3186 extern int sched_getscheduler (__pid_t __pid) throw ();
3187 extern int sched_yield (void) throw ();
3188 extern int sched_get_priority_max (int __algorithm) throw ();
3189 extern int sched_get_priority_min (int __algorithm) throw ();
3190 extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw ();
3191 extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
3192 __const cpu_set_t *__cpuset) throw ();
3193 extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
3194 cpu_set_t *__cpuset) throw ();
3197 typedef __clock_t clock_t;
3198 typedef __time_t time_t;
3199 typedef __clockid_t clockid_t;
3200 typedef __timer_t timer_t;
3213 __const char *tm_zone;
3217 struct timespec it_interval;
3218 struct timespec it_value;
3221 typedef __pid_t pid_t;
3222 extern clock_t clock (void) throw ();
3223 extern time_t time (time_t *__timer) throw ();
3224 extern double difftime (time_t __time1, time_t __time0)
3225 throw () __attribute__ ((__const__));
3226 extern time_t mktime (struct tm *__tp) throw ();
3227 extern size_t strftime (char *__restrict __s, size_t __maxsize,
3228 __const char *__restrict __format,
3229 __const struct tm *__restrict __tp) throw ();
3230 extern char *strptime (__const char *__restrict __s,
3231 __const char *__restrict __fmt, struct tm *__tp)
3233 extern struct tm *gmtime (__const time_t *__timer) throw ();
3234 extern struct tm *localtime (__const time_t *__timer) throw ();
3235 extern struct tm *gmtime_r (__const time_t *__restrict __timer,
3236 struct tm *__restrict __tp) throw ();
3237 extern struct tm *localtime_r (__const time_t *__restrict __timer,
3238 struct tm *__restrict __tp) throw ();
3239 extern char *asctime (__const struct tm *__tp) throw ();
3240 extern char *ctime (__const time_t *__timer) throw ();
3241 extern char *asctime_r (__const struct tm *__restrict __tp,
3242 char *__restrict __buf) throw ();
3243 extern char *ctime_r (__const time_t *__restrict __timer,
3244 char *__restrict __buf) throw ();
3245 extern char *tzname[2];
3246 extern void tzset (void) throw ();
3247 extern int daylight;
3248 extern long int timezone;
3249 extern int stime (__const time_t *__when) throw ();
3250 extern time_t timegm (struct tm *__tp) throw ();
3251 extern time_t timelocal (struct tm *__tp) throw ();
3252 extern int dysize (int __year) throw () __attribute__ ((__const__));
3253 extern int nanosleep (__const struct timespec *__requested_time,
3254 struct timespec *__remaining);
3255 extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw ();
3256 extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw ();
3257 extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
3259 extern int timer_create (clockid_t __clock_id,
3260 struct sigevent *__restrict __evp,
3261 timer_t *__restrict __timerid) throw ();
3262 extern int timer_delete (timer_t __timerid) throw ();
3263 extern int timer_settime (timer_t __timerid, int __flags,
3264 __const struct itimerspec *__restrict __value,
3265 struct itimerspec *__restrict __ovalue) throw ();
3266 extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
3268 extern int timer_getoverrun (timer_t __timerid) throw ();
3271 typedef int __sig_atomic_t;
3274 unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
3276 typedef __sigset_t sigset_t;
3281 PTHREAD_CREATE_JOINABLE,
3282 PTHREAD_CREATE_DETACHED
3286 PTHREAD_INHERIT_SCHED,
3287 PTHREAD_EXPLICIT_SCHED
3291 PTHREAD_SCOPE_SYSTEM,
3292 PTHREAD_SCOPE_PROCESS
3296 PTHREAD_MUTEX_ADAPTIVE_NP,
3297 PTHREAD_MUTEX_RECURSIVE_NP,
3298 PTHREAD_MUTEX_ERRORCHECK_NP,
3299 PTHREAD_MUTEX_TIMED_NP
3301 PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_ADAPTIVE_NP,
3302 PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
3303 PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
3304 PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
3305 , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_ADAPTIVE_NP
3309 PTHREAD_PROCESS_PRIVATE,
3310 PTHREAD_PROCESS_SHARED
3314 PTHREAD_RWLOCK_PREFER_READER_NP,
3315 PTHREAD_RWLOCK_PREFER_WRITER_NP,
3316 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
3317 PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_WRITER_NP
3319 struct _pthread_cleanup_buffer
3321 void (*__routine) (void *);
3324 struct _pthread_cleanup_buffer *__prev;
3328 PTHREAD_CANCEL_ENABLE,
3329 PTHREAD_CANCEL_DISABLE
3333 PTHREAD_CANCEL_DEFERRED,
3334 PTHREAD_CANCEL_ASYNCHRONOUS
3336 extern int pthread_create (pthread_t *__restrict __threadp,
3337 __const pthread_attr_t *__restrict __attr,
3338 void *(*__start_routine) (void *),
3339 void *__restrict __arg) throw ();
3340 extern pthread_t pthread_self (void) throw ();
3341 extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) throw ();
3342 extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
3343 extern int pthread_join (pthread_t __th, void **__thread_return);
3344 extern int pthread_detach (pthread_t __th) throw ();
3345 extern int pthread_attr_init (pthread_attr_t *__attr) throw ();
3346 extern int pthread_attr_destroy (pthread_attr_t *__attr) throw ();
3347 extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
3348 int __detachstate) throw ();
3349 extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
3350 int *__detachstate) throw ();
3351 extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
3352 __const struct sched_param *__restrict
3354 extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
3356 struct sched_param *__restrict __param)
3358 extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
3360 extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
3361 __attr, int *__restrict __policy)
3363 extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
3364 int __inherit) throw ();
3365 extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
3366 __attr, int *__restrict __inherit)
3368 extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
3370 extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
3371 int *__restrict __scope) throw ();
3372 extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
3373 size_t __guardsize) throw ();
3374 extern int pthread_attr_getguardsize (__const pthread_attr_t *__restrict
3375 __attr, size_t *__restrict __guardsize)
3377 extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
3378 void *__stackaddr) throw ();
3379 extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
3380 __attr, void **__restrict __stackaddr)
3382 extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
3383 size_t __stacksize) throw ();
3384 extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
3385 void **__restrict __stackaddr,
3386 size_t *__restrict __stacksize) throw ();
3387 extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
3388 size_t __stacksize) throw ();
3389 extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
3390 __attr, size_t *__restrict __stacksize)
3392 extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
3393 __const struct sched_param *__param)
3395 extern int pthread_getschedparam (pthread_t __target_thread,
3396 int *__restrict __policy,
3397 struct sched_param *__restrict __param)
3399 extern int pthread_getconcurrency (void) throw ();
3400 extern int pthread_setconcurrency (int __level) throw ();
3401 extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex,
3402 __const pthread_mutexattr_t *__restrict
3403 __mutex_attr) throw ();
3404 extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) throw ();
3405 extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) throw ();
3406 extern int pthread_mutex_lock (pthread_mutex_t *__mutex) throw ();
3407 extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
3408 __const struct timespec *__restrict
3409 __abstime) throw ();
3410 extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) throw ();
3411 extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) throw ();
3412 extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) throw ();
3413 extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
3415 int *__restrict __pshared) throw ();
3416 extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
3417 int __pshared) throw ();
3418 extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
3420 extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
3421 __attr, int *__restrict __kind) throw ();
3422 extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
3423 __const pthread_condattr_t *__restrict
3424 __cond_attr) throw ();
3425 extern int pthread_cond_destroy (pthread_cond_t *__cond) throw ();
3426 extern int pthread_cond_signal (pthread_cond_t *__cond) throw ();
3427 extern int pthread_cond_broadcast (pthread_cond_t *__cond) throw ();
3428 extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
3429 pthread_mutex_t *__restrict __mutex);
3430 extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
3431 pthread_mutex_t *__restrict __mutex,
3432 __const struct timespec *__restrict
3434 extern int pthread_condattr_init (pthread_condattr_t *__attr) throw ();
3435 extern int pthread_condattr_destroy (pthread_condattr_t *__attr) throw ();
3436 extern int pthread_condattr_getpshared (__const pthread_condattr_t *
3438 int *__restrict __pshared) throw ();
3439 extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
3440 int __pshared) throw ();
3441 extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
3442 __const pthread_rwlockattr_t *__restrict
3444 extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) throw ();
3445 extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) throw ();
3446 extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) throw ();
3447 extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
3448 __const struct timespec *__restrict
3449 __abstime) throw ();
3450 extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) throw ();
3451 extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) throw ();
3452 extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
3453 __const struct timespec *__restrict
3454 __abstime) throw ();
3455 extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) throw ();
3456 extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) throw ();
3457 extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) throw ();
3458 extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
3460 int *__restrict __pshared) throw ();
3461 extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
3462 int __pshared) throw ();
3463 extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *__attr,
3464 int *__pref) throw ();
3465 extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
3466 int __pref) throw ();
3467 extern int pthread_key_create (pthread_key_t *__key,
3468 void (*__destr_function) (void *)) throw ();
3469 extern int pthread_key_delete (pthread_key_t __key) throw ();
3470 extern int pthread_setspecific (pthread_key_t __key,
3471 __const void *__pointer) throw ();
3472 extern void *pthread_getspecific (pthread_key_t __key) throw ();
3473 extern int pthread_once (pthread_once_t *__once_control,
3474 void (*__init_routine) (void));
3475 extern int pthread_setcancelstate (int __state, int *__oldstate);
3476 extern int pthread_setcanceltype (int __type, int *__oldtype);
3477 extern int pthread_cancel (pthread_t __cancelthread);
3478 extern void pthread_testcancel (void);
3479 extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer,
3480 void (*__routine) (void *),
3481 void *__arg) throw ();
3482 extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer,
3483 int __execute) throw ();
3484 extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer,
3485 void (*__routine) (void *),
3486 void *__arg) throw ();
3487 extern void __pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer,
3488 void (*__routine) (void *),
3489 void *__arg) throw ();
3490 extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer,
3491 int __execute) throw ();
3492 extern void __pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer,
3493 int __execute) throw ();
3494 extern int pthread_sigmask (int __how,
3495 __const __sigset_t *__restrict __newmask,
3496 __sigset_t *__restrict __oldmask)throw ();
3497 extern int pthread_kill (pthread_t __threadid, int __signo) throw ();
3498 extern int pthread_atfork (void (*__prepare) (void),
3499 void (*__parent) (void),
3500 void (*__child) (void)) throw ();
3501 extern void pthread_kill_other_threads_np (void) throw ();
3509 typedef __off64_t __offmax_t;
3510 struct __STDIO_FILE_STRUCT {
3511 unsigned short __modeflags;
3512 unsigned char __ungot[2];
3514 unsigned char *__bufstart;
3515 unsigned char *__bufend;
3516 unsigned char *__bufpos;
3517 unsigned char *__bufread;
3518 unsigned char *__bufgetc_u;
3519 unsigned char *__bufputc_u;
3520 struct __STDIO_FILE_STRUCT *__nextopen;
3522 pthread_mutex_t __lock;
3524 extern int __fgetc_unlocked(FILE *__stream);
3525 extern int __fputc_unlocked(int __c, FILE *__stream);
3526 extern FILE *__stdin;
3527 extern FILE *__stdout;
3528 typedef __builtin_va_list __gnuc_va_list;
3529 typedef __STDIO_fpos_t fpos_t;
3530 typedef __STDIO_fpos64_t fpos64_t;
3532 extern FILE *stdout;
3533 extern FILE *stderr;
3534 extern int remove (__const char *__filename) throw ();
3535 extern int rename (__const char *__old, __const char *__new) throw ();
3536 extern FILE *tmpfile (void) ;
3537 extern FILE *tmpfile64 (void) ;
3538 extern char *tmpnam (char *__s) throw () ;
3539 extern char *tmpnam_r (char *__s) throw () ;
3540 extern char *tempnam (__const char *__dir, __const char *__pfx)
3541 throw () __attribute__ ((__malloc__)) ;
3542 extern int fclose (FILE *__stream);
3543 extern int fflush (FILE *__stream);
3544 extern int fflush_unlocked (FILE *__stream);
3545 extern int fcloseall (void);
3546 extern FILE *fopen (__const char *__restrict __filename,
3547 __const char *__restrict __modes) ;
3548 extern FILE *freopen (__const char *__restrict __filename,
3549 __const char *__restrict __modes,
3550 FILE *__restrict __stream) ;
3551 extern FILE *fopen64 (__const char *__restrict __filename,
3552 __const char *__restrict __modes) ;
3553 extern FILE *freopen64 (__const char *__restrict __filename,
3554 __const char *__restrict __modes,
3555 FILE *__restrict __stream) ;
3556 extern FILE *fdopen (int __fd, __const char *__modes) throw () ;
3557 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();
3558 extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
3559 int __modes, size_t __n) throw ();
3560 extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
3561 size_t __size) throw ();
3562 extern void setlinebuf (FILE *__stream) throw ();
3563 extern int fprintf (FILE *__restrict __stream,
3564 __const char *__restrict __format, ...);
3565 extern int printf (__const char *__restrict __format, ...);
3566 extern int sprintf (char *__restrict __s,
3567 __const char *__restrict __format, ...) throw ();
3568 extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
3569 __gnuc_va_list __arg);
3570 extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
3571 extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
3572 __gnuc_va_list __arg) throw ();
3573 extern int snprintf (char *__restrict __s, size_t __maxlen,
3574 __const char *__restrict __format, ...)
3575 throw () __attribute__ ((__format__ (__printf__, 3, 4)));
3576 extern int vsnprintf (char *__restrict __s, size_t __maxlen,
3577 __const char *__restrict __format, __gnuc_va_list __arg)
3578 throw () __attribute__ ((__format__ (__printf__, 3, 0)));
3579 extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
3580 __gnuc_va_list __arg)
3581 throw () __attribute__ ((__format__ (__printf__, 2, 0))) ;
3582 extern int asprintf (char **__restrict __ptr,
3583 __const char *__restrict __fmt, ...)
3584 throw () __attribute__ ((__format__ (__printf__, 2, 3))) ;
3585 extern int vdprintf (int __fd, __const char *__restrict __fmt,
3586 __gnuc_va_list __arg)
3587 __attribute__ ((__format__ (__printf__, 2, 0)));
3588 extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
3589 __attribute__ ((__format__ (__printf__, 2, 3)));
3590 extern int fscanf (FILE *__restrict __stream,
3591 __const char *__restrict __format, ...) ;
3592 extern int scanf (__const char *__restrict __format, ...) ;
3593 extern int sscanf (__const char *__restrict __s,
3594 __const char *__restrict __format, ...) throw ();
3595 extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
3596 __gnuc_va_list __arg)
3597 __attribute__ ((__format__ (__scanf__, 2, 0))) ;
3598 extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
3599 __attribute__ ((__format__ (__scanf__, 1, 0))) ;
3600 extern int vsscanf (__const char *__restrict __s,
3601 __const char *__restrict __format, __gnuc_va_list __arg)
3602 throw () __attribute__ ((__format__ (__scanf__, 2, 0)));
3603 extern int fgetc (FILE *__stream);
3604 extern int getc (FILE *__stream);
3605 extern int getchar (void);
3606 extern int getc_unlocked (FILE *__stream);
3607 extern int getchar_unlocked (void);
3608 extern int fgetc_unlocked (FILE *__stream);
3609 extern int fputc (int __c, FILE *__stream);
3610 extern int putc (int __c, FILE *__stream);
3611 extern int putchar (int __c);
3612 extern int fputc_unlocked (int __c, FILE *__stream);
3613 extern int putc_unlocked (int __c, FILE *__stream);
3614 extern int putchar_unlocked (int __c);
3615 extern int getw (FILE *__stream);
3616 extern int putw (int __w, FILE *__stream);
3617 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
3619 extern char *gets (char *__s) ;
3620 extern char *fgets_unlocked (char *__restrict __s, int __n,
3621 FILE *__restrict __stream) ;
3622 extern __ssize_t getdelim (char **__restrict __lineptr,
3623 size_t *__restrict __n, int __delimiter,
3624 FILE *__restrict __stream) ;
3625 extern __ssize_t getline (char **__restrict __lineptr,
3626 size_t *__restrict __n,
3627 FILE *__restrict __stream) ;
3628 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
3629 extern int puts (__const char *__s);
3630 extern int ungetc (int __c, FILE *__stream);
3631 extern size_t fread (void *__restrict __ptr, size_t __size,
3632 size_t __n, FILE *__restrict __stream) ;
3633 extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
3634 size_t __n, FILE *__restrict __s) ;
3635 extern int fputs_unlocked (__const char *__restrict __s,
3636 FILE *__restrict __stream);
3637 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
3638 size_t __n, FILE *__restrict __stream) ;
3639 extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
3640 size_t __n, FILE *__restrict __stream) ;
3641 extern int fseek (FILE *__stream, long int __off, int __whence);
3642 extern long int ftell (FILE *__stream) ;
3643 extern void rewind (FILE *__stream);
3644 extern int fseeko (FILE *__stream, __off_t __off, int __whence);
3645 extern __off_t ftello (FILE *__stream) ;
3646 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
3647 extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
3648 extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
3649 extern __off64_t ftello64 (FILE *__stream) ;
3650 extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
3651 extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);
3652 extern void clearerr (FILE *__stream) throw ();
3653 extern int feof (FILE *__stream) throw () ;
3654 extern int ferror (FILE *__stream) throw () ;
3655 extern void clearerr_unlocked (FILE *__stream) throw ();
3656 extern int feof_unlocked (FILE *__stream) throw () ;
3657 extern int ferror_unlocked (FILE *__stream) throw () ;
3658 extern void perror (__const char *__s);
3659 extern int fileno (FILE *__stream) throw () ;
3660 extern int fileno_unlocked (FILE *__stream) throw () ;
3661 extern FILE *popen (__const char *__command, __const char *__modes) ;
3662 extern int pclose (FILE *__stream);
3663 extern char *ctermid (char *__s) throw ();
3664 extern char *cuserid (char *__s);
3665 extern void flockfile (FILE *__stream) throw ();
3666 extern int ftrylockfile (FILE *__stream) throw () ;
3667 extern void funlockfile (FILE *__stream) throw ();
3669 namespace std __attribute__ ((__visibility__ ("default"))) {
3714 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
3715 template<typename _CharT>
3718 typedef unsigned long int_type;
3719 typedef std::streampos pos_type;
3720 typedef std::streamoff off_type;
3721 typedef std::mbstate_t state_type;
3723 template<typename _CharT>
3726 typedef _CharT char_type;
3727 typedef typename _Char_types<_CharT>::int_type int_type;
3728 typedef typename _Char_types<_CharT>::pos_type pos_type;
3729 typedef typename _Char_types<_CharT>::off_type off_type;
3730 typedef typename _Char_types<_CharT>::state_type state_type;
3732 assign(char_type& __c1, const char_type& __c2)
3735 eq(const char_type& __c1, const char_type& __c2)
3736 { return __c1 == __c2; }
3738 lt(const char_type& __c1, const char_type& __c2)
3739 { return __c1 < __c2; }
3741 compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
3743 length(const char_type* __s);
3744 static const char_type*
3745 find(const char_type* __s, std::size_t __n, const char_type& __a);
3747 move(char_type* __s1, const char_type* __s2, std::size_t __n);
3749 copy(char_type* __s1, const char_type* __s2, std::size_t __n);
3751 assign(char_type* __s, std::size_t __n, char_type __a);
3753 to_char_type(const int_type& __c)
3754 { return static_cast<char_type>(__c); }
3756 to_int_type(const char_type& __c)
3757 { return static_cast<int_type>(__c); }
3759 eq_int_type(const int_type& __c1, const int_type& __c2)
3760 { return __c1 == __c2; }
3763 { return static_cast<int_type>((-1)); }
3765 not_eof(const int_type& __c)
3766 { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
3768 template<typename _CharT>
3770 char_traits<_CharT>::
3771 compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
3773 for (std::size_t __i = 0; __i < __n; ++__i)
3774 if (lt(__s1[__i], __s2[__i]))
3776 else if (lt(__s2[__i], __s1[__i]))
3780 template<typename _CharT>
3782 char_traits<_CharT>::
3783 length(const char_type* __p)
3785 std::size_t __i = 0;
3786 while (!eq(__p[__i], char_type()))
3790 template<typename _CharT>
3791 const typename char_traits<_CharT>::char_type*
3792 char_traits<_CharT>::
3793 find(const char_type* __s, std::size_t __n, const char_type& __a)
3795 for (std::size_t __i = 0; __i < __n; ++__i)
3796 if (eq(__s[__i], __a))
3800 template<typename _CharT>
3801 typename char_traits<_CharT>::char_type*
3802 char_traits<_CharT>::
3803 move(char_type* __s1, const char_type* __s2, std::size_t __n)
3805 return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
3806 __n * sizeof(char_type)));
3808 template<typename _CharT>
3809 typename char_traits<_CharT>::char_type*
3810 char_traits<_CharT>::
3811 copy(char_type* __s1, const char_type* __s2, std::size_t __n)
3813 std::copy(__s2, __s2 + __n, __s1);
3816 template<typename _CharT>
3817 typename char_traits<_CharT>::char_type*
3818 char_traits<_CharT>::
3819 assign(char_type* __s, std::size_t __n, char_type __a)
3821 std::fill_n(__s, __n, __a);
3825 namespace std __attribute__ ((__visibility__ ("default"))) {
3826 template<class _CharT>
3827 struct char_traits : public __gnu_cxx::char_traits<_CharT>
3830 struct char_traits<char>
3832 typedef char char_type;
3833 typedef int int_type;
3834 typedef streampos pos_type;
3835 typedef streamoff off_type;
3836 typedef mbstate_t state_type;
3838 assign(char_type& __c1, const char_type& __c2)
3841 eq(const char_type& __c1, const char_type& __c2)
3842 { return __c1 == __c2; }
3844 lt(const char_type& __c1, const char_type& __c2)
3845 { return __c1 < __c2; }
3847 compare(const char_type* __s1, const char_type* __s2, size_t __n)
3848 { return __builtin_memcmp(__s1, __s2, __n); }
3850 length(const char_type* __s)
3851 { return __builtin_strlen(__s); }
3852 static const char_type*
3853 find(const char_type* __s, size_t __n, const char_type& __a)
3854 { return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); }
3856 move(char_type* __s1, const char_type* __s2, size_t __n)
3857 { return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n)); }
3859 copy(char_type* __s1, const char_type* __s2, size_t __n)
3860 { return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n)); }
3862 assign(char_type* __s, size_t __n, char_type __a)
3863 { return static_cast<char_type*>(__builtin_memset(__s, __a, __n)); }
3865 to_char_type(const int_type& __c)
3866 { return static_cast<char_type>(__c); }
3868 to_int_type(const char_type& __c)
3869 { return static_cast<int_type>(static_cast<unsigned char>(__c)); }
3871 eq_int_type(const int_type& __c1, const int_type& __c2)
3872 { return __c1 == __c2; }
3874 eof() { return static_cast<int_type>((-1)); }
3876 not_eof(const int_type& __c)
3877 { return (__c == eof()) ? 0 : __c; }
3883 char *decimal_point;
3884 char *thousands_sep;
3886 char *int_curr_symbol;
3887 char *currency_symbol;
3888 char *mon_decimal_point;
3889 char *mon_thousands_sep;
3891 char *positive_sign;
3892 char *negative_sign;
3893 char int_frac_digits;
3896 char p_sep_by_space;
3898 char n_sep_by_space;
3901 char int_p_cs_precedes;
3902 char int_p_sep_by_space;
3903 char int_n_cs_precedes;
3904 char int_n_sep_by_space;
3905 char int_p_sign_posn;
3906 char int_n_sign_posn;
3908 extern char *setlocale (int __category, __const char *__locale) throw ();
3909 extern struct lconv *localeconv (void) throw ();
3911 namespace std __attribute__ ((__visibility__ ("default"))) {
3916 namespace std __attribute__ ((__visibility__ ("default"))) {
3917 typedef int* __c_locale;
3919 __convert_from_v(const __c_locale&, char* __out,
3920 const int __size __attribute__((__unused__)),
3921 const char* __fmt, ...)
3923 char* __old = std::setlocale(1, __null);
3924 char* __sav = __null;
3925 if (__builtin_strcmp(__old, "C"))
3927 const size_t __len = __builtin_strlen(__old) + 1;
3928 __sav = new char[__len];
3929 __builtin_memcpy(__sav, __old, __len);
3930 std::setlocale(1, "C");
3932 __builtin_va_list __args;
3933 __builtin_va_start(__args, __fmt);
3934 const int __ret = __builtin_vsprintf(__out, __fmt, __args);
3935 __builtin_va_end(__args);
3938 std::setlocale(1, __sav);
3947 _ISupper = (1 << (0)),
3948 _ISlower = (1 << (1)),
3949 _ISalpha = (1 << (2)),
3950 _ISdigit = (1 << (3)),
3951 _ISxdigit = (1 << (4)),
3952 _ISspace = (1 << (5)),
3953 _ISprint = (1 << (6)),
3954 _ISgraph = (1 << (7)),
3955 _ISblank = (1 << (8)),
3956 _IScntrl = (1 << (9)),
3957 _ISpunct = (1 << (10)),
3958 _ISalnum = (1 << (11))
3960 typedef __uint16_t __ctype_mask_t;
3961 typedef __int16_t __ctype_touplow_t;
3962 extern const __ctype_mask_t *__C_ctype_b;
3963 extern const __ctype_touplow_t *__C_ctype_toupper;
3964 extern const __ctype_touplow_t *__C_ctype_tolower;
3965 extern const __ctype_mask_t *__ctype_b;
3966 extern const __ctype_touplow_t *__ctype_toupper;
3967 extern const __ctype_touplow_t *__ctype_tolower;
3968 extern int isalnum (int) throw ();
3969 extern int isalpha (int) throw ();
3970 extern int iscntrl (int) throw ();
3971 extern int isdigit (int) throw ();
3972 extern int islower (int) throw ();
3973 extern int isgraph (int) throw ();
3974 extern int isprint (int) throw ();
3975 extern int ispunct (int) throw ();
3976 extern int isspace (int) throw ();
3977 extern int isupper (int) throw ();
3978 extern int isxdigit (int) throw ();
3979 extern int tolower (int __c) throw ();
3980 extern int toupper (int __c) throw ();
3981 extern int isblank (int) throw ();
3982 extern int isctype (int __c, int __mask) throw ();
3983 extern int isascii (int __c) throw ();
3984 extern int toascii (int __c) throw ();
3985 extern int _toupper (int) throw ();
3986 extern int _tolower (int) throw ();
3988 namespace std __attribute__ ((__visibility__ ("default"))) {
4003 namespace std __attribute__ ((__visibility__ ("default"))) {
4005 template<typename _Facet>
4007 has_facet(const locale&) throw();
4008 template<typename _Facet>
4010 use_facet(const locale&);
4011 template<typename _CharT>
4013 isspace(_CharT, const locale&);
4014 template<typename _CharT>
4016 isprint(_CharT, const locale&);
4017 template<typename _CharT>
4019 iscntrl(_CharT, const locale&);
4020 template<typename _CharT>
4022 isupper(_CharT, const locale&);
4023 template<typename _CharT>
4025 islower(_CharT, const locale&);
4026 template<typename _CharT>
4028 isalpha(_CharT, const locale&);
4029 template<typename _CharT>
4031 isdigit(_CharT, const locale&);
4032 template<typename _CharT>
4034 ispunct(_CharT, const locale&);
4035 template<typename _CharT>
4037 isxdigit(_CharT, const locale&);
4038 template<typename _CharT>
4040 isalnum(_CharT, const locale&);
4041 template<typename _CharT>
4043 isgraph(_CharT, const locale&);
4044 template<typename _CharT>
4046 toupper(_CharT, const locale&);
4047 template<typename _CharT>
4049 tolower(_CharT, const locale&);
4051 template<typename _CharT>
4053 template<> class ctype<char>;
4054 template<typename _CharT>
4057 template<typename _InternT, typename _ExternT, typename _StateT>
4059 template<> class codecvt<char, char, mbstate_t>;
4060 template<typename _InternT, typename _ExternT, typename _StateT>
4061 class codecvt_byname;
4062 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
4064 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
4066 template<typename _CharT> class numpunct;
4067 template<typename _CharT> class numpunct_byname;
4068 template<typename _CharT>
4070 template<typename _CharT> class
4073 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
4075 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
4076 class time_get_byname;
4077 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
4079 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
4080 class time_put_byname;
4082 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
4084 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
4086 template<typename _CharT, bool _Intl = false>
4088 template<typename _CharT, bool _Intl = false>
4089 class moneypunct_byname;
4090 class messages_base;
4091 template<typename _CharT>
4093 template<typename _CharT>
4094 class messages_byname;
4097 typedef __ssize_t ssize_t;
4098 typedef __gid_t gid_t;
4099 typedef __uid_t uid_t;
4100 typedef __off_t off_t;
4101 typedef __off64_t off64_t;
4102 typedef __useconds_t useconds_t;
4103 typedef __socklen_t socklen_t;
4104 extern int access (__const char *__name, int __type) throw () __attribute__ ((__nonnull__ (1)));
4105 extern __off_t lseek (int __fd, __off_t __offset, int __whence) throw ();
4106 extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
4108 extern int close (int __fd);
4109 extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ;
4110 extern ssize_t write (int __fd, __const void *__buf, size_t __n) ;
4111 extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
4113 extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
4115 extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
4116 __off64_t __offset) ;
4117 extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n,
4118 __off64_t __offset) ;
4119 extern int pipe (int __pipedes[2]) throw () ;
4120 extern unsigned int alarm (unsigned int __seconds) throw ();
4121 extern unsigned int sleep (unsigned int __seconds);
4122 extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
4124 extern int usleep (__useconds_t __useconds);
4125 extern int pause (void);
4126 extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
4127 throw () __attribute__ ((__nonnull__ (1))) ;
4128 extern int fchown (int __fd, __uid_t __owner, __gid_t __group) throw () ;
4129 extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
4130 throw () __attribute__ ((__nonnull__ (1))) ;
4131 extern int chdir (__const char *__path) throw () __attribute__ ((__nonnull__ (1))) ;
4132 extern int fchdir (int __fd) throw () ;
4133 extern char *getcwd (char *__buf, size_t __size) throw () ;
4134 extern char *get_current_dir_name (void) throw ();
4135 extern int dup (int __fd) throw () ;
4136 extern int dup2 (int __fd, int __fd2) throw ();
4137 extern char **__environ;
4138 extern char **environ;
4139 extern int execve (__const char *__path, char *__const __argv[],
4140 char *__const __envp[]) throw () __attribute__ ((__nonnull__ (1)));
4141 extern int execv (__const char *__path, char *__const __argv[])
4142 throw () __attribute__ ((__nonnull__ (1)));
4143 extern int execle (__const char *__path, __const char *__arg, ...)
4144 throw () __attribute__ ((__nonnull__ (1)));
4145 extern int execl (__const char *__path, __const char *__arg, ...)
4146 throw () __attribute__ ((__nonnull__ (1)));
4147 extern int execvp (__const char *__file, char *__const __argv[])
4148 throw () __attribute__ ((__nonnull__ (1)));
4149 extern int execlp (__const char *__file, __const char *__arg, ...)
4150 throw () __attribute__ ((__nonnull__ (1)));
4151 extern int nice (int __inc) throw () ;
4152 extern void _exit (int __status) __attribute__ ((__noreturn__));
4161 _PC_CHOWN_RESTRICTED,
4169 _PC_REC_INCR_XFER_SIZE,
4170 _PC_REC_MAX_XFER_SIZE,
4171 _PC_REC_MIN_XFER_SIZE,
4188 _SC_REALTIME_SIGNALS,
4189 _SC_PRIORITY_SCHEDULING,
4191 _SC_ASYNCHRONOUS_IO,
4193 _SC_SYNCHRONIZED_IO,
4198 _SC_MEMORY_PROTECTION,
4199 _SC_MESSAGE_PASSING,
4201 _SC_SHARED_MEMORY_OBJECTS,
4204 _SC_AIO_PRIO_DELTA_MAX,
4219 _SC_COLL_WEIGHTS_MAX,
4220 _SC_EQUIV_CLASS_MAX,
4224 _SC_CHARCLASS_NAME_MAX,
4240 _SC_IOV_MAX = _SC_UIO_MAXIOV,
4241 _SC_PII_INTERNET_STREAM,
4242 _SC_PII_INTERNET_DGRAM,
4248 _SC_THREAD_SAFE_FUNCTIONS,
4249 _SC_GETGR_R_SIZE_MAX,
4250 _SC_GETPW_R_SIZE_MAX,
4253 _SC_THREAD_DESTRUCTOR_ITERATIONS,
4254 _SC_THREAD_KEYS_MAX,
4255 _SC_THREAD_STACK_MIN,
4256 _SC_THREAD_THREADS_MAX,
4257 _SC_THREAD_ATTR_STACKADDR,
4258 _SC_THREAD_ATTR_STACKSIZE,
4259 _SC_THREAD_PRIORITY_SCHEDULING,
4260 _SC_THREAD_PRIO_INHERIT,
4261 _SC_THREAD_PRIO_PROTECT,
4262 _SC_THREAD_PROCESS_SHARED,
4263 _SC_NPROCESSORS_CONF,
4264 _SC_NPROCESSORS_ONLN,
4270 _SC_XOPEN_XCU_VERSION,
4305 _SC_XBS5_ILP32_OFF32,
4306 _SC_XBS5_ILP32_OFFBIG,
4307 _SC_XBS5_LP64_OFF64,
4308 _SC_XBS5_LPBIG_OFFBIG,
4311 _SC_XOPEN_REALTIME_THREADS,
4316 _SC_C_LANG_SUPPORT_R,
4317 _SC_CLOCK_SELECTION,
4321 _SC_DEVICE_SPECIFIC,
4322 _SC_DEVICE_SPECIFIC_R,
4326 _SC_FILE_ATTRIBUTES,
4329 _SC_MONOTONIC_CLOCK,
4333 _SC_READER_WRITER_LOCKS,
4340 _SC_SPORADIC_SERVER,
4341 _SC_THREAD_SPORADIC_SERVER,
4342 _SC_SYSTEM_DATABASE,
4343 _SC_SYSTEM_DATABASE_R,
4345 _SC_TYPED_MEMORY_OBJECTS,
4349 _SC_2_PBS_ACCOUNTING,
4355 _SC_2_PBS_CHECKPOINT,
4357 _SC_V6_ILP32_OFFBIG,
4359 _SC_V6_LPBIG_OFFBIG,
4362 _SC_TRACE_EVENT_FILTER,
4365 _SC_LEVEL1_ICACHE_SIZE,
4366 _SC_LEVEL1_ICACHE_ASSOC,
4367 _SC_LEVEL1_ICACHE_LINESIZE,
4368 _SC_LEVEL1_DCACHE_SIZE,
4369 _SC_LEVEL1_DCACHE_ASSOC,
4370 _SC_LEVEL1_DCACHE_LINESIZE,
4371 _SC_LEVEL2_CACHE_SIZE,
4372 _SC_LEVEL2_CACHE_ASSOC,
4373 _SC_LEVEL2_CACHE_LINESIZE,
4374 _SC_LEVEL3_CACHE_SIZE,
4375 _SC_LEVEL3_CACHE_ASSOC,
4376 _SC_LEVEL3_CACHE_LINESIZE,
4377 _SC_LEVEL4_CACHE_SIZE,
4378 _SC_LEVEL4_CACHE_ASSOC,
4379 _SC_LEVEL4_CACHE_LINESIZE,
4380 _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
4386 _CS_V6_WIDTH_RESTRICTED_ENVS,
4387 _CS_LFS_CFLAGS = 1000,
4394 _CS_LFS64_LINTFLAGS,
4395 _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
4396 _CS_XBS5_ILP32_OFF32_LDFLAGS,
4397 _CS_XBS5_ILP32_OFF32_LIBS,
4398 _CS_XBS5_ILP32_OFF32_LINTFLAGS,
4399 _CS_XBS5_ILP32_OFFBIG_CFLAGS,
4400 _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
4401 _CS_XBS5_ILP32_OFFBIG_LIBS,
4402 _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
4403 _CS_XBS5_LP64_OFF64_CFLAGS,
4404 _CS_XBS5_LP64_OFF64_LDFLAGS,
4405 _CS_XBS5_LP64_OFF64_LIBS,
4406 _CS_XBS5_LP64_OFF64_LINTFLAGS,
4407 _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
4408 _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
4409 _CS_XBS5_LPBIG_OFFBIG_LIBS,
4410 _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
4411 _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
4412 _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
4413 _CS_POSIX_V6_ILP32_OFF32_LIBS,
4414 _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
4415 _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
4416 _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
4417 _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
4418 _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
4419 _CS_POSIX_V6_LP64_OFF64_CFLAGS,
4420 _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
4421 _CS_POSIX_V6_LP64_OFF64_LIBS,
4422 _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
4423 _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
4424 _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
4425 _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
4426 _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
4428 extern long int pathconf (__const char *__path, int __name)
4429 throw () __attribute__ ((__nonnull__ (1)));
4430 extern long int fpathconf (int __fd, int __name) throw ();
4431 extern long int sysconf (int __name) throw ();
4432 extern size_t confstr (int __name, char *__buf, size_t __len) throw ();
4433 extern __pid_t getpid (void) throw ();
4434 extern __pid_t getppid (void) throw ();
4435 extern __pid_t getpgrp (void) throw ();
4436 extern __pid_t __getpgid (__pid_t __pid) throw ();
4437 extern __pid_t getpgid (__pid_t __pid) throw ();
4438 extern int setpgid (__pid_t __pid, __pid_t __pgid) throw ();
4439 extern int setpgrp (void) throw ();
4440 extern __pid_t setsid (void) throw ();
4441 extern __pid_t getsid (__pid_t __pid) throw ();
4442 extern __uid_t getuid (void) throw ();
4443 extern __uid_t geteuid (void) throw ();
4444 extern __gid_t getgid (void) throw ();
4445 extern __gid_t getegid (void) throw ();
4446 extern int getgroups (int __size, __gid_t __list[]) throw () ;
4447 extern int setuid (__uid_t __uid) throw ();
4448 extern int setreuid (__uid_t __ruid, __uid_t __euid) throw ();
4449 extern int seteuid (__uid_t __uid) throw ();
4450 extern int setgid (__gid_t __gid) throw ();
4451 extern int setregid (__gid_t __rgid, __gid_t __egid) throw ();
4452 extern int setegid (__gid_t __gid) throw ();
4453 extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
4455 extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
4457 extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
4459 extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
4461 extern __pid_t vfork (void) throw ();
4462 extern char *ttyname (int __fd) throw ();
4463 extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
4464 throw () __attribute__ ((__nonnull__ (2))) ;
4465 extern int isatty (int __fd) throw ();
4466 extern int link (__const char *__from, __const char *__to)
4467 throw () __attribute__ ((__nonnull__ (1, 2))) ;
4468 extern int symlink (__const char *__from, __const char *__to)
4469 throw () __attribute__ ((__nonnull__ (1, 2))) ;
4470 extern ssize_t readlink (__const char *__restrict __path,
4471 char *__restrict __buf, size_t __len)
4472 throw () __attribute__ ((__nonnull__ (1, 2))) ;
4473 extern int unlink (__const char *__name) throw () __attribute__ ((__nonnull__ (1)));
4474 extern int rmdir (__const char *__path) throw () __attribute__ ((__nonnull__ (1)));
4475 extern __pid_t tcgetpgrp (int __fd) throw ();
4476 extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) throw ();
4477 extern char *getlogin (void);
4478 extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)));
4480 extern char *optarg;
4484 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
4487 extern int gethostname (char *__name, size_t __len) throw () __attribute__ ((__nonnull__ (1)));
4488 extern int sethostname (__const char *__name, size_t __len)
4489 throw () __attribute__ ((__nonnull__ (1))) ;
4490 extern int sethostid (long int __id) throw () ;
4491 extern int getdomainname (char *__name, size_t __len)
4492 throw () __attribute__ ((__nonnull__ (1))) ;
4493 extern int setdomainname (__const char *__name, size_t __len)
4494 throw () __attribute__ ((__nonnull__ (1))) ;
4495 extern int vhangup (void) throw ();
4496 extern int acct (__const char *__name) throw ();
4497 extern char *getusershell (void) throw ();
4498 extern void endusershell (void) throw ();
4499 extern void setusershell (void) throw ();
4500 extern int daemon (int __nochdir, int __noclose) throw () ;
4501 extern int chroot (__const char *__path) throw () __attribute__ ((__nonnull__ (1))) ;
4502 extern char *getpass (__const char *__prompt) __attribute__ ((__nonnull__ (1)));
4503 extern int fsync (int __fd);
4504 extern long int gethostid (void);
4505 extern void sync (void) throw ();
4506 extern int getpagesize (void) throw () __attribute__ ((__const__));
4507 extern int getdtablesize (void) throw ();
4508 extern int truncate (__const char *__file, __off_t __length)
4509 throw () __attribute__ ((__nonnull__ (1))) ;
4510 extern int truncate64 (__const char *__file, __off64_t __length)
4511 throw () __attribute__ ((__nonnull__ (1))) ;
4512 extern int ftruncate (int __fd, __off_t __length) throw () ;
4513 extern int ftruncate64 (int __fd, __off64_t __length) throw () ;
4514 extern int brk (void *__addr) throw () ;
4515 extern void *sbrk (intptr_t __delta) throw ();
4516 extern long int syscall (long int __sysno, ...) throw ();
4517 extern int lockf (int __fd, int __cmd, __off_t __len) ;
4518 extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
4519 extern int fdatasync (int __fildes) throw ();
4520 extern char *crypt (__const char *__key, __const char *__salt)
4521 throw () __attribute__ ((__nonnull__ (1, 2)));
4522 extern void encrypt (char *__block, int __edflag) throw () __attribute__ ((__nonnull__ (1)));
4523 extern void swab (__const void *__restrict __from, void *__restrict __to,
4524 ssize_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
4525 extern char *ctermid (char *__s) throw ();
4527 typedef pthread_key_t __gthread_key_t;
4528 typedef pthread_once_t __gthread_once_t;
4529 typedef pthread_mutex_t __gthread_mutex_t;
4530 typedef pthread_mutex_t __gthread_recursive_mutex_t;
4531 typedef pthread_cond_t __gthread_cond_t;
4532 static __typeof(pthread_once) __gthrw_pthread_once __attribute__ ((__weakref__("pthread_once")));
4533 static __typeof(pthread_getspecific) __gthrw_pthread_getspecific __attribute__ ((__weakref__("pthread_getspecific")));
4534 static __typeof(pthread_setspecific) __gthrw_pthread_setspecific __attribute__ ((__weakref__("pthread_setspecific")));
4535 static __typeof(pthread_create) __gthrw_pthread_create __attribute__ ((__weakref__("pthread_create")));
4536 static __typeof(pthread_cancel) __gthrw_pthread_cancel __attribute__ ((__weakref__("pthread_cancel")));
4537 static __typeof(pthread_mutex_lock) __gthrw_pthread_mutex_lock __attribute__ ((__weakref__("pthread_mutex_lock")));
4538 static __typeof(pthread_mutex_trylock) __gthrw_pthread_mutex_trylock __attribute__ ((__weakref__("pthread_mutex_trylock")));
4539 static __typeof(pthread_mutex_unlock) __gthrw_pthread_mutex_unlock __attribute__ ((__weakref__("pthread_mutex_unlock")));
4540 static __typeof(pthread_mutex_init) __gthrw_pthread_mutex_init __attribute__ ((__weakref__("pthread_mutex_init")));
4541 static __typeof(pthread_cond_broadcast) __gthrw_pthread_cond_broadcast __attribute__ ((__weakref__("pthread_cond_broadcast")));
4542 static __typeof(pthread_cond_wait) __gthrw_pthread_cond_wait __attribute__ ((__weakref__("pthread_cond_wait")));
4543 static __typeof(pthread_key_create) __gthrw_pthread_key_create __attribute__ ((__weakref__("pthread_key_create")));
4544 static __typeof(pthread_key_delete) __gthrw_pthread_key_delete __attribute__ ((__weakref__("pthread_key_delete")));
4545 static __typeof(pthread_mutexattr_init) __gthrw_pthread_mutexattr_init __attribute__ ((__weakref__("pthread_mutexattr_init")));
4546 static __typeof(pthread_mutexattr_settype) __gthrw_pthread_mutexattr_settype __attribute__ ((__weakref__("pthread_mutexattr_settype")));
4547 static __typeof(pthread_mutexattr_destroy) __gthrw_pthread_mutexattr_destroy __attribute__ ((__weakref__("pthread_mutexattr_destroy")));
4549 __gthread_active_p (void)
4551 static void *const __gthread_active_ptr
4552 = __extension__ (void *) &__gthrw_pthread_cancel;
4553 return __gthread_active_ptr != 0;
4556 __gthread_once (__gthread_once_t *once, void (*func) (void))
4558 if (__gthread_active_p ())
4559 return __gthrw_pthread_once (once, func);
4564 __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
4566 return __gthrw_pthread_key_create (key, dtor);
4569 __gthread_key_delete (__gthread_key_t key)
4571 return __gthrw_pthread_key_delete (key);
4573 static inline void *
4574 __gthread_getspecific (__gthread_key_t key)
4576 return __gthrw_pthread_getspecific (key);
4579 __gthread_setspecific (__gthread_key_t key, const void *ptr)
4581 return __gthrw_pthread_setspecific (key, ptr);
4584 __gthread_mutex_lock (__gthread_mutex_t *mutex)
4586 if (__gthread_active_p ())
4587 return __gthrw_pthread_mutex_lock (mutex);
4592 __gthread_mutex_trylock (__gthread_mutex_t *mutex)
4594 if (__gthread_active_p ())
4595 return __gthrw_pthread_mutex_trylock (mutex);
4600 __gthread_mutex_unlock (__gthread_mutex_t *mutex)
4602 if (__gthread_active_p ())
4603 return __gthrw_pthread_mutex_unlock (mutex);
4608 __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex)
4610 return __gthread_mutex_lock (mutex);
4613 __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex)
4615 return __gthread_mutex_trylock (mutex);
4618 __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex)
4620 return __gthread_mutex_unlock (mutex);
4623 __gthread_cond_broadcast (__gthread_cond_t *cond)
4625 return __gthrw_pthread_cond_broadcast (cond);
4628 __gthread_cond_wait (__gthread_cond_t *cond, __gthread_mutex_t *mutex)
4630 return __gthrw_pthread_cond_wait (cond, mutex);
4633 __gthread_cond_wait_recursive (__gthread_cond_t *cond,
4634 __gthread_recursive_mutex_t *mutex)
4636 return __gthread_cond_wait (cond, mutex);
4638 typedef int _Atomic_word;
4639 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
4640 static inline _Atomic_word
4641 __exchange_and_add(volatile _Atomic_word* __mem, int __val)
4642 { return __sync_fetch_and_add(__mem, __val); }
4644 __atomic_add(volatile _Atomic_word* __mem, int __val)
4645 { __sync_fetch_and_add(__mem, __val); }
4646 static inline _Atomic_word
4647 __exchange_and_add_single(_Atomic_word* __mem, int __val)
4649 _Atomic_word __result = *__mem;
4654 __atomic_add_single(_Atomic_word* __mem, int __val)
4655 { *__mem += __val; }
4656 static inline _Atomic_word
4657 __attribute__ ((__unused__))
4658 __exchange_and_add_dispatch(_Atomic_word* __mem, int __val)
4660 if (__gthread_active_p())
4661 return __exchange_and_add(__mem, __val);
4663 return __exchange_and_add_single(__mem, __val);
4666 __attribute__ ((__unused__))
4667 __atomic_add_dispatch(_Atomic_word* __mem, int __val)
4669 if (__gthread_active_p())
4670 __atomic_add(__mem, __val);
4672 __atomic_add_single(__mem, __val);
4678 class bad_alloc : public exception
4681 bad_alloc() throw() { }
4682 virtual ~bad_alloc() throw();
4683 virtual const char* what() const throw();
4685 struct nothrow_t { };
4686 extern const nothrow_t nothrow;
4687 typedef void (*new_handler)();
4688 new_handler set_new_handler(new_handler) throw();
4690 void* operator new(std::size_t) throw (std::bad_alloc);
4691 void* operator new[](std::size_t) throw (std::bad_alloc);
4692 void operator delete(void*) throw();
4693 void operator delete[](void*) throw();
4694 void* operator new(std::size_t, const std::nothrow_t&) throw();
4695 void* operator new[](std::size_t, const std::nothrow_t&) throw();
4696 void operator delete(void*, const std::nothrow_t&) throw();
4697 void operator delete[](void*, const std::nothrow_t&) throw();
4698 inline void* operator new(std::size_t, void* __p) throw() { return __p; }
4699 inline void* operator new[](std::size_t, void* __p) throw() { return __p; }
4700 inline void operator delete (void*, void*) throw() { }
4701 inline void operator delete[](void*, void*) throw() { }
4703 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
4705 using std::ptrdiff_t;
4706 template<typename _Tp>
4710 typedef size_t size_type;
4711 typedef ptrdiff_t difference_type;
4712 typedef _Tp* pointer;
4713 typedef const _Tp* const_pointer;
4714 typedef _Tp& reference;
4715 typedef const _Tp& const_reference;
4716 typedef _Tp value_type;
4717 template<typename _Tp1>
4719 { typedef new_allocator<_Tp1> other; };
4720 new_allocator() throw() { }
4721 new_allocator(const new_allocator&) throw() { }
4722 template<typename _Tp1>
4723 new_allocator(const new_allocator<_Tp1>&) throw() { }
4724 ~new_allocator() throw() { }
4726 address(reference __x) const { return &__x; }
4728 address(const_reference __x) const { return &__x; }
4730 allocate(size_type __n, const void* = 0)
4732 if (__builtin_expect(__n > this->max_size(), false))
4733 std::__throw_bad_alloc();
4734 return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
4737 deallocate(pointer __p, size_type)
4738 { ::operator delete(__p); }
4740 max_size() const throw()
4741 { return size_t(-1) / sizeof(_Tp); }
4743 construct(pointer __p, const _Tp& __val)
4744 { ::new((void *)__p) _Tp(__val); }
4746 destroy(pointer __p) { __p->~_Tp(); }
4748 template<typename _Tp>
4750 operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
4752 template<typename _Tp>
4754 operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
4757 namespace std __attribute__ ((__visibility__ ("default"))) {
4758 template<typename _Tp>
4761 class allocator<void>
4764 typedef size_t size_type;
4765 typedef ptrdiff_t difference_type;
4766 typedef void* pointer;
4767 typedef const void* const_pointer;
4768 typedef void value_type;
4769 template<typename _Tp1>
4771 { typedef allocator<_Tp1> other; };
4773 template<typename _Tp>
4774 class allocator: public __gnu_cxx::new_allocator<_Tp>
4777 typedef size_t size_type;
4778 typedef ptrdiff_t difference_type;
4779 typedef _Tp* pointer;
4780 typedef const _Tp* const_pointer;
4781 typedef _Tp& reference;
4782 typedef const _Tp& const_reference;
4783 typedef _Tp value_type;
4784 template<typename _Tp1>
4786 { typedef allocator<_Tp1> other; };
4787 allocator() throw() { }
4788 allocator(const allocator& __a) throw()
4789 : __gnu_cxx::new_allocator<_Tp>(__a) { }
4790 template<typename _Tp1>
4791 allocator(const allocator<_Tp1>&) throw() { }
4792 ~allocator() throw() { }
4794 template<typename _T1, typename _T2>
4796 operator==(const allocator<_T1>&, const allocator<_T2>&)
4798 template<typename _Tp>
4800 operator==(const allocator<_Tp>&, const allocator<_Tp>&)
4802 template<typename _T1, typename _T2>
4804 operator!=(const allocator<_T1>&, const allocator<_T2>&)
4806 template<typename _Tp>
4808 operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
4810 extern template class allocator<char>;
4811 extern template class allocator<wchar_t>;
4812 template<typename _Alloc, bool = __is_empty(_Alloc)>
4814 { static void _S_do_it(_Alloc&, _Alloc&) { } };
4815 template<typename _Alloc>
4816 struct __alloc_swap<_Alloc, false>
4819 _S_do_it(_Alloc& __one, _Alloc& __two)
4825 template<typename _Alloc, bool = __is_empty(_Alloc)>
4829 _S_do_it(const _Alloc&, const _Alloc&)
4832 template<typename _Alloc>
4833 struct __alloc_neq<_Alloc, false>
4836 _S_do_it(const _Alloc& __one, const _Alloc& __two)
4837 { return __one != __two; }
4840 namespace __cxxabiv1
4842 class __forced_unwind
4844 virtual ~__forced_unwind() throw();
4845 virtual void __pure_dummy() = 0;
4848 namespace std __attribute__ ((__visibility__ ("default"))) {
4849 template<typename _CharT, typename _Traits>
4851 __ostream_write(basic_ostream<_CharT, _Traits>& __out,
4852 const _CharT* __s, streamsize __n)
4854 typedef basic_ostream<_CharT, _Traits> __ostream_type;
4855 typedef typename __ostream_type::ios_base __ios_base;
4856 const streamsize __put = __out.rdbuf()->sputn(__s, __n);
4858 __out.setstate(__ios_base::badbit);
4860 template<typename _CharT, typename _Traits>
4862 __ostream_fill(basic_ostream<_CharT, _Traits>& __out, streamsize __n)
4864 typedef basic_ostream<_CharT, _Traits> __ostream_type;
4865 typedef typename __ostream_type::ios_base __ios_base;
4866 const _CharT __c = __out.fill();
4867 for (; __n > 0; --__n)
4869 const typename _Traits::int_type __put = __out.rdbuf()->sputc(__c);
4870 if (_Traits::eq_int_type(__put, _Traits::eof()))
4872 __out.setstate(__ios_base::badbit);
4877 template<typename _CharT, typename _Traits>
4878 basic_ostream<_CharT, _Traits>&
4879 __ostream_insert(basic_ostream<_CharT, _Traits>& __out,
4880 const _CharT* __s, streamsize __n)
4882 typedef basic_ostream<_CharT, _Traits> __ostream_type;
4883 typedef typename __ostream_type::ios_base __ios_base;
4884 typename __ostream_type::sentry __cerb(__out);
4889 const streamsize __w = __out.width();
4892 const bool __left = ((__out.flags()
4893 & __ios_base::adjustfield)
4894 == __ios_base::left);
4896 __ostream_fill(__out, __w - __n);
4898 __ostream_write(__out, __s, __n);
4899 if (__left && __out.good())
4900 __ostream_fill(__out, __w - __n);
4903 __ostream_write(__out, __s, __n);
4906 catch(__cxxabiv1::__forced_unwind&)
4908 __out._M_setstate(__ios_base::badbit);
4912 { __out._M_setstate(__ios_base::badbit); }
4916 extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
4918 namespace std __attribute__ ((__visibility__ ("default"))) {
4919 template<typename _Arg, typename _Result>
4920 struct unary_function
4922 typedef _Arg argument_type;
4923 typedef _Result result_type;
4925 template<typename _Arg1, typename _Arg2, typename _Result>
4926 struct binary_function
4928 typedef _Arg1 first_argument_type;
4929 typedef _Arg2 second_argument_type;
4930 typedef _Result result_type;
4932 template<typename _Tp>
4933 struct plus : public binary_function<_Tp, _Tp, _Tp>
4936 operator()(const _Tp& __x, const _Tp& __y) const
4937 { return __x + __y; }
4939 template<typename _Tp>
4940 struct minus : public binary_function<_Tp, _Tp, _Tp>
4943 operator()(const _Tp& __x, const _Tp& __y) const
4944 { return __x - __y; }
4946 template<typename _Tp>
4947 struct multiplies : public binary_function<_Tp, _Tp, _Tp>
4950 operator()(const _Tp& __x, const _Tp& __y) const
4951 { return __x * __y; }
4953 template<typename _Tp>
4954 struct divides : public binary_function<_Tp, _Tp, _Tp>
4957 operator()(const _Tp& __x, const _Tp& __y) const
4958 { return __x / __y; }
4960 template<typename _Tp>
4961 struct modulus : public binary_function<_Tp, _Tp, _Tp>
4964 operator()(const _Tp& __x, const _Tp& __y) const
4965 { return __x % __y; }
4967 template<typename _Tp>
4968 struct negate : public unary_function<_Tp, _Tp>
4971 operator()(const _Tp& __x) const
4974 template<typename _Tp>
4975 struct equal_to : public binary_function<_Tp, _Tp, bool>
4978 operator()(const _Tp& __x, const _Tp& __y) const
4979 { return __x == __y; }
4981 template<typename _Tp>
4982 struct not_equal_to : public binary_function<_Tp, _Tp, bool>
4985 operator()(const _Tp& __x, const _Tp& __y) const
4986 { return __x != __y; }
4988 template<typename _Tp>
4989 struct greater : public binary_function<_Tp, _Tp, bool>
4992 operator()(const _Tp& __x, const _Tp& __y) const
4993 { return __x > __y; }
4995 template<typename _Tp>
4996 struct less : public binary_function<_Tp, _Tp, bool>
4999 operator()(const _Tp& __x, const _Tp& __y) const
5000 { return __x < __y; }
5002 template<typename _Tp>
5003 struct greater_equal : public binary_function<_Tp, _Tp, bool>
5006 operator()(const _Tp& __x, const _Tp& __y) const
5007 { return __x >= __y; }
5009 template<typename _Tp>
5010 struct less_equal : public binary_function<_Tp, _Tp, bool>
5013 operator()(const _Tp& __x, const _Tp& __y) const
5014 { return __x <= __y; }
5016 template<typename _Tp>
5017 struct logical_and : public binary_function<_Tp, _Tp, bool>
5020 operator()(const _Tp& __x, const _Tp& __y) const
5021 { return __x && __y; }
5023 template<typename _Tp>
5024 struct logical_or : public binary_function<_Tp, _Tp, bool>
5027 operator()(const _Tp& __x, const _Tp& __y) const
5028 { return __x || __y; }
5030 template<typename _Tp>
5031 struct logical_not : public unary_function<_Tp, bool>
5034 operator()(const _Tp& __x) const
5037 template<typename _Tp>
5038 struct bit_and : public binary_function<_Tp, _Tp, _Tp>
5041 operator()(const _Tp& __x, const _Tp& __y) const
5042 { return __x & __y; }
5044 template<typename _Tp>
5045 struct bit_or : public binary_function<_Tp, _Tp, _Tp>
5048 operator()(const _Tp& __x, const _Tp& __y) const
5049 { return __x | __y; }
5051 template<typename _Tp>
5052 struct bit_xor : public binary_function<_Tp, _Tp, _Tp>
5055 operator()(const _Tp& __x, const _Tp& __y) const
5056 { return __x ^ __y; }
5058 template<typename _Predicate>
5060 : public unary_function<typename _Predicate::argument_type, bool>
5066 unary_negate(const _Predicate& __x) : _M_pred(__x) { }
5068 operator()(const typename _Predicate::argument_type& __x) const
5069 { return !_M_pred(__x); }
5071 template<typename _Predicate>
5072 inline unary_negate<_Predicate>
5073 not1(const _Predicate& __pred)
5074 { return unary_negate<_Predicate>(__pred); }
5075 template<typename _Predicate>
5077 : public binary_function<typename _Predicate::first_argument_type,
5078 typename _Predicate::second_argument_type, bool>
5084 binary_negate(const _Predicate& __x) : _M_pred(__x) { }
5086 operator()(const typename _Predicate::first_argument_type& __x,
5087 const typename _Predicate::second_argument_type& __y) const
5088 { return !_M_pred(__x, __y); }
5090 template<typename _Predicate>
5091 inline binary_negate<_Predicate>
5092 not2(const _Predicate& __pred)
5093 { return binary_negate<_Predicate>(__pred); }
5094 template<typename _Arg, typename _Result>
5095 class pointer_to_unary_function : public unary_function<_Arg, _Result>
5098 _Result (*_M_ptr)(_Arg);
5100 pointer_to_unary_function() { }
5102 pointer_to_unary_function(_Result (*__x)(_Arg))
5105 operator()(_Arg __x) const
5106 { return _M_ptr(__x); }
5108 template<typename _Arg, typename _Result>
5109 inline pointer_to_unary_function<_Arg, _Result>
5110 ptr_fun(_Result (*__x)(_Arg))
5111 { return pointer_to_unary_function<_Arg, _Result>(__x); }
5112 template<typename _Arg1, typename _Arg2, typename _Result>
5113 class pointer_to_binary_function
5114 : public binary_function<_Arg1, _Arg2, _Result>
5117 _Result (*_M_ptr)(_Arg1, _Arg2);
5119 pointer_to_binary_function() { }
5121 pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
5124 operator()(_Arg1 __x, _Arg2 __y) const
5125 { return _M_ptr(__x, __y); }
5127 template<typename _Arg1, typename _Arg2, typename _Result>
5128 inline pointer_to_binary_function<_Arg1, _Arg2, _Result>
5129 ptr_fun(_Result (*__x)(_Arg1, _Arg2))
5130 { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); }
5131 template<typename _Tp>
5132 struct _Identity : public unary_function<_Tp,_Tp>
5135 operator()(_Tp& __x) const
5138 operator()(const _Tp& __x) const
5141 template<typename _Pair>
5142 struct _Select1st : public unary_function<_Pair,
5143 typename _Pair::first_type>
5145 typename _Pair::first_type&
5146 operator()(_Pair& __x) const
5147 { return __x.first; }
5148 const typename _Pair::first_type&
5149 operator()(const _Pair& __x) const
5150 { return __x.first; }
5152 template<typename _Pair>
5153 struct _Select2nd : public unary_function<_Pair,
5154 typename _Pair::second_type>
5156 typename _Pair::second_type&
5157 operator()(_Pair& __x) const
5158 { return __x.second; }
5159 const typename _Pair::second_type&
5160 operator()(const _Pair& __x) const
5161 { return __x.second; }
5163 template<typename _Ret, typename _Tp>
5164 class mem_fun_t : public unary_function<_Tp*, _Ret>
5168 mem_fun_t(_Ret (_Tp::*__pf)())
5171 operator()(_Tp* __p) const
5172 { return (__p->*_M_f)(); }
5174 _Ret (_Tp::*_M_f)();
5176 template<typename _Ret, typename _Tp>
5177 class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
5181 const_mem_fun_t(_Ret (_Tp::*__pf)() const)
5184 operator()(const _Tp* __p) const
5185 { return (__p->*_M_f)(); }
5187 _Ret (_Tp::*_M_f)() const;
5189 template<typename _Ret, typename _Tp>
5190 class mem_fun_ref_t : public unary_function<_Tp, _Ret>
5194 mem_fun_ref_t(_Ret (_Tp::*__pf)())
5197 operator()(_Tp& __r) const
5198 { return (__r.*_M_f)(); }
5200 _Ret (_Tp::*_M_f)();
5202 template<typename _Ret, typename _Tp>
5203 class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
5207 const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const)
5210 operator()(const _Tp& __r) const
5211 { return (__r.*_M_f)(); }
5213 _Ret (_Tp::*_M_f)() const;
5215 template<typename _Ret, typename _Tp, typename _Arg>
5216 class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret>
5220 mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
5223 operator()(_Tp* __p, _Arg __x) const
5224 { return (__p->*_M_f)(__x); }
5226 _Ret (_Tp::*_M_f)(_Arg);
5228 template<typename _Ret, typename _Tp, typename _Arg>
5229 class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret>
5233 const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const)
5236 operator()(const _Tp* __p, _Arg __x) const
5237 { return (__p->*_M_f)(__x); }
5239 _Ret (_Tp::*_M_f)(_Arg) const;
5241 template<typename _Ret, typename _Tp, typename _Arg>
5242 class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
5246 mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg))
5249 operator()(_Tp& __r, _Arg __x) const
5250 { return (__r.*_M_f)(__x); }
5252 _Ret (_Tp::*_M_f)(_Arg);
5254 template<typename _Ret, typename _Tp, typename _Arg>
5255 class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
5259 const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const)
5262 operator()(const _Tp& __r, _Arg __x) const
5263 { return (__r.*_M_f)(__x); }
5265 _Ret (_Tp::*_M_f)(_Arg) const;
5267 template<typename _Ret, typename _Tp>
5268 inline mem_fun_t<_Ret, _Tp>
5269 mem_fun(_Ret (_Tp::*__f)())
5270 { return mem_fun_t<_Ret, _Tp>(__f); }
5271 template<typename _Ret, typename _Tp>
5272 inline const_mem_fun_t<_Ret, _Tp>
5273 mem_fun(_Ret (_Tp::*__f)() const)
5274 { return const_mem_fun_t<_Ret, _Tp>(__f); }
5275 template<typename _Ret, typename _Tp>
5276 inline mem_fun_ref_t<_Ret, _Tp>
5277 mem_fun_ref(_Ret (_Tp::*__f)())
5278 { return mem_fun_ref_t<_Ret, _Tp>(__f); }
5279 template<typename _Ret, typename _Tp>
5280 inline const_mem_fun_ref_t<_Ret, _Tp>
5281 mem_fun_ref(_Ret (_Tp::*__f)() const)
5282 { return const_mem_fun_ref_t<_Ret, _Tp>(__f); }
5283 template<typename _Ret, typename _Tp, typename _Arg>
5284 inline mem_fun1_t<_Ret, _Tp, _Arg>
5285 mem_fun(_Ret (_Tp::*__f)(_Arg))
5286 { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
5287 template<typename _Ret, typename _Tp, typename _Arg>
5288 inline const_mem_fun1_t<_Ret, _Tp, _Arg>
5289 mem_fun(_Ret (_Tp::*__f)(_Arg) const)
5290 { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
5291 template<typename _Ret, typename _Tp, typename _Arg>
5292 inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
5293 mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
5294 { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
5295 template<typename _Ret, typename _Tp, typename _Arg>
5296 inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
5297 mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
5298 { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
5300 namespace std __attribute__ ((__visibility__ ("default"))) {
5301 template<typename _Operation>
5303 : public unary_function<typename _Operation::second_argument_type,
5304 typename _Operation::result_type>
5308 typename _Operation::first_argument_type value;
5310 binder1st(const _Operation& __x,
5311 const typename _Operation::first_argument_type& __y)
5312 : op(__x), value(__y) { }
5313 typename _Operation::result_type
5314 operator()(const typename _Operation::second_argument_type& __x) const
5315 { return op(value, __x); }
5316 typename _Operation::result_type
5317 operator()(typename _Operation::second_argument_type& __x) const
5318 { return op(value, __x); }
5320 template<typename _Operation, typename _Tp>
5321 inline binder1st<_Operation>
5322 bind1st(const _Operation& __fn, const _Tp& __x)
5324 typedef typename _Operation::first_argument_type _Arg1_type;
5325 return binder1st<_Operation>(__fn, _Arg1_type(__x));
5327 template<typename _Operation>
5329 : public unary_function<typename _Operation::first_argument_type,
5330 typename _Operation::result_type>
5334 typename _Operation::second_argument_type value;
5336 binder2nd(const _Operation& __x,
5337 const typename _Operation::second_argument_type& __y)
5338 : op(__x), value(__y) { }
5339 typename _Operation::result_type
5340 operator()(const typename _Operation::first_argument_type& __x) const
5341 { return op(__x, value); }
5342 typename _Operation::result_type
5343 operator()(typename _Operation::first_argument_type& __x) const
5344 { return op(__x, value); }
5346 template<typename _Operation, typename _Tp>
5347 inline binder2nd<_Operation>
5348 bind2nd(const _Operation& __fn, const _Tp& __x)
5350 typedef typename _Operation::second_argument_type _Arg2_type;
5351 return binder2nd<_Operation>(__fn, _Arg2_type(__x));
5354 namespace std __attribute__ ((__visibility__ ("default"))) {
5355 template<typename _CharT, typename _Traits, typename _Alloc>
5358 typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
5360 typedef _Traits traits_type;
5361 typedef typename _Traits::char_type value_type;
5362 typedef _Alloc allocator_type;
5363 typedef typename _CharT_alloc_type::size_type size_type;
5364 typedef typename _CharT_alloc_type::difference_type difference_type;
5365 typedef typename _CharT_alloc_type::reference reference;
5366 typedef typename _CharT_alloc_type::const_reference const_reference;
5367 typedef typename _CharT_alloc_type::pointer pointer;
5368 typedef typename _CharT_alloc_type::const_pointer const_pointer;
5369 typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator;
5370 typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
5372 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
5373 typedef std::reverse_iterator<iterator> reverse_iterator;
5377 size_type _M_length;
5378 size_type _M_capacity;
5379 _Atomic_word _M_refcount;
5381 struct _Rep : _Rep_base
5383 typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc;
5384 static const size_type _S_max_size;
5385 static const _CharT _S_terminal;
5386 static size_type _S_empty_rep_storage[];
5390 void* __p = reinterpret_cast<void*>(&_S_empty_rep_storage);
5391 return *reinterpret_cast<_Rep*>(__p);
5394 _M_is_leaked() const
5395 { return this->_M_refcount < 0; }
5397 _M_is_shared() const
5398 { return this->_M_refcount > 0; }
5401 { this->_M_refcount = -1; }
5404 { this->_M_refcount = 0; }
5406 _M_set_length_and_sharable(size_type __n)
5408 this->_M_set_sharable();
5409 this->_M_length = __n;
5410 traits_type::assign(this->_M_refdata()[__n], _S_terminal);
5413 _M_refdata() throw()
5414 { return reinterpret_cast<_CharT*>(this + 1); }
5416 _M_grab(const _Alloc& __alloc1, const _Alloc& __alloc2)
5418 return (!_M_is_leaked() && __alloc1 == __alloc2)
5419 ? _M_refcopy() : _M_clone(__alloc1);
5422 _S_create(size_type, size_type, const _Alloc&);
5424 _M_dispose(const _Alloc& __a)
5426 if (__builtin_expect(this != &_S_empty_rep(), false))
5427 if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount,
5432 _M_destroy(const _Alloc&) throw();
5434 _M_refcopy() throw()
5436 if (__builtin_expect(this != &_S_empty_rep(), false))
5437 __gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1);
5438 return _M_refdata();
5441 _M_clone(const _Alloc&, size_type __res = 0);
5443 struct _Alloc_hider : _Alloc
5445 _Alloc_hider(_CharT* __dat, const _Alloc& __a)
5446 : _Alloc(__a), _M_p(__dat) { }
5450 static const size_type npos = static_cast<size_type>(-1);
5452 mutable _Alloc_hider _M_dataplus;
5455 { return _M_dataplus._M_p; }
5457 _M_data(_CharT* __p)
5458 { return (_M_dataplus._M_p = __p); }
5461 { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }
5464 { return iterator(_M_data()); }
5467 { return iterator(_M_data() + this->size()); }
5471 if (!_M_rep()->_M_is_leaked())
5475 _M_check(size_type __pos, const char* __s) const
5477 if (__pos > this->size())
5478 __throw_out_of_range((__s));
5482 _M_check_length(size_type __n1, size_type __n2, const char* __s) const
5484 if (this->max_size() - (this->size() - __n1) < __n2)
5485 __throw_length_error((__s));
5488 _M_limit(size_type __pos, size_type __off) const
5490 const bool __testoff = __off < this->size() - __pos;
5491 return __testoff ? __off : this->size() - __pos;
5494 _M_disjunct(const _CharT* __s) const
5496 return (less<const _CharT*>()(__s, _M_data())
5497 || less<const _CharT*>()(_M_data() + this->size(), __s));
5500 _M_copy(_CharT* __d, const _CharT* __s, size_type __n)
5503 traits_type::assign(*__d, *__s);
5505 traits_type::copy(__d, __s, __n);
5508 _M_move(_CharT* __d, const _CharT* __s, size_type __n)
5511 traits_type::assign(*__d, *__s);
5513 traits_type::move(__d, __s, __n);
5516 _M_assign(_CharT* __d, size_type __n, _CharT __c)
5519 traits_type::assign(*__d, __c);
5521 traits_type::assign(__d, __n, __c);
5523 template<class _Iterator>
5525 _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
5527 for (; __k1 != __k2; ++__k1, ++__p)
5528 traits_type::assign(*__p, *__k1);
5531 _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2)
5532 { _S_copy_chars(__p, __k1.base(), __k2.base()); }
5534 _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
5535 { _S_copy_chars(__p, __k1.base(), __k2.base()); }
5537 _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2)
5538 { _M_copy(__p, __k1, __k2 - __k1); }
5540 _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
5541 { _M_copy(__p, __k1, __k2 - __k1); }
5543 _S_compare(size_type __n1, size_type __n2)
5545 const difference_type __d = difference_type(__n1 - __n2);
5546 if (__d > __gnu_cxx::__numeric_traits<int>::__max)
5547 return __gnu_cxx::__numeric_traits<int>::__max;
5548 else if (__d < __gnu_cxx::__numeric_traits<int>::__min)
5549 return __gnu_cxx::__numeric_traits<int>::__min;
5554 _M_mutate(size_type __pos, size_type __len1, size_type __len2);
5559 { return _Rep::_S_empty_rep(); }
5564 basic_string(const _Alloc& __a);
5565 basic_string(const basic_string& __str);
5566 basic_string(const basic_string& __str, size_type __pos,
5567 size_type __n = npos);
5568 basic_string(const basic_string& __str, size_type __pos,
5569 size_type __n, const _Alloc& __a);
5570 basic_string(const _CharT* __s, size_type __n,
5571 const _Alloc& __a = _Alloc());
5572 basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
5573 basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
5574 template<class _InputIterator>
5575 basic_string(_InputIterator __beg, _InputIterator __end,
5576 const _Alloc& __a = _Alloc());
5578 { _M_rep()->_M_dispose(this->get_allocator()); }
5580 operator=(const basic_string& __str)
5581 { return this->assign(__str); }
5583 operator=(const _CharT* __s)
5584 { return this->assign(__s); }
5586 operator=(_CharT __c)
5588 this->assign(1, __c);
5595 return iterator(_M_data());
5599 { return const_iterator(_M_data()); }
5604 return iterator(_M_data() + this->size());
5608 { return const_iterator(_M_data() + this->size()); }
5611 { return reverse_iterator(this->end()); }
5612 const_reverse_iterator
5614 { return const_reverse_iterator(this->end()); }
5617 { return reverse_iterator(this->begin()); }
5618 const_reverse_iterator
5620 { return const_reverse_iterator(this->begin()); }
5624 { return _M_rep()->_M_length; }
5627 { return _M_rep()->_M_length; }
5630 { return _Rep::_S_max_size; }
5632 resize(size_type __n, _CharT __c);
5634 resize(size_type __n)
5635 { this->resize(__n, _CharT()); }
5638 { return _M_rep()->_M_capacity; }
5640 reserve(size_type __res_arg = 0);
5643 { _M_mutate(0, this->size(), 0); }
5646 { return this->size() == 0; }
5648 operator[] (size_type __pos) const
5651 return _M_data()[__pos];
5654 operator[](size_type __pos)
5659 return _M_data()[__pos];
5662 at(size_type __n) const
5664 if (__n >= this->size())
5665 __throw_out_of_range(("basic_string::at"));
5666 return _M_data()[__n];
5672 __throw_out_of_range(("basic_string::at"));
5674 return _M_data()[__n];
5677 operator+=(const basic_string& __str)
5678 { return this->append(__str); }
5680 operator+=(const _CharT* __s)
5681 { return this->append(__s); }
5683 operator+=(_CharT __c)
5685 this->push_back(__c);
5689 append(const basic_string& __str);
5691 append(const basic_string& __str, size_type __pos, size_type __n);
5693 append(const _CharT* __s, size_type __n);
5695 append(const _CharT* __s)
5698 return this->append(__s, traits_type::length(__s));
5701 append(size_type __n, _CharT __c);
5702 template<class _InputIterator>
5704 append(_InputIterator __first, _InputIterator __last)
5705 { return this->replace(_M_iend(), _M_iend(), __first, __last); }
5707 push_back(_CharT __c)
5709 const size_type __len = 1 + this->size();
5710 if (__len > this->capacity() || _M_rep()->_M_is_shared())
5711 this->reserve(__len);
5712 traits_type::assign(_M_data()[this->size()], __c);
5713 _M_rep()->_M_set_length_and_sharable(__len);
5716 assign(const basic_string& __str);
5718 assign(const basic_string& __str, size_type __pos, size_type __n)
5719 { return this->assign(__str._M_data()
5720 + __str._M_check(__pos, "basic_string::assign"),
5721 __str._M_limit(__pos, __n)); }
5723 assign(const _CharT* __s, size_type __n);
5725 assign(const _CharT* __s)
5728 return this->assign(__s, traits_type::length(__s));
5731 assign(size_type __n, _CharT __c)
5732 { return _M_replace_aux(size_type(0), this->size(), __n, __c); }
5733 template<class _InputIterator>
5735 assign(_InputIterator __first, _InputIterator __last)
5736 { return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
5738 insert(iterator __p, size_type __n, _CharT __c)
5739 { this->replace(__p, __p, __n, __c); }
5740 template<class _InputIterator>
5742 insert(iterator __p, _InputIterator __beg, _InputIterator __end)
5743 { this->replace(__p, __p, __beg, __end); }
5745 insert(size_type __pos1, const basic_string& __str)
5746 { return this->insert(__pos1, __str, size_type(0), __str.size()); }
5748 insert(size_type __pos1, const basic_string& __str,
5749 size_type __pos2, size_type __n)
5750 { return this->insert(__pos1, __str._M_data()
5751 + __str._M_check(__pos2, "basic_string::insert"),
5752 __str._M_limit(__pos2, __n)); }
5754 insert(size_type __pos, const _CharT* __s, size_type __n);
5756 insert(size_type __pos, const _CharT* __s)
5759 return this->insert(__pos, __s, traits_type::length(__s));
5762 insert(size_type __pos, size_type __n, _CharT __c)
5763 { return _M_replace_aux(_M_check(__pos, "basic_string::insert"),
5764 size_type(0), __n, __c); }
5766 insert(iterator __p, _CharT __c)
5769 const size_type __pos = __p - _M_ibegin();
5770 _M_replace_aux(__pos, size_type(0), size_type(1), __c);
5771 _M_rep()->_M_set_leaked();
5772 return iterator(_M_data() + __pos);
5775 erase(size_type __pos = 0, size_type __n = npos)
5777 _M_mutate(_M_check(__pos, "basic_string::erase"),
5778 _M_limit(__pos, __n), size_type(0));
5782 erase(iterator __position)
5785 const size_type __pos = __position - _M_ibegin();
5786 _M_mutate(__pos, size_type(1), size_type(0));
5787 _M_rep()->_M_set_leaked();
5788 return iterator(_M_data() + __pos);
5791 erase(iterator __first, iterator __last)
5794 const size_type __pos = __first - _M_ibegin();
5795 _M_mutate(__pos, __last - __first, size_type(0));
5796 _M_rep()->_M_set_leaked();
5797 return iterator(_M_data() + __pos);
5800 replace(size_type __pos, size_type __n, const basic_string& __str)
5801 { return this->replace(__pos, __n, __str._M_data(), __str.size()); }
5803 replace(size_type __pos1, size_type __n1, const basic_string& __str,
5804 size_type __pos2, size_type __n2)
5805 { return this->replace(__pos1, __n1, __str._M_data()
5806 + __str._M_check(__pos2, "basic_string::replace"),
5807 __str._M_limit(__pos2, __n2)); }
5809 replace(size_type __pos, size_type __n1, const _CharT* __s,
5812 replace(size_type __pos, size_type __n1, const _CharT* __s)
5815 return this->replace(__pos, __n1, __s, traits_type::length(__s));
5818 replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
5819 { return _M_replace_aux(_M_check(__pos, "basic_string::replace"),
5820 _M_limit(__pos, __n1), __n2, __c); }
5822 replace(iterator __i1, iterator __i2, const basic_string& __str)
5823 { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
5825 replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
5828 return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
5831 replace(iterator __i1, iterator __i2, const _CharT* __s)
5834 return this->replace(__i1, __i2, __s, traits_type::length(__s));
5837 replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
5840 return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
5842 template<class _InputIterator>
5844 replace(iterator __i1, iterator __i2,
5845 _InputIterator __k1, _InputIterator __k2)
5849 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
5850 return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
5853 replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
5857 return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
5861 replace(iterator __i1, iterator __i2,
5862 const _CharT* __k1, const _CharT* __k2)
5866 return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
5870 replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
5874 return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
5875 __k1.base(), __k2 - __k1);
5878 replace(iterator __i1, iterator __i2,
5879 const_iterator __k1, const_iterator __k2)
5883 return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
5884 __k1.base(), __k2 - __k1);
5887 template<class _Integer>
5889 _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
5890 _Integer __val, __true_type)
5891 { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
5892 template<class _InputIterator>
5894 _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
5895 _InputIterator __k2, __false_type);
5897 _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
5900 _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
5902 template<class _InIterator>
5904 _S_construct_aux(_InIterator __beg, _InIterator __end,
5905 const _Alloc& __a, __false_type)
5907 typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
5908 return _S_construct(__beg, __end, __a, _Tag());
5910 template<class _Integer>
5912 _S_construct_aux(_Integer __beg, _Integer __end,
5913 const _Alloc& __a, __true_type)
5914 { return _S_construct(static_cast<size_type>(__beg), __end, __a); }
5915 template<class _InIterator>
5917 _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a)
5919 typedef typename std::__is_integer<_InIterator>::__type _Integral;
5920 return _S_construct_aux(__beg, __end, __a, _Integral());
5922 template<class _InIterator>
5924 _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
5925 input_iterator_tag);
5926 template<class _FwdIterator>
5928 _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a,
5929 forward_iterator_tag);
5931 _S_construct(size_type __req, _CharT __c, const _Alloc& __a);
5934 copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
5936 swap(basic_string& __s);
5939 { return _M_data(); }
5942 { return _M_data(); }
5944 get_allocator() const
5945 { return _M_dataplus; }
5947 find(const _CharT* __s, size_type __pos, size_type __n) const;
5949 find(const basic_string& __str, size_type __pos = 0) const
5950 { return this->find(__str.data(), __pos, __str.size()); }
5952 find(const _CharT* __s, size_type __pos = 0) const
5955 return this->find(__s, __pos, traits_type::length(__s));
5958 find(_CharT __c, size_type __pos = 0) const;
5960 rfind(const basic_string& __str, size_type __pos = npos) const
5961 { return this->rfind(__str.data(), __pos, __str.size()); }
5963 rfind(const _CharT* __s, size_type __pos, size_type __n) const;
5965 rfind(const _CharT* __s, size_type __pos = npos) const
5968 return this->rfind(__s, __pos, traits_type::length(__s));
5971 rfind(_CharT __c, size_type __pos = npos) const;
5973 find_first_of(const basic_string& __str, size_type __pos = 0) const
5974 { return this->find_first_of(__str.data(), __pos, __str.size()); }
5976 find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
5978 find_first_of(const _CharT* __s, size_type __pos = 0) const
5981 return this->find_first_of(__s, __pos, traits_type::length(__s));
5984 find_first_of(_CharT __c, size_type __pos = 0) const
5985 { return this->find(__c, __pos); }
5987 find_last_of(const basic_string& __str, size_type __pos = npos) const
5988 { return this->find_last_of(__str.data(), __pos, __str.size()); }
5990 find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
5992 find_last_of(const _CharT* __s, size_type __pos = npos) const
5995 return this->find_last_of(__s, __pos, traits_type::length(__s));
5998 find_last_of(_CharT __c, size_type __pos = npos) const
5999 { return this->rfind(__c, __pos); }
6001 find_first_not_of(const basic_string& __str, size_type __pos = 0) const
6002 { return this->find_first_not_of(__str.data(), __pos, __str.size()); }
6004 find_first_not_of(const _CharT* __s, size_type __pos,
6005 size_type __n) const;
6007 find_first_not_of(const _CharT* __s, size_type __pos = 0) const
6010 return this->find_first_not_of(__s, __pos, traits_type::length(__s));
6013 find_first_not_of(_CharT __c, size_type __pos = 0) const;
6015 find_last_not_of(const basic_string& __str, size_type __pos = npos) const
6016 { return this->find_last_not_of(__str.data(), __pos, __str.size()); }
6018 find_last_not_of(const _CharT* __s, size_type __pos,
6019 size_type __n) const;
6021 find_last_not_of(const _CharT* __s, size_type __pos = npos) const
6024 return this->find_last_not_of(__s, __pos, traits_type::length(__s));
6027 find_last_not_of(_CharT __c, size_type __pos = npos) const;
6029 substr(size_type __pos = 0, size_type __n = npos) const
6030 { return basic_string(*this,
6031 _M_check(__pos, "basic_string::substr"), __n); }
6033 compare(const basic_string& __str) const
6035 const size_type __size = this->size();
6036 const size_type __osize = __str.size();
6037 const size_type __len = std::min(__size, __osize);
6038 int __r = traits_type::compare(_M_data(), __str.data(), __len);
6040 __r = _S_compare(__size, __osize);
6044 compare(size_type __pos, size_type __n, const basic_string& __str) const;
6046 compare(size_type __pos1, size_type __n1, const basic_string& __str,
6047 size_type __pos2, size_type __n2) const;
6049 compare(const _CharT* __s) const;
6051 compare(size_type __pos, size_type __n1, const _CharT* __s) const;
6053 compare(size_type __pos, size_type __n1, const _CharT* __s,
6054 size_type __n2) const;
6056 template<typename _CharT, typename _Traits, typename _Alloc>
6057 inline basic_string<_CharT, _Traits, _Alloc>::
6059 : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
6060 template<typename _CharT, typename _Traits, typename _Alloc>
6061 basic_string<_CharT, _Traits, _Alloc>
6062 operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6063 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6065 basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
6066 __str.append(__rhs);
6069 template<typename _CharT, typename _Traits, typename _Alloc>
6070 basic_string<_CharT,_Traits,_Alloc>
6071 operator+(const _CharT* __lhs,
6072 const basic_string<_CharT,_Traits,_Alloc>& __rhs);
6073 template<typename _CharT, typename _Traits, typename _Alloc>
6074 basic_string<_CharT,_Traits,_Alloc>
6075 operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);
6076 template<typename _CharT, typename _Traits, typename _Alloc>
6077 inline basic_string<_CharT, _Traits, _Alloc>
6078 operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6079 const _CharT* __rhs)
6081 basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
6082 __str.append(__rhs);
6085 template<typename _CharT, typename _Traits, typename _Alloc>
6086 inline basic_string<_CharT, _Traits, _Alloc>
6087 operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
6089 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
6090 typedef typename __string_type::size_type __size_type;
6091 __string_type __str(__lhs);
6092 __str.append(__size_type(1), __rhs);
6095 template<typename _CharT, typename _Traits, typename _Alloc>
6097 operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6098 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6099 { return __lhs.compare(__rhs) == 0; }
6100 template<typename _CharT>
6102 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, bool>::__type
6103 operator==(const basic_string<_CharT>& __lhs,
6104 const basic_string<_CharT>& __rhs)
6105 { return (__lhs.size() == __rhs.size()
6106 && !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(),
6108 template<typename _CharT, typename _Traits, typename _Alloc>
6110 operator==(const _CharT* __lhs,
6111 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6112 { return __rhs.compare(__lhs) == 0; }
6113 template<typename _CharT, typename _Traits, typename _Alloc>
6115 operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6116 const _CharT* __rhs)
6117 { return __lhs.compare(__rhs) == 0; }
6118 template<typename _CharT, typename _Traits, typename _Alloc>
6120 operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6121 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6122 { return !(__lhs == __rhs); }
6123 template<typename _CharT, typename _Traits, typename _Alloc>
6125 operator!=(const _CharT* __lhs,
6126 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6127 { return !(__lhs == __rhs); }
6128 template<typename _CharT, typename _Traits, typename _Alloc>
6130 operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6131 const _CharT* __rhs)
6132 { return !(__lhs == __rhs); }
6133 template<typename _CharT, typename _Traits, typename _Alloc>
6135 operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6136 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6137 { return __lhs.compare(__rhs) < 0; }
6138 template<typename _CharT, typename _Traits, typename _Alloc>
6140 operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6141 const _CharT* __rhs)
6142 { return __lhs.compare(__rhs) < 0; }
6143 template<typename _CharT, typename _Traits, typename _Alloc>
6145 operator<(const _CharT* __lhs,
6146 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6147 { return __rhs.compare(__lhs) > 0; }
6148 template<typename _CharT, typename _Traits, typename _Alloc>
6150 operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6151 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6152 { return __lhs.compare(__rhs) > 0; }
6153 template<typename _CharT, typename _Traits, typename _Alloc>
6155 operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6156 const _CharT* __rhs)
6157 { return __lhs.compare(__rhs) > 0; }
6158 template<typename _CharT, typename _Traits, typename _Alloc>
6160 operator>(const _CharT* __lhs,
6161 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6162 { return __rhs.compare(__lhs) < 0; }
6163 template<typename _CharT, typename _Traits, typename _Alloc>
6165 operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6166 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6167 { return __lhs.compare(__rhs) <= 0; }
6168 template<typename _CharT, typename _Traits, typename _Alloc>
6170 operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6171 const _CharT* __rhs)
6172 { return __lhs.compare(__rhs) <= 0; }
6173 template<typename _CharT, typename _Traits, typename _Alloc>
6175 operator<=(const _CharT* __lhs,
6176 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6177 { return __rhs.compare(__lhs) >= 0; }
6178 template<typename _CharT, typename _Traits, typename _Alloc>
6180 operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6181 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6182 { return __lhs.compare(__rhs) >= 0; }
6183 template<typename _CharT, typename _Traits, typename _Alloc>
6185 operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
6186 const _CharT* __rhs)
6187 { return __lhs.compare(__rhs) >= 0; }
6188 template<typename _CharT, typename _Traits, typename _Alloc>
6190 operator>=(const _CharT* __lhs,
6191 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6192 { return __rhs.compare(__lhs) <= 0; }
6193 template<typename _CharT, typename _Traits, typename _Alloc>
6195 swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
6196 basic_string<_CharT, _Traits, _Alloc>& __rhs)
6197 { __lhs.swap(__rhs); }
6198 template<typename _CharT, typename _Traits, typename _Alloc>
6199 basic_istream<_CharT, _Traits>&
6200 operator>>(basic_istream<_CharT, _Traits>& __is,
6201 basic_string<_CharT, _Traits, _Alloc>& __str);
6203 basic_istream<char>&
6204 operator>>(basic_istream<char>& __is, basic_string<char>& __str);
6205 template<typename _CharT, typename _Traits, typename _Alloc>
6206 inline basic_ostream<_CharT, _Traits>&
6207 operator<<(basic_ostream<_CharT, _Traits>& __os,
6208 const basic_string<_CharT, _Traits, _Alloc>& __str)
6210 return __ostream_insert(__os, __str.data(), __str.size());
6212 template<typename _CharT, typename _Traits, typename _Alloc>
6213 basic_istream<_CharT, _Traits>&
6214 getline(basic_istream<_CharT, _Traits>& __is,
6215 basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim);
6216 template<typename _CharT, typename _Traits, typename _Alloc>
6217 inline basic_istream<_CharT, _Traits>&
6218 getline(basic_istream<_CharT, _Traits>& __is,
6219 basic_string<_CharT, _Traits, _Alloc>& __str)
6220 { return getline(__is, __str, __is.widen('\n')); }
6222 basic_istream<char>&
6223 getline(basic_istream<char>& __in, basic_string<char>& __str,
6226 namespace std __attribute__ ((__visibility__ ("default"))) {
6227 template<typename _CharT, typename _Traits, typename _Alloc>
6228 const typename basic_string<_CharT, _Traits, _Alloc>::size_type
6229 basic_string<_CharT, _Traits, _Alloc>::
6230 _Rep::_S_max_size = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4;
6231 template<typename _CharT, typename _Traits, typename _Alloc>
6233 basic_string<_CharT, _Traits, _Alloc>::
6234 _Rep::_S_terminal = _CharT();
6235 template<typename _CharT, typename _Traits, typename _Alloc>
6236 const typename basic_string<_CharT, _Traits, _Alloc>::size_type
6237 basic_string<_CharT, _Traits, _Alloc>::npos;
6238 template<typename _CharT, typename _Traits, typename _Alloc>
6239 typename basic_string<_CharT, _Traits, _Alloc>::size_type
6240 basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
6241 (sizeof(_Rep_base) + sizeof(_CharT) + sizeof(size_type) - 1) /
6243 template<typename _CharT, typename _Traits, typename _Alloc>
6244 template<typename _InIterator>
6246 basic_string<_CharT, _Traits, _Alloc>::
6247 _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
6250 if (__beg == __end && __a == _Alloc())
6251 return _S_empty_rep()._M_refdata();
6253 size_type __len = 0;
6254 while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT))
6256 __buf[__len++] = *__beg;
6259 _Rep* __r = _Rep::_S_create(__len, size_type(0), __a);
6260 _M_copy(__r->_M_refdata(), __buf, __len);
6263 while (__beg != __end)
6265 if (__len == __r->_M_capacity)
6267 _Rep* __another = _Rep::_S_create(__len + 1, __len, __a);
6268 _M_copy(__another->_M_refdata(), __r->_M_refdata(), __len);
6269 __r->_M_destroy(__a);
6272 __r->_M_refdata()[__len++] = *__beg;
6278 __r->_M_destroy(__a);
6281 __r->_M_set_length_and_sharable(__len);
6282 return __r->_M_refdata();
6284 template<typename _CharT, typename _Traits, typename _Alloc>
6285 template <typename _InIterator>
6287 basic_string<_CharT, _Traits, _Alloc>::
6288 _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
6289 forward_iterator_tag)
6291 if (__beg == __end && __a == _Alloc())
6292 return _S_empty_rep()._M_refdata();
6293 if (__builtin_expect(__gnu_cxx::__is_null_pointer(__beg)
6294 && __beg != __end, 0))
6295 __throw_logic_error(("basic_string::_S_construct NULL not valid"));
6296 const size_type __dnew = static_cast<size_type>(std::distance(__beg,
6298 _Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a);
6300 { _S_copy_chars(__r->_M_refdata(), __beg, __end); }
6303 __r->_M_destroy(__a);
6306 __r->_M_set_length_and_sharable(__dnew);
6307 return __r->_M_refdata();
6309 template<typename _CharT, typename _Traits, typename _Alloc>
6311 basic_string<_CharT, _Traits, _Alloc>::
6312 _S_construct(size_type __n, _CharT __c, const _Alloc& __a)
6314 if (__n == 0 && __a == _Alloc())
6315 return _S_empty_rep()._M_refdata();
6316 _Rep* __r = _Rep::_S_create(__n, size_type(0), __a);
6318 _M_assign(__r->_M_refdata(), __n, __c);
6319 __r->_M_set_length_and_sharable(__n);
6320 return __r->_M_refdata();
6322 template<typename _CharT, typename _Traits, typename _Alloc>
6323 basic_string<_CharT, _Traits, _Alloc>::
6324 basic_string(const basic_string& __str)
6325 : _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()),
6326 __str.get_allocator()),
6327 __str.get_allocator())
6329 template<typename _CharT, typename _Traits, typename _Alloc>
6330 basic_string<_CharT, _Traits, _Alloc>::
6331 basic_string(const _Alloc& __a)
6332 : _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a)
6334 template<typename _CharT, typename _Traits, typename _Alloc>
6335 basic_string<_CharT, _Traits, _Alloc>::
6336 basic_string(const basic_string& __str, size_type __pos, size_type __n)
6337 : _M_dataplus(_S_construct(__str._M_data()
6338 + __str._M_check(__pos,
6339 "basic_string::basic_string"),
6340 __str._M_data() + __str._M_limit(__pos, __n)
6341 + __pos, _Alloc()), _Alloc())
6343 template<typename _CharT, typename _Traits, typename _Alloc>
6344 basic_string<_CharT, _Traits, _Alloc>::
6345 basic_string(const basic_string& __str, size_type __pos,
6346 size_type __n, const _Alloc& __a)
6347 : _M_dataplus(_S_construct(__str._M_data()
6348 + __str._M_check(__pos,
6349 "basic_string::basic_string"),
6350 __str._M_data() + __str._M_limit(__pos, __n)
6353 template<typename _CharT, typename _Traits, typename _Alloc>
6354 basic_string<_CharT, _Traits, _Alloc>::
6355 basic_string(const _CharT* __s, size_type __n, const _Alloc& __a)
6356 : _M_dataplus(_S_construct(__s, __s + __n, __a), __a)
6358 template<typename _CharT, typename _Traits, typename _Alloc>
6359 basic_string<_CharT, _Traits, _Alloc>::
6360 basic_string(const _CharT* __s, const _Alloc& __a)
6361 : _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) :
6362 __s + npos, __a), __a)
6364 template<typename _CharT, typename _Traits, typename _Alloc>
6365 basic_string<_CharT, _Traits, _Alloc>::
6366 basic_string(size_type __n, _CharT __c, const _Alloc& __a)
6367 : _M_dataplus(_S_construct(__n, __c, __a), __a)
6369 template<typename _CharT, typename _Traits, typename _Alloc>
6370 template<typename _InputIterator>
6371 basic_string<_CharT, _Traits, _Alloc>::
6372 basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a)
6373 : _M_dataplus(_S_construct(__beg, __end, __a), __a)
6375 template<typename _CharT, typename _Traits, typename _Alloc>
6376 basic_string<_CharT, _Traits, _Alloc>&
6377 basic_string<_CharT, _Traits, _Alloc>::
6378 assign(const basic_string& __str)
6380 if (_M_rep() != __str._M_rep())
6382 const allocator_type __a = this->get_allocator();
6383 _CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator());
6384 _M_rep()->_M_dispose(__a);
6389 template<typename _CharT, typename _Traits, typename _Alloc>
6390 basic_string<_CharT, _Traits, _Alloc>&
6391 basic_string<_CharT, _Traits, _Alloc>::
6392 assign(const _CharT* __s, size_type __n)
6395 _M_check_length(this->size(), __n, "basic_string::assign");
6396 if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
6397 return _M_replace_safe(size_type(0), this->size(), __s, __n);
6400 const size_type __pos = __s - _M_data();
6402 _M_copy(_M_data(), __s, __n);
6404 _M_move(_M_data(), __s, __n);
6405 _M_rep()->_M_set_length_and_sharable(__n);
6409 template<typename _CharT, typename _Traits, typename _Alloc>
6410 basic_string<_CharT, _Traits, _Alloc>&
6411 basic_string<_CharT, _Traits, _Alloc>::
6412 append(size_type __n, _CharT __c)
6416 _M_check_length(size_type(0), __n, "basic_string::append");
6417 const size_type __len = __n + this->size();
6418 if (__len > this->capacity() || _M_rep()->_M_is_shared())
6419 this->reserve(__len);
6420 _M_assign(_M_data() + this->size(), __n, __c);
6421 _M_rep()->_M_set_length_and_sharable(__len);
6425 template<typename _CharT, typename _Traits, typename _Alloc>
6426 basic_string<_CharT, _Traits, _Alloc>&
6427 basic_string<_CharT, _Traits, _Alloc>::
6428 append(const _CharT* __s, size_type __n)
6433 _M_check_length(size_type(0), __n, "basic_string::append");
6434 const size_type __len = __n + this->size();
6435 if (__len > this->capacity() || _M_rep()->_M_is_shared())
6437 if (_M_disjunct(__s))
6438 this->reserve(__len);
6441 const size_type __off = __s - _M_data();
6442 this->reserve(__len);
6443 __s = _M_data() + __off;
6446 _M_copy(_M_data() + this->size(), __s, __n);
6447 _M_rep()->_M_set_length_and_sharable(__len);
6451 template<typename _CharT, typename _Traits, typename _Alloc>
6452 basic_string<_CharT, _Traits, _Alloc>&
6453 basic_string<_CharT, _Traits, _Alloc>::
6454 append(const basic_string& __str)
6456 const size_type __size = __str.size();
6459 const size_type __len = __size + this->size();
6460 if (__len > this->capacity() || _M_rep()->_M_is_shared())
6461 this->reserve(__len);
6462 _M_copy(_M_data() + this->size(), __str._M_data(), __size);
6463 _M_rep()->_M_set_length_and_sharable(__len);
6467 template<typename _CharT, typename _Traits, typename _Alloc>
6468 basic_string<_CharT, _Traits, _Alloc>&
6469 basic_string<_CharT, _Traits, _Alloc>::
6470 append(const basic_string& __str, size_type __pos, size_type __n)
6472 __str._M_check(__pos, "basic_string::append");
6473 __n = __str._M_limit(__pos, __n);
6476 const size_type __len = __n + this->size();
6477 if (__len > this->capacity() || _M_rep()->_M_is_shared())
6478 this->reserve(__len);
6479 _M_copy(_M_data() + this->size(), __str._M_data() + __pos, __n);
6480 _M_rep()->_M_set_length_and_sharable(__len);
6484 template<typename _CharT, typename _Traits, typename _Alloc>
6485 basic_string<_CharT, _Traits, _Alloc>&
6486 basic_string<_CharT, _Traits, _Alloc>::
6487 insert(size_type __pos, const _CharT* __s, size_type __n)
6490 _M_check(__pos, "basic_string::insert");
6491 _M_check_length(size_type(0), __n, "basic_string::insert");
6492 if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
6493 return _M_replace_safe(__pos, size_type(0), __s, __n);
6496 const size_type __off = __s - _M_data();
6497 _M_mutate(__pos, 0, __n);
6498 __s = _M_data() + __off;
6499 _CharT* __p = _M_data() + __pos;
6500 if (__s + __n <= __p)
6501 _M_copy(__p, __s, __n);
6502 else if (__s >= __p)
6503 _M_copy(__p, __s + __n, __n);
6506 const size_type __nleft = __p - __s;
6507 _M_copy(__p, __s, __nleft);
6508 _M_copy(__p + __nleft, __p + __n, __n - __nleft);
6513 template<typename _CharT, typename _Traits, typename _Alloc>
6514 basic_string<_CharT, _Traits, _Alloc>&
6515 basic_string<_CharT, _Traits, _Alloc>::
6516 replace(size_type __pos, size_type __n1, const _CharT* __s,
6520 _M_check(__pos, "basic_string::replace");
6521 __n1 = _M_limit(__pos, __n1);
6522 _M_check_length(__n1, __n2, "basic_string::replace");
6524 if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
6525 return _M_replace_safe(__pos, __n1, __s, __n2);
6526 else if ((__left = __s + __n2 <= _M_data() + __pos)
6527 || _M_data() + __pos + __n1 <= __s)
6529 size_type __off = __s - _M_data();
6530 __left ? __off : (__off += __n2 - __n1);
6531 _M_mutate(__pos, __n1, __n2);
6532 _M_copy(_M_data() + __pos, _M_data() + __off, __n2);
6537 const basic_string __tmp(__s, __n2);
6538 return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2);
6541 template<typename _CharT, typename _Traits, typename _Alloc>
6543 basic_string<_CharT, _Traits, _Alloc>::_Rep::
6544 _M_destroy(const _Alloc& __a) throw ()
6546 const size_type __size = sizeof(_Rep_base) +
6547 (this->_M_capacity + 1) * sizeof(_CharT);
6548 _Raw_bytes_alloc(__a).deallocate(reinterpret_cast<char*>(this), __size);
6550 template<typename _CharT, typename _Traits, typename _Alloc>
6552 basic_string<_CharT, _Traits, _Alloc>::
6555 if (_M_rep() == &_S_empty_rep())
6557 if (_M_rep()->_M_is_shared())
6559 _M_rep()->_M_set_leaked();
6561 template<typename _CharT, typename _Traits, typename _Alloc>
6563 basic_string<_CharT, _Traits, _Alloc>::
6564 _M_mutate(size_type __pos, size_type __len1, size_type __len2)
6566 const size_type __old_size = this->size();
6567 const size_type __new_size = __old_size + __len2 - __len1;
6568 const size_type __how_much = __old_size - __pos - __len1;
6569 if (__new_size > this->capacity() || _M_rep()->_M_is_shared())
6571 const allocator_type __a = get_allocator();
6572 _Rep* __r = _Rep::_S_create(__new_size, this->capacity(), __a);
6574 _M_copy(__r->_M_refdata(), _M_data(), __pos);
6576 _M_copy(__r->_M_refdata() + __pos + __len2,
6577 _M_data() + __pos + __len1, __how_much);
6578 _M_rep()->_M_dispose(__a);
6579 _M_data(__r->_M_refdata());
6581 else if (__how_much && __len1 != __len2)
6583 _M_move(_M_data() + __pos + __len2,
6584 _M_data() + __pos + __len1, __how_much);
6586 _M_rep()->_M_set_length_and_sharable(__new_size);
6588 template<typename _CharT, typename _Traits, typename _Alloc>
6590 basic_string<_CharT, _Traits, _Alloc>::
6591 reserve(size_type __res)
6593 if (__res != this->capacity() || _M_rep()->_M_is_shared())
6595 if (__res < this->size())
6596 __res = this->size();
6597 const allocator_type __a = get_allocator();
6598 _CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size());
6599 _M_rep()->_M_dispose(__a);
6603 template<typename _CharT, typename _Traits, typename _Alloc>
6605 basic_string<_CharT, _Traits, _Alloc>::
6606 swap(basic_string& __s)
6608 if (_M_rep()->_M_is_leaked())
6609 _M_rep()->_M_set_sharable();
6610 if (__s._M_rep()->_M_is_leaked())
6611 __s._M_rep()->_M_set_sharable();
6612 if (this->get_allocator() == __s.get_allocator())
6614 _CharT* __tmp = _M_data();
6615 _M_data(__s._M_data());
6620 const basic_string __tmp1(_M_ibegin(), _M_iend(),
6621 __s.get_allocator());
6622 const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(),
6623 this->get_allocator());
6628 template<typename _CharT, typename _Traits, typename _Alloc>
6629 typename basic_string<_CharT, _Traits, _Alloc>::_Rep*
6630 basic_string<_CharT, _Traits, _Alloc>::_Rep::
6631 _S_create(size_type __capacity, size_type __old_capacity,
6632 const _Alloc& __alloc)
6634 if (__capacity > _S_max_size)
6635 __throw_length_error(("basic_string::_S_create"));
6636 const size_type __pagesize = 4096;
6637 const size_type __malloc_header_size = 4 * sizeof(void*);
6638 if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
6639 __capacity = 2 * __old_capacity;
6640 size_type __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
6641 const size_type __adj_size = __size + __malloc_header_size;
6642 if (__adj_size > __pagesize && __capacity > __old_capacity)
6644 const size_type __extra = __pagesize - __adj_size % __pagesize;
6645 __capacity += __extra / sizeof(_CharT);
6646 if (__capacity > _S_max_size)
6647 __capacity = _S_max_size;
6648 __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
6650 void* __place = _Raw_bytes_alloc(__alloc).allocate(__size);
6651 _Rep *__p = new (__place) _Rep;
6652 __p->_M_capacity = __capacity;
6653 __p->_M_set_sharable();
6656 template<typename _CharT, typename _Traits, typename _Alloc>
6658 basic_string<_CharT, _Traits, _Alloc>::_Rep::
6659 _M_clone(const _Alloc& __alloc, size_type __res)
6661 const size_type __requested_cap = this->_M_length + __res;
6662 _Rep* __r = _Rep::_S_create(__requested_cap, this->_M_capacity,
6664 if (this->_M_length)
6665 _M_copy(__r->_M_refdata(), _M_refdata(), this->_M_length);
6666 __r->_M_set_length_and_sharable(this->_M_length);
6667 return __r->_M_refdata();
6669 template<typename _CharT, typename _Traits, typename _Alloc>
6671 basic_string<_CharT, _Traits, _Alloc>::
6672 resize(size_type __n, _CharT __c)
6674 const size_type __size = this->size();
6675 _M_check_length(__size, __n, "basic_string::resize");
6677 this->append(__n - __size, __c);
6678 else if (__n < __size)
6681 template<typename _CharT, typename _Traits, typename _Alloc>
6682 template<typename _InputIterator>
6683 basic_string<_CharT, _Traits, _Alloc>&
6684 basic_string<_CharT, _Traits, _Alloc>::
6685 _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
6686 _InputIterator __k2, __false_type)
6688 const basic_string __s(__k1, __k2);
6689 const size_type __n1 = __i2 - __i1;
6690 _M_check_length(__n1, __s.size(), "basic_string::_M_replace_dispatch");
6691 return _M_replace_safe(__i1 - _M_ibegin(), __n1, __s._M_data(),
6694 template<typename _CharT, typename _Traits, typename _Alloc>
6695 basic_string<_CharT, _Traits, _Alloc>&
6696 basic_string<_CharT, _Traits, _Alloc>::
6697 _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
6700 _M_check_length(__n1, __n2, "basic_string::_M_replace_aux");
6701 _M_mutate(__pos1, __n1, __n2);
6703 _M_assign(_M_data() + __pos1, __n2, __c);
6706 template<typename _CharT, typename _Traits, typename _Alloc>
6707 basic_string<_CharT, _Traits, _Alloc>&
6708 basic_string<_CharT, _Traits, _Alloc>::
6709 _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
6712 _M_mutate(__pos1, __n1, __n2);
6714 _M_copy(_M_data() + __pos1, __s, __n2);
6717 template<typename _CharT, typename _Traits, typename _Alloc>
6718 basic_string<_CharT, _Traits, _Alloc>
6719 operator+(const _CharT* __lhs,
6720 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6723 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
6724 typedef typename __string_type::size_type __size_type;
6725 const __size_type __len = _Traits::length(__lhs);
6726 __string_type __str;
6727 __str.reserve(__len + __rhs.size());
6728 __str.append(__lhs, __len);
6729 __str.append(__rhs);
6732 template<typename _CharT, typename _Traits, typename _Alloc>
6733 basic_string<_CharT, _Traits, _Alloc>
6734 operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
6736 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
6737 typedef typename __string_type::size_type __size_type;
6738 __string_type __str;
6739 const __size_type __len = __rhs.size();
6740 __str.reserve(__len + 1);
6741 __str.append(__size_type(1), __lhs);
6742 __str.append(__rhs);
6745 template<typename _CharT, typename _Traits, typename _Alloc>
6746 typename basic_string<_CharT, _Traits, _Alloc>::size_type
6747 basic_string<_CharT, _Traits, _Alloc>::
6748 copy(_CharT* __s, size_type __n, size_type __pos) const
6750 _M_check(__pos, "basic_string::copy");
6751 __n = _M_limit(__pos, __n);
6754 _M_copy(__s, _M_data() + __pos, __n);
6757 template<typename _CharT, typename _Traits, typename _Alloc>
6758 typename basic_string<_CharT, _Traits, _Alloc>::size_type
6759 basic_string<_CharT, _Traits, _Alloc>::
6760 find(const _CharT* __s, size_type __pos, size_type __n) const
6763 const size_type __size = this->size();
6764 const _CharT* __data = _M_data();
6766 return __pos <= __size ? __pos : npos;
6769 for (; __pos <= __size - __n; ++__pos)
6770 if (traits_type::eq(__data[__pos], __s[0])
6771 && traits_type::compare(__data + __pos + 1,
6772 __s + 1, __n - 1) == 0)
6777 template<typename _CharT, typename _Traits, typename _Alloc>
6778 typename basic_string<_CharT, _Traits, _Alloc>::size_type
6779 basic_string<_CharT, _Traits, _Alloc>::
6780 find(_CharT __c, size_type __pos) const
6782 size_type __ret = npos;
6783 const size_type __size = this->size();
6786 const _CharT* __data = _M_data();
6787 const size_type __n = __size - __pos;
6788 const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
6790 __ret = __p - __data;
6794 template<typename _CharT, typename _Traits, typename _Alloc>
6795 typename basic_string<_CharT, _Traits, _Alloc>::size_type
6796 basic_string<_CharT, _Traits, _Alloc>::
6797 rfind(const _CharT* __s, size_type __pos, size_type __n) const
6800 const size_type __size = this->size();
6803 __pos = std::min(size_type(__size - __n), __pos);
6804 const _CharT* __data = _M_data();
6807 if (traits_type::compare(__data + __pos, __s, __n) == 0)
6810 while (__pos-- > 0);
6814 template<typename _CharT, typename _Traits, typename _Alloc>
6815 typename basic_string<_CharT, _Traits, _Alloc>::size_type
6816 basic_string<_CharT, _Traits, _Alloc>::
6817 rfind(_CharT __c, size_type __pos) const
6819 size_type __size = this->size();
6822 if (--__size > __pos)
6824 for (++__size; __size-- > 0; )
6825 if (traits_type::eq(_M_data()[__size], __c))
6830 template<typename _CharT, typename _Traits, typename _Alloc>
6831 typename basic_string<_CharT, _Traits, _Alloc>::size_type
6832 basic_string<_CharT, _Traits, _Alloc>::
6833 find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
6836 for (; __n && __pos < this->size(); ++__pos)
6838 const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
6844 template<typename _CharT, typename _Traits, typename _Alloc>
6845 typename basic_string<_CharT, _Traits, _Alloc>::size_type
6846 basic_string<_CharT, _Traits, _Alloc>::
6847 find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
6850 size_type __size = this->size();
6853 if (--__size > __pos)
6857 if (traits_type::find(__s, __n, _M_data()[__size]))
6860 while (__size-- != 0);
6864 template<typename _CharT, typename _Traits, typename _Alloc>
6865 typename basic_string<_CharT, _Traits, _Alloc>::size_type
6866 basic_string<_CharT, _Traits, _Alloc>::
6867 find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
6870 for (; __pos < this->size(); ++__pos)
6871 if (!traits_type::find(__s, __n, _M_data()[__pos]))
6875 template<typename _CharT, typename _Traits, typename _Alloc>
6876 typename basic_string<_CharT, _Traits, _Alloc>::size_type
6877 basic_string<_CharT, _Traits, _Alloc>::
6878 find_first_not_of(_CharT __c, size_type __pos) const
6880 for (; __pos < this->size(); ++__pos)
6881 if (!traits_type::eq(_M_data()[__pos], __c))
6885 template<typename _CharT, typename _Traits, typename _Alloc>
6886 typename basic_string<_CharT, _Traits, _Alloc>::size_type
6887 basic_string<_CharT, _Traits, _Alloc>::
6888 find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
6891 size_type __size = this->size();
6894 if (--__size > __pos)
6898 if (!traits_type::find(__s, __n, _M_data()[__size]))
6905 template<typename _CharT, typename _Traits, typename _Alloc>
6906 typename basic_string<_CharT, _Traits, _Alloc>::size_type
6907 basic_string<_CharT, _Traits, _Alloc>::
6908 find_last_not_of(_CharT __c, size_type __pos) const
6910 size_type __size = this->size();
6913 if (--__size > __pos)
6917 if (!traits_type::eq(_M_data()[__size], __c))
6924 template<typename _CharT, typename _Traits, typename _Alloc>
6926 basic_string<_CharT, _Traits, _Alloc>::
6927 compare(size_type __pos, size_type __n, const basic_string& __str) const
6929 _M_check(__pos, "basic_string::compare");
6930 __n = _M_limit(__pos, __n);
6931 const size_type __osize = __str.size();
6932 const size_type __len = std::min(__n, __osize);
6933 int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
6935 __r = _S_compare(__n, __osize);
6938 template<typename _CharT, typename _Traits, typename _Alloc>
6940 basic_string<_CharT, _Traits, _Alloc>::
6941 compare(size_type __pos1, size_type __n1, const basic_string& __str,
6942 size_type __pos2, size_type __n2) const
6944 _M_check(__pos1, "basic_string::compare");
6945 __str._M_check(__pos2, "basic_string::compare");
6946 __n1 = _M_limit(__pos1, __n1);
6947 __n2 = __str._M_limit(__pos2, __n2);
6948 const size_type __len = std::min(__n1, __n2);
6949 int __r = traits_type::compare(_M_data() + __pos1,
6950 __str.data() + __pos2, __len);
6952 __r = _S_compare(__n1, __n2);
6955 template<typename _CharT, typename _Traits, typename _Alloc>
6957 basic_string<_CharT, _Traits, _Alloc>::
6958 compare(const _CharT* __s) const
6961 const size_type __size = this->size();
6962 const size_type __osize = traits_type::length(__s);
6963 const size_type __len = std::min(__size, __osize);
6964 int __r = traits_type::compare(_M_data(), __s, __len);
6966 __r = _S_compare(__size, __osize);
6969 template<typename _CharT, typename _Traits, typename _Alloc>
6971 basic_string <_CharT, _Traits, _Alloc>::
6972 compare(size_type __pos, size_type __n1, const _CharT* __s) const
6975 _M_check(__pos, "basic_string::compare");
6976 __n1 = _M_limit(__pos, __n1);
6977 const size_type __osize = traits_type::length(__s);
6978 const size_type __len = std::min(__n1, __osize);
6979 int __r = traits_type::compare(_M_data() + __pos, __s, __len);
6981 __r = _S_compare(__n1, __osize);
6984 template<typename _CharT, typename _Traits, typename _Alloc>
6986 basic_string <_CharT, _Traits, _Alloc>::
6987 compare(size_type __pos, size_type __n1, const _CharT* __s,
6988 size_type __n2) const
6991 _M_check(__pos, "basic_string::compare");
6992 __n1 = _M_limit(__pos, __n1);
6993 const size_type __len = std::min(__n1, __n2);
6994 int __r = traits_type::compare(_M_data() + __pos, __s, __len);
6996 __r = _S_compare(__n1, __n2);
6999 template<typename _CharT, typename _Traits, typename _Alloc>
7000 basic_istream<_CharT, _Traits>&
7001 operator>>(basic_istream<_CharT, _Traits>& __in,
7002 basic_string<_CharT, _Traits, _Alloc>& __str)
7004 typedef basic_istream<_CharT, _Traits> __istream_type;
7005 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
7006 typedef typename __istream_type::ios_base __ios_base;
7007 typedef typename __istream_type::int_type __int_type;
7008 typedef typename __string_type::size_type __size_type;
7009 typedef ctype<_CharT> __ctype_type;
7010 typedef typename __ctype_type::ctype_base __ctype_base;
7011 __size_type __extracted = 0;
7012 typename __ios_base::iostate __err = __ios_base::goodbit;
7013 typename __istream_type::sentry __cerb(__in, false);
7020 __size_type __len = 0;
7021 const streamsize __w = __in.width();
7022 const __size_type __n = __w > 0 ? static_cast<__size_type>(__w)
7024 const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
7025 const __int_type __eof = _Traits::eof();
7026 __int_type __c = __in.rdbuf()->sgetc();
7027 while (__extracted < __n
7028 && !_Traits::eq_int_type(__c, __eof)
7029 && !__ct.is(__ctype_base::space,
7030 _Traits::to_char_type(__c)))
7032 if (__len == sizeof(__buf) / sizeof(_CharT))
7034 __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
7037 __buf[__len++] = _Traits::to_char_type(__c);
7039 __c = __in.rdbuf()->snextc();
7041 __str.append(__buf, __len);
7042 if (_Traits::eq_int_type(__c, __eof))
7043 __err |= __ios_base::eofbit;
7046 catch(__cxxabiv1::__forced_unwind&)
7048 __in._M_setstate(__ios_base::badbit);
7053 __in._M_setstate(__ios_base::badbit);
7057 __err |= __ios_base::failbit;
7059 __in.setstate(__err);
7062 template<typename _CharT, typename _Traits, typename _Alloc>
7063 basic_istream<_CharT, _Traits>&
7064 getline(basic_istream<_CharT, _Traits>& __in,
7065 basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
7067 typedef basic_istream<_CharT, _Traits> __istream_type;
7068 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
7069 typedef typename __istream_type::ios_base __ios_base;
7070 typedef typename __istream_type::int_type __int_type;
7071 typedef typename __string_type::size_type __size_type;
7072 __size_type __extracted = 0;
7073 const __size_type __n = __str.max_size();
7074 typename __ios_base::iostate __err = __ios_base::goodbit;
7075 typename __istream_type::sentry __cerb(__in, true);
7081 const __int_type __idelim = _Traits::to_int_type(__delim);
7082 const __int_type __eof = _Traits::eof();
7083 __int_type __c = __in.rdbuf()->sgetc();
7084 while (__extracted < __n
7085 && !_Traits::eq_int_type(__c, __eof)
7086 && !_Traits::eq_int_type(__c, __idelim))
7088 __str += _Traits::to_char_type(__c);
7090 __c = __in.rdbuf()->snextc();
7092 if (_Traits::eq_int_type(__c, __eof))
7093 __err |= __ios_base::eofbit;
7094 else if (_Traits::eq_int_type(__c, __idelim))
7097 __in.rdbuf()->sbumpc();
7100 __err |= __ios_base::failbit;
7102 catch(__cxxabiv1::__forced_unwind&)
7104 __in._M_setstate(__ios_base::badbit);
7109 __in._M_setstate(__ios_base::badbit);
7113 __err |= __ios_base::failbit;
7115 __in.setstate(__err);
7118 extern template class basic_string<char>;
7120 basic_istream<char>&
7121 operator>>(basic_istream<char>&, string&);
7123 basic_ostream<char>&
7124 operator<<(basic_ostream<char>&, const string&);
7126 basic_istream<char>&
7127 getline(basic_istream<char>&, string&, char);
7129 basic_istream<char>&
7130 getline(basic_istream<char>&, string&);
7132 namespace std __attribute__ ((__visibility__ ("default"))) {
7136 typedef int category;
7142 template<typename _Facet>
7144 has_facet(const locale&) throw();
7145 template<typename _Facet>
7146 friend const _Facet&
7147 use_facet(const locale&);
7148 template<typename _Cache>
7149 friend struct __use_cache;
7150 static const category none = 0;
7151 static const category ctype = 1L << 0;
7152 static const category numeric = 1L << 1;
7153 static const category collate = 1L << 2;
7154 static const category time = 1L << 3;
7155 static const category monetary = 1L << 4;
7156 static const category messages = 1L << 5;
7157 static const category all = (ctype | numeric | collate |
7158 time | monetary | messages);
7160 locale(const locale& __other) throw();
7162 locale(const char* __s);
7163 locale(const locale& __base, const char* __s, category __cat);
7164 locale(const locale& __base, const locale& __add, category __cat);
7165 template<typename _Facet>
7166 locale(const locale& __other, _Facet* __f);
7169 operator=(const locale& __other) throw();
7170 template<typename _Facet>
7172 combine(const locale& __other) const;
7176 operator==(const locale& __other) const throw ();
7178 operator!=(const locale& __other) const throw ()
7179 { return !(this->operator==(__other)); }
7180 template<typename _Char, typename _Traits, typename _Alloc>
7182 operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
7183 const basic_string<_Char, _Traits, _Alloc>& __s2) const;
7185 global(const locale&);
7186 static const locale&
7190 static _Impl* _S_classic;
7191 static _Impl* _S_global;
7192 static const char* const* const _S_categories;
7193 enum { _S_categories_size = 6 + 0 };
7194 static __gthread_once_t _S_once;
7196 locale(_Impl*) throw();
7200 _S_initialize_once();
7202 _S_normalize_category(category);
7204 _M_coalesce(const locale& __base, const locale& __add, category __cat);
7209 friend class locale;
7210 friend class locale::_Impl;
7211 mutable _Atomic_word _M_refcount;
7212 static __c_locale _S_c_locale;
7213 static const char _S_c_name[2];
7214 static __gthread_once_t _S_once;
7216 _S_initialize_once();
7219 facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)
7224 _S_create_c_locale(__c_locale& __cloc, const char* __s,
7225 __c_locale __old = 0);
7227 _S_clone_c_locale(__c_locale& __cloc);
7229 _S_destroy_c_locale(__c_locale& __cloc);
7236 _M_add_reference() const throw()
7237 { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
7239 _M_remove_reference() const throw()
7241 if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
7249 facet(const facet&);
7251 operator=(const facet&);
7256 friend class locale;
7257 friend class locale::_Impl;
7258 template<typename _Facet>
7259 friend const _Facet&
7260 use_facet(const locale&);
7261 template<typename _Facet>
7263 has_facet(const locale&) throw ();
7264 mutable size_t _M_index;
7265 static _Atomic_word _S_refcount;
7267 operator=(const id&);
7277 friend class locale;
7278 friend class locale::facet;
7279 template<typename _Facet>
7281 has_facet(const locale&) throw();
7282 template<typename _Facet>
7283 friend const _Facet&
7284 use_facet(const locale&);
7285 template<typename _Cache>
7286 friend struct __use_cache;
7288 _Atomic_word _M_refcount;
7289 const facet** _M_facets;
7290 size_t _M_facets_size;
7291 const facet** _M_caches;
7293 static const locale::id* const _S_id_ctype[];
7294 static const locale::id* const _S_id_numeric[];
7295 static const locale::id* const _S_id_collate[];
7296 static const locale::id* const _S_id_time[];
7297 static const locale::id* const _S_id_monetary[];
7298 static const locale::id* const _S_id_messages[];
7299 static const locale::id* const* const _S_facet_categories[];
7301 _M_add_reference() throw()
7302 { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
7304 _M_remove_reference() throw()
7306 if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
7314 _Impl(const _Impl&, size_t);
7315 _Impl(const char*, size_t);
7316 _Impl(size_t) throw();
7318 _Impl(const _Impl&);
7320 operator=(const _Impl&);
7322 _M_check_same_name()
7326 for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i)
7327 __ret = __builtin_strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
7331 _M_replace_categories(const _Impl*, category);
7333 _M_replace_category(const _Impl*, const locale::id* const*);
7335 _M_replace_facet(const _Impl*, const locale::id*);
7337 _M_install_facet(const locale::id*, const facet*);
7338 template<typename _Facet>
7340 _M_init_facet(_Facet* __facet)
7341 { _M_install_facet(&_Facet::id, __facet); }
7343 _M_install_cache(const facet*, size_t);
7345 template<typename _Facet>
7347 has_facet(const locale& __loc) throw();
7348 template<typename _Facet>
7350 use_facet(const locale& __loc);
7351 template<typename _CharT>
7352 class collate : public locale::facet
7355 typedef _CharT char_type;
7356 typedef basic_string<_CharT> string_type;
7358 __c_locale _M_c_locale_collate;
7360 static locale::id id;
7362 collate(size_t __refs = 0)
7363 : facet(__refs), _M_c_locale_collate(_S_get_c_locale())
7366 collate(__c_locale __cloc, size_t __refs = 0)
7367 : facet(__refs), _M_c_locale_collate(_S_clone_c_locale(__cloc))
7370 compare(const _CharT* __lo1, const _CharT* __hi1,
7371 const _CharT* __lo2, const _CharT* __hi2) const
7372 { return this->do_compare(__lo1, __hi1, __lo2, __hi2); }
7374 transform(const _CharT* __lo, const _CharT* __hi) const
7375 { return this->do_transform(__lo, __hi); }
7377 hash(const _CharT* __lo, const _CharT* __hi) const
7378 { return this->do_hash(__lo, __hi); }
7380 _M_compare(const _CharT*, const _CharT*) const;
7382 _M_transform(_CharT*, const _CharT*, size_t) const;
7386 { _S_destroy_c_locale(_M_c_locale_collate); }
7388 do_compare(const _CharT* __lo1, const _CharT* __hi1,
7389 const _CharT* __lo2, const _CharT* __hi2) const;
7391 do_transform(const _CharT* __lo, const _CharT* __hi) const;
7393 do_hash(const _CharT* __lo, const _CharT* __hi) const;
7395 template<typename _CharT>
7396 locale::id collate<_CharT>::id;
7399 collate<char>::_M_compare(const char*, const char*) const;
7402 collate<char>::_M_transform(char*, const char*, size_t) const;
7403 template<typename _CharT>
7404 class collate_byname : public collate<_CharT>
7407 typedef _CharT char_type;
7408 typedef basic_string<_CharT> string_type;
7410 collate_byname(const char* __s, size_t __refs = 0)
7411 : collate<_CharT>(__refs)
7413 if (__builtin_strcmp(__s, "C") != 0
7414 && __builtin_strcmp(__s, "POSIX") != 0)
7416 this->_S_destroy_c_locale(this->_M_c_locale_collate);
7417 this->_S_create_c_locale(this->_M_c_locale_collate, __s);
7422 ~collate_byname() { }
7425 namespace std __attribute__ ((__visibility__ ("default"))) {
7426 template<typename _Facet>
7428 locale(const locale& __other, _Facet* __f)
7430 _M_impl = new _Impl(*__other._M_impl, 1);
7432 { _M_impl->_M_install_facet(&_Facet::id, __f); }
7435 _M_impl->_M_remove_reference();
7438 delete [] _M_impl->_M_names[0];
7439 _M_impl->_M_names[0] = 0;
7441 template<typename _Facet>
7444 combine(const locale& __other) const
7446 _Impl* __tmp = new _Impl(*_M_impl, 1);
7449 __tmp->_M_replace_facet(__other._M_impl, &_Facet::id);
7453 __tmp->_M_remove_reference();
7456 return locale(__tmp);
7458 template<typename _CharT, typename _Traits, typename _Alloc>
7461 operator()(const basic_string<_CharT, _Traits, _Alloc>& __s1,
7462 const basic_string<_CharT, _Traits, _Alloc>& __s2) const
7464 typedef std::collate<_CharT> __collate_type;
7465 const __collate_type& __collate = use_facet<__collate_type>(*this);
7466 return (__collate.compare(__s1.data(), __s1.data() + __s1.length(),
7467 __s2.data(), __s2.data() + __s2.length()) < 0);
7469 template<typename _Facet>
7471 has_facet(const locale& __loc) throw()
7473 const size_t __i = _Facet::id._M_id();
7474 const locale::facet** __facets = __loc._M_impl->_M_facets;
7475 return (__i < __loc._M_impl->_M_facets_size
7476 && dynamic_cast<const _Facet*>(__facets[__i]));
7478 template<typename _Facet>
7480 use_facet(const locale& __loc)
7482 const size_t __i = _Facet::id._M_id();
7483 const locale::facet** __facets = __loc._M_impl->_M_facets;
7484 if (__i >= __loc._M_impl->_M_facets_size || !__facets[__i])
7486 return dynamic_cast<const _Facet&>(*__facets[__i]);
7488 template<typename _CharT>
7490 collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const
7492 template<typename _CharT>
7494 collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const
7496 template<typename _CharT>
7499 do_compare(const _CharT* __lo1, const _CharT* __hi1,
7500 const _CharT* __lo2, const _CharT* __hi2) const
7502 const string_type __one(__lo1, __hi1);
7503 const string_type __two(__lo2, __hi2);
7504 const _CharT* __p = __one.c_str();
7505 const _CharT* __pend = __one.data() + __one.length();
7506 const _CharT* __q = __two.c_str();
7507 const _CharT* __qend = __two.data() + __two.length();
7510 const int __res = _M_compare(__p, __q);
7513 __p += char_traits<_CharT>::length(__p);
7514 __q += char_traits<_CharT>::length(__q);
7515 if (__p == __pend && __q == __qend)
7517 else if (__p == __pend)
7519 else if (__q == __qend)
7525 template<typename _CharT>
7526 typename collate<_CharT>::string_type
7528 do_transform(const _CharT* __lo, const _CharT* __hi) const
7531 const string_type __str(__lo, __hi);
7532 const _CharT* __p = __str.c_str();
7533 const _CharT* __pend = __str.data() + __str.length();
7534 size_t __len = (__hi - __lo) * 2;
7535 _CharT* __c = new _CharT[__len];
7540 size_t __res = _M_transform(__c, __p, __len);
7544 delete [] __c, __c = 0;
7545 __c = new _CharT[__len];
7546 __res = _M_transform(__c, __p, __len);
7548 __ret.append(__c, __res);
7549 __p += char_traits<_CharT>::length(__p);
7553 __ret.push_back(_CharT());
7564 template<typename _CharT>
7567 do_hash(const _CharT* __lo, const _CharT* __hi) const
7569 unsigned long __val = 0;
7570 for (; __lo < __hi; ++__lo)
7572 *__lo + ((__val << 7)
7573 | (__val >> (__gnu_cxx::__numeric_traits<unsigned long>::
7575 return static_cast<long>(__val);
7577 extern template class collate<char>;
7578 extern template class collate_byname<char>;
7580 const collate<char>&
7581 use_facet<collate<char> >(const locale&);
7584 has_facet<collate<char> >(const locale&);
7586 namespace std __attribute__ ((__visibility__ ("default"))) {
7589 _S_boolalpha = 1L << 0,
7593 _S_internal = 1L << 4,
7597 _S_scientific = 1L << 8,
7598 _S_showbase = 1L << 9,
7599 _S_showpoint = 1L << 10,
7600 _S_showpos = 1L << 11,
7601 _S_skipws = 1L << 12,
7602 _S_unitbuf = 1L << 13,
7603 _S_uppercase = 1L << 14,
7604 _S_adjustfield = _S_left | _S_right | _S_internal,
7605 _S_basefield = _S_dec | _S_oct | _S_hex,
7606 _S_floatfield = _S_scientific | _S_fixed,
7607 _S_ios_fmtflags_end = 1L << 16
7609 inline _Ios_Fmtflags
7610 operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
7611 { return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
7612 inline _Ios_Fmtflags
7613 operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
7614 { return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
7615 inline _Ios_Fmtflags
7616 operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
7617 { return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
7618 inline _Ios_Fmtflags&
7619 operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
7620 { return __a = __a | __b; }
7621 inline _Ios_Fmtflags&
7622 operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
7623 { return __a = __a & __b; }
7624 inline _Ios_Fmtflags&
7625 operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
7626 { return __a = __a ^ __b; }
7627 inline _Ios_Fmtflags
7628 operator~(_Ios_Fmtflags __a)
7629 { return _Ios_Fmtflags(~static_cast<int>(__a)); }
7638 _S_ios_openmode_end = 1L << 16
7640 inline _Ios_Openmode
7641 operator&(_Ios_Openmode __a, _Ios_Openmode __b)
7642 { return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
7643 inline _Ios_Openmode
7644 operator|(_Ios_Openmode __a, _Ios_Openmode __b)
7645 { return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
7646 inline _Ios_Openmode
7647 operator^(_Ios_Openmode __a, _Ios_Openmode __b)
7648 { return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
7649 inline _Ios_Openmode&
7650 operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
7651 { return __a = __a | __b; }
7652 inline _Ios_Openmode&
7653 operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
7654 { return __a = __a & __b; }
7655 inline _Ios_Openmode&
7656 operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
7657 { return __a = __a ^ __b; }
7658 inline _Ios_Openmode
7659 operator~(_Ios_Openmode __a)
7660 { return _Ios_Openmode(~static_cast<int>(__a)); }
7664 _S_badbit = 1L << 0,
7665 _S_eofbit = 1L << 1,
7666 _S_failbit = 1L << 2,
7667 _S_ios_iostate_end = 1L << 16
7670 operator&(_Ios_Iostate __a, _Ios_Iostate __b)
7671 { return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
7673 operator|(_Ios_Iostate __a, _Ios_Iostate __b)
7674 { return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
7676 operator^(_Ios_Iostate __a, _Ios_Iostate __b)
7677 { return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
7678 inline _Ios_Iostate&
7679 operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
7680 { return __a = __a | __b; }
7681 inline _Ios_Iostate&
7682 operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
7683 { return __a = __a & __b; }
7684 inline _Ios_Iostate&
7685 operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
7686 { return __a = __a ^ __b; }
7688 operator~(_Ios_Iostate __a)
7689 { return _Ios_Iostate(~static_cast<int>(__a)); }
7695 _S_ios_seekdir_end = 1L << 16
7700 class failure : public exception
7704 failure(const string& __str) throw();
7708 what() const throw();
7712 typedef _Ios_Fmtflags fmtflags;
7713 static const fmtflags boolalpha = _S_boolalpha;
7714 static const fmtflags dec = _S_dec;
7715 static const fmtflags fixed = _S_fixed;
7716 static const fmtflags hex = _S_hex;
7717 static const fmtflags internal = _S_internal;
7718 static const fmtflags left = _S_left;
7719 static const fmtflags oct = _S_oct;
7720 static const fmtflags right = _S_right;
7721 static const fmtflags scientific = _S_scientific;
7722 static const fmtflags showbase = _S_showbase;
7723 static const fmtflags showpoint = _S_showpoint;
7724 static const fmtflags showpos = _S_showpos;
7725 static const fmtflags skipws = _S_skipws;
7726 static const fmtflags unitbuf = _S_unitbuf;
7727 static const fmtflags uppercase = _S_uppercase;
7728 static const fmtflags adjustfield = _S_adjustfield;
7729 static const fmtflags basefield = _S_basefield;
7730 static const fmtflags floatfield = _S_floatfield;
7731 typedef _Ios_Iostate iostate;
7732 static const iostate badbit = _S_badbit;
7733 static const iostate eofbit = _S_eofbit;
7734 static const iostate failbit = _S_failbit;
7735 static const iostate goodbit = _S_goodbit;
7736 typedef _Ios_Openmode openmode;
7737 static const openmode app = _S_app;
7738 static const openmode ate = _S_ate;
7739 static const openmode binary = _S_bin;
7740 static const openmode in = _S_in;
7741 static const openmode out = _S_out;
7742 static const openmode trunc = _S_trunc;
7743 typedef _Ios_Seekdir seekdir;
7744 static const seekdir beg = _S_beg;
7745 static const seekdir cur = _S_cur;
7746 static const seekdir end = _S_end;
7747 typedef int io_state;
7748 typedef int open_mode;
7749 typedef int seek_dir;
7750 typedef std::streampos streampos;
7751 typedef std::streamoff streamoff;
7758 typedef void (*event_callback) (event, ios_base&, int);
7760 register_callback(event_callback __fn, int __index);
7762 streamsize _M_precision;
7763 streamsize _M_width;
7765 iostate _M_exception;
7766 iostate _M_streambuf_state;
7767 struct _Callback_list
7769 _Callback_list* _M_next;
7770 ios_base::event_callback _M_fn;
7772 _Atomic_word _M_refcount;
7773 _Callback_list(ios_base::event_callback __fn, int __index,
7774 _Callback_list* __cb)
7775 : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
7777 _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
7779 _M_remove_reference()
7780 { return __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1); }
7782 _Callback_list* _M_callbacks;
7784 _M_call_callbacks(event __ev) throw();
7786 _M_dispose_callbacks(void);
7791 _Words() : _M_pword(0), _M_iword(0) { }
7793 _Words _M_word_zero;
7794 enum { _S_local_word_size = 8 };
7795 _Words _M_local_word[_S_local_word_size];
7799 _M_grow_words(int __index, bool __iword);
7800 locale _M_ios_locale;
7806 friend class ios_base;
7811 static _Atomic_word _S_refcount;
7812 static bool _S_synced_with_stdio;
7816 { return _M_flags; }
7818 flags(fmtflags __fmtfl)
7820 fmtflags __old = _M_flags;
7825 setf(fmtflags __fmtfl)
7827 fmtflags __old = _M_flags;
7828 _M_flags |= __fmtfl;
7832 setf(fmtflags __fmtfl, fmtflags __mask)
7834 fmtflags __old = _M_flags;
7835 _M_flags &= ~__mask;
7836 _M_flags |= (__fmtfl & __mask);
7840 unsetf(fmtflags __mask)
7841 { _M_flags &= ~__mask; }
7844 { return _M_precision; }
7846 precision(streamsize __prec)
7848 streamsize __old = _M_precision;
7849 _M_precision = __prec;
7854 { return _M_width; }
7856 width(streamsize __wide)
7858 streamsize __old = _M_width;
7863 sync_with_stdio(bool __sync = true);
7865 imbue(const locale& __loc);
7868 { return _M_ios_locale; }
7871 { return _M_ios_locale; }
7877 _Words& __word = (__ix < _M_word_size)
7878 ? _M_word[__ix] : _M_grow_words(__ix, true);
7879 return __word._M_iword;
7884 _Words& __word = (__ix < _M_word_size)
7885 ? _M_word[__ix] : _M_grow_words(__ix, false);
7886 return __word._M_pword;
7888 virtual ~ios_base();
7892 ios_base(const ios_base&);
7894 operator=(const ios_base&);
7897 boolalpha(ios_base& __base)
7899 __base.setf(ios_base::boolalpha);
7903 noboolalpha(ios_base& __base)
7905 __base.unsetf(ios_base::boolalpha);
7909 showbase(ios_base& __base)
7911 __base.setf(ios_base::showbase);
7915 noshowbase(ios_base& __base)
7917 __base.unsetf(ios_base::showbase);
7921 showpoint(ios_base& __base)
7923 __base.setf(ios_base::showpoint);
7927 noshowpoint(ios_base& __base)
7929 __base.unsetf(ios_base::showpoint);
7933 showpos(ios_base& __base)
7935 __base.setf(ios_base::showpos);
7939 noshowpos(ios_base& __base)
7941 __base.unsetf(ios_base::showpos);
7945 skipws(ios_base& __base)
7947 __base.setf(ios_base::skipws);
7951 noskipws(ios_base& __base)
7953 __base.unsetf(ios_base::skipws);
7957 uppercase(ios_base& __base)
7959 __base.setf(ios_base::uppercase);
7963 nouppercase(ios_base& __base)
7965 __base.unsetf(ios_base::uppercase);
7969 unitbuf(ios_base& __base)
7971 __base.setf(ios_base::unitbuf);
7975 nounitbuf(ios_base& __base)
7977 __base.unsetf(ios_base::unitbuf);
7981 internal(ios_base& __base)
7983 __base.setf(ios_base::internal, ios_base::adjustfield);
7987 left(ios_base& __base)
7989 __base.setf(ios_base::left, ios_base::adjustfield);
7993 right(ios_base& __base)
7995 __base.setf(ios_base::right, ios_base::adjustfield);
7999 dec(ios_base& __base)
8001 __base.setf(ios_base::dec, ios_base::basefield);
8005 hex(ios_base& __base)
8007 __base.setf(ios_base::hex, ios_base::basefield);
8011 oct(ios_base& __base)
8013 __base.setf(ios_base::oct, ios_base::basefield);
8017 fixed(ios_base& __base)
8019 __base.setf(ios_base::fixed, ios_base::floatfield);
8023 scientific(ios_base& __base)
8025 __base.setf(ios_base::scientific, ios_base::floatfield);
8029 namespace std __attribute__ ((__visibility__ ("default"))) {
8030 template<typename _CharT, typename _Traits>
8032 __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*,
8033 basic_streambuf<_CharT, _Traits>*, bool&);
8034 template<typename _CharT, typename _Traits>
8035 class basic_streambuf
8038 typedef _CharT char_type;
8039 typedef _Traits traits_type;
8040 typedef typename traits_type::int_type int_type;
8041 typedef typename traits_type::pos_type pos_type;
8042 typedef typename traits_type::off_type off_type;
8043 typedef basic_streambuf<char_type, traits_type> __streambuf_type;
8044 friend class basic_ios<char_type, traits_type>;
8045 friend class basic_istream<char_type, traits_type>;
8046 friend class basic_ostream<char_type, traits_type>;
8047 friend class istreambuf_iterator<char_type, traits_type>;
8048 friend class ostreambuf_iterator<char_type, traits_type>;
8050 __copy_streambufs_eof<>(__streambuf_type*, __streambuf_type*, bool&);
8051 template<bool _IsMove, typename _CharT2>
8052 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
8054 __copy_move_a2(istreambuf_iterator<_CharT2>,
8055 istreambuf_iterator<_CharT2>, _CharT2*);
8056 template<typename _CharT2>
8057 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
8058 istreambuf_iterator<_CharT2> >::__type
8059 find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
8061 template<typename _CharT2, typename _Traits2>
8062 friend basic_istream<_CharT2, _Traits2>&
8063 operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2*);
8064 template<typename _CharT2, typename _Traits2, typename _Alloc>
8065 friend basic_istream<_CharT2, _Traits2>&
8066 operator>>(basic_istream<_CharT2, _Traits2>&,
8067 basic_string<_CharT2, _Traits2, _Alloc>&);
8068 template<typename _CharT2, typename _Traits2, typename _Alloc>
8069 friend basic_istream<_CharT2, _Traits2>&
8070 getline(basic_istream<_CharT2, _Traits2>&,
8071 basic_string<_CharT2, _Traits2, _Alloc>&, _CharT2);
8073 char_type* _M_in_beg;
8074 char_type* _M_in_cur;
8075 char_type* _M_in_end;
8076 char_type* _M_out_beg;
8077 char_type* _M_out_cur;
8078 char_type* _M_out_end;
8079 locale _M_buf_locale;
8085 pubimbue(const locale &__loc)
8087 locale __tmp(this->getloc());
8089 _M_buf_locale = __loc;
8094 { return _M_buf_locale; }
8096 pubsetbuf(char_type* __s, streamsize __n)
8097 { return this->setbuf(__s, __n); }
8099 pubseekoff(off_type __off, ios_base::seekdir __way,
8100 ios_base::openmode __mode = ios_base::in | ios_base::out)
8101 { return this->seekoff(__off, __way, __mode); }
8103 pubseekpos(pos_type __sp,
8104 ios_base::openmode __mode = ios_base::in | ios_base::out)
8105 { return this->seekpos(__sp, __mode); }
8107 pubsync() { return this->sync(); }
8111 const streamsize __ret = this->egptr() - this->gptr();
8112 return __ret ? __ret : this->showmanyc();
8117 int_type __ret = traits_type::eof();
8118 if (__builtin_expect(!traits_type::eq_int_type(this->sbumpc(),
8120 __ret = this->sgetc();
8127 if (__builtin_expect(this->gptr() < this->egptr(), true))
8129 __ret = traits_type::to_int_type(*this->gptr());
8133 __ret = this->uflow();
8140 if (__builtin_expect(this->gptr() < this->egptr(), true))
8141 __ret = traits_type::to_int_type(*this->gptr());
8143 __ret = this->underflow();
8147 sgetn(char_type* __s, streamsize __n)
8148 { return this->xsgetn(__s, __n); }
8150 sputbackc(char_type __c)
8153 const bool __testpos = this->eback() < this->gptr();
8154 if (__builtin_expect(!__testpos ||
8155 !traits_type::eq(__c, this->gptr()[-1]), false))
8156 __ret = this->pbackfail(traits_type::to_int_type(__c));
8160 __ret = traits_type::to_int_type(*this->gptr());
8168 if (__builtin_expect(this->eback() < this->gptr(), true))
8171 __ret = traits_type::to_int_type(*this->gptr());
8174 __ret = this->pbackfail();
8178 sputc(char_type __c)
8181 if (__builtin_expect(this->pptr() < this->epptr(), true))
8183 *this->pptr() = __c;
8185 __ret = traits_type::to_int_type(__c);
8188 __ret = this->overflow(traits_type::to_int_type(__c));
8192 sputn(const char_type* __s, streamsize __n)
8193 { return this->xsputn(__s, __n); }
8196 : _M_in_beg(0), _M_in_cur(0), _M_in_end(0),
8197 _M_out_beg(0), _M_out_cur(0), _M_out_end(0),
8198 _M_buf_locale(locale())
8201 eback() const { return _M_in_beg; }
8203 gptr() const { return _M_in_cur; }
8205 egptr() const { return _M_in_end; }
8207 gbump(int __n) { _M_in_cur += __n; }
8209 setg(char_type* __gbeg, char_type* __gnext, char_type* __gend)
8212 _M_in_cur = __gnext;
8216 pbase() const { return _M_out_beg; }
8218 pptr() const { return _M_out_cur; }
8220 epptr() const { return _M_out_end; }
8222 pbump(int __n) { _M_out_cur += __n; }
8224 setp(char_type* __pbeg, char_type* __pend)
8226 _M_out_beg = _M_out_cur = __pbeg;
8227 _M_out_end = __pend;
8230 imbue(const locale&)
8232 virtual basic_streambuf<char_type,_Traits>*
8233 setbuf(char_type*, streamsize)
8236 seekoff(off_type, ios_base::seekdir,
8237 ios_base::openmode = ios_base::in | ios_base::out)
8238 { return pos_type(off_type(-1)); }
8241 ios_base::openmode = ios_base::in | ios_base::out)
8242 { return pos_type(off_type(-1)); }
8244 sync() { return 0; }
8246 showmanyc() { return 0; }
8248 xsgetn(char_type* __s, streamsize __n);
8251 { return traits_type::eof(); }
8255 int_type __ret = traits_type::eof();
8256 const bool __testeof = traits_type::eq_int_type(this->underflow(),
8260 __ret = traits_type::to_int_type(*this->gptr());
8266 pbackfail(int_type = traits_type::eof())
8267 { return traits_type::eof(); }
8269 xsputn(const char_type* __s, streamsize __n);
8271 overflow(int_type = traits_type::eof())
8272 { return traits_type::eof(); }
8277 if (this->gptr() < this->egptr())
8283 basic_streambuf(const __streambuf_type& __sb)
8284 : _M_in_beg(__sb._M_in_beg), _M_in_cur(__sb._M_in_cur),
8285 _M_in_end(__sb._M_in_end), _M_out_beg(__sb._M_out_beg),
8286 _M_out_cur(__sb._M_out_cur), _M_out_end(__sb._M_out_cur),
8287 _M_buf_locale(__sb._M_buf_locale)
8290 operator=(const __streambuf_type&) { return *this; };
8294 __copy_streambufs_eof(basic_streambuf<char>* __sbin,
8295 basic_streambuf<char>* __sbout, bool& __ineof);
8297 namespace std __attribute__ ((__visibility__ ("default"))) {
8298 template<typename _CharT, typename _Traits>
8300 basic_streambuf<_CharT, _Traits>::
8301 xsgetn(char_type* __s, streamsize __n)
8303 streamsize __ret = 0;
8306 const streamsize __buf_len = this->egptr() - this->gptr();
8309 const streamsize __remaining = __n - __ret;
8310 const streamsize __len = std::min(__buf_len, __remaining);
8311 traits_type::copy(__s, this->gptr(), __len);
8318 const int_type __c = this->uflow();
8319 if (!traits_type::eq_int_type(__c, traits_type::eof()))
8321 traits_type::assign(*__s++, traits_type::to_char_type(__c));
8330 template<typename _CharT, typename _Traits>
8332 basic_streambuf<_CharT, _Traits>::
8333 xsputn(const char_type* __s, streamsize __n)
8335 streamsize __ret = 0;
8338 const streamsize __buf_len = this->epptr() - this->pptr();
8341 const streamsize __remaining = __n - __ret;
8342 const streamsize __len = std::min(__buf_len, __remaining);
8343 traits_type::copy(this->pptr(), __s, __len);
8350 int_type __c = this->overflow(traits_type::to_int_type(*__s));
8351 if (!traits_type::eq_int_type(__c, traits_type::eof()))
8362 template<typename _CharT, typename _Traits>
8364 __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>* __sbin,
8365 basic_streambuf<_CharT, _Traits>* __sbout,
8368 streamsize __ret = 0;
8370 typename _Traits::int_type __c = __sbin->sgetc();
8371 while (!_Traits::eq_int_type(__c, _Traits::eof()))
8373 __c = __sbout->sputc(_Traits::to_char_type(__c));
8374 if (_Traits::eq_int_type(__c, _Traits::eof()))
8380 __c = __sbin->snextc();
8384 template<typename _CharT, typename _Traits>
8386 __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
8387 basic_streambuf<_CharT, _Traits>* __sbout)
8390 return __copy_streambufs_eof(__sbin, __sbout, __ineof);
8392 extern template class basic_streambuf<char>;
8395 __copy_streambufs(basic_streambuf<char>*,
8396 basic_streambuf<char>*);
8399 __copy_streambufs_eof(basic_streambuf<char>*,
8400 basic_streambuf<char>*, bool&);
8402 namespace std __attribute__ ((__visibility__ ("default"))) {
8405 typedef const __ctype_touplow_t* __to_type;
8406 typedef __ctype_mask_t mask;
8407 static const mask upper = _ISupper;
8408 static const mask lower = _ISlower;
8409 static const mask alpha = _ISalpha;
8410 static const mask digit = _ISdigit;
8411 static const mask xdigit = _ISxdigit;
8412 static const mask space = _ISspace;
8413 static const mask print = _ISprint;
8414 static const mask graph = _ISalpha | _ISdigit | _ISpunct;
8415 static const mask cntrl = _IScntrl;
8416 static const mask punct = _ISpunct;
8417 static const mask alnum = _ISalpha | _ISdigit;
8420 namespace std __attribute__ ((__visibility__ ("default"))) {
8421 template<typename _CharT, typename _Traits>
8422 class istreambuf_iterator
8423 : public iterator<input_iterator_tag, _CharT, typename _Traits::off_type,
8427 typedef _CharT char_type;
8428 typedef _Traits traits_type;
8429 typedef typename _Traits::int_type int_type;
8430 typedef basic_streambuf<_CharT, _Traits> streambuf_type;
8431 typedef basic_istream<_CharT, _Traits> istream_type;
8432 template<typename _CharT2>
8433 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
8434 ostreambuf_iterator<_CharT2> >::__type
8435 copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
8436 ostreambuf_iterator<_CharT2>);
8437 template<bool _IsMove, typename _CharT2>
8438 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
8440 __copy_move_a2(istreambuf_iterator<_CharT2>,
8441 istreambuf_iterator<_CharT2>, _CharT2*);
8442 template<typename _CharT2>
8443 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
8444 istreambuf_iterator<_CharT2> >::__type
8445 find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
8448 mutable streambuf_type* _M_sbuf;
8449 mutable int_type _M_c;
8451 istreambuf_iterator() throw()
8452 : _M_sbuf(0), _M_c(traits_type::eof()) { }
8453 istreambuf_iterator(istream_type& __s) throw()
8454 : _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { }
8455 istreambuf_iterator(streambuf_type* __s) throw()
8456 : _M_sbuf(__s), _M_c(traits_type::eof()) { }
8460 return traits_type::to_char_type(_M_get());
8462 istreambuf_iterator&
8469 _M_c = traits_type::eof();
8477 istreambuf_iterator __old = *this;
8480 __old._M_c = _M_sbuf->sbumpc();
8481 _M_c = traits_type::eof();
8486 equal(const istreambuf_iterator& __b) const
8487 { return _M_at_eof() == __b._M_at_eof(); }
8492 const int_type __eof = traits_type::eof();
8493 int_type __ret = __eof;
8496 if (!traits_type::eq_int_type(_M_c, __eof))
8498 else if (!traits_type::eq_int_type((__ret = _M_sbuf->sgetc()),
8509 const int_type __eof = traits_type::eof();
8510 return traits_type::eq_int_type(_M_get(), __eof);
8513 template<typename _CharT, typename _Traits>
8515 operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
8516 const istreambuf_iterator<_CharT, _Traits>& __b)
8517 { return __a.equal(__b); }
8518 template<typename _CharT, typename _Traits>
8520 operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
8521 const istreambuf_iterator<_CharT, _Traits>& __b)
8522 { return !__a.equal(__b); }
8523 template<typename _CharT, typename _Traits>
8524 class ostreambuf_iterator
8525 : public iterator<output_iterator_tag, void, void, void, void>
8528 typedef _CharT char_type;
8529 typedef _Traits traits_type;
8530 typedef basic_streambuf<_CharT, _Traits> streambuf_type;
8531 typedef basic_ostream<_CharT, _Traits> ostream_type;
8532 template<typename _CharT2>
8533 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
8534 ostreambuf_iterator<_CharT2> >::__type
8535 copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
8536 ostreambuf_iterator<_CharT2>);
8538 streambuf_type* _M_sbuf;
8541 ostreambuf_iterator(ostream_type& __s) throw ()
8542 : _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { }
8543 ostreambuf_iterator(streambuf_type* __s) throw ()
8544 : _M_sbuf(__s), _M_failed(!_M_sbuf) { }
8545 ostreambuf_iterator&
8546 operator=(_CharT __c)
8549 _Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof()))
8553 ostreambuf_iterator&
8556 ostreambuf_iterator&
8559 ostreambuf_iterator&
8563 failed() const throw()
8564 { return _M_failed; }
8565 ostreambuf_iterator&
8566 _M_put(const _CharT* __ws, streamsize __len)
8568 if (__builtin_expect(!_M_failed, true)
8569 && __builtin_expect(this->_M_sbuf->sputn(__ws, __len) != __len,
8575 template<typename _CharT>
8576 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
8577 ostreambuf_iterator<_CharT> >::__type
8578 copy(istreambuf_iterator<_CharT> __first,
8579 istreambuf_iterator<_CharT> __last,
8580 ostreambuf_iterator<_CharT> __result)
8582 if (__first._M_sbuf && !__last._M_sbuf && !__result._M_failed)
8585 __copy_streambufs_eof(__first._M_sbuf, __result._M_sbuf, __ineof);
8587 __result._M_failed = true;
8591 template<bool _IsMove, typename _CharT>
8592 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
8593 ostreambuf_iterator<_CharT> >::__type
8594 __copy_move_a2(_CharT* __first, _CharT* __last,
8595 ostreambuf_iterator<_CharT> __result)
8597 const streamsize __num = __last - __first;
8599 __result._M_put(__first, __num);
8602 template<bool _IsMove, typename _CharT>
8603 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
8604 ostreambuf_iterator<_CharT> >::__type
8605 __copy_move_a2(const _CharT* __first, const _CharT* __last,
8606 ostreambuf_iterator<_CharT> __result)
8608 const streamsize __num = __last - __first;
8610 __result._M_put(__first, __num);
8613 template<bool _IsMove, typename _CharT>
8614 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
8616 __copy_move_a2(istreambuf_iterator<_CharT> __first,
8617 istreambuf_iterator<_CharT> __last, _CharT* __result)
8619 typedef istreambuf_iterator<_CharT> __is_iterator_type;
8620 typedef typename __is_iterator_type::traits_type traits_type;
8621 typedef typename __is_iterator_type::streambuf_type streambuf_type;
8622 typedef typename traits_type::int_type int_type;
8623 if (__first._M_sbuf && !__last._M_sbuf)
8625 streambuf_type* __sb = __first._M_sbuf;
8626 int_type __c = __sb->sgetc();
8627 while (!traits_type::eq_int_type(__c, traits_type::eof()))
8629 const streamsize __n = __sb->egptr() - __sb->gptr();
8632 traits_type::copy(__result, __sb->gptr(), __n);
8635 __c = __sb->underflow();
8639 *__result++ = traits_type::to_char_type(__c);
8640 __c = __sb->snextc();
8646 template<typename _CharT>
8647 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
8648 istreambuf_iterator<_CharT> >::__type
8649 find(istreambuf_iterator<_CharT> __first,
8650 istreambuf_iterator<_CharT> __last, const _CharT& __val)
8652 typedef istreambuf_iterator<_CharT> __is_iterator_type;
8653 typedef typename __is_iterator_type::traits_type traits_type;
8654 typedef typename __is_iterator_type::streambuf_type streambuf_type;
8655 typedef typename traits_type::int_type int_type;
8656 if (__first._M_sbuf && !__last._M_sbuf)
8658 const int_type __ival = traits_type::to_int_type(__val);
8659 streambuf_type* __sb = __first._M_sbuf;
8660 int_type __c = __sb->sgetc();
8661 while (!traits_type::eq_int_type(__c, traits_type::eof())
8662 && !traits_type::eq_int_type(__c, __ival))
8664 streamsize __n = __sb->egptr() - __sb->gptr();
8667 const _CharT* __p = traits_type::find(__sb->gptr(),
8670 __n = __p - __sb->gptr();
8672 __c = __sb->sgetc();
8675 __c = __sb->snextc();
8677 if (!traits_type::eq_int_type(__c, traits_type::eof()))
8680 __first._M_sbuf = 0;
8685 namespace std __attribute__ ((__visibility__ ("default"))) {
8686 template<typename _Tv>
8688 __convert_to_v(const char* __in, _Tv& __out, ios_base::iostate& __err,
8689 const __c_locale& __cloc);
8692 __convert_to_v(const char*, float&, ios_base::iostate&,
8696 __convert_to_v(const char*, double&, ios_base::iostate&,
8700 __convert_to_v(const char*, long double&, ios_base::iostate&,
8702 template<typename _CharT, typename _Traits>
8706 _S_pad(ios_base& __io, _CharT __fill, _CharT* __news,
8707 const _CharT* __olds, const streamsize __newlen,
8708 const streamsize __oldlen);
8710 template<typename _CharT>
8712 __add_grouping(_CharT* __s, _CharT __sep,
8713 const char* __gbeg, size_t __gsize,
8714 const _CharT* __first, const _CharT* __last);
8715 template<typename _CharT>
8717 ostreambuf_iterator<_CharT>
8718 __write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len)
8720 __s._M_put(__ws, __len);
8723 template<typename _CharT, typename _OutIter>
8726 __write(_OutIter __s, const _CharT* __ws, int __len)
8728 for (int __j = 0; __j < __len; __j++, ++__s)
8732 template<typename _CharT>
8733 class __ctype_abstract_base : public locale::facet, public ctype_base
8736 typedef _CharT char_type;
8738 is(mask __m, char_type __c) const
8739 { return this->do_is(__m, __c); }
8741 is(const char_type *__lo, const char_type *__hi, mask *__vec) const
8742 { return this->do_is(__lo, __hi, __vec); }
8744 scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
8745 { return this->do_scan_is(__m, __lo, __hi); }
8747 scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
8748 { return this->do_scan_not(__m, __lo, __hi); }
8750 toupper(char_type __c) const
8751 { return this->do_toupper(__c); }
8753 toupper(char_type *__lo, const char_type* __hi) const
8754 { return this->do_toupper(__lo, __hi); }
8756 tolower(char_type __c) const
8757 { return this->do_tolower(__c); }
8759 tolower(char_type* __lo, const char_type* __hi) const
8760 { return this->do_tolower(__lo, __hi); }
8762 widen(char __c) const
8763 { return this->do_widen(__c); }
8765 widen(const char* __lo, const char* __hi, char_type* __to) const
8766 { return this->do_widen(__lo, __hi, __to); }
8768 narrow(char_type __c, char __dfault) const
8769 { return this->do_narrow(__c, __dfault); }
8771 narrow(const char_type* __lo, const char_type* __hi,
8772 char __dfault, char *__to) const
8773 { return this->do_narrow(__lo, __hi, __dfault, __to); }
8776 __ctype_abstract_base(size_t __refs = 0): facet(__refs) { }
8778 ~__ctype_abstract_base() { }
8780 do_is(mask __m, char_type __c) const = 0;
8781 virtual const char_type*
8782 do_is(const char_type* __lo, const char_type* __hi,
8783 mask* __vec) const = 0;
8784 virtual const char_type*
8785 do_scan_is(mask __m, const char_type* __lo,
8786 const char_type* __hi) const = 0;
8787 virtual const char_type*
8788 do_scan_not(mask __m, const char_type* __lo,
8789 const char_type* __hi) const = 0;
8791 do_toupper(char_type) const = 0;
8792 virtual const char_type*
8793 do_toupper(char_type* __lo, const char_type* __hi) const = 0;
8795 do_tolower(char_type) const = 0;
8796 virtual const char_type*
8797 do_tolower(char_type* __lo, const char_type* __hi) const = 0;
8799 do_widen(char) const = 0;
8801 do_widen(const char* __lo, const char* __hi,
8802 char_type* __dest) const = 0;
8804 do_narrow(char_type, char __dfault) const = 0;
8805 virtual const char_type*
8806 do_narrow(const char_type* __lo, const char_type* __hi,
8807 char __dfault, char* __dest) const = 0;
8809 template<typename _CharT>
8810 class ctype : public __ctype_abstract_base<_CharT>
8813 typedef _CharT char_type;
8814 typedef typename __ctype_abstract_base<_CharT>::mask mask;
8815 static locale::id id;
8817 ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { }
8822 do_is(mask __m, char_type __c) const;
8823 virtual const char_type*
8824 do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
8825 virtual const char_type*
8826 do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
8827 virtual const char_type*
8828 do_scan_not(mask __m, const char_type* __lo,
8829 const char_type* __hi) const;
8831 do_toupper(char_type __c) const;
8832 virtual const char_type*
8833 do_toupper(char_type* __lo, const char_type* __hi) const;
8835 do_tolower(char_type __c) const;
8836 virtual const char_type*
8837 do_tolower(char_type* __lo, const char_type* __hi) const;
8839 do_widen(char __c) const;
8841 do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
8843 do_narrow(char_type, char __dfault) const;
8844 virtual const char_type*
8845 do_narrow(const char_type* __lo, const char_type* __hi,
8846 char __dfault, char* __dest) const;
8848 template<typename _CharT>
8849 locale::id ctype<_CharT>::id;
8851 class ctype<char> : public locale::facet, public ctype_base
8854 typedef char char_type;
8856 __c_locale _M_c_locale_ctype;
8858 __to_type _M_toupper;
8859 __to_type _M_tolower;
8860 const mask* _M_table;
8861 mutable char _M_widen_ok;
8862 mutable char _M_widen[1 + static_cast<unsigned char>(-1)];
8863 mutable char _M_narrow[1 + static_cast<unsigned char>(-1)];
8864 mutable char _M_narrow_ok;
8866 static locale::id id;
8867 static const size_t table_size = 1 + static_cast<unsigned char>(-1);
8869 ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
8871 ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false,
8874 is(mask __m, char __c) const;
8876 is(const char* __lo, const char* __hi, mask* __vec) const;
8878 scan_is(mask __m, const char* __lo, const char* __hi) const;
8880 scan_not(mask __m, const char* __lo, const char* __hi) const;
8882 toupper(char_type __c) const
8883 { return this->do_toupper(__c); }
8885 toupper(char_type *__lo, const char_type* __hi) const
8886 { return this->do_toupper(__lo, __hi); }
8888 tolower(char_type __c) const
8889 { return this->do_tolower(__c); }
8891 tolower(char_type* __lo, const char_type* __hi) const
8892 { return this->do_tolower(__lo, __hi); }
8894 widen(char __c) const
8897 return _M_widen[static_cast<unsigned char>(__c)];
8898 this->_M_widen_init();
8899 return this->do_widen(__c);
8902 widen(const char* __lo, const char* __hi, char_type* __to) const
8904 if (_M_widen_ok == 1)
8906 __builtin_memcpy(__to, __lo, __hi - __lo);
8911 return this->do_widen(__lo, __hi, __to);
8914 narrow(char_type __c, char __dfault) const
8916 if (_M_narrow[static_cast<unsigned char>(__c)])
8917 return _M_narrow[static_cast<unsigned char>(__c)];
8918 const char __t = do_narrow(__c, __dfault);
8919 if (__t != __dfault)
8920 _M_narrow[static_cast<unsigned char>(__c)] = __t;
8924 narrow(const char_type* __lo, const char_type* __hi,
8925 char __dfault, char *__to) const
8927 if (__builtin_expect(_M_narrow_ok == 1, true))
8929 __builtin_memcpy(__to, __lo, __hi - __lo);
8934 return this->do_narrow(__lo, __hi, __dfault, __to);
8937 table() const throw()
8938 { return _M_table; }
8940 classic_table() throw();
8945 do_toupper(char_type) const;
8946 virtual const char_type*
8947 do_toupper(char_type* __lo, const char_type* __hi) const;
8949 do_tolower(char_type) const;
8950 virtual const char_type*
8951 do_tolower(char_type* __lo, const char_type* __hi) const;
8953 do_widen(char __c) const
8956 do_widen(const char* __lo, const char* __hi, char_type* __dest) const
8958 __builtin_memcpy(__dest, __lo, __hi - __lo);
8962 do_narrow(char_type __c, char) const
8964 virtual const char_type*
8965 do_narrow(const char_type* __lo, const char_type* __hi,
8966 char, char* __dest) const
8968 __builtin_memcpy(__dest, __lo, __hi - __lo);
8972 void _M_widen_init() const
8974 char __tmp[sizeof(_M_widen)];
8975 for (size_t __i = 0; __i < sizeof(_M_widen); ++__i)
8977 do_widen(__tmp, __tmp + sizeof(__tmp), _M_widen);
8979 if (__builtin_memcmp(__tmp, _M_widen, sizeof(_M_widen)))
8982 void _M_narrow_init() const
8984 char __tmp[sizeof(_M_narrow)];
8985 for (size_t __i = 0; __i < sizeof(_M_narrow); ++__i)
8987 do_narrow(__tmp, __tmp + sizeof(__tmp), 0, _M_narrow);
8989 if (__builtin_memcmp(__tmp, _M_narrow, sizeof(_M_narrow)))
8994 do_narrow(__tmp, __tmp + 1, 1, &__c);
9002 use_facet<ctype<char> >(const locale& __loc);
9003 template<typename _CharT>
9004 class ctype_byname : public ctype<_CharT>
9007 typedef typename ctype<_CharT>::mask mask;
9009 ctype_byname(const char* __s, size_t __refs = 0);
9012 ~ctype_byname() { };
9015 class ctype_byname<char> : public ctype<char>
9019 ctype_byname(const char* __s, size_t __refs = 0);
9025 namespace std __attribute__ ((__visibility__ ("default"))) {
9028 is(mask __m, char __c) const
9029 { return _M_table[static_cast<unsigned char>(__c)] & __m; }
9032 is(const char* __low, const char* __high, mask* __vec) const
9034 while (__low < __high)
9035 *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
9040 scan_is(mask __m, const char* __low, const char* __high) const
9042 while (__low < __high
9043 && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
9049 scan_not(mask __m, const char* __low, const char* __high) const
9051 while (__low < __high
9052 && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
9057 namespace std __attribute__ ((__visibility__ ("default"))) {
9068 _S_odigits_end = _S_odigits + 16,
9069 _S_oudigits = _S_odigits_end,
9070 _S_oudigits_end = _S_oudigits + 16,
9071 _S_oe = _S_odigits + 14,
9072 _S_oE = _S_oudigits + 14,
9073 _S_oend = _S_oudigits_end
9075 static const char* _S_atoms_out;
9076 static const char* _S_atoms_in;
9084 _S_ie = _S_izero + 14,
9085 _S_iE = _S_izero + 20,
9089 _S_format_float(const ios_base& __io, char* __fptr, char __mod);
9091 template<typename _CharT>
9092 struct __numpunct_cache : public locale::facet
9094 const char* _M_grouping;
9095 size_t _M_grouping_size;
9096 bool _M_use_grouping;
9097 const _CharT* _M_truename;
9098 size_t _M_truename_size;
9099 const _CharT* _M_falsename;
9100 size_t _M_falsename_size;
9101 _CharT _M_decimal_point;
9102 _CharT _M_thousands_sep;
9103 _CharT _M_atoms_out[__num_base::_S_oend];
9104 _CharT _M_atoms_in[__num_base::_S_iend];
9106 __numpunct_cache(size_t __refs = 0) : facet(__refs),
9107 _M_grouping(__null), _M_grouping_size(0), _M_use_grouping(false),
9108 _M_truename(__null), _M_truename_size(0), _M_falsename(__null),
9109 _M_falsename_size(0), _M_decimal_point(_CharT()),
9110 _M_thousands_sep(_CharT()), _M_allocated(false)
9112 ~__numpunct_cache();
9114 _M_cache(const locale& __loc);
9117 operator=(const __numpunct_cache&);
9119 __numpunct_cache(const __numpunct_cache&);
9121 template<typename _CharT>
9122 __numpunct_cache<_CharT>::~__numpunct_cache()
9126 delete [] _M_grouping;
9127 delete [] _M_truename;
9128 delete [] _M_falsename;
9131 template<typename _CharT>
9132 class numpunct : public locale::facet
9135 typedef _CharT char_type;
9136 typedef basic_string<_CharT> string_type;
9137 typedef __numpunct_cache<_CharT> __cache_type;
9139 __cache_type* _M_data;
9141 static locale::id id;
9143 numpunct(size_t __refs = 0) : facet(__refs), _M_data(__null)
9144 { _M_initialize_numpunct(); }
9146 numpunct(__cache_type* __cache, size_t __refs = 0)
9147 : facet(__refs), _M_data(__cache)
9148 { _M_initialize_numpunct(); }
9150 numpunct(__c_locale __cloc, size_t __refs = 0)
9151 : facet(__refs), _M_data(__null)
9152 { _M_initialize_numpunct(__cloc); }
9154 decimal_point() const
9155 { return this->do_decimal_point(); }
9157 thousands_sep() const
9158 { return this->do_thousands_sep(); }
9161 { return this->do_grouping(); }
9164 { return this->do_truename(); }
9167 { return this->do_falsename(); }
9172 do_decimal_point() const
9173 { return _M_data->_M_decimal_point; }
9175 do_thousands_sep() const
9176 { return _M_data->_M_thousands_sep; }
9179 { return _M_data->_M_grouping; }
9182 { return _M_data->_M_truename; }
9184 do_falsename() const
9185 { return _M_data->_M_falsename; }
9187 _M_initialize_numpunct(__c_locale __cloc = __null);
9189 template<typename _CharT>
9190 locale::id numpunct<_CharT>::id;
9192 numpunct<char>::~numpunct();
9195 numpunct<char>::_M_initialize_numpunct(__c_locale __cloc);
9196 template<typename _CharT>
9197 class numpunct_byname : public numpunct<_CharT>
9200 typedef _CharT char_type;
9201 typedef basic_string<_CharT> string_type;
9203 numpunct_byname(const char* __s, size_t __refs = 0)
9204 : numpunct<_CharT>(__refs)
9206 if (__builtin_strcmp(__s, "C") != 0
9207 && __builtin_strcmp(__s, "POSIX") != 0)
9210 this->_S_create_c_locale(__tmp, __s);
9211 this->_M_initialize_numpunct(__tmp);
9212 this->_S_destroy_c_locale(__tmp);
9217 ~numpunct_byname() { }
9219 template<typename _CharT, typename _InIter>
9220 class num_get : public locale::facet
9223 typedef _CharT char_type;
9224 typedef _InIter iter_type;
9225 static locale::id id;
9227 num_get(size_t __refs = 0) : facet(__refs) { }
9229 get(iter_type __in, iter_type __end, ios_base& __io,
9230 ios_base::iostate& __err, bool& __v) const
9231 { return this->do_get(__in, __end, __io, __err, __v); }
9233 get(iter_type __in, iter_type __end, ios_base& __io,
9234 ios_base::iostate& __err, long& __v) const
9235 { return this->do_get(__in, __end, __io, __err, __v); }
9237 get(iter_type __in, iter_type __end, ios_base& __io,
9238 ios_base::iostate& __err, unsigned short& __v) const
9239 { return this->do_get(__in, __end, __io, __err, __v); }
9241 get(iter_type __in, iter_type __end, ios_base& __io,
9242 ios_base::iostate& __err, unsigned int& __v) const
9243 { return this->do_get(__in, __end, __io, __err, __v); }
9245 get(iter_type __in, iter_type __end, ios_base& __io,
9246 ios_base::iostate& __err, unsigned long& __v) const
9247 { return this->do_get(__in, __end, __io, __err, __v); }
9249 get(iter_type __in, iter_type __end, ios_base& __io,
9250 ios_base::iostate& __err, long long& __v) const
9251 { return this->do_get(__in, __end, __io, __err, __v); }
9253 get(iter_type __in, iter_type __end, ios_base& __io,
9254 ios_base::iostate& __err, unsigned long long& __v) const
9255 { return this->do_get(__in, __end, __io, __err, __v); }
9257 get(iter_type __in, iter_type __end, ios_base& __io,
9258 ios_base::iostate& __err, float& __v) const
9259 { return this->do_get(__in, __end, __io, __err, __v); }
9261 get(iter_type __in, iter_type __end, ios_base& __io,
9262 ios_base::iostate& __err, double& __v) const
9263 { return this->do_get(__in, __end, __io, __err, __v); }
9265 get(iter_type __in, iter_type __end, ios_base& __io,
9266 ios_base::iostate& __err, long double& __v) const
9267 { return this->do_get(__in, __end, __io, __err, __v); }
9269 get(iter_type __in, iter_type __end, ios_base& __io,
9270 ios_base::iostate& __err, void*& __v) const
9271 { return this->do_get(__in, __end, __io, __err, __v); }
9273 virtual ~num_get() { }
9275 _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&,
9276 string& __xtrc) const;
9277 template<typename _ValueT>
9279 _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
9280 _ValueT& __v) const;
9281 template<typename _CharT2>
9282 typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, int>::__type
9283 _M_find(const _CharT2*, size_t __len, _CharT2 __c) const
9288 if (__c >= _CharT2('0') && __c < _CharT2(_CharT2('0') + __len))
9289 __ret = __c - _CharT2('0');
9293 if (__c >= _CharT2('0') && __c <= _CharT2('9'))
9294 __ret = __c - _CharT2('0');
9295 else if (__c >= _CharT2('a') && __c <= _CharT2('f'))
9296 __ret = 10 + (__c - _CharT2('a'));
9297 else if (__c >= _CharT2('A') && __c <= _CharT2('F'))
9298 __ret = 10 + (__c - _CharT2('A'));
9302 template<typename _CharT2>
9303 typename __gnu_cxx::__enable_if<!__is_char<_CharT2>::__value,
9305 _M_find(const _CharT2* __zero, size_t __len, _CharT2 __c) const
9308 const char_type* __q = char_traits<_CharT2>::find(__zero, __len, __c);
9311 __ret = __q - __zero;
9318 do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
9320 do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, long&) const;
9322 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
9323 unsigned short&) const;
9325 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
9326 unsigned int&) const;
9328 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
9329 unsigned long&) const;
9331 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
9334 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
9335 unsigned long long&) const;
9337 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
9340 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
9343 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
9344 long double&) const;
9346 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
9349 template<typename _CharT, typename _InIter>
9350 locale::id num_get<_CharT, _InIter>::id;
9351 template<typename _CharT, typename _OutIter>
9352 class num_put : public locale::facet
9355 typedef _CharT char_type;
9356 typedef _OutIter iter_type;
9357 static locale::id id;
9359 num_put(size_t __refs = 0) : facet(__refs) { }
9361 put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const
9362 { return this->do_put(__s, __f, __fill, __v); }
9364 put(iter_type __s, ios_base& __f, char_type __fill, long __v) const
9365 { return this->do_put(__s, __f, __fill, __v); }
9367 put(iter_type __s, ios_base& __f, char_type __fill,
9368 unsigned long __v) const
9369 { return this->do_put(__s, __f, __fill, __v); }
9371 put(iter_type __s, ios_base& __f, char_type __fill, long long __v) const
9372 { return this->do_put(__s, __f, __fill, __v); }
9374 put(iter_type __s, ios_base& __f, char_type __fill,
9375 unsigned long long __v) const
9376 { return this->do_put(__s, __f, __fill, __v); }
9378 put(iter_type __s, ios_base& __f, char_type __fill, double __v) const
9379 { return this->do_put(__s, __f, __fill, __v); }
9381 put(iter_type __s, ios_base& __f, char_type __fill,
9382 long double __v) const
9383 { return this->do_put(__s, __f, __fill, __v); }
9385 put(iter_type __s, ios_base& __f, char_type __fill,
9386 const void* __v) const
9387 { return this->do_put(__s, __f, __fill, __v); }
9389 template<typename _ValueT>
9391 _M_insert_float(iter_type, ios_base& __io, char_type __fill,
9392 char __mod, _ValueT __v) const;
9394 _M_group_float(const char* __grouping, size_t __grouping_size,
9395 char_type __sep, const char_type* __p, char_type* __new,
9396 char_type* __cs, int& __len) const;
9397 template<typename _ValueT>
9399 _M_insert_int(iter_type, ios_base& __io, char_type __fill,
9402 _M_group_int(const char* __grouping, size_t __grouping_size,
9403 char_type __sep, ios_base& __io, char_type* __new,
9404 char_type* __cs, int& __len) const;
9406 _M_pad(char_type __fill, streamsize __w, ios_base& __io,
9407 char_type* __new, const char_type* __cs, int& __len) const;
9411 do_put(iter_type, ios_base&, char_type __fill, bool __v) const;
9413 do_put(iter_type, ios_base&, char_type __fill, long __v) const;
9415 do_put(iter_type, ios_base&, char_type __fill, unsigned long) const;
9417 do_put(iter_type, ios_base&, char_type __fill, long long __v) const;
9419 do_put(iter_type, ios_base&, char_type __fill, unsigned long long) const;
9421 do_put(iter_type, ios_base&, char_type __fill, double __v) const;
9423 do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
9425 do_put(iter_type, ios_base&, char_type __fill, const void* __v) const;
9427 template <typename _CharT, typename _OutIter>
9428 locale::id num_put<_CharT, _OutIter>::id;
9429 template<typename _CharT>
9431 isspace(_CharT __c, const locale& __loc)
9432 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); }
9433 template<typename _CharT>
9435 isprint(_CharT __c, const locale& __loc)
9436 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); }
9437 template<typename _CharT>
9439 iscntrl(_CharT __c, const locale& __loc)
9440 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); }
9441 template<typename _CharT>
9443 isupper(_CharT __c, const locale& __loc)
9444 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); }
9445 template<typename _CharT>
9447 islower(_CharT __c, const locale& __loc)
9448 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); }
9449 template<typename _CharT>
9451 isalpha(_CharT __c, const locale& __loc)
9452 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); }
9453 template<typename _CharT>
9455 isdigit(_CharT __c, const locale& __loc)
9456 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); }
9457 template<typename _CharT>
9459 ispunct(_CharT __c, const locale& __loc)
9460 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); }
9461 template<typename _CharT>
9463 isxdigit(_CharT __c, const locale& __loc)
9464 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); }
9465 template<typename _CharT>
9467 isalnum(_CharT __c, const locale& __loc)
9468 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); }
9469 template<typename _CharT>
9471 isgraph(_CharT __c, const locale& __loc)
9472 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); }
9473 template<typename _CharT>
9475 toupper(_CharT __c, const locale& __loc)
9476 { return use_facet<ctype<_CharT> >(__loc).toupper(__c); }
9477 template<typename _CharT>
9479 tolower(_CharT __c, const locale& __loc)
9480 { return use_facet<ctype<_CharT> >(__loc).tolower(__c); }
9482 namespace std __attribute__ ((__visibility__ ("default"))) {
9483 template<typename _Facet>
9487 operator() (const locale& __loc) const;
9489 template<typename _CharT>
9490 struct __use_cache<__numpunct_cache<_CharT> >
9492 const __numpunct_cache<_CharT>*
9493 operator() (const locale& __loc) const
9495 const size_t __i = numpunct<_CharT>::id._M_id();
9496 const locale::facet** __caches = __loc._M_impl->_M_caches;
9499 __numpunct_cache<_CharT>* __tmp = __null;
9502 __tmp = new __numpunct_cache<_CharT>;
9503 __tmp->_M_cache(__loc);
9510 __loc._M_impl->_M_install_cache(__tmp, __i);
9512 return static_cast<const __numpunct_cache<_CharT>*>(__caches[__i]);
9515 template<typename _CharT>
9517 __numpunct_cache<_CharT>::_M_cache(const locale& __loc)
9519 _M_allocated = true;
9520 const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
9521 _M_grouping_size = __np.grouping().size();
9522 char* __grouping = new char[_M_grouping_size];
9523 __np.grouping().copy(__grouping, _M_grouping_size);
9524 _M_grouping = __grouping;
9525 _M_use_grouping = (_M_grouping_size
9526 && static_cast<signed char>(__np.grouping()[0]) > 0);
9527 _M_truename_size = __np.truename().size();
9528 _CharT* __truename = new _CharT[_M_truename_size];
9529 __np.truename().copy(__truename, _M_truename_size);
9530 _M_truename = __truename;
9531 _M_falsename_size = __np.falsename().size();
9532 _CharT* __falsename = new _CharT[_M_falsename_size];
9533 __np.falsename().copy(__falsename, _M_falsename_size);
9534 _M_falsename = __falsename;
9535 _M_decimal_point = __np.decimal_point();
9536 _M_thousands_sep = __np.thousands_sep();
9537 const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
9538 __ct.widen(__num_base::_S_atoms_out,
9539 __num_base::_S_atoms_out + __num_base::_S_oend, _M_atoms_out);
9540 __ct.widen(__num_base::_S_atoms_in,
9541 __num_base::_S_atoms_in + __num_base::_S_iend, _M_atoms_in);
9544 __verify_grouping(const char* __grouping, size_t __grouping_size,
9545 const string& __grouping_tmp);
9546 template<typename _CharT, typename _InIter>
9548 num_get<_CharT, _InIter>::
9549 _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
9550 ios_base::iostate& __err, string& __xtrc) const
9552 typedef char_traits<_CharT> __traits_type;
9553 typedef __numpunct_cache<_CharT> __cache_type;
9554 __use_cache<__cache_type> __uc;
9555 const locale& __loc = __io._M_getloc();
9556 const __cache_type* __lc = __uc(__loc);
9557 const _CharT* __lit = __lc->_M_atoms_in;
9558 char_type __c = char_type();
9559 bool __testeof = __beg == __end;
9563 const bool __plus = __c == __lit[__num_base::_S_iplus];
9564 if ((__plus || __c == __lit[__num_base::_S_iminus])
9565 && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
9566 && !(__c == __lc->_M_decimal_point))
9568 __xtrc += __plus ? '+' : '-';
9569 if (++__beg != __end)
9575 bool __found_mantissa = false;
9579 if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
9580 || __c == __lc->_M_decimal_point)
9582 else if (__c == __lit[__num_base::_S_izero])
9584 if (!__found_mantissa)
9587 __found_mantissa = true;
9590 if (++__beg != __end)
9598 bool __found_dec = false;
9599 bool __found_sci = false;
9600 string __found_grouping;
9601 if (__lc->_M_use_grouping)
9602 __found_grouping.reserve(32);
9603 const char_type* __lit_zero = __lit + __num_base::_S_izero;
9604 if (!__lc->_M_allocated)
9607 const int __digit = _M_find(__lit_zero, 10, __c);
9610 __xtrc += '0' + __digit;
9611 __found_mantissa = true;
9613 else if (__c == __lc->_M_decimal_point
9614 && !__found_dec && !__found_sci)
9619 else if ((__c == __lit[__num_base::_S_ie]
9620 || __c == __lit[__num_base::_S_iE])
9621 && !__found_sci && __found_mantissa)
9625 if (++__beg != __end)
9628 const bool __plus = __c == __lit[__num_base::_S_iplus];
9629 if (__plus || __c == __lit[__num_base::_S_iminus])
9630 __xtrc += __plus ? '+' : '-';
9642 if (++__beg != __end)
9650 if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
9652 if (!__found_dec && !__found_sci)
9656 __found_grouping += static_cast<char>(__sep_pos);
9668 else if (__c == __lc->_M_decimal_point)
9670 if (!__found_dec && !__found_sci)
9672 if (__found_grouping.size())
9673 __found_grouping += static_cast<char>(__sep_pos);
9682 const char_type* __q =
9683 __traits_type::find(__lit_zero, 10, __c);
9686 __xtrc += '0' + (__q - __lit_zero);
9687 __found_mantissa = true;
9690 else if ((__c == __lit[__num_base::_S_ie]
9691 || __c == __lit[__num_base::_S_iE])
9692 && !__found_sci && __found_mantissa)
9694 if (__found_grouping.size() && !__found_dec)
9695 __found_grouping += static_cast<char>(__sep_pos);
9698 if (++__beg != __end)
9701 const bool __plus = __c == __lit[__num_base::_S_iplus];
9702 if ((__plus || __c == __lit[__num_base::_S_iminus])
9703 && !(__lc->_M_use_grouping
9704 && __c == __lc->_M_thousands_sep)
9705 && !(__c == __lc->_M_decimal_point))
9706 __xtrc += __plus ? '+' : '-';
9719 if (++__beg != __end)
9724 if (__found_grouping.size())
9726 if (!__found_dec && !__found_sci)
9727 __found_grouping += static_cast<char>(__sep_pos);
9728 if (!std::__verify_grouping(__lc->_M_grouping,
9729 __lc->_M_grouping_size,
9731 __err |= ios_base::failbit;
9734 __err |= ios_base::eofbit;
9737 template<typename _CharT, typename _InIter>
9738 template<typename _ValueT>
9740 num_get<_CharT, _InIter>::
9741 _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
9742 ios_base::iostate& __err, _ValueT& __v) const
9744 typedef char_traits<_CharT> __traits_type;
9745 using __gnu_cxx::__add_unsigned;
9746 typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
9747 typedef __numpunct_cache<_CharT> __cache_type;
9748 __use_cache<__cache_type> __uc;
9749 const locale& __loc = __io._M_getloc();
9750 const __cache_type* __lc = __uc(__loc);
9751 const _CharT* __lit = __lc->_M_atoms_in;
9752 char_type __c = char_type();
9753 const ios_base::fmtflags __basefield = __io.flags()
9754 & ios_base::basefield;
9755 const bool __oct = __basefield == ios_base::oct;
9756 int __base = __oct ? 8 : (__basefield == ios_base::hex ? 16 : 10);
9757 bool __testeof = __beg == __end;
9758 bool __negative = false;
9762 if (__gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
9763 __negative = __c == __lit[__num_base::_S_iminus];
9764 if ((__negative || __c == __lit[__num_base::_S_iplus])
9765 && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
9766 && !(__c == __lc->_M_decimal_point))
9768 if (++__beg != __end)
9774 bool __found_zero = false;
9778 if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
9779 || __c == __lc->_M_decimal_point)
9781 else if (__c == __lit[__num_base::_S_izero]
9782 && (!__found_zero || __base == 10))
9784 __found_zero = true;
9786 if (__basefield == 0)
9791 else if (__found_zero
9792 && (__c == __lit[__num_base::_S_ix]
9793 || __c == __lit[__num_base::_S_iX]))
9795 if (__basefield == 0)
9799 __found_zero = false;
9807 if (++__beg != __end)
9816 const size_t __len = (__base == 16 ? __num_base::_S_iend
9817 - __num_base::_S_izero : __base);
9818 string __found_grouping;
9819 if (__lc->_M_use_grouping)
9820 __found_grouping.reserve(32);
9821 bool __testfail = false;
9822 const __unsigned_type __max = __negative
9823 ? -__gnu_cxx::__numeric_traits<_ValueT>::__min
9824 : __gnu_cxx::__numeric_traits<_ValueT>::__max;
9825 const __unsigned_type __smax = __max / __base;
9826 __unsigned_type __result = 0;
9828 const char_type* __lit_zero = __lit + __num_base::_S_izero;
9829 if (!__lc->_M_allocated)
9832 __digit = _M_find(__lit_zero, __len, __c);
9835 if (__result > __smax)
9840 __testfail |= __result > __max - __digit;
9841 __result += __digit;
9844 if (++__beg != __end)
9852 if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
9856 __found_grouping += static_cast<char>(__sep_pos);
9865 else if (__c == __lc->_M_decimal_point)
9869 const char_type* __q =
9870 __traits_type::find(__lit_zero, __len, __c);
9873 __digit = __q - __lit_zero;
9876 if (__result > __smax)
9881 __testfail |= __result > __max - __digit;
9882 __result += __digit;
9886 if (++__beg != __end)
9891 if (__found_grouping.size())
9893 __found_grouping += static_cast<char>(__sep_pos);
9894 if (!std::__verify_grouping(__lc->_M_grouping,
9895 __lc->_M_grouping_size,
9897 __err |= ios_base::failbit;
9899 if (!__testfail && (__sep_pos || __found_zero
9900 || __found_grouping.size()))
9901 __v = __negative ? -__result : __result;
9903 __err |= ios_base::failbit;
9905 __err |= ios_base::eofbit;
9908 template<typename _CharT, typename _InIter>
9910 num_get<_CharT, _InIter>::
9911 do_get(iter_type __beg, iter_type __end, ios_base& __io,
9912 ios_base::iostate& __err, bool& __v) const
9914 if (!(__io.flags() & ios_base::boolalpha))
9917 __beg = _M_extract_int(__beg, __end, __io, __err, __l);
9918 if (__l == 0 || __l == 1)
9921 __err |= ios_base::failbit;
9925 typedef __numpunct_cache<_CharT> __cache_type;
9926 __use_cache<__cache_type> __uc;
9927 const locale& __loc = __io._M_getloc();
9928 const __cache_type* __lc = __uc(__loc);
9929 bool __testf = true;
9930 bool __testt = true;
9932 bool __testeof = __beg == __end;
9933 for (__n = 0; !__testeof; ++__n)
9935 const char_type __c = *__beg;
9938 if (__n < __lc->_M_falsename_size)
9939 __testf = __c == __lc->_M_falsename[__n];
9945 if (__n < __lc->_M_truename_size)
9946 __testt = __c == __lc->_M_truename[__n];
9950 if (!__testf && !__testt)
9952 if (++__beg == __end)
9955 if (__testf && __n == __lc->_M_falsename_size)
9957 else if (__testt && __n == __lc->_M_truename_size)
9960 __err |= ios_base::failbit;
9962 __err |= ios_base::eofbit;
9966 template<typename _CharT, typename _InIter>
9968 num_get<_CharT, _InIter>::
9969 do_get(iter_type __beg, iter_type __end, ios_base& __io,
9970 ios_base::iostate& __err, long& __v) const
9971 { return _M_extract_int(__beg, __end, __io, __err, __v); }
9972 template<typename _CharT, typename _InIter>
9974 num_get<_CharT, _InIter>::
9975 do_get(iter_type __beg, iter_type __end, ios_base& __io,
9976 ios_base::iostate& __err, unsigned short& __v) const
9977 { return _M_extract_int(__beg, __end, __io, __err, __v); }
9978 template<typename _CharT, typename _InIter>
9980 num_get<_CharT, _InIter>::
9981 do_get(iter_type __beg, iter_type __end, ios_base& __io,
9982 ios_base::iostate& __err, unsigned int& __v) const
9983 { return _M_extract_int(__beg, __end, __io, __err, __v); }
9984 template<typename _CharT, typename _InIter>
9986 num_get<_CharT, _InIter>::
9987 do_get(iter_type __beg, iter_type __end, ios_base& __io,
9988 ios_base::iostate& __err, unsigned long& __v) const
9989 { return _M_extract_int(__beg, __end, __io, __err, __v); }
9990 template<typename _CharT, typename _InIter>
9992 num_get<_CharT, _InIter>::
9993 do_get(iter_type __beg, iter_type __end, ios_base& __io,
9994 ios_base::iostate& __err, long long& __v) const
9995 { return _M_extract_int(__beg, __end, __io, __err, __v); }
9996 template<typename _CharT, typename _InIter>
9998 num_get<_CharT, _InIter>::
9999 do_get(iter_type __beg, iter_type __end, ios_base& __io,
10000 ios_base::iostate& __err, unsigned long long& __v) const
10001 { return _M_extract_int(__beg, __end, __io, __err, __v); }
10002 template<typename _CharT, typename _InIter>
10004 num_get<_CharT, _InIter>::
10005 do_get(iter_type __beg, iter_type __end, ios_base& __io,
10006 ios_base::iostate& __err, float& __v) const
10009 __xtrc.reserve(32);
10010 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
10011 std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
10014 template<typename _CharT, typename _InIter>
10016 num_get<_CharT, _InIter>::
10017 do_get(iter_type __beg, iter_type __end, ios_base& __io,
10018 ios_base::iostate& __err, double& __v) const
10021 __xtrc.reserve(32);
10022 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
10023 std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
10026 template<typename _CharT, typename _InIter>
10028 num_get<_CharT, _InIter>::
10029 do_get(iter_type __beg, iter_type __end, ios_base& __io,
10030 ios_base::iostate& __err, long double& __v) const
10033 __xtrc.reserve(32);
10034 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
10035 std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
10038 template<typename _CharT, typename _InIter>
10040 num_get<_CharT, _InIter>::
10041 do_get(iter_type __beg, iter_type __end, ios_base& __io,
10042 ios_base::iostate& __err, void*& __v) const
10044 typedef ios_base::fmtflags fmtflags;
10045 const fmtflags __fmt = __io.flags();
10046 __io.flags((__fmt & ~ios_base::basefield) | ios_base::hex);
10047 typedef __gnu_cxx::__conditional_type<(sizeof(void*)
10048 <= sizeof(unsigned long)),
10049 unsigned long, unsigned long long>::__type _UIntPtrType;
10051 __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
10053 if (!(__err & ios_base::failbit))
10054 __v = reinterpret_cast<void*>(__ul);
10057 template<typename _CharT, typename _OutIter>
10059 num_put<_CharT, _OutIter>::
10060 _M_pad(_CharT __fill, streamsize __w, ios_base& __io,
10061 _CharT* __new, const _CharT* __cs, int& __len) const
10063 __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new,
10065 __len = static_cast<int>(__w);
10067 template<typename _CharT, typename _ValueT>
10069 __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit,
10070 ios_base::fmtflags __flags, bool __dec)
10072 _CharT* __buf = __bufend;
10073 if (__builtin_expect(__dec, true))
10077 *--__buf = __lit[(__v % 10) + __num_base::_S_odigits];
10082 else if ((__flags & ios_base::basefield) == ios_base::oct)
10086 *--__buf = __lit[(__v & 0x7) + __num_base::_S_odigits];
10093 const bool __uppercase = __flags & ios_base::uppercase;
10094 const int __case_offset = __uppercase ? __num_base::_S_oudigits
10095 : __num_base::_S_odigits;
10098 *--__buf = __lit[(__v & 0xf) + __case_offset];
10103 return __bufend - __buf;
10105 template<typename _CharT, typename _OutIter>
10107 num_put<_CharT, _OutIter>::
10108 _M_group_int(const char* __grouping, size_t __grouping_size, _CharT __sep,
10109 ios_base&, _CharT* __new, _CharT* __cs, int& __len) const
10111 _CharT* __p = std::__add_grouping(__new, __sep, __grouping,
10112 __grouping_size, __cs, __cs + __len);
10113 __len = __p - __new;
10115 template<typename _CharT, typename _OutIter>
10116 template<typename _ValueT>
10118 num_put<_CharT, _OutIter>::
10119 _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
10122 using __gnu_cxx::__add_unsigned;
10123 typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
10124 typedef __numpunct_cache<_CharT> __cache_type;
10125 __use_cache<__cache_type> __uc;
10126 const locale& __loc = __io._M_getloc();
10127 const __cache_type* __lc = __uc(__loc);
10128 const _CharT* __lit = __lc->_M_atoms_out;
10129 const ios_base::fmtflags __flags = __io.flags();
10130 const int __ilen = 5 * sizeof(_ValueT);
10131 _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
10133 const ios_base::fmtflags __basefield = __flags & ios_base::basefield;
10134 const bool __dec = (__basefield != ios_base::oct
10135 && __basefield != ios_base::hex);
10136 const __unsigned_type __u = ((__v > 0 || !__dec)
10137 ? __unsigned_type(__v)
10138 : -__unsigned_type(__v));
10139 int __len = __int_to_char(__cs + __ilen, __u, __lit, __flags, __dec);
10140 __cs += __ilen - __len;
10141 if (__lc->_M_use_grouping)
10143 _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
10146 _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size,
10147 __lc->_M_thousands_sep, __io, __cs2 + 2, __cs, __len);
10150 if (__builtin_expect(__dec, true))
10154 if (bool(__flags & ios_base::showpos)
10155 && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
10156 *--__cs = __lit[__num_base::_S_oplus], ++__len;
10159 *--__cs = __lit[__num_base::_S_ominus], ++__len;
10161 else if (bool(__flags & ios_base::showbase) && __v)
10163 if (__basefield == ios_base::oct)
10164 *--__cs = __lit[__num_base::_S_odigits], ++__len;
10167 const bool __uppercase = __flags & ios_base::uppercase;
10168 *--__cs = __lit[__num_base::_S_ox + __uppercase];
10169 *--__cs = __lit[__num_base::_S_odigits];
10173 const streamsize __w = __io.width();
10174 if (__w > static_cast<streamsize>(__len))
10176 _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
10178 _M_pad(__fill, __w, __io, __cs3, __cs, __len);
10182 return std::__write(__s, __cs, __len);
10184 template<typename _CharT, typename _OutIter>
10186 num_put<_CharT, _OutIter>::
10187 _M_group_float(const char* __grouping, size_t __grouping_size,
10188 _CharT __sep, const _CharT* __p, _CharT* __new,
10189 _CharT* __cs, int& __len) const
10191 const int __declen = __p ? __p - __cs : __len;
10192 _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping,
10194 __cs, __cs + __declen);
10195 int __newlen = __p2 - __new;
10198 char_traits<_CharT>::copy(__p2, __p, __len - __declen);
10199 __newlen += __len - __declen;
10203 template<typename _CharT, typename _OutIter>
10204 template<typename _ValueT>
10206 num_put<_CharT, _OutIter>::
10207 _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod,
10210 typedef __numpunct_cache<_CharT> __cache_type;
10211 __use_cache<__cache_type> __uc;
10212 const locale& __loc = __io._M_getloc();
10213 const __cache_type* __lc = __uc(__loc);
10214 const streamsize __prec = __io.precision() < 0 ? 6 : __io.precision();
10215 const int __max_digits =
10216 __gnu_cxx::__numeric_traits<_ValueT>::__digits10;
10219 __num_base::_S_format_float(__io, __fbuf, __mod);
10220 const bool __fixed = __io.flags() & ios_base::fixed;
10221 const int __max_exp =
10222 __gnu_cxx::__numeric_traits<_ValueT>::__max_exponent10;
10223 const int __cs_size = __fixed ? __max_exp + __prec + 4
10224 : __max_digits * 2 + __prec;
10225 char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
10226 __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf,
10228 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
10229 _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
10231 __ctype.widen(__cs, __cs + __len, __ws);
10233 const char* __p = char_traits<char>::find(__cs, __len, '.');
10236 __wp = __ws + (__p - __cs);
10237 *__wp = __lc->_M_decimal_point;
10239 if (__lc->_M_use_grouping
10240 && (__wp || __len < 3 || (__cs[1] <= '9' && __cs[2] <= '9'
10241 && __cs[1] >= '0' && __cs[2] >= '0')))
10243 _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
10245 streamsize __off = 0;
10246 if (__cs[0] == '-' || __cs[0] == '+')
10249 __ws2[0] = __ws[0];
10252 _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size,
10253 __lc->_M_thousands_sep, __wp, __ws2 + __off,
10254 __ws + __off, __len);
10258 const streamsize __w = __io.width();
10259 if (__w > static_cast<streamsize>(__len))
10261 _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
10263 _M_pad(__fill, __w, __io, __ws3, __ws, __len);
10267 return std::__write(__s, __ws, __len);
10269 template<typename _CharT, typename _OutIter>
10271 num_put<_CharT, _OutIter>::
10272 do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
10274 const ios_base::fmtflags __flags = __io.flags();
10275 if ((__flags & ios_base::boolalpha) == 0)
10277 const long __l = __v;
10278 __s = _M_insert_int(__s, __io, __fill, __l);
10282 typedef __numpunct_cache<_CharT> __cache_type;
10283 __use_cache<__cache_type> __uc;
10284 const locale& __loc = __io._M_getloc();
10285 const __cache_type* __lc = __uc(__loc);
10286 const _CharT* __name = __v ? __lc->_M_truename
10287 : __lc->_M_falsename;
10288 int __len = __v ? __lc->_M_truename_size
10289 : __lc->_M_falsename_size;
10290 const streamsize __w = __io.width();
10291 if (__w > static_cast<streamsize>(__len))
10294 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
10296 _M_pad(__fill, __w, __io, __cs, __name, __len);
10300 __s = std::__write(__s, __name, __len);
10304 template<typename _CharT, typename _OutIter>
10306 num_put<_CharT, _OutIter>::
10307 do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
10308 { return _M_insert_int(__s, __io, __fill, __v); }
10309 template<typename _CharT, typename _OutIter>
10311 num_put<_CharT, _OutIter>::
10312 do_put(iter_type __s, ios_base& __io, char_type __fill,
10313 unsigned long __v) const
10314 { return _M_insert_int(__s, __io, __fill, __v); }
10315 template<typename _CharT, typename _OutIter>
10317 num_put<_CharT, _OutIter>::
10318 do_put(iter_type __s, ios_base& __io, char_type __fill, long long __v) const
10319 { return _M_insert_int(__s, __io, __fill, __v); }
10320 template<typename _CharT, typename _OutIter>
10322 num_put<_CharT, _OutIter>::
10323 do_put(iter_type __s, ios_base& __io, char_type __fill,
10324 unsigned long long __v) const
10325 { return _M_insert_int(__s, __io, __fill, __v); }
10326 template<typename _CharT, typename _OutIter>
10328 num_put<_CharT, _OutIter>::
10329 do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
10330 { return _M_insert_float(__s, __io, __fill, char(), __v); }
10331 template<typename _CharT, typename _OutIter>
10333 num_put<_CharT, _OutIter>::
10334 do_put(iter_type __s, ios_base& __io, char_type __fill,
10335 long double __v) const
10336 { return _M_insert_float(__s, __io, __fill, 'L', __v); }
10337 template<typename _CharT, typename _OutIter>
10339 num_put<_CharT, _OutIter>::
10340 do_put(iter_type __s, ios_base& __io, char_type __fill,
10341 const void* __v) const
10343 const ios_base::fmtflags __flags = __io.flags();
10344 const ios_base::fmtflags __fmt = ~(ios_base::basefield
10345 | ios_base::uppercase
10346 | ios_base::internal);
10347 __io.flags((__flags & __fmt) | (ios_base::hex | ios_base::showbase));
10348 typedef __gnu_cxx::__conditional_type<(sizeof(const void*)
10349 <= sizeof(unsigned long)),
10350 unsigned long, unsigned long long>::__type _UIntPtrType;
10351 __s = _M_insert_int(__s, __io, __fill,
10352 reinterpret_cast<_UIntPtrType>(__v));
10353 __io.flags(__flags);
10356 template<typename _CharT, typename _Traits>
10358 __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill,
10359 _CharT* __news, const _CharT* __olds,
10360 const streamsize __newlen,
10361 const streamsize __oldlen)
10363 const size_t __plen = static_cast<size_t>(__newlen - __oldlen);
10364 const ios_base::fmtflags __adjust = __io.flags() & ios_base::adjustfield;
10365 if (__adjust == ios_base::left)
10367 _Traits::copy(__news, __olds, __oldlen);
10368 _Traits::assign(__news + __oldlen, __plen, __fill);
10372 if (__adjust == ios_base::internal)
10374 const locale& __loc = __io._M_getloc();
10375 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
10376 if (__ctype.widen('-') == __olds[0]
10377 || __ctype.widen('+') == __olds[0])
10379 __news[0] = __olds[0];
10383 else if (__ctype.widen('0') == __olds[0]
10385 && (__ctype.widen('x') == __olds[1]
10386 || __ctype.widen('X') == __olds[1]))
10388 __news[0] = __olds[0];
10389 __news[1] = __olds[1];
10394 _Traits::assign(__news, __plen, __fill);
10395 _Traits::copy(__news + __plen, __olds + __mod, __oldlen - __mod);
10397 template<typename _CharT>
10399 __add_grouping(_CharT* __s, _CharT __sep,
10400 const char* __gbeg, size_t __gsize,
10401 const _CharT* __first, const _CharT* __last)
10405 while (__last - __first > __gbeg[__idx]
10406 && static_cast<signed char>(__gbeg[__idx]) > 0)
10408 __last -= __gbeg[__idx];
10409 __idx < __gsize - 1 ? ++__idx : ++__ctr;
10411 while (__first != __last)
10412 *__s++ = *__first++;
10416 for (char __i = __gbeg[__idx]; __i > 0; --__i)
10417 *__s++ = *__first++;
10422 for (char __i = __gbeg[__idx]; __i > 0; --__i)
10423 *__s++ = *__first++;
10427 extern template class numpunct<char>;
10428 extern template class numpunct_byname<char>;
10429 extern template class num_get<char>;
10430 extern template class num_put<char>;
10431 extern template class ctype_byname<char>;
10433 const numpunct<char>&
10434 use_facet<numpunct<char> >(const locale&);
10436 const num_put<char>&
10437 use_facet<num_put<char> >(const locale&);
10439 const num_get<char>&
10440 use_facet<num_get<char> >(const locale&);
10443 has_facet<ctype<char> >(const locale&);
10446 has_facet<numpunct<char> >(const locale&);
10449 has_facet<num_put<char> >(const locale&);
10452 has_facet<num_get<char> >(const locale&);
10454 namespace std __attribute__ ((__visibility__ ("default"))) {
10455 template<typename _Facet>
10456 inline const _Facet&
10457 __check_facet(const _Facet* __f)
10460 __throw_bad_cast();
10463 template<typename _CharT, typename _Traits>
10464 class basic_ios : public ios_base
10467 typedef _CharT char_type;
10468 typedef typename _Traits::int_type int_type;
10469 typedef typename _Traits::pos_type pos_type;
10470 typedef typename _Traits::off_type off_type;
10471 typedef _Traits traits_type;
10472 typedef ctype<_CharT> __ctype_type;
10473 typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
10475 typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
10478 basic_ostream<_CharT, _Traits>* _M_tie;
10479 mutable char_type _M_fill;
10480 mutable bool _M_fill_init;
10481 basic_streambuf<_CharT, _Traits>* _M_streambuf;
10482 const __ctype_type* _M_ctype;
10483 const __num_put_type* _M_num_put;
10484 const __num_get_type* _M_num_get;
10486 operator void*() const
10487 { return this->fail() ? 0 : const_cast<basic_ios*>(this); }
10490 { return this->fail(); }
10493 { return _M_streambuf_state; }
10495 clear(iostate __state = goodbit);
10497 setstate(iostate __state)
10498 { this->clear(this->rdstate() | __state); }
10500 _M_setstate(iostate __state)
10502 _M_streambuf_state |= __state;
10503 if (this->exceptions() & __state)
10508 { return this->rdstate() == 0; }
10511 { return (this->rdstate() & eofbit) != 0; }
10514 { return (this->rdstate() & (badbit | failbit)) != 0; }
10517 { return (this->rdstate() & badbit) != 0; }
10520 { return _M_exception; }
10522 exceptions(iostate __except)
10524 _M_exception = __except;
10525 this->clear(_M_streambuf_state);
10528 basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
10529 : ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
10530 _M_ctype(0), _M_num_put(0), _M_num_get(0)
10531 { this->init(__sb); }
10534 basic_ostream<_CharT, _Traits>*
10537 basic_ostream<_CharT, _Traits>*
10538 tie(basic_ostream<_CharT, _Traits>* __tiestr)
10540 basic_ostream<_CharT, _Traits>* __old = _M_tie;
10544 basic_streambuf<_CharT, _Traits>*
10546 { return _M_streambuf; }
10547 basic_streambuf<_CharT, _Traits>*
10548 rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
10550 copyfmt(const basic_ios& __rhs);
10556 _M_fill = this->widen(' ');
10557 _M_fill_init = true;
10562 fill(char_type __ch)
10564 char_type __old = this->fill();
10569 imbue(const locale& __loc);
10571 narrow(char_type __c, char __dfault) const
10572 { return __check_facet(_M_ctype).narrow(__c, __dfault); }
10574 widen(char __c) const
10575 { return __check_facet(_M_ctype).widen(__c); }
10578 : ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false),
10579 _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
10582 init(basic_streambuf<_CharT, _Traits>* __sb);
10584 _M_cache_locale(const locale& __loc);
10587 namespace std __attribute__ ((__visibility__ ("default"))) {
10588 template<typename _CharT, typename _Traits>
10590 basic_ios<_CharT, _Traits>::clear(iostate __state)
10593 _M_streambuf_state = __state;
10595 _M_streambuf_state = __state | badbit;
10596 if (this->exceptions() & this->rdstate())
10597 __throw_ios_failure(("basic_ios::clear"));
10599 template<typename _CharT, typename _Traits>
10600 basic_streambuf<_CharT, _Traits>*
10601 basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
10603 basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
10604 _M_streambuf = __sb;
10608 template<typename _CharT, typename _Traits>
10609 basic_ios<_CharT, _Traits>&
10610 basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
10612 if (this != &__rhs)
10614 _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ?
10615 _M_local_word : new _Words[__rhs._M_word_size];
10616 _Callback_list* __cb = __rhs._M_callbacks;
10618 __cb->_M_add_reference();
10619 _M_call_callbacks(erase_event);
10620 if (_M_word != _M_local_word)
10625 _M_dispose_callbacks();
10626 _M_callbacks = __cb;
10627 for (int __i = 0; __i < __rhs._M_word_size; ++__i)
10628 __words[__i] = __rhs._M_word[__i];
10630 _M_word_size = __rhs._M_word_size;
10631 this->flags(__rhs.flags());
10632 this->width(__rhs.width());
10633 this->precision(__rhs.precision());
10634 this->tie(__rhs.tie());
10635 this->fill(__rhs.fill());
10636 _M_ios_locale = __rhs.getloc();
10637 _M_cache_locale(_M_ios_locale);
10638 _M_call_callbacks(copyfmt_event);
10639 this->exceptions(__rhs.exceptions());
10643 template<typename _CharT, typename _Traits>
10645 basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
10647 locale __old(this->getloc());
10648 ios_base::imbue(__loc);
10649 _M_cache_locale(__loc);
10650 if (this->rdbuf() != 0)
10651 this->rdbuf()->pubimbue(__loc);
10654 template<typename _CharT, typename _Traits>
10656 basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb)
10658 ios_base::_M_init();
10659 _M_cache_locale(_M_ios_locale);
10660 _M_fill = _CharT();
10661 _M_fill_init = false;
10663 _M_exception = goodbit;
10664 _M_streambuf = __sb;
10665 _M_streambuf_state = __sb ? goodbit : badbit;
10667 template<typename _CharT, typename _Traits>
10669 basic_ios<_CharT, _Traits>::_M_cache_locale(const locale& __loc)
10671 if (__builtin_expect(has_facet<__ctype_type>(__loc), true))
10672 _M_ctype = &use_facet<__ctype_type>(__loc);
10675 if (__builtin_expect(has_facet<__num_put_type>(__loc), true))
10676 _M_num_put = &use_facet<__num_put_type>(__loc);
10679 if (__builtin_expect(has_facet<__num_get_type>(__loc), true))
10680 _M_num_get = &use_facet<__num_get_type>(__loc);
10684 extern template class basic_ios<char>;
10686 namespace std __attribute__ ((__visibility__ ("default"))) {
10687 template<typename _CharT, typename _Traits>
10688 class basic_ostream : virtual public basic_ios<_CharT, _Traits>
10691 typedef _CharT char_type;
10692 typedef typename _Traits::int_type int_type;
10693 typedef typename _Traits::pos_type pos_type;
10694 typedef typename _Traits::off_type off_type;
10695 typedef _Traits traits_type;
10696 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
10697 typedef basic_ios<_CharT, _Traits> __ios_type;
10698 typedef basic_ostream<_CharT, _Traits> __ostream_type;
10699 typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
10701 typedef ctype<_CharT> __ctype_type;
10703 basic_ostream(__streambuf_type* __sb)
10704 { this->init(__sb); }
10706 ~basic_ostream() { }
10708 friend class sentry;
10710 operator<<(__ostream_type& (*__pf)(__ostream_type&))
10712 return __pf(*this);
10715 operator<<(__ios_type& (*__pf)(__ios_type&))
10721 operator<<(ios_base& (*__pf) (ios_base&))
10727 operator<<(long __n)
10728 { return _M_insert(__n); }
10730 operator<<(unsigned long __n)
10731 { return _M_insert(__n); }
10733 operator<<(bool __n)
10734 { return _M_insert(__n); }
10736 operator<<(short __n);
10738 operator<<(unsigned short __n)
10740 return _M_insert(static_cast<unsigned long>(__n));
10743 operator<<(int __n);
10745 operator<<(unsigned int __n)
10747 return _M_insert(static_cast<unsigned long>(__n));
10750 operator<<(long long __n)
10751 { return _M_insert(__n); }
10753 operator<<(unsigned long long __n)
10754 { return _M_insert(__n); }
10756 operator<<(double __f)
10757 { return _M_insert(__f); }
10759 operator<<(float __f)
10761 return _M_insert(static_cast<double>(__f));
10764 operator<<(long double __f)
10765 { return _M_insert(__f); }
10767 operator<<(const void* __p)
10768 { return _M_insert(__p); }
10770 operator<<(__streambuf_type* __sb);
10772 put(char_type __c);
10774 _M_write(const char_type* __s, streamsize __n)
10776 const streamsize __put = this->rdbuf()->sputn(__s, __n);
10778 this->setstate(ios_base::badbit);
10781 write(const char_type* __s, streamsize __n);
10789 seekp(off_type, ios_base::seekdir);
10793 template<typename _ValueT>
10795 _M_insert(_ValueT __v);
10797 template <typename _CharT, typename _Traits>
10798 class basic_ostream<_CharT, _Traits>::sentry
10801 basic_ostream<_CharT, _Traits>& _M_os;
10804 sentry(basic_ostream<_CharT, _Traits>& __os);
10807 if (bool(_M_os.flags() & ios_base::unitbuf) && !uncaught_exception())
10809 if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
10810 _M_os.setstate(ios_base::badbit);
10813 operator bool() const
10816 template<typename _CharT, typename _Traits>
10817 inline basic_ostream<_CharT, _Traits>&
10818 operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
10819 { return __ostream_insert(__out, &__c, 1); }
10820 template<typename _CharT, typename _Traits>
10821 inline basic_ostream<_CharT, _Traits>&
10822 operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
10823 { return (__out << __out.widen(__c)); }
10824 template <class _Traits>
10825 inline basic_ostream<char, _Traits>&
10826 operator<<(basic_ostream<char, _Traits>& __out, char __c)
10827 { return __ostream_insert(__out, &__c, 1); }
10828 template<class _Traits>
10829 inline basic_ostream<char, _Traits>&
10830 operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
10831 { return (__out << static_cast<char>(__c)); }
10832 template<class _Traits>
10833 inline basic_ostream<char, _Traits>&
10834 operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
10835 { return (__out << static_cast<char>(__c)); }
10836 template<typename _CharT, typename _Traits>
10837 inline basic_ostream<_CharT, _Traits>&
10838 operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
10841 __out.setstate(ios_base::badbit);
10843 __ostream_insert(__out, __s,
10844 static_cast<streamsize>(_Traits::length(__s)));
10847 template<typename _CharT, typename _Traits>
10848 basic_ostream<_CharT, _Traits> &
10849 operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s);
10850 template<class _Traits>
10851 inline basic_ostream<char, _Traits>&
10852 operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
10855 __out.setstate(ios_base::badbit);
10857 __ostream_insert(__out, __s,
10858 static_cast<streamsize>(_Traits::length(__s)));
10861 template<class _Traits>
10862 inline basic_ostream<char, _Traits>&
10863 operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
10864 { return (__out << reinterpret_cast<const char*>(__s)); }
10865 template<class _Traits>
10866 inline basic_ostream<char, _Traits> &
10867 operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
10868 { return (__out << reinterpret_cast<const char*>(__s)); }
10869 template<typename _CharT, typename _Traits>
10870 inline basic_ostream<_CharT, _Traits>&
10871 endl(basic_ostream<_CharT, _Traits>& __os)
10872 { return flush(__os.put(__os.widen('\n'))); }
10873 template<typename _CharT, typename _Traits>
10874 inline basic_ostream<_CharT, _Traits>&
10875 ends(basic_ostream<_CharT, _Traits>& __os)
10876 { return __os.put(_CharT()); }
10877 template<typename _CharT, typename _Traits>
10878 inline basic_ostream<_CharT, _Traits>&
10879 flush(basic_ostream<_CharT, _Traits>& __os)
10880 { return __os.flush(); }
10882 namespace std __attribute__ ((__visibility__ ("default"))) {
10883 template<typename _CharT, typename _Traits>
10884 basic_ostream<_CharT, _Traits>::sentry::
10885 sentry(basic_ostream<_CharT, _Traits>& __os)
10886 : _M_ok(false), _M_os(__os)
10888 if (__os.tie() && __os.good())
10889 __os.tie()->flush();
10893 __os.setstate(ios_base::failbit);
10895 template<typename _CharT, typename _Traits>
10896 template<typename _ValueT>
10897 basic_ostream<_CharT, _Traits>&
10898 basic_ostream<_CharT, _Traits>::
10899 _M_insert(_ValueT __v)
10901 sentry __cerb(*this);
10904 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
10907 const __num_put_type& __np = __check_facet(this->_M_num_put);
10908 if (__np.put(*this, *this, this->fill(), __v).failed())
10909 __err |= ios_base::badbit;
10911 catch(__cxxabiv1::__forced_unwind&)
10913 this->_M_setstate(ios_base::badbit);
10917 { this->_M_setstate(ios_base::badbit); }
10919 this->setstate(__err);
10923 template<typename _CharT, typename _Traits>
10924 basic_ostream<_CharT, _Traits>&
10925 basic_ostream<_CharT, _Traits>::
10926 operator<<(short __n)
10928 const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
10929 if (__fmt == ios_base::oct || __fmt == ios_base::hex)
10930 return _M_insert(static_cast<long>(static_cast<unsigned short>(__n)));
10932 return _M_insert(static_cast<long>(__n));
10934 template<typename _CharT, typename _Traits>
10935 basic_ostream<_CharT, _Traits>&
10936 basic_ostream<_CharT, _Traits>::
10937 operator<<(int __n)
10939 const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
10940 if (__fmt == ios_base::oct || __fmt == ios_base::hex)
10941 return _M_insert(static_cast<long>(static_cast<unsigned int>(__n)));
10943 return _M_insert(static_cast<long>(__n));
10945 template<typename _CharT, typename _Traits>
10946 basic_ostream<_CharT, _Traits>&
10947 basic_ostream<_CharT, _Traits>::
10948 operator<<(__streambuf_type* __sbin)
10950 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
10951 sentry __cerb(*this);
10952 if (__cerb && __sbin)
10956 if (!__copy_streambufs(__sbin, this->rdbuf()))
10957 __err |= ios_base::failbit;
10959 catch(__cxxabiv1::__forced_unwind&)
10961 this->_M_setstate(ios_base::badbit);
10965 { this->_M_setstate(ios_base::failbit); }
10968 __err |= ios_base::badbit;
10970 this->setstate(__err);
10973 template<typename _CharT, typename _Traits>
10974 basic_ostream<_CharT, _Traits>&
10975 basic_ostream<_CharT, _Traits>::
10978 sentry __cerb(*this);
10981 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
10984 const int_type __put = this->rdbuf()->sputc(__c);
10985 if (traits_type::eq_int_type(__put, traits_type::eof()))
10986 __err |= ios_base::badbit;
10988 catch(__cxxabiv1::__forced_unwind&)
10990 this->_M_setstate(ios_base::badbit);
10994 { this->_M_setstate(ios_base::badbit); }
10996 this->setstate(__err);
11000 template<typename _CharT, typename _Traits>
11001 basic_ostream<_CharT, _Traits>&
11002 basic_ostream<_CharT, _Traits>::
11003 write(const _CharT* __s, streamsize __n)
11005 sentry __cerb(*this);
11009 { _M_write(__s, __n); }
11010 catch(__cxxabiv1::__forced_unwind&)
11012 this->_M_setstate(ios_base::badbit);
11016 { this->_M_setstate(ios_base::badbit); }
11020 template<typename _CharT, typename _Traits>
11021 basic_ostream<_CharT, _Traits>&
11022 basic_ostream<_CharT, _Traits>::
11025 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11028 if (this->rdbuf() && this->rdbuf()->pubsync() == -1)
11029 __err |= ios_base::badbit;
11031 catch(__cxxabiv1::__forced_unwind&)
11033 this->_M_setstate(ios_base::badbit);
11037 { this->_M_setstate(ios_base::badbit); }
11039 this->setstate(__err);
11042 template<typename _CharT, typename _Traits>
11043 typename basic_ostream<_CharT, _Traits>::pos_type
11044 basic_ostream<_CharT, _Traits>::
11047 pos_type __ret = pos_type(-1);
11051 __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
11053 catch(__cxxabiv1::__forced_unwind&)
11055 this->_M_setstate(ios_base::badbit);
11059 { this->_M_setstate(ios_base::badbit); }
11062 template<typename _CharT, typename _Traits>
11063 basic_ostream<_CharT, _Traits>&
11064 basic_ostream<_CharT, _Traits>::
11065 seekp(pos_type __pos)
11067 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11072 const pos_type __p = this->rdbuf()->pubseekpos(__pos,
11074 if (__p == pos_type(off_type(-1)))
11075 __err |= ios_base::failbit;
11078 catch(__cxxabiv1::__forced_unwind&)
11080 this->_M_setstate(ios_base::badbit);
11084 { this->_M_setstate(ios_base::badbit); }
11086 this->setstate(__err);
11089 template<typename _CharT, typename _Traits>
11090 basic_ostream<_CharT, _Traits>&
11091 basic_ostream<_CharT, _Traits>::
11092 seekp(off_type __off, ios_base::seekdir __dir)
11094 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11099 const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
11101 if (__p == pos_type(off_type(-1)))
11102 __err |= ios_base::failbit;
11105 catch(__cxxabiv1::__forced_unwind&)
11107 this->_M_setstate(ios_base::badbit);
11111 { this->_M_setstate(ios_base::badbit); }
11113 this->setstate(__err);
11116 template<typename _CharT, typename _Traits>
11117 basic_ostream<_CharT, _Traits>&
11118 operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
11121 __out.setstate(ios_base::badbit);
11124 const size_t __clen = char_traits<char>::length(__s);
11130 __ptr_guard (_CharT *__ip): __p(__ip) { }
11131 ~__ptr_guard() { delete[] __p; }
11132 _CharT* __get() { return __p; }
11133 } __pg (new _CharT[__clen]);
11134 _CharT *__ws = __pg.__get();
11135 for (size_t __i = 0; __i < __clen; ++__i)
11136 __ws[__i] = __out.widen(__s[__i]);
11137 __ostream_insert(__out, __ws, __clen);
11139 catch(__cxxabiv1::__forced_unwind&)
11141 __out._M_setstate(ios_base::badbit);
11145 { __out._M_setstate(ios_base::badbit); }
11149 extern template class basic_ostream<char>;
11150 extern template ostream& endl(ostream&);
11151 extern template ostream& ends(ostream&);
11152 extern template ostream& flush(ostream&);
11153 extern template ostream& operator<<(ostream&, char);
11154 extern template ostream& operator<<(ostream&, unsigned char);
11155 extern template ostream& operator<<(ostream&, signed char);
11156 extern template ostream& operator<<(ostream&, const char*);
11157 extern template ostream& operator<<(ostream&, const unsigned char*);
11158 extern template ostream& operator<<(ostream&, const signed char*);
11159 extern template ostream& ostream::_M_insert(long);
11160 extern template ostream& ostream::_M_insert(unsigned long);
11161 extern template ostream& ostream::_M_insert(bool);
11162 extern template ostream& ostream::_M_insert(long long);
11163 extern template ostream& ostream::_M_insert(unsigned long long);
11164 extern template ostream& ostream::_M_insert(double);
11165 extern template ostream& ostream::_M_insert(long double);
11166 extern template ostream& ostream::_M_insert(const void*);
11168 namespace std __attribute__ ((__visibility__ ("default"))) {
11169 template<typename _CharT, typename _Traits>
11170 class basic_istream : virtual public basic_ios<_CharT, _Traits>
11173 typedef _CharT char_type;
11174 typedef typename _Traits::int_type int_type;
11175 typedef typename _Traits::pos_type pos_type;
11176 typedef typename _Traits::off_type off_type;
11177 typedef _Traits traits_type;
11178 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
11179 typedef basic_ios<_CharT, _Traits> __ios_type;
11180 typedef basic_istream<_CharT, _Traits> __istream_type;
11181 typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
11183 typedef ctype<_CharT> __ctype_type;
11185 streamsize _M_gcount;
11188 basic_istream(__streambuf_type* __sb)
11189 : _M_gcount(streamsize(0))
11190 { this->init(__sb); }
11193 { _M_gcount = streamsize(0); }
11195 friend class sentry;
11197 operator>>(__istream_type& (*__pf)(__istream_type&))
11198 { return __pf(*this); }
11200 operator>>(__ios_type& (*__pf)(__ios_type&))
11206 operator>>(ios_base& (*__pf)(ios_base&))
11212 operator>>(bool& __n)
11213 { return _M_extract(__n); }
11215 operator>>(short& __n);
11217 operator>>(unsigned short& __n)
11218 { return _M_extract(__n); }
11220 operator>>(int& __n);
11222 operator>>(unsigned int& __n)
11223 { return _M_extract(__n); }
11225 operator>>(long& __n)
11226 { return _M_extract(__n); }
11228 operator>>(unsigned long& __n)
11229 { return _M_extract(__n); }
11231 operator>>(long long& __n)
11232 { return _M_extract(__n); }
11234 operator>>(unsigned long long& __n)
11235 { return _M_extract(__n); }
11237 operator>>(float& __f)
11238 { return _M_extract(__f); }
11240 operator>>(double& __f)
11241 { return _M_extract(__f); }
11243 operator>>(long double& __f)
11244 { return _M_extract(__f); }
11246 operator>>(void*& __p)
11247 { return _M_extract(__p); }
11249 operator>>(__streambuf_type* __sb);
11252 { return _M_gcount; }
11256 get(char_type& __c);
11258 get(char_type* __s, streamsize __n, char_type __delim);
11260 get(char_type* __s, streamsize __n)
11261 { return this->get(__s, __n, this->widen('\n')); }
11263 get(__streambuf_type& __sb, char_type __delim);
11265 get(__streambuf_type& __sb)
11266 { return this->get(__sb, this->widen('\n')); }
11268 getline(char_type* __s, streamsize __n, char_type __delim);
11270 getline(char_type* __s, streamsize __n)
11271 { return this->getline(__s, __n, this->widen('\n')); }
11275 ignore(streamsize __n);
11277 ignore(streamsize __n, int_type __delim);
11281 read(char_type* __s, streamsize __n);
11283 readsome(char_type* __s, streamsize __n);
11285 putback(char_type __c);
11295 seekg(off_type, ios_base::seekdir);
11298 : _M_gcount(streamsize(0))
11300 template<typename _ValueT>
11302 _M_extract(_ValueT& __v);
11305 basic_istream<char>&
11306 basic_istream<char>::
11307 getline(char_type* __s, streamsize __n, char_type __delim);
11309 basic_istream<char>&
11310 basic_istream<char>::
11311 ignore(streamsize __n);
11313 basic_istream<char>&
11314 basic_istream<char>::
11315 ignore(streamsize __n, int_type __delim);
11316 template<typename _CharT, typename _Traits>
11317 class basic_istream<_CharT, _Traits>::sentry
11320 typedef _Traits traits_type;
11321 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
11322 typedef basic_istream<_CharT, _Traits> __istream_type;
11323 typedef typename __istream_type::__ctype_type __ctype_type;
11324 typedef typename _Traits::int_type __int_type;
11326 sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
11327 operator bool() const
11332 template<typename _CharT, typename _Traits>
11333 basic_istream<_CharT, _Traits>&
11334 operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c);
11335 template<class _Traits>
11336 inline basic_istream<char, _Traits>&
11337 operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
11338 { return (__in >> reinterpret_cast<char&>(__c)); }
11339 template<class _Traits>
11340 inline basic_istream<char, _Traits>&
11341 operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
11342 { return (__in >> reinterpret_cast<char&>(__c)); }
11343 template<typename _CharT, typename _Traits>
11344 basic_istream<_CharT, _Traits>&
11345 operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s);
11347 basic_istream<char>&
11348 operator>>(basic_istream<char>& __in, char* __s);
11349 template<class _Traits>
11350 inline basic_istream<char, _Traits>&
11351 operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
11352 { return (__in >> reinterpret_cast<char*>(__s)); }
11353 template<class _Traits>
11354 inline basic_istream<char, _Traits>&
11355 operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
11356 { return (__in >> reinterpret_cast<char*>(__s)); }
11357 template<typename _CharT, typename _Traits>
11358 class basic_iostream
11359 : public basic_istream<_CharT, _Traits>,
11360 public basic_ostream<_CharT, _Traits>
11363 typedef _CharT char_type;
11364 typedef typename _Traits::int_type int_type;
11365 typedef typename _Traits::pos_type pos_type;
11366 typedef typename _Traits::off_type off_type;
11367 typedef _Traits traits_type;
11368 typedef basic_istream<_CharT, _Traits> __istream_type;
11369 typedef basic_ostream<_CharT, _Traits> __ostream_type;
11371 basic_iostream(basic_streambuf<_CharT, _Traits>* __sb)
11372 : __istream_type(__sb), __ostream_type(__sb) { }
11374 ~basic_iostream() { }
11377 : __istream_type(), __ostream_type() { }
11379 template<typename _CharT, typename _Traits>
11380 basic_istream<_CharT, _Traits>&
11381 ws(basic_istream<_CharT, _Traits>& __is);
11383 namespace std __attribute__ ((__visibility__ ("default"))) {
11384 template<typename _CharT, typename _Traits>
11385 basic_istream<_CharT, _Traits>::sentry::
11386 sentry(basic_istream<_CharT, _Traits>& __in, bool __noskip) : _M_ok(false)
11388 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11392 __in.tie()->flush();
11393 if (!__noskip && bool(__in.flags() & ios_base::skipws))
11395 const __int_type __eof = traits_type::eof();
11396 __streambuf_type* __sb = __in.rdbuf();
11397 __int_type __c = __sb->sgetc();
11398 const __ctype_type& __ct = __check_facet(__in._M_ctype);
11399 while (!traits_type::eq_int_type(__c, __eof)
11400 && __ct.is(ctype_base::space,
11401 traits_type::to_char_type(__c)))
11402 __c = __sb->snextc();
11403 if (traits_type::eq_int_type(__c, __eof))
11404 __err |= ios_base::eofbit;
11407 if (__in.good() && __err == ios_base::goodbit)
11411 __err |= ios_base::failbit;
11412 __in.setstate(__err);
11415 template<typename _CharT, typename _Traits>
11416 template<typename _ValueT>
11417 basic_istream<_CharT, _Traits>&
11418 basic_istream<_CharT, _Traits>::
11419 _M_extract(_ValueT& __v)
11421 sentry __cerb(*this, false);
11424 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11427 const __num_get_type& __ng = __check_facet(this->_M_num_get);
11428 __ng.get(*this, 0, *this, __err, __v);
11430 catch(__cxxabiv1::__forced_unwind&)
11432 this->_M_setstate(ios_base::badbit);
11436 { this->_M_setstate(ios_base::badbit); }
11438 this->setstate(__err);
11442 template<typename _CharT, typename _Traits>
11443 basic_istream<_CharT, _Traits>&
11444 basic_istream<_CharT, _Traits>::
11445 operator>>(short& __n)
11451 if (__gnu_cxx::__numeric_traits<short>::__min <= __l
11452 && __l <= __gnu_cxx::__numeric_traits<short>::__max)
11455 this->setstate(ios_base::failbit);
11459 template<typename _CharT, typename _Traits>
11460 basic_istream<_CharT, _Traits>&
11461 basic_istream<_CharT, _Traits>::
11462 operator>>(int& __n)
11468 if (__gnu_cxx::__numeric_traits<int>::__min <= __l
11469 && __l <= __gnu_cxx::__numeric_traits<int>::__max)
11472 this->setstate(ios_base::failbit);
11476 template<typename _CharT, typename _Traits>
11477 basic_istream<_CharT, _Traits>&
11478 basic_istream<_CharT, _Traits>::
11479 operator>>(__streambuf_type* __sbout)
11481 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11482 sentry __cerb(*this, false);
11483 if (__cerb && __sbout)
11488 if (!__copy_streambufs_eof(this->rdbuf(), __sbout, __ineof))
11489 __err |= ios_base::failbit;
11491 __err |= ios_base::eofbit;
11493 catch(__cxxabiv1::__forced_unwind&)
11495 this->_M_setstate(ios_base::failbit);
11499 { this->_M_setstate(ios_base::failbit); }
11502 __err |= ios_base::failbit;
11504 this->setstate(__err);
11507 template<typename _CharT, typename _Traits>
11508 typename basic_istream<_CharT, _Traits>::int_type
11509 basic_istream<_CharT, _Traits>::
11512 const int_type __eof = traits_type::eof();
11513 int_type __c = __eof;
11515 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11516 sentry __cerb(*this, true);
11521 __c = this->rdbuf()->sbumpc();
11522 if (!traits_type::eq_int_type(__c, __eof))
11525 __err |= ios_base::eofbit;
11527 catch(__cxxabiv1::__forced_unwind&)
11529 this->_M_setstate(ios_base::badbit);
11533 { this->_M_setstate(ios_base::badbit); }
11536 __err |= ios_base::failbit;
11538 this->setstate(__err);
11541 template<typename _CharT, typename _Traits>
11542 basic_istream<_CharT, _Traits>&
11543 basic_istream<_CharT, _Traits>::
11544 get(char_type& __c)
11547 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11548 sentry __cerb(*this, true);
11553 const int_type __cb = this->rdbuf()->sbumpc();
11554 if (!traits_type::eq_int_type(__cb, traits_type::eof()))
11557 __c = traits_type::to_char_type(__cb);
11560 __err |= ios_base::eofbit;
11562 catch(__cxxabiv1::__forced_unwind&)
11564 this->_M_setstate(ios_base::badbit);
11568 { this->_M_setstate(ios_base::badbit); }
11571 __err |= ios_base::failbit;
11573 this->setstate(__err);
11576 template<typename _CharT, typename _Traits>
11577 basic_istream<_CharT, _Traits>&
11578 basic_istream<_CharT, _Traits>::
11579 get(char_type* __s, streamsize __n, char_type __delim)
11582 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11583 sentry __cerb(*this, true);
11588 const int_type __idelim = traits_type::to_int_type(__delim);
11589 const int_type __eof = traits_type::eof();
11590 __streambuf_type* __sb = this->rdbuf();
11591 int_type __c = __sb->sgetc();
11592 while (_M_gcount + 1 < __n
11593 && !traits_type::eq_int_type(__c, __eof)
11594 && !traits_type::eq_int_type(__c, __idelim))
11596 *__s++ = traits_type::to_char_type(__c);
11598 __c = __sb->snextc();
11600 if (traits_type::eq_int_type(__c, __eof))
11601 __err |= ios_base::eofbit;
11603 catch(__cxxabiv1::__forced_unwind&)
11605 this->_M_setstate(ios_base::badbit);
11609 { this->_M_setstate(ios_base::badbit); }
11612 *__s = char_type();
11614 __err |= ios_base::failbit;
11616 this->setstate(__err);
11619 template<typename _CharT, typename _Traits>
11620 basic_istream<_CharT, _Traits>&
11621 basic_istream<_CharT, _Traits>::
11622 get(__streambuf_type& __sb, char_type __delim)
11625 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11626 sentry __cerb(*this, true);
11631 const int_type __idelim = traits_type::to_int_type(__delim);
11632 const int_type __eof = traits_type::eof();
11633 __streambuf_type* __this_sb = this->rdbuf();
11634 int_type __c = __this_sb->sgetc();
11635 char_type __c2 = traits_type::to_char_type(__c);
11636 while (!traits_type::eq_int_type(__c, __eof)
11637 && !traits_type::eq_int_type(__c, __idelim)
11638 && !traits_type::eq_int_type(__sb.sputc(__c2), __eof))
11641 __c = __this_sb->snextc();
11642 __c2 = traits_type::to_char_type(__c);
11644 if (traits_type::eq_int_type(__c, __eof))
11645 __err |= ios_base::eofbit;
11647 catch(__cxxabiv1::__forced_unwind&)
11649 this->_M_setstate(ios_base::badbit);
11653 { this->_M_setstate(ios_base::badbit); }
11656 __err |= ios_base::failbit;
11658 this->setstate(__err);
11661 template<typename _CharT, typename _Traits>
11662 basic_istream<_CharT, _Traits>&
11663 basic_istream<_CharT, _Traits>::
11664 getline(char_type* __s, streamsize __n, char_type __delim)
11667 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11668 sentry __cerb(*this, true);
11673 const int_type __idelim = traits_type::to_int_type(__delim);
11674 const int_type __eof = traits_type::eof();
11675 __streambuf_type* __sb = this->rdbuf();
11676 int_type __c = __sb->sgetc();
11677 while (_M_gcount + 1 < __n
11678 && !traits_type::eq_int_type(__c, __eof)
11679 && !traits_type::eq_int_type(__c, __idelim))
11681 *__s++ = traits_type::to_char_type(__c);
11682 __c = __sb->snextc();
11685 if (traits_type::eq_int_type(__c, __eof))
11686 __err |= ios_base::eofbit;
11689 if (traits_type::eq_int_type(__c, __idelim))
11695 __err |= ios_base::failbit;
11698 catch(__cxxabiv1::__forced_unwind&)
11700 this->_M_setstate(ios_base::badbit);
11704 { this->_M_setstate(ios_base::badbit); }
11707 *__s = char_type();
11709 __err |= ios_base::failbit;
11711 this->setstate(__err);
11714 template<typename _CharT, typename _Traits>
11715 basic_istream<_CharT, _Traits>&
11716 basic_istream<_CharT, _Traits>::
11720 sentry __cerb(*this, true);
11723 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11726 const int_type __eof = traits_type::eof();
11727 __streambuf_type* __sb = this->rdbuf();
11728 if (traits_type::eq_int_type(__sb->sbumpc(), __eof))
11729 __err |= ios_base::eofbit;
11733 catch(__cxxabiv1::__forced_unwind&)
11735 this->_M_setstate(ios_base::badbit);
11739 { this->_M_setstate(ios_base::badbit); }
11741 this->setstate(__err);
11745 template<typename _CharT, typename _Traits>
11746 basic_istream<_CharT, _Traits>&
11747 basic_istream<_CharT, _Traits>::
11748 ignore(streamsize __n)
11751 sentry __cerb(*this, true);
11752 if (__cerb && __n > 0)
11754 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11757 const int_type __eof = traits_type::eof();
11758 __streambuf_type* __sb = this->rdbuf();
11759 int_type __c = __sb->sgetc();
11760 bool __large_ignore = false;
11763 while (_M_gcount < __n
11764 && !traits_type::eq_int_type(__c, __eof))
11767 __c = __sb->snextc();
11769 if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
11770 && !traits_type::eq_int_type(__c, __eof))
11773 __gnu_cxx::__numeric_traits<streamsize>::__min;
11774 __large_ignore = true;
11779 if (__large_ignore)
11780 _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
11781 if (traits_type::eq_int_type(__c, __eof))
11782 __err |= ios_base::eofbit;
11784 catch(__cxxabiv1::__forced_unwind&)
11786 this->_M_setstate(ios_base::badbit);
11790 { this->_M_setstate(ios_base::badbit); }
11792 this->setstate(__err);
11796 template<typename _CharT, typename _Traits>
11797 basic_istream<_CharT, _Traits>&
11798 basic_istream<_CharT, _Traits>::
11799 ignore(streamsize __n, int_type __delim)
11802 sentry __cerb(*this, true);
11803 if (__cerb && __n > 0)
11805 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11808 const int_type __eof = traits_type::eof();
11809 __streambuf_type* __sb = this->rdbuf();
11810 int_type __c = __sb->sgetc();
11811 bool __large_ignore = false;
11814 while (_M_gcount < __n
11815 && !traits_type::eq_int_type(__c, __eof)
11816 && !traits_type::eq_int_type(__c, __delim))
11819 __c = __sb->snextc();
11821 if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
11822 && !traits_type::eq_int_type(__c, __eof)
11823 && !traits_type::eq_int_type(__c, __delim))
11826 __gnu_cxx::__numeric_traits<streamsize>::__min;
11827 __large_ignore = true;
11832 if (__large_ignore)
11833 _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
11834 if (traits_type::eq_int_type(__c, __eof))
11835 __err |= ios_base::eofbit;
11836 else if (traits_type::eq_int_type(__c, __delim))
11839 < __gnu_cxx::__numeric_traits<streamsize>::__max)
11844 catch(__cxxabiv1::__forced_unwind&)
11846 this->_M_setstate(ios_base::badbit);
11850 { this->_M_setstate(ios_base::badbit); }
11852 this->setstate(__err);
11856 template<typename _CharT, typename _Traits>
11857 typename basic_istream<_CharT, _Traits>::int_type
11858 basic_istream<_CharT, _Traits>::
11861 int_type __c = traits_type::eof();
11863 sentry __cerb(*this, true);
11866 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11869 __c = this->rdbuf()->sgetc();
11870 if (traits_type::eq_int_type(__c, traits_type::eof()))
11871 __err |= ios_base::eofbit;
11873 catch(__cxxabiv1::__forced_unwind&)
11875 this->_M_setstate(ios_base::badbit);
11879 { this->_M_setstate(ios_base::badbit); }
11881 this->setstate(__err);
11885 template<typename _CharT, typename _Traits>
11886 basic_istream<_CharT, _Traits>&
11887 basic_istream<_CharT, _Traits>::
11888 read(char_type* __s, streamsize __n)
11891 sentry __cerb(*this, true);
11894 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11897 _M_gcount = this->rdbuf()->sgetn(__s, __n);
11898 if (_M_gcount != __n)
11899 __err |= (ios_base::eofbit | ios_base::failbit);
11901 catch(__cxxabiv1::__forced_unwind&)
11903 this->_M_setstate(ios_base::badbit);
11907 { this->_M_setstate(ios_base::badbit); }
11909 this->setstate(__err);
11913 template<typename _CharT, typename _Traits>
11915 basic_istream<_CharT, _Traits>::
11916 readsome(char_type* __s, streamsize __n)
11919 sentry __cerb(*this, true);
11922 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11925 const streamsize __num = this->rdbuf()->in_avail();
11927 _M_gcount = this->rdbuf()->sgetn(__s, std::min(__num, __n));
11928 else if (__num == -1)
11929 __err |= ios_base::eofbit;
11931 catch(__cxxabiv1::__forced_unwind&)
11933 this->_M_setstate(ios_base::badbit);
11937 { this->_M_setstate(ios_base::badbit); }
11939 this->setstate(__err);
11943 template<typename _CharT, typename _Traits>
11944 basic_istream<_CharT, _Traits>&
11945 basic_istream<_CharT, _Traits>::
11946 putback(char_type __c)
11949 sentry __cerb(*this, true);
11952 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11955 const int_type __eof = traits_type::eof();
11956 __streambuf_type* __sb = this->rdbuf();
11958 || traits_type::eq_int_type(__sb->sputbackc(__c), __eof))
11959 __err |= ios_base::badbit;
11961 catch(__cxxabiv1::__forced_unwind&)
11963 this->_M_setstate(ios_base::badbit);
11967 { this->_M_setstate(ios_base::badbit); }
11969 this->setstate(__err);
11973 template<typename _CharT, typename _Traits>
11974 basic_istream<_CharT, _Traits>&
11975 basic_istream<_CharT, _Traits>::
11979 sentry __cerb(*this, true);
11982 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
11985 const int_type __eof = traits_type::eof();
11986 __streambuf_type* __sb = this->rdbuf();
11988 || traits_type::eq_int_type(__sb->sungetc(), __eof))
11989 __err |= ios_base::badbit;
11991 catch(__cxxabiv1::__forced_unwind&)
11993 this->_M_setstate(ios_base::badbit);
11997 { this->_M_setstate(ios_base::badbit); }
11999 this->setstate(__err);
12003 template<typename _CharT, typename _Traits>
12005 basic_istream<_CharT, _Traits>::
12009 sentry __cerb(*this, true);
12012 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
12015 __streambuf_type* __sb = this->rdbuf();
12018 if (__sb->pubsync() == -1)
12019 __err |= ios_base::badbit;
12024 catch(__cxxabiv1::__forced_unwind&)
12026 this->_M_setstate(ios_base::badbit);
12030 { this->_M_setstate(ios_base::badbit); }
12032 this->setstate(__err);
12036 template<typename _CharT, typename _Traits>
12037 typename basic_istream<_CharT, _Traits>::pos_type
12038 basic_istream<_CharT, _Traits>::
12041 pos_type __ret = pos_type(-1);
12045 __ret = this->rdbuf()->pubseekoff(0, ios_base::cur,
12048 catch(__cxxabiv1::__forced_unwind&)
12050 this->_M_setstate(ios_base::badbit);
12054 { this->_M_setstate(ios_base::badbit); }
12057 template<typename _CharT, typename _Traits>
12058 basic_istream<_CharT, _Traits>&
12059 basic_istream<_CharT, _Traits>::
12060 seekg(pos_type __pos)
12062 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
12067 const pos_type __p = this->rdbuf()->pubseekpos(__pos,
12069 if (__p == pos_type(off_type(-1)))
12070 __err |= ios_base::failbit;
12073 catch(__cxxabiv1::__forced_unwind&)
12075 this->_M_setstate(ios_base::badbit);
12079 { this->_M_setstate(ios_base::badbit); }
12081 this->setstate(__err);
12084 template<typename _CharT, typename _Traits>
12085 basic_istream<_CharT, _Traits>&
12086 basic_istream<_CharT, _Traits>::
12087 seekg(off_type __off, ios_base::seekdir __dir)
12089 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
12094 const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
12096 if (__p == pos_type(off_type(-1)))
12097 __err |= ios_base::failbit;
12100 catch(__cxxabiv1::__forced_unwind&)
12102 this->_M_setstate(ios_base::badbit);
12106 { this->_M_setstate(ios_base::badbit); }
12108 this->setstate(__err);
12111 template<typename _CharT, typename _Traits>
12112 basic_istream<_CharT, _Traits>&
12113 operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
12115 typedef basic_istream<_CharT, _Traits> __istream_type;
12116 typedef typename __istream_type::int_type __int_type;
12117 typename __istream_type::sentry __cerb(__in, false);
12120 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
12123 const __int_type __cb = __in.rdbuf()->sbumpc();
12124 if (!_Traits::eq_int_type(__cb, _Traits::eof()))
12125 __c = _Traits::to_char_type(__cb);
12127 __err |= (ios_base::eofbit | ios_base::failbit);
12129 catch(__cxxabiv1::__forced_unwind&)
12131 __in._M_setstate(ios_base::badbit);
12135 { __in._M_setstate(ios_base::badbit); }
12137 __in.setstate(__err);
12141 template<typename _CharT, typename _Traits>
12142 basic_istream<_CharT, _Traits>&
12143 operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
12145 typedef basic_istream<_CharT, _Traits> __istream_type;
12146 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
12147 typedef typename _Traits::int_type int_type;
12148 typedef _CharT char_type;
12149 typedef ctype<_CharT> __ctype_type;
12150 streamsize __extracted = 0;
12151 ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
12152 typename __istream_type::sentry __cerb(__in, false);
12157 streamsize __num = __in.width();
12159 __num = __gnu_cxx::__numeric_traits<streamsize>::__max;
12160 const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
12161 const int_type __eof = _Traits::eof();
12162 __streambuf_type* __sb = __in.rdbuf();
12163 int_type __c = __sb->sgetc();
12164 while (__extracted < __num - 1
12165 && !_Traits::eq_int_type(__c, __eof)
12166 && !__ct.is(ctype_base::space,
12167 _Traits::to_char_type(__c)))
12169 *__s++ = _Traits::to_char_type(__c);
12171 __c = __sb->snextc();
12173 if (_Traits::eq_int_type(__c, __eof))
12174 __err |= ios_base::eofbit;
12175 *__s = char_type();
12178 catch(__cxxabiv1::__forced_unwind&)
12180 __in._M_setstate(ios_base::badbit);
12184 { __in._M_setstate(ios_base::badbit); }
12187 __err |= ios_base::failbit;
12189 __in.setstate(__err);
12192 template<typename _CharT, typename _Traits>
12193 basic_istream<_CharT, _Traits>&
12194 ws(basic_istream<_CharT, _Traits>& __in)
12196 typedef basic_istream<_CharT, _Traits> __istream_type;
12197 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
12198 typedef typename __istream_type::int_type __int_type;
12199 typedef ctype<_CharT> __ctype_type;
12200 const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
12201 const __int_type __eof = _Traits::eof();
12202 __streambuf_type* __sb = __in.rdbuf();
12203 __int_type __c = __sb->sgetc();
12204 while (!_Traits::eq_int_type(__c, __eof)
12205 && __ct.is(ctype_base::space, _Traits::to_char_type(__c)))
12206 __c = __sb->snextc();
12207 if (_Traits::eq_int_type(__c, __eof))
12208 __in.setstate(ios_base::eofbit);
12211 extern template class basic_istream<char>;
12212 extern template istream& ws(istream&);
12213 extern template istream& operator>>(istream&, char&);
12214 extern template istream& operator>>(istream&, char*);
12215 extern template istream& operator>>(istream&, unsigned char&);
12216 extern template istream& operator>>(istream&, signed char&);
12217 extern template istream& operator>>(istream&, unsigned char*);
12218 extern template istream& operator>>(istream&, signed char*);
12219 extern template istream& istream::_M_extract(unsigned short&);
12220 extern template istream& istream::_M_extract(unsigned int&);
12221 extern template istream& istream::_M_extract(long&);
12222 extern template istream& istream::_M_extract(unsigned long&);
12223 extern template istream& istream::_M_extract(bool&);
12224 extern template istream& istream::_M_extract(long long&);
12225 extern template istream& istream::_M_extract(unsigned long long&);
12226 extern template istream& istream::_M_extract(float&);
12227 extern template istream& istream::_M_extract(double&);
12228 extern template istream& istream::_M_extract(long double&);
12229 extern template istream& istream::_M_extract(void*&);
12230 extern template class basic_iostream<char>;
12232 namespace std __attribute__ ((__visibility__ ("default"))) {
12233 template<typename _Tp, typename _CharT = char,
12234 typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
12235 class istream_iterator
12236 : public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
12239 typedef _CharT char_type;
12240 typedef _Traits traits_type;
12241 typedef basic_istream<_CharT, _Traits> istream_type;
12243 istream_type* _M_stream;
12248 : _M_stream(0), _M_value(), _M_ok(false) {}
12249 istream_iterator(istream_type& __s)
12252 istream_iterator(const istream_iterator& __obj)
12253 : _M_stream(__obj._M_stream), _M_value(__obj._M_value),
12263 operator->() const { return &(operator*()); }
12275 istream_iterator __tmp = *this;
12280 _M_equal(const istream_iterator& __x) const
12281 { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); }
12286 _M_ok = (_M_stream && *_M_stream) ? true : false;
12289 *_M_stream >> _M_value;
12290 _M_ok = *_M_stream ? true : false;
12294 template<typename _Tp, typename _CharT, typename _Traits, typename _Dist>
12296 operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
12297 const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
12298 { return __x._M_equal(__y); }
12299 template <class _Tp, class _CharT, class _Traits, class _Dist>
12301 operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
12302 const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
12303 { return !__x._M_equal(__y); }
12304 template<typename _Tp, typename _CharT = char,
12305 typename _Traits = char_traits<_CharT> >
12306 class ostream_iterator
12307 : public iterator<output_iterator_tag, void, void, void, void>
12310 typedef _CharT char_type;
12311 typedef _Traits traits_type;
12312 typedef basic_ostream<_CharT, _Traits> ostream_type;
12314 ostream_type* _M_stream;
12315 const _CharT* _M_string;
12317 ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {}
12318 ostream_iterator(ostream_type& __s, const _CharT* __c)
12319 : _M_stream(&__s), _M_string(__c) { }
12320 ostream_iterator(const ostream_iterator& __obj)
12321 : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
12323 operator=(const _Tp& __value)
12326 *_M_stream << __value;
12327 if (_M_string) *_M_stream << _M_string;
12341 namespace std __attribute__ ((__visibility__ ("default"))) {
12342 struct _List_node_base
12344 _List_node_base* _M_next;
12345 _List_node_base* _M_prev;
12347 swap(_List_node_base& __x, _List_node_base& __y);
12349 transfer(_List_node_base * const __first,
12350 _List_node_base * const __last);
12354 hook(_List_node_base * const __position);
12358 template<typename _Tp>
12359 struct _List_node : public _List_node_base
12363 template<typename _Tp>
12364 struct _List_iterator
12366 typedef _List_iterator<_Tp> _Self;
12367 typedef _List_node<_Tp> _Node;
12368 typedef ptrdiff_t difference_type;
12369 typedef std::bidirectional_iterator_tag iterator_category;
12370 typedef _Tp value_type;
12371 typedef _Tp* pointer;
12372 typedef _Tp& reference;
12376 _List_iterator(_List_node_base* __x)
12380 { return static_cast<_Node*>(_M_node)->_M_data; }
12383 { return &static_cast<_Node*>(_M_node)->_M_data; }
12387 _M_node = _M_node->_M_next;
12393 _Self __tmp = *this;
12394 _M_node = _M_node->_M_next;
12400 _M_node = _M_node->_M_prev;
12406 _Self __tmp = *this;
12407 _M_node = _M_node->_M_prev;
12411 operator==(const _Self& __x) const
12412 { return _M_node == __x._M_node; }
12414 operator!=(const _Self& __x) const
12415 { return _M_node != __x._M_node; }
12416 _List_node_base* _M_node;
12418 template<typename _Tp>
12419 struct _List_const_iterator
12421 typedef _List_const_iterator<_Tp> _Self;
12422 typedef const _List_node<_Tp> _Node;
12423 typedef _List_iterator<_Tp> iterator;
12424 typedef ptrdiff_t difference_type;
12425 typedef std::bidirectional_iterator_tag iterator_category;
12426 typedef _Tp value_type;
12427 typedef const _Tp* pointer;
12428 typedef const _Tp& reference;
12429 _List_const_iterator()
12432 _List_const_iterator(const _List_node_base* __x)
12434 _List_const_iterator(const iterator& __x)
12435 : _M_node(__x._M_node) { }
12438 { return static_cast<_Node*>(_M_node)->_M_data; }
12441 { return &static_cast<_Node*>(_M_node)->_M_data; }
12445 _M_node = _M_node->_M_next;
12451 _Self __tmp = *this;
12452 _M_node = _M_node->_M_next;
12458 _M_node = _M_node->_M_prev;
12464 _Self __tmp = *this;
12465 _M_node = _M_node->_M_prev;
12469 operator==(const _Self& __x) const
12470 { return _M_node == __x._M_node; }
12472 operator!=(const _Self& __x) const
12473 { return _M_node != __x._M_node; }
12474 const _List_node_base* _M_node;
12476 template<typename _Val>
12478 operator==(const _List_iterator<_Val>& __x,
12479 const _List_const_iterator<_Val>& __y)
12480 { return __x._M_node == __y._M_node; }
12481 template<typename _Val>
12483 operator!=(const _List_iterator<_Val>& __x,
12484 const _List_const_iterator<_Val>& __y)
12485 { return __x._M_node != __y._M_node; }
12486 template<typename _Tp, typename _Alloc>
12490 typedef typename _Alloc::template rebind<_List_node<_Tp> >::other
12492 typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
12494 : public _Node_alloc_type
12496 _List_node_base _M_node;
12498 : _Node_alloc_type(), _M_node()
12500 _List_impl(const _Node_alloc_type& __a)
12501 : _Node_alloc_type(__a), _M_node()
12504 _List_impl _M_impl;
12507 { return _M_impl._Node_alloc_type::allocate(1); }
12509 _M_put_node(_List_node<_Tp>* __p)
12510 { _M_impl._Node_alloc_type::deallocate(__p, 1); }
12512 typedef _Alloc allocator_type;
12514 _M_get_Node_allocator()
12515 { return *static_cast<_Node_alloc_type*>(&this->_M_impl); }
12516 const _Node_alloc_type&
12517 _M_get_Node_allocator() const
12518 { return *static_cast<const _Node_alloc_type*>(&this->_M_impl); }
12520 _M_get_Tp_allocator() const
12521 { return _Tp_alloc_type(_M_get_Node_allocator()); }
12523 get_allocator() const
12524 { return allocator_type(_M_get_Node_allocator()); }
12528 _List_base(const allocator_type& __a)
12538 this->_M_impl._M_node._M_next = &this->_M_impl._M_node;
12539 this->_M_impl._M_node._M_prev = &this->_M_impl._M_node;
12542 template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
12543 class list : protected _List_base<_Tp, _Alloc>
12545 typedef typename _Alloc::value_type _Alloc_value_type;
12546 typedef _List_base<_Tp, _Alloc> _Base;
12547 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
12549 typedef _Tp value_type;
12550 typedef typename _Tp_alloc_type::pointer pointer;
12551 typedef typename _Tp_alloc_type::const_pointer const_pointer;
12552 typedef typename _Tp_alloc_type::reference reference;
12553 typedef typename _Tp_alloc_type::const_reference const_reference;
12554 typedef _List_iterator<_Tp> iterator;
12555 typedef _List_const_iterator<_Tp> const_iterator;
12556 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
12557 typedef std::reverse_iterator<iterator> reverse_iterator;
12558 typedef size_t size_type;
12559 typedef ptrdiff_t difference_type;
12560 typedef _Alloc allocator_type;
12562 typedef _List_node<_Tp> _Node;
12563 using _Base::_M_impl;
12564 using _Base::_M_put_node;
12565 using _Base::_M_get_node;
12566 using _Base::_M_get_Tp_allocator;
12567 using _Base::_M_get_Node_allocator;
12569 _M_create_node(const value_type& __x)
12571 _Node* __p = this->_M_get_node();
12574 _M_get_Tp_allocator().construct(&__p->_M_data, __x);
12587 list(const allocator_type& __a)
12590 list(size_type __n, const value_type& __value = value_type(),
12591 const allocator_type& __a = allocator_type())
12593 { _M_fill_initialize(__n, __value); }
12594 list(const list& __x)
12595 : _Base(__x._M_get_Node_allocator())
12596 { _M_initialize_dispatch(__x.begin(), __x.end(), __false_type()); }
12597 template<typename _InputIterator>
12598 list(_InputIterator __first, _InputIterator __last,
12599 const allocator_type& __a = allocator_type())
12602 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
12603 _M_initialize_dispatch(__first, __last, _Integral());
12606 operator=(const list& __x);
12608 assign(size_type __n, const value_type& __val)
12609 { _M_fill_assign(__n, __val); }
12610 template<typename _InputIterator>
12612 assign(_InputIterator __first, _InputIterator __last)
12614 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
12615 _M_assign_dispatch(__first, __last, _Integral());
12618 get_allocator() const
12619 { return _Base::get_allocator(); }
12622 { return iterator(this->_M_impl._M_node._M_next); }
12625 { return const_iterator(this->_M_impl._M_node._M_next); }
12628 { return iterator(&this->_M_impl._M_node); }
12631 { return const_iterator(&this->_M_impl._M_node); }
12634 { return reverse_iterator(end()); }
12635 const_reverse_iterator
12637 { return const_reverse_iterator(end()); }
12640 { return reverse_iterator(begin()); }
12641 const_reverse_iterator
12643 { return const_reverse_iterator(begin()); }
12646 { return this->_M_impl._M_node._M_next == &this->_M_impl._M_node; }
12649 { return std::distance(begin(), end()); }
12652 { return _M_get_Tp_allocator().max_size(); }
12654 resize(size_type __new_size, value_type __x = value_type());
12657 { return *begin(); }
12660 { return *begin(); }
12664 iterator __tmp = end();
12671 const_iterator __tmp = end();
12676 push_front(const value_type& __x)
12677 { this->_M_insert(begin(), __x); }
12680 { this->_M_erase(begin()); }
12682 push_back(const value_type& __x)
12683 { this->_M_insert(end(), __x); }
12686 { this->_M_erase(iterator(this->_M_impl._M_node._M_prev)); }
12688 insert(iterator __position, const value_type& __x);
12690 insert(iterator __position, size_type __n, const value_type& __x)
12692 list __tmp(__n, __x, _M_get_Node_allocator());
12693 splice(__position, __tmp);
12695 template<typename _InputIterator>
12697 insert(iterator __position, _InputIterator __first,
12698 _InputIterator __last)
12700 list __tmp(__first, __last, _M_get_Node_allocator());
12701 splice(__position, __tmp);
12704 erase(iterator __position);
12706 erase(iterator __first, iterator __last)
12708 while (__first != __last)
12709 __first = erase(__first);
12715 _List_node_base::swap(this->_M_impl._M_node, __x._M_impl._M_node);
12716 std::__alloc_swap<typename _Base::_Node_alloc_type>::
12717 _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator());
12726 splice(iterator __position, list& __x)
12730 _M_check_equal_allocators(__x);
12731 this->_M_transfer(__position, __x.begin(), __x.end());
12735 splice(iterator __position, list& __x, iterator __i)
12737 iterator __j = __i;
12739 if (__position == __i || __position == __j)
12742 _M_check_equal_allocators(__x);
12743 this->_M_transfer(__position, __i, __j);
12746 splice(iterator __position, list& __x, iterator __first,
12749 if (__first != __last)
12752 _M_check_equal_allocators(__x);
12753 this->_M_transfer(__position, __first, __last);
12757 remove(const _Tp& __value);
12758 template<typename _Predicate>
12760 remove_if(_Predicate);
12763 template<typename _BinaryPredicate>
12765 unique(_BinaryPredicate);
12768 template<typename _StrictWeakOrdering>
12770 merge(list&, _StrictWeakOrdering);
12773 { this->_M_impl._M_node.reverse(); }
12776 template<typename _StrictWeakOrdering>
12778 sort(_StrictWeakOrdering);
12780 template<typename _Integer>
12782 _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
12783 { _M_fill_initialize(static_cast<size_type>(__n), __x); }
12784 template<typename _InputIterator>
12786 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
12789 for (; __first != __last; ++__first)
12790 push_back(*__first);
12793 _M_fill_initialize(size_type __n, const value_type& __x)
12795 for (; __n > 0; --__n)
12798 template<typename _Integer>
12800 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
12801 { _M_fill_assign(__n, __val); }
12802 template<typename _InputIterator>
12804 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
12807 _M_fill_assign(size_type __n, const value_type& __val);
12809 _M_transfer(iterator __position, iterator __first, iterator __last)
12810 { __position._M_node->transfer(__first._M_node, __last._M_node); }
12812 _M_insert(iterator __position, const value_type& __x)
12814 _Node* __tmp = _M_create_node(__x);
12815 __tmp->hook(__position._M_node);
12818 _M_erase(iterator __position)
12820 __position._M_node->unhook();
12821 _Node* __n = static_cast<_Node*>(__position._M_node);
12822 _M_get_Tp_allocator().destroy(&__n->_M_data);
12826 _M_check_equal_allocators(list& __x)
12828 if (std::__alloc_neq<typename _Base::_Node_alloc_type>::
12829 _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator()))
12830 __throw_runtime_error(("list::_M_check_equal_allocators"));
12833 template<typename _Tp, typename _Alloc>
12835 operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
12837 typedef typename list<_Tp, _Alloc>::const_iterator const_iterator;
12838 const_iterator __end1 = __x.end();
12839 const_iterator __end2 = __y.end();
12840 const_iterator __i1 = __x.begin();
12841 const_iterator __i2 = __y.begin();
12842 while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
12847 return __i1 == __end1 && __i2 == __end2;
12849 template<typename _Tp, typename _Alloc>
12851 operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
12852 { return std::lexicographical_compare(__x.begin(), __x.end(),
12853 __y.begin(), __y.end()); }
12854 template<typename _Tp, typename _Alloc>
12856 operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
12857 { return !(__x == __y); }
12858 template<typename _Tp, typename _Alloc>
12860 operator>(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
12861 { return __y < __x; }
12862 template<typename _Tp, typename _Alloc>
12864 operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
12865 { return !(__y < __x); }
12866 template<typename _Tp, typename _Alloc>
12868 operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
12869 { return !(__x < __y); }
12870 template<typename _Tp, typename _Alloc>
12872 swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
12875 namespace std __attribute__ ((__visibility__ ("default"))) {
12876 template<typename _Tp, typename _Alloc>
12878 _List_base<_Tp, _Alloc>::
12881 typedef _List_node<_Tp> _Node;
12882 _Node* __cur = static_cast<_Node*>(this->_M_impl._M_node._M_next);
12883 while (__cur != &this->_M_impl._M_node)
12885 _Node* __tmp = __cur;
12886 __cur = static_cast<_Node*>(__cur->_M_next);
12887 _M_get_Tp_allocator().destroy(&__tmp->_M_data);
12888 _M_put_node(__tmp);
12891 template<typename _Tp, typename _Alloc>
12892 typename list<_Tp, _Alloc>::iterator
12893 list<_Tp, _Alloc>::
12894 insert(iterator __position, const value_type& __x)
12896 _Node* __tmp = _M_create_node(__x);
12897 __tmp->hook(__position._M_node);
12898 return iterator(__tmp);
12900 template<typename _Tp, typename _Alloc>
12901 typename list<_Tp, _Alloc>::iterator
12902 list<_Tp, _Alloc>::
12903 erase(iterator __position)
12905 iterator __ret = iterator(__position._M_node->_M_next);
12906 _M_erase(__position);
12909 template<typename _Tp, typename _Alloc>
12911 list<_Tp, _Alloc>::
12912 resize(size_type __new_size, value_type __x)
12914 iterator __i = begin();
12915 size_type __len = 0;
12916 for (; __i != end() && __len < __new_size; ++__i, ++__len)
12918 if (__len == __new_size)
12921 insert(end(), __new_size - __len, __x);
12923 template<typename _Tp, typename _Alloc>
12925 list<_Tp, _Alloc>::
12926 operator=(const list& __x)
12930 iterator __first1 = begin();
12931 iterator __last1 = end();
12932 const_iterator __first2 = __x.begin();
12933 const_iterator __last2 = __x.end();
12934 for (; __first1 != __last1 && __first2 != __last2;
12935 ++__first1, ++__first2)
12936 *__first1 = *__first2;
12937 if (__first2 == __last2)
12938 erase(__first1, __last1);
12940 insert(__last1, __first2, __last2);
12944 template<typename _Tp, typename _Alloc>
12946 list<_Tp, _Alloc>::
12947 _M_fill_assign(size_type __n, const value_type& __val)
12949 iterator __i = begin();
12950 for (; __i != end() && __n > 0; ++__i, --__n)
12953 insert(end(), __n, __val);
12957 template<typename _Tp, typename _Alloc>
12958 template <typename _InputIterator>
12960 list<_Tp, _Alloc>::
12961 _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
12964 iterator __first1 = begin();
12965 iterator __last1 = end();
12966 for (; __first1 != __last1 && __first2 != __last2;
12967 ++__first1, ++__first2)
12968 *__first1 = *__first2;
12969 if (__first2 == __last2)
12970 erase(__first1, __last1);
12972 insert(__last1, __first2, __last2);
12974 template<typename _Tp, typename _Alloc>
12976 list<_Tp, _Alloc>::
12977 remove(const value_type& __value)
12979 iterator __first = begin();
12980 iterator __last = end();
12981 iterator __extra = __last;
12982 while (__first != __last)
12984 iterator __next = __first;
12986 if (*__first == __value)
12988 if (&*__first != &__value)
12995 if (__extra != __last)
12998 template<typename _Tp, typename _Alloc>
13000 list<_Tp, _Alloc>::
13003 iterator __first = begin();
13004 iterator __last = end();
13005 if (__first == __last)
13007 iterator __next = __first;
13008 while (++__next != __last)
13010 if (*__first == *__next)
13017 template<typename _Tp, typename _Alloc>
13019 list<_Tp, _Alloc>::
13024 _M_check_equal_allocators(__x);
13025 iterator __first1 = begin();
13026 iterator __last1 = end();
13027 iterator __first2 = __x.begin();
13028 iterator __last2 = __x.end();
13029 while (__first1 != __last1 && __first2 != __last2)
13030 if (*__first2 < *__first1)
13032 iterator __next = __first2;
13033 _M_transfer(__first1, __first2, ++__next);
13038 if (__first2 != __last2)
13039 _M_transfer(__last1, __first2, __last2);
13042 template<typename _Tp, typename _Alloc>
13043 template <typename _StrictWeakOrdering>
13045 list<_Tp, _Alloc>::
13046 merge(list& __x, _StrictWeakOrdering __comp)
13050 _M_check_equal_allocators(__x);
13051 iterator __first1 = begin();
13052 iterator __last1 = end();
13053 iterator __first2 = __x.begin();
13054 iterator __last2 = __x.end();
13055 while (__first1 != __last1 && __first2 != __last2)
13056 if (__comp(*__first2, *__first1))
13058 iterator __next = __first2;
13059 _M_transfer(__first1, __first2, ++__next);
13064 if (__first2 != __last2)
13065 _M_transfer(__last1, __first2, __last2);
13068 template<typename _Tp, typename _Alloc>
13070 list<_Tp, _Alloc>::
13073 if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
13074 && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
13078 list * __fill = &__tmp[0];
13082 __carry.splice(__carry.begin(), *this, begin());
13083 for(__counter = &__tmp[0];
13084 __counter != __fill && !__counter->empty();
13087 __counter->merge(__carry);
13088 __carry.swap(*__counter);
13090 __carry.swap(*__counter);
13091 if (__counter == __fill)
13094 while ( !empty() );
13095 for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
13096 __counter->merge(*(__counter - 1));
13097 swap( *(__fill - 1) );
13100 template<typename _Tp, typename _Alloc>
13101 template <typename _Predicate>
13103 list<_Tp, _Alloc>::
13104 remove_if(_Predicate __pred)
13106 iterator __first = begin();
13107 iterator __last = end();
13108 while (__first != __last)
13110 iterator __next = __first;
13112 if (__pred(*__first))
13117 template<typename _Tp, typename _Alloc>
13118 template <typename _BinaryPredicate>
13120 list<_Tp, _Alloc>::
13121 unique(_BinaryPredicate __binary_pred)
13123 iterator __first = begin();
13124 iterator __last = end();
13125 if (__first == __last)
13127 iterator __next = __first;
13128 while (++__next != __last)
13130 if (__binary_pred(*__first, *__next))
13137 template<typename _Tp, typename _Alloc>
13138 template <typename _StrictWeakOrdering>
13140 list<_Tp, _Alloc>::
13141 sort(_StrictWeakOrdering __comp)
13143 if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
13144 && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
13148 list * __fill = &__tmp[0];
13152 __carry.splice(__carry.begin(), *this, begin());
13153 for(__counter = &__tmp[0];
13154 __counter != __fill && !__counter->empty();
13157 __counter->merge(__carry, __comp);
13158 __carry.swap(*__counter);
13160 __carry.swap(*__counter);
13161 if (__counter == __fill)
13164 while ( !empty() );
13165 for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
13166 __counter->merge(*(__counter - 1), __comp);
13167 swap(*(__fill - 1));
13171 typedef QtValidLicenseForCoreModule QtCoreModule;
13172 template <typename T> class QVector;
13173 template <typename T> class QSet;
13174 struct __attribute__((visibility("default"))) QListData {
13176 QBasicAtomicInt ref;
13177 int alloc, begin, end;
13181 enum { DataHeaderSize = sizeof(Data) - sizeof(void *) };
13184 void realloc(int alloc);
13185 static Data shared_null;
13187 void **erase(void **xi);
13189 void **append(const QListData &l);
13191 void **insert(int i);
13192 void remove(int i);
13193 void remove(int i, int n);
13194 void move(int from, int to);
13195 inline int size() const { return d->end - d->begin; }
13196 inline bool isEmpty() const { return d->end == d->begin; }
13197 inline void **at(int i) const { return d->array + d->begin + i; }
13198 inline void **begin() const { return d->array + d->begin; }
13199 inline void **end() const { return d->array + d->end; }
13201 template <typename T>
13204 struct Node { void *v;
13206 { return *reinterpret_cast<T*>(QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic
13209 union { QListData p; QListData::Data *d; };
13211 inline QList() : d(&QListData::shared_null) { d->ref.ref(); }
13212 inline QList(const QList<T> &l) : d(l.d) { d->ref.ref(); if (!d->sharable) detach_helper(); }
13214 QList<T> &operator=(const QList<T> &l);
13215 bool operator==(const QList<T> &l) const;
13216 inline bool operator!=(const QList<T> &l) const { return !(*this == l); }
13217 inline int size() const { return p.size(); }
13218 inline void detach() { if (d->ref != 1) detach_helper(); }
13219 inline bool isDetached() const { return d->ref == 1; }
13220 inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
13221 inline bool isEmpty() const { return p.isEmpty(); }
13223 const T &at(int i) const;
13224 const T &operator[](int i) const;
13225 T &operator[](int i);
13226 void append(const T &t);
13227 void append(const QList<T> &t);
13228 void prepend(const T &t);
13229 void insert(int i, const T &t);
13230 void replace(int i, const T &t);
13231 void removeAt(int i);
13232 int removeAll(const T &t);
13233 bool removeOne(const T &t);
13237 void move(int from, int to);
13238 void swap(int i, int j);
13239 int indexOf(const T &t, int from = 0) const;
13240 int lastIndexOf(const T &t, int from = -1) const;
13241 QBool contains(const T &t) const;
13242 int count(const T &t) const;
13243 class const_iterator;
13247 typedef std::random_access_iterator_tag iterator_category;
13248 typedef ptrdiff_t difference_type;
13249 typedef T value_type;
13250 typedef T *pointer;
13251 typedef T &reference;
13252 inline iterator() : i(0) {}
13253 inline iterator(Node *n) : i(n) {}
13254 inline iterator(const iterator &o): i(o.i){}
13255 inline T &operator*() const { return i->t(); }
13256 inline T *operator->() const { return &i->t(); }
13257 inline T &operator[](int j) const { return i[j].t(); }
13258 inline bool operator==(const iterator &o) const { return i == o.i; }
13259 inline bool operator!=(const iterator &o) const { return i != o.i; }
13260 inline bool operator<(const iterator& other) const { return i < other.i; }
13261 inline bool operator<=(const iterator& other) const { return i <= other.i; }
13262 inline bool operator>(const iterator& other) const { return i > other.i; }
13263 inline bool operator>=(const iterator& other) const { return i >= other.i; }
13264 inline bool operator==(const const_iterator &o) const
13265 { return i == o.i; }
13266 inline bool operator!=(const const_iterator &o) const
13267 { return i != o.i; }
13268 inline bool operator<(const const_iterator& other) const
13269 { return i < other.i; }
13270 inline bool operator<=(const const_iterator& other) const
13271 { return i <= other.i; }
13272 inline bool operator>(const const_iterator& other) const
13273 { return i > other.i; }
13274 inline bool operator>=(const const_iterator& other) const
13275 { return i >= other.i; }
13276 inline iterator &operator++() { ++i; return *this; }
13277 inline iterator operator++(int) { Node *n = i; ++i; return n; }
13278 inline iterator &operator--() { i--; return *this; }
13279 inline iterator operator--(int) { Node *n = i; i--; return n; }
13280 inline iterator &operator+=(int j) { i+=j; return *this; }
13281 inline iterator &operator-=(int j) { i-=j; return *this; }
13282 inline iterator operator+(int j) const { return iterator(i+j); }
13283 inline iterator operator-(int j) const { return iterator(i-j); }
13284 inline int operator-(iterator j) const { return i - j.i; }
13286 friend class iterator;
13287 class const_iterator {
13290 typedef std::random_access_iterator_tag iterator_category;
13291 typedef ptrdiff_t difference_type;
13292 typedef T value_type;
13293 typedef const T *pointer;
13294 typedef const T &reference;
13295 inline const_iterator() : i(0) {}
13296 inline const_iterator(Node *n) : i(n) {}
13297 inline const_iterator(const const_iterator &o): i(o.i) {}
13298 inline const_iterator(const iterator &o): i(o.i) {}
13299 inline const T &operator*() const { return i->t(); }
13300 inline const T *operator->() const { return &i->t(); }
13301 inline const T &operator[](int j) const { return i[j].t(); }
13302 inline bool operator==(const const_iterator &o) const { return i == o.i; }
13303 inline bool operator!=(const const_iterator &o) const { return i != o.i; }
13304 inline bool operator<(const const_iterator& other) const { return i < other.i; }
13305 inline bool operator<=(const const_iterator& other) const { return i <= other.i; }
13306 inline bool operator>(const const_iterator& other) const { return i > other.i; }
13307 inline bool operator>=(const const_iterator& other) const { return i >= other.i; }
13308 inline const_iterator &operator++() { ++i; return *this; }
13309 inline const_iterator operator++(int) { Node *n = i; ++i; return n; }
13310 inline const_iterator &operator--() { i--; return *this; }
13311 inline const_iterator operator--(int) { Node *n = i; i--; return n; }
13312 inline const_iterator &operator+=(int j) { i+=j; return *this; }
13313 inline const_iterator &operator-=(int j) { i-=j; return *this; }
13314 inline const_iterator operator+(int j) const { return const_iterator(i+j); }
13315 inline const_iterator operator-(int j) const { return const_iterator(i-j); }
13316 inline int operator-(const_iterator j) const { return i - j.i; }
13318 friend class const_iterator;
13319 inline iterator begin() { detach(); return reinterpret_cast<Node *>(p.begin()); }
13320 inline const_iterator begin() const { return reinterpret_cast<Node *>(p.begin()); }
13321 inline const_iterator constBegin() const { return reinterpret_cast<Node *>(p.begin()); }
13322 inline iterator end() { detach(); return reinterpret_cast<Node *>(p.end()); }
13323 inline const_iterator end() const { return reinterpret_cast<Node *>(p.end()); }
13324 inline const_iterator constEnd() const { return reinterpret_cast<Node *>(p.end()); }
13325 iterator insert(iterator before, const T &t);
13326 iterator erase(iterator pos);
13327 iterator erase(iterator first, iterator last);
13328 typedef iterator Iterator;
13329 typedef const_iterator ConstIterator;
13330 inline int count() const { return p.size(); }
13331 inline int length() const { return p.size(); }
13332 inline T& first() { qt_noop(); return *begin(); }
13333 inline const T& first() const { qt_noop(); return *begin(); }
13334 T& last() { qt_noop(); return *(--end()); }
13335 const T& last() const { qt_noop(); return *(--end()); }
13336 inline void removeFirst() { qt_noop(); erase(begin()); }
13337 inline void removeLast() { qt_noop(); erase(--end()); }
13338 inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; }
13339 inline bool endsWith(const T &t) const { return !isEmpty() && last() == t; }
13340 QList<T> mid(int pos, int length = -1) const;
13341 T value(int i) const;
13342 T value(int i, const T &defaultValue) const;
13343 inline void push_back(const T &t) { append(t); }
13344 inline void push_front(const T &t) { prepend(t); }
13345 inline T& front() { return first(); }
13346 inline const T& front() const { return first(); }
13347 inline T& back() { return last(); }
13348 inline const T& back() const { return last(); }
13349 inline void pop_front() { removeFirst(); }
13350 inline void pop_back() { removeLast(); }
13351 inline bool empty() const { return isEmpty(); }
13352 typedef int size_type;
13353 typedef T value_type;
13354 typedef value_type *pointer;
13355 typedef const value_type *const_pointer;
13356 typedef value_type &reference;
13357 typedef const value_type &const_reference;
13358 typedef ptrdiff_t difference_type;
13359 QList<T> &operator+=(const QList<T> &l);
13360 inline QList<T> operator+(const QList<T> &l) const
13361 { QList n = *this; n += l; return n; }
13362 inline QList<T> &operator+=(const T &t)
13363 { append(t); return *this; }
13364 inline QList<T> &operator<< (const T &t)
13365 { append(t); return *this; }
13366 inline QList<T> &operator<<(const QList<T> &l)
13367 { *this += l; return *this; }
13368 QVector<T> toVector() const;
13369 QSet<T> toSet() const;
13370 static QList<T> fromVector(const QVector<T> &vector);
13371 static QList<T> fromSet(const QSet<T> &set);
13372 static inline QList<T> fromStdList(const std::list<T> &list)
13373 { QList<T> tmp; qCopy(list.begin(), list.end(), std::back_inserter(tmp)); return tmp; }
13374 inline std::list<T> toStdList() const
13375 { std::list<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
13377 void detach_helper();
13378 void free(QListData::Data *d);
13379 void node_construct(Node *n, const T &t);
13380 void node_destruct(Node *n);
13381 void node_copy(Node *from, Node *to, Node *src);
13382 void node_destruct(Node *from, Node *to);
13384 template <typename T>
13385 inline void QList<T>::node_construct(Node *n, const T &t)
13387 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) n->v = new T(t);
13388 else if (QTypeInfo<T>::isComplex) new (n) T(t);
13389 else *reinterpret_cast<T*>(n) = t;
13391 template <typename T>
13392 inline void QList<T>::node_destruct(Node *n)
13394 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) delete reinterpret_cast<T*>(n->v);
13395 else if (QTypeInfo<T>::isComplex) reinterpret_cast<T*>(n)->~T();
13397 template <typename T>
13398 inline void QList<T>::node_copy(Node *from, Node *to, Node *src)
13400 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic)
13402 (from++)->v = new T(*reinterpret_cast<T*>((src++)->v));
13403 else if (QTypeInfo<T>::isComplex)
13405 new (from++) T(*reinterpret_cast<T*>(src++));
13407 template <typename T>
13408 inline void QList<T>::node_destruct(Node *from, Node *to)
13410 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic)
13411 while(from != to) --to, delete reinterpret_cast<T*>(to->v);
13412 else if (QTypeInfo<T>::isComplex)
13413 while (from != to) --to, reinterpret_cast<T*>(to)->~T();
13415 template <typename T>
13416 inline QList<T> &QList<T>::operator=(const QList<T> &l)
13420 if (!d->ref.deref())
13428 template <typename T>
13429 inline typename QList<T>::iterator QList<T>::insert(iterator before, const T &t)
13430 { Node *n = reinterpret_cast<Node *>(p.insert(before.i-reinterpret_cast<Node *>(p.begin())));
13431 node_construct(n,t); return n; }
13432 template <typename T>
13433 inline typename QList<T>::iterator QList<T>::erase(iterator it)
13434 { node_destruct(it.i);
13435 return reinterpret_cast<Node *>(p.erase(reinterpret_cast<void**>(it.i))); }
13436 template <typename T>
13437 inline const T &QList<T>::at(int i) const
13439 return reinterpret_cast<Node *>(p.at(i))->t(); }
13440 template <typename T>
13441 inline const T &QList<T>::operator[](int i) const
13443 return reinterpret_cast<Node *>(p.at(i))->t(); }
13444 template <typename T>
13445 inline T &QList<T>::operator[](int i)
13447 detach(); return reinterpret_cast<Node *>(p.at(i))->t(); }
13448 template <typename T>
13449 inline void QList<T>::removeAt(int i)
13450 { if(i >= 0 && i < p.size()) { detach();
13451 node_destruct(reinterpret_cast<Node *>(p.at(i))); p.remove(i); } }
13452 template <typename T>
13453 inline T QList<T>::takeAt(int i)
13455 detach(); Node *n = reinterpret_cast<Node *>(p.at(i)); T t = n->t(); node_destruct(n);
13456 p.remove(i); return t; }
13457 template <typename T>
13458 inline T QList<T>::takeFirst()
13459 { T t = first(); removeFirst(); return t; }
13460 template <typename T>
13461 inline T QList<T>::takeLast()
13462 { T t = last(); removeLast(); return t; }
13463 template <typename T>
13464 void QList<T>::append(const T &t)
13467 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
13468 node_construct(reinterpret_cast<Node *>(p.append()), t);
13471 node_construct(reinterpret_cast<Node *>(p.append()), cpy);
13474 template <typename T>
13475 inline void QList<T>::prepend(const T &t)
13478 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
13479 node_construct(reinterpret_cast<Node *>(p.prepend()), t);
13482 node_construct(reinterpret_cast<Node *>(p.prepend()), cpy);
13485 template <typename T>
13486 inline void QList<T>::insert(int i, const T &t)
13489 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
13490 node_construct(reinterpret_cast<Node *>(p.insert(i)), t);
13493 node_construct(reinterpret_cast<Node *>(p.insert(i)), cpy);
13496 template <typename T>
13497 inline void QList<T>::replace(int i, const T &t)
13501 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
13502 reinterpret_cast<Node *>(p.at(i))->t() = t;
13505 reinterpret_cast<Node *>(p.at(i))->t() = cpy;
13508 template <typename T>
13509 inline void QList<T>::swap(int i, int j)
13513 void *t = d->array[d->begin + i];
13514 d->array[d->begin + i] = d->array[d->begin + j];
13515 d->array[d->begin + j] = t;
13517 template <typename T>
13518 inline void QList<T>::move(int from, int to)
13524 template<typename T>
13525 QList<T> QList<T>::mid(int pos, int alength) const
13528 alength = size() - pos;
13529 if (pos == 0 && alength == size())
13532 if (pos + alength > size())
13533 alength = size() - pos;
13534 for (int i = pos; i < pos + alength; ++i)
13538 template<typename T>
13539 T QList<T>::value(int i) const
13541 if (i < 0 || i >= p.size()) {
13544 return reinterpret_cast<Node *>(p.at(i))->t();
13546 template<typename T>
13547 T QList<T>::value(int i, const T& defaultValue) const
13549 return ((i < 0 || i >= p.size()) ? defaultValue : reinterpret_cast<Node *>(p.at(i))->t());
13551 template <typename T>
13552 void QList<T>::detach_helper()
13554 Node *n = reinterpret_cast<Node *>(p.begin());
13555 QListData::Data *x = p.detach2();
13556 node_copy(reinterpret_cast<Node *>(p.begin()), reinterpret_cast<Node *>(p.end()), n);
13557 if (!x->ref.deref())
13560 template <typename T>
13563 if (d && !d->ref.deref())
13566 template <typename T>
13567 bool QList<T>::operator==(const QList<T> &l) const
13569 if (p.size() != l.p.size())
13573 Node *i = reinterpret_cast<Node *>(p.end());
13574 Node *b = reinterpret_cast<Node *>(p.begin());
13575 Node *li = reinterpret_cast<Node *>(l.p.end());
13578 if (!(i->t() == li->t()))
13583 template <typename T>
13584 void QList<T>::free(QListData::Data *data)
13586 node_destruct(reinterpret_cast<Node *>(data->array + data->begin),
13587 reinterpret_cast<Node *>(data->array + data->end));
13588 if (data->ref == 0)
13591 template <typename T>
13592 void QList<T>::clear()
13594 *this = QList<T>();
13596 template <typename T>
13597 int QList<T>::removeAll(const T &_t)
13601 int removedCount=0, i=0;
13603 while (i < p.size())
13604 if ((n = reinterpret_cast<Node *>(p.at(i)))->t() == t) {
13611 return removedCount;
13613 template <typename T>
13614 bool QList<T>::removeOne(const T &_t)
13617 int index = indexOf(_t);
13624 template <typename T>
13625 typename QList<T>::iterator QList<T>::erase(typename QList<T>::iterator afirst,
13626 typename QList<T>::iterator alast)
13628 for (Node *n = afirst.i; n < alast.i; ++n)
13630 int idx = afirst - begin();
13631 p.remove(idx, alast - afirst);
13632 return begin() + idx;
13634 template <typename T>
13635 QList<T> &QList<T>::operator+=(const QList<T> &l)
13638 Node *n = reinterpret_cast<Node *>(p.append(l.p));
13639 node_copy(n, reinterpret_cast<Node *>(p.end()), reinterpret_cast<Node *>(l.p.begin()));
13642 template <typename T>
13643 inline void QList<T>::append(const QList<T> &t)
13647 template <typename T>
13648 int QList<T>::indexOf(const T &t, int from) const
13651 from = qMax(from + p.size(), 0);
13652 if (from < p.size()) {
13653 Node *n = reinterpret_cast<Node *>(p.at(from -1));
13654 Node *e = reinterpret_cast<Node *>(p.end());
13657 return n - reinterpret_cast<Node *>(p.begin());
13661 template <typename T>
13662 int QList<T>::lastIndexOf(const T &t, int from) const
13666 else if (from >= p.size())
13669 Node *b = reinterpret_cast<Node *>(p.begin());
13670 Node *n = reinterpret_cast<Node *>(p.at(from + 1));
13678 template <typename T>
13679 QBool QList<T>::contains(const T &t) const
13681 Node *b = reinterpret_cast<Node *>(p.begin());
13682 Node *i = reinterpret_cast<Node *>(p.end());
13685 return QBool(true);
13686 return QBool(false);
13688 template <typename T>
13689 int QList<T>::count(const T &t) const
13692 Node *b = reinterpret_cast<Node *>(p.begin());
13693 Node *i = reinterpret_cast<Node *>(p.end());
13699 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; } };
13700 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; } };
13701 typedef QtValidLicenseForCoreModule QtCoreModule;
13726 enum KeyboardModifier {
13727 NoModifier = 0x00000000,
13728 ShiftModifier = 0x02000000,
13729 ControlModifier = 0x04000000,
13730 AltModifier = 0x08000000,
13731 MetaModifier = 0x10000000,
13732 KeypadModifier = 0x20000000,
13733 GroupSwitchModifier = 0x40000000,
13734 KeyboardModifierMask = 0xfe000000
13736 typedef QFlags<KeyboardModifier> KeyboardModifiers;
13738 META = Qt::MetaModifier,
13739 SHIFT = Qt::ShiftModifier,
13740 CTRL = Qt::ControlModifier,
13741 ALT = Qt::AltModifier,
13742 MODIFIER_MASK = KeyboardModifierMask,
13743 UNICODE_ACCEL = 0x00000000
13746 NoButton = 0x00000000,
13747 LeftButton = 0x00000001,
13748 RightButton = 0x00000002,
13749 MidButton = 0x00000004,
13750 XButton1 = 0x00000008,
13751 XButton2 = 0x00000010,
13752 MouseButtonMask = 0x000000ff
13754 typedef QFlags<MouseButton> MouseButtons;
13759 typedef QFlags<Orientation> Orientations;
13764 StrongFocus = TabFocus | ClickFocus | 0x8,
13765 WheelFocus = StrongFocus | 0x4
13771 enum AlignmentFlag {
13772 AlignLeft = 0x0001,
13773 AlignLeading = AlignLeft,
13774 AlignRight = 0x0002,
13775 AlignTrailing = AlignRight,
13776 AlignHCenter = 0x0004,
13777 AlignJustify = 0x0008,
13778 AlignAbsolute = 0x0010,
13779 AlignHorizontal_Mask = AlignLeft | AlignRight | AlignHCenter | AlignJustify | AlignAbsolute,
13781 AlignBottom = 0x0040,
13782 AlignVCenter = 0x0080,
13783 AlignVertical_Mask = AlignTop | AlignBottom | AlignVCenter,
13784 AlignCenter = AlignVCenter | AlignHCenter
13786 typedef QFlags<AlignmentFlag> Alignment;
13788 TextSingleLine = 0x0100,
13789 TextDontClip = 0x0200,
13790 TextExpandTabs = 0x0400,
13791 TextShowMnemonic = 0x0800,
13792 TextWordWrap = 0x1000,
13793 TextWrapAnywhere = 0x2000,
13794 TextDontPrint = 0x4000,
13795 TextIncludeTrailingSpaces = 0x08000000,
13796 TextHideMnemonic = 0x8000,
13797 TextJustificationForced = 0x10000,
13798 TextForceLeftToRight = 0x20000,
13799 TextForceRightToLeft = 0x40000
13801 enum TextElideMode {
13808 Widget = 0x00000000,
13809 Window = 0x00000001,
13810 Dialog = 0x00000002 | Window,
13811 Sheet = 0x00000004 | Window,
13812 Drawer = 0x00000006 | Window,
13813 Popup = 0x00000008 | Window,
13814 Tool = 0x0000000a | Window,
13815 ToolTip = 0x0000000c | Window,
13816 SplashScreen = 0x0000000e | Window,
13817 Desktop = 0x00000010 | Window,
13818 SubWindow = 0x00000012,
13819 WindowType_Mask = 0x000000ff,
13820 MSWindowsFixedSizeDialogHint = 0x00000100,
13821 MSWindowsOwnDC = 0x00000200,
13822 X11BypassWindowManagerHint = 0x00000400,
13823 FramelessWindowHint = 0x00000800,
13824 WindowTitleHint = 0x00001000,
13825 WindowSystemMenuHint = 0x00002000,
13826 WindowMinimizeButtonHint = 0x00004000,
13827 WindowMaximizeButtonHint = 0x00008000,
13828 WindowMinMaxButtonsHint = WindowMinimizeButtonHint | WindowMaximizeButtonHint,
13829 WindowContextHelpButtonHint = 0x00010000,
13830 WindowShadeButtonHint = 0x00020000,
13831 WindowStaysOnTopHint = 0x00040000,
13832 CustomizeWindowHint = 0x02000000,
13833 WindowStaysOnBottomHint = 0x04000000,
13834 WindowCloseButtonHint = 0x08000000,
13835 MacWindowToolBarButtonHint = 0x10000000,
13836 BypassGraphicsProxyWidget = 0x20000000,
13837 WindowOkButtonHint = 0x00080000,
13838 WindowCancelButtonHint = 0x00100000
13840 typedef QFlags<WindowType> WindowFlags;
13842 WindowNoState = 0x00000000,
13843 WindowMinimized = 0x00000001,
13844 WindowMaximized = 0x00000002,
13845 WindowFullScreen = 0x00000004,
13846 WindowActive = 0x00000008
13848 typedef QFlags<WindowState> WindowStates;
13849 enum WidgetAttribute {
13852 WA_MouseTracking = 2,
13853 WA_ContentsPropagated = 3,
13854 WA_OpaquePaintEvent = 4,
13855 WA_NoBackground = WA_OpaquePaintEvent,
13856 WA_StaticContents = 5,
13858 WA_PaintOnScreen = 8,
13859 WA_NoSystemBackground = 9,
13860 WA_UpdatesDisabled = 10,
13862 WA_MacNoClickThrough = 12,
13863 WA_PaintOutsidePaintEvent = 13,
13864 WA_InputMethodEnabled = 14,
13865 WA_WState_Visible = 15,
13866 WA_WState_Hidden = 16,
13867 WA_ForceDisabled = 32,
13868 WA_KeyCompression = 33,
13869 WA_PendingMoveEvent = 34,
13870 WA_PendingResizeEvent = 35,
13871 WA_SetPalette = 36,
13874 WA_NoChildEventsFromChildren = 39,
13875 WA_WindowModified = 41,
13878 WA_PendingUpdate = 44,
13879 WA_InvalidSize = 45,
13880 WA_MacBrushedMetal = 46,
13881 WA_MacMetalStyle = WA_MacBrushedMetal,
13882 WA_CustomWhatsThis = 47,
13883 WA_LayoutOnEntireRect = 48,
13884 WA_OutsideWSRange = 49,
13885 WA_GrabbedShortcut = 50,
13886 WA_TransparentForMouseEvents = 51,
13887 WA_PaintUnclipped = 52,
13888 WA_SetWindowIcon = 53,
13889 WA_NoMouseReplay = 54,
13890 WA_DeleteOnClose = 55,
13891 WA_RightToLeft = 56,
13892 WA_SetLayoutDirection = 57,
13893 WA_NoChildEventsForParent = 58,
13894 WA_ForceUpdatesDisabled = 59,
13895 WA_WState_Created = 60,
13896 WA_WState_CompressKeys = 61,
13897 WA_WState_InPaintEvent = 62,
13898 WA_WState_Reparented = 63,
13899 WA_WState_ConfigPending = 64,
13900 WA_WState_Polished = 66,
13901 WA_WState_DND = 67,
13902 WA_WState_OwnSizePolicy = 68,
13903 WA_WState_ExplicitShowHide = 69,
13905 WA_MouseNoMask = 71,
13906 WA_GroupLeader = 72,
13907 WA_NoMousePropagation = 73,
13909 WA_InputMethodTransparent = 75,
13910 WA_QuitOnClose = 76,
13911 WA_KeyboardFocusChange = 77,
13912 WA_AcceptDrops = 78,
13913 WA_DropSiteRegistered = 79,
13914 WA_ForceAcceptDrops = WA_DropSiteRegistered,
13915 WA_WindowPropagation = 80,
13916 WA_NoX11EventCompression = 81,
13917 WA_TintedBackground = 82,
13918 WA_X11OpenGLOverlay = 83,
13919 WA_AlwaysShowToolTips = 84,
13920 WA_MacOpaqueSizeGrip = 85,
13923 WA_MacShowFocusRect = 88,
13924 WA_MacNormalSize = 89,
13925 WA_MacSmallSize = 90,
13926 WA_MacMiniSize = 91,
13927 WA_LayoutUsesWidgetRect = 92,
13928 WA_StyledBackground = 93,
13929 WA_MSWindowsUseDirect3D = 94,
13930 WA_CanHostQMdiSubWindowTitleBar = 95,
13931 WA_MacAlwaysShowToolWindow = 96,
13932 WA_StyleSheet = 97,
13933 WA_ShowWithoutActivating = 98,
13934 WA_X11BypassTransientForHint = 99,
13935 WA_NativeWindow = 100,
13936 WA_DontCreateNativeAncestors = 101,
13937 WA_MacVariableSize = 102,
13938 WA_DontShowOnScreen = 103,
13939 WA_X11NetWmWindowTypeDesktop = 104,
13940 WA_X11NetWmWindowTypeDock = 105,
13941 WA_X11NetWmWindowTypeToolBar = 106,
13942 WA_X11NetWmWindowTypeMenu = 107,
13943 WA_X11NetWmWindowTypeUtility = 108,
13944 WA_X11NetWmWindowTypeSplash = 109,
13945 WA_X11NetWmWindowTypeDialog = 110,
13946 WA_X11NetWmWindowTypeDropDownMenu = 111,
13947 WA_X11NetWmWindowTypePopupMenu = 112,
13948 WA_X11NetWmWindowTypeToolTip = 113,
13949 WA_X11NetWmWindowTypeNotification = 114,
13950 WA_X11NetWmWindowTypeCombo = 115,
13951 WA_X11NetWmWindowTypeDND = 116,
13952 WA_MacFrameworkScaled = 117,
13953 WA_SetWindowModality = 118,
13954 WA_WState_WindowOpacitySet = 119,
13955 WA_TranslucentBackground = 120,
13958 enum ApplicationAttribute
13960 AA_ImmediateWidgetCreation = 0,
13961 AA_MSWindowsUseDirect3DByDefault = 1,
13962 AA_DontShowIconsInMenus = 2,
13963 AA_NativeWindows = 3,
13964 AA_DontCreateNativeWidgetSiblings = 4,
13965 AA_MacPluginApplication = 5,
13968 enum ImageConversionFlag {
13969 ColorMode_Mask = 0x00000003,
13970 AutoColor = 0x00000000,
13971 ColorOnly = 0x00000003,
13972 MonoOnly = 0x00000002,
13973 AlphaDither_Mask = 0x0000000c,
13974 ThresholdAlphaDither = 0x00000000,
13975 OrderedAlphaDither = 0x00000004,
13976 DiffuseAlphaDither = 0x00000008,
13977 NoAlpha = 0x0000000c,
13978 Dither_Mask = 0x00000030,
13979 DiffuseDither = 0x00000000,
13980 OrderedDither = 0x00000010,
13981 ThresholdDither = 0x00000020,
13982 DitherMode_Mask = 0x000000c0,
13983 AutoDither = 0x00000000,
13984 PreferDither = 0x00000040,
13985 AvoidDither = 0x00000080,
13986 NoOpaqueDetection = 0x00000100
13988 typedef QFlags<ImageConversionFlag> ImageConversionFlags;
13994 Key_Escape = 0x01000000,
13995 Key_Tab = 0x01000001,
13996 Key_Backtab = 0x01000002,
13997 Key_Backspace = 0x01000003,
13998 Key_Return = 0x01000004,
13999 Key_Enter = 0x01000005,
14000 Key_Insert = 0x01000006,
14001 Key_Delete = 0x01000007,
14002 Key_Pause = 0x01000008,
14003 Key_Print = 0x01000009,
14004 Key_SysReq = 0x0100000a,
14005 Key_Clear = 0x0100000b,
14006 Key_Home = 0x01000010,
14007 Key_End = 0x01000011,
14008 Key_Left = 0x01000012,
14009 Key_Up = 0x01000013,
14010 Key_Right = 0x01000014,
14011 Key_Down = 0x01000015,
14012 Key_PageUp = 0x01000016,
14013 Key_PageDown = 0x01000017,
14014 Key_Shift = 0x01000020,
14015 Key_Control = 0x01000021,
14016 Key_Meta = 0x01000022,
14017 Key_Alt = 0x01000023,
14018 Key_CapsLock = 0x01000024,
14019 Key_NumLock = 0x01000025,
14020 Key_ScrollLock = 0x01000026,
14021 Key_F1 = 0x01000030,
14022 Key_F2 = 0x01000031,
14023 Key_F3 = 0x01000032,
14024 Key_F4 = 0x01000033,
14025 Key_F5 = 0x01000034,
14026 Key_F6 = 0x01000035,
14027 Key_F7 = 0x01000036,
14028 Key_F8 = 0x01000037,
14029 Key_F9 = 0x01000038,
14030 Key_F10 = 0x01000039,
14031 Key_F11 = 0x0100003a,
14032 Key_F12 = 0x0100003b,
14033 Key_F13 = 0x0100003c,
14034 Key_F14 = 0x0100003d,
14035 Key_F15 = 0x0100003e,
14036 Key_F16 = 0x0100003f,
14037 Key_F17 = 0x01000040,
14038 Key_F18 = 0x01000041,
14039 Key_F19 = 0x01000042,
14040 Key_F20 = 0x01000043,
14041 Key_F21 = 0x01000044,
14042 Key_F22 = 0x01000045,
14043 Key_F23 = 0x01000046,
14044 Key_F24 = 0x01000047,
14045 Key_F25 = 0x01000048,
14046 Key_F26 = 0x01000049,
14047 Key_F27 = 0x0100004a,
14048 Key_F28 = 0x0100004b,
14049 Key_F29 = 0x0100004c,
14050 Key_F30 = 0x0100004d,
14051 Key_F31 = 0x0100004e,
14052 Key_F32 = 0x0100004f,
14053 Key_F33 = 0x01000050,
14054 Key_F34 = 0x01000051,
14055 Key_F35 = 0x01000052,
14056 Key_Super_L = 0x01000053,
14057 Key_Super_R = 0x01000054,
14058 Key_Menu = 0x01000055,
14059 Key_Hyper_L = 0x01000056,
14060 Key_Hyper_R = 0x01000057,
14061 Key_Help = 0x01000058,
14062 Key_Direction_L = 0x01000059,
14063 Key_Direction_R = 0x01000060,
14065 Key_Any = Key_Space,
14067 Key_QuoteDbl = 0x22,
14068 Key_NumberSign = 0x23,
14070 Key_Percent = 0x25,
14071 Key_Ampersand = 0x26,
14072 Key_Apostrophe = 0x27,
14073 Key_ParenLeft = 0x28,
14074 Key_ParenRight = 0x29,
14075 Key_Asterisk = 0x2a,
14092 Key_Semicolon = 0x3b,
14095 Key_Greater = 0x3e,
14096 Key_Question = 0x3f,
14124 Key_BracketLeft = 0x5b,
14125 Key_Backslash = 0x5c,
14126 Key_BracketRight = 0x5d,
14127 Key_AsciiCircum = 0x5e,
14128 Key_Underscore = 0x5f,
14129 Key_QuoteLeft = 0x60,
14130 Key_BraceLeft = 0x7b,
14132 Key_BraceRight = 0x7d,
14133 Key_AsciiTilde = 0x7e,
14134 Key_nobreakspace = 0x0a0,
14135 Key_exclamdown = 0x0a1,
14137 Key_sterling = 0x0a3,
14138 Key_currency = 0x0a4,
14140 Key_brokenbar = 0x0a6,
14141 Key_section = 0x0a7,
14142 Key_diaeresis = 0x0a8,
14143 Key_copyright = 0x0a9,
14144 Key_ordfeminine = 0x0aa,
14145 Key_guillemotleft = 0x0ab,
14146 Key_notsign = 0x0ac,
14147 Key_hyphen = 0x0ad,
14148 Key_registered = 0x0ae,
14149 Key_macron = 0x0af,
14150 Key_degree = 0x0b0,
14151 Key_plusminus = 0x0b1,
14152 Key_twosuperior = 0x0b2,
14153 Key_threesuperior = 0x0b3,
14156 Key_paragraph = 0x0b6,
14157 Key_periodcentered = 0x0b7,
14158 Key_cedilla = 0x0b8,
14159 Key_onesuperior = 0x0b9,
14160 Key_masculine = 0x0ba,
14161 Key_guillemotright = 0x0bb,
14162 Key_onequarter = 0x0bc,
14163 Key_onehalf = 0x0bd,
14164 Key_threequarters = 0x0be,
14165 Key_questiondown = 0x0bf,
14166 Key_Agrave = 0x0c0,
14167 Key_Aacute = 0x0c1,
14168 Key_Acircumflex = 0x0c2,
14169 Key_Atilde = 0x0c3,
14170 Key_Adiaeresis = 0x0c4,
14173 Key_Ccedilla = 0x0c7,
14174 Key_Egrave = 0x0c8,
14175 Key_Eacute = 0x0c9,
14176 Key_Ecircumflex = 0x0ca,
14177 Key_Ediaeresis = 0x0cb,
14178 Key_Igrave = 0x0cc,
14179 Key_Iacute = 0x0cd,
14180 Key_Icircumflex = 0x0ce,
14181 Key_Idiaeresis = 0x0cf,
14183 Key_Ntilde = 0x0d1,
14184 Key_Ograve = 0x0d2,
14185 Key_Oacute = 0x0d3,
14186 Key_Ocircumflex = 0x0d4,
14187 Key_Otilde = 0x0d5,
14188 Key_Odiaeresis = 0x0d6,
14189 Key_multiply = 0x0d7,
14190 Key_Ooblique = 0x0d8,
14191 Key_Ugrave = 0x0d9,
14192 Key_Uacute = 0x0da,
14193 Key_Ucircumflex = 0x0db,
14194 Key_Udiaeresis = 0x0dc,
14195 Key_Yacute = 0x0dd,
14197 Key_ssharp = 0x0df,
14198 Key_division = 0x0f7,
14199 Key_ydiaeresis = 0x0ff,
14200 Key_AltGr = 0x01001103,
14201 Key_Multi_key = 0x01001120,
14202 Key_Codeinput = 0x01001137,
14203 Key_SingleCandidate = 0x0100113c,
14204 Key_MultipleCandidate = 0x0100113d,
14205 Key_PreviousCandidate = 0x0100113e,
14206 Key_Mode_switch = 0x0100117e,
14207 Key_Kanji = 0x01001121,
14208 Key_Muhenkan = 0x01001122,
14209 Key_Henkan = 0x01001123,
14210 Key_Romaji = 0x01001124,
14211 Key_Hiragana = 0x01001125,
14212 Key_Katakana = 0x01001126,
14213 Key_Hiragana_Katakana = 0x01001127,
14214 Key_Zenkaku = 0x01001128,
14215 Key_Hankaku = 0x01001129,
14216 Key_Zenkaku_Hankaku = 0x0100112a,
14217 Key_Touroku = 0x0100112b,
14218 Key_Massyo = 0x0100112c,
14219 Key_Kana_Lock = 0x0100112d,
14220 Key_Kana_Shift = 0x0100112e,
14221 Key_Eisu_Shift = 0x0100112f,
14222 Key_Eisu_toggle = 0x01001130,
14223 Key_Hangul = 0x01001131,
14224 Key_Hangul_Start = 0x01001132,
14225 Key_Hangul_End = 0x01001133,
14226 Key_Hangul_Hanja = 0x01001134,
14227 Key_Hangul_Jamo = 0x01001135,
14228 Key_Hangul_Romaja = 0x01001136,
14229 Key_Hangul_Jeonja = 0x01001138,
14230 Key_Hangul_Banja = 0x01001139,
14231 Key_Hangul_PreHanja = 0x0100113a,
14232 Key_Hangul_PostHanja = 0x0100113b,
14233 Key_Hangul_Special = 0x0100113f,
14234 Key_Dead_Grave = 0x01001250,
14235 Key_Dead_Acute = 0x01001251,
14236 Key_Dead_Circumflex = 0x01001252,
14237 Key_Dead_Tilde = 0x01001253,
14238 Key_Dead_Macron = 0x01001254,
14239 Key_Dead_Breve = 0x01001255,
14240 Key_Dead_Abovedot = 0x01001256,
14241 Key_Dead_Diaeresis = 0x01001257,
14242 Key_Dead_Abovering = 0x01001258,
14243 Key_Dead_Doubleacute = 0x01001259,
14244 Key_Dead_Caron = 0x0100125a,
14245 Key_Dead_Cedilla = 0x0100125b,
14246 Key_Dead_Ogonek = 0x0100125c,
14247 Key_Dead_Iota = 0x0100125d,
14248 Key_Dead_Voiced_Sound = 0x0100125e,
14249 Key_Dead_Semivoiced_Sound = 0x0100125f,
14250 Key_Dead_Belowdot = 0x01001260,
14251 Key_Dead_Hook = 0x01001261,
14252 Key_Dead_Horn = 0x01001262,
14253 Key_Back = 0x01000061,
14254 Key_Forward = 0x01000062,
14255 Key_Stop = 0x01000063,
14256 Key_Refresh = 0x01000064,
14257 Key_VolumeDown = 0x01000070,
14258 Key_VolumeMute = 0x01000071,
14259 Key_VolumeUp = 0x01000072,
14260 Key_BassBoost = 0x01000073,
14261 Key_BassUp = 0x01000074,
14262 Key_BassDown = 0x01000075,
14263 Key_TrebleUp = 0x01000076,
14264 Key_TrebleDown = 0x01000077,
14265 Key_MediaPlay = 0x01000080,
14266 Key_MediaStop = 0x01000081,
14267 Key_MediaPrevious = 0x01000082,
14268 Key_MediaNext = 0x01000083,
14269 Key_MediaRecord = 0x01000084,
14270 Key_HomePage = 0x01000090,
14271 Key_Favorites = 0x01000091,
14272 Key_Search = 0x01000092,
14273 Key_Standby = 0x01000093,
14274 Key_OpenUrl = 0x01000094,
14275 Key_LaunchMail = 0x010000a0,
14276 Key_LaunchMedia = 0x010000a1,
14277 Key_Launch0 = 0x010000a2,
14278 Key_Launch1 = 0x010000a3,
14279 Key_Launch2 = 0x010000a4,
14280 Key_Launch3 = 0x010000a5,
14281 Key_Launch4 = 0x010000a6,
14282 Key_Launch5 = 0x010000a7,
14283 Key_Launch6 = 0x010000a8,
14284 Key_Launch7 = 0x010000a9,
14285 Key_Launch8 = 0x010000aa,
14286 Key_Launch9 = 0x010000ab,
14287 Key_LaunchA = 0x010000ac,
14288 Key_LaunchB = 0x010000ad,
14289 Key_LaunchC = 0x010000ae,
14290 Key_LaunchD = 0x010000af,
14291 Key_LaunchE = 0x010000b0,
14292 Key_LaunchF = 0x010000b1,
14293 Key_MediaLast = 0x0100ffff,
14294 Key_Select = 0x01010000,
14295 Key_Yes = 0x01010001,
14296 Key_No = 0x01010002,
14297 Key_Cancel = 0x01020001,
14298 Key_Printer = 0x01020002,
14299 Key_Execute = 0x01020003,
14300 Key_Sleep = 0x01020004,
14301 Key_Play = 0x01020005,
14302 Key_Zoom = 0x01020006,
14303 Key_Context1 = 0x01100000,
14304 Key_Context2 = 0x01100001,
14305 Key_Context3 = 0x01100002,
14306 Key_Context4 = 0x01100003,
14307 Key_Call = 0x01100004,
14308 Key_Hangup = 0x01100005,
14309 Key_Flip = 0x01100006,
14310 Key_unknown = 0x01ffffff
14333 MPenCapStyle = 0x30
14335 enum PenJoinStyle {
14339 SvgMiterJoin = 0x100,
14340 MPenJoinStyle = 0x1c0
14358 LinearGradientPattern,
14359 RadialGradientPattern,
14360 ConicalGradientPattern,
14361 TexturePattern = 24
14390 PointingHandCursor,
14396 LastCursor = ClosedHandCursor,
14406 enum AspectRatioMode {
14409 KeepAspectRatioByExpanding
14411 enum AnchorAttribute {
14415 enum DockWidgetArea {
14416 LeftDockWidgetArea = 0x1,
14417 RightDockWidgetArea = 0x2,
14418 TopDockWidgetArea = 0x4,
14419 BottomDockWidgetArea = 0x8,
14420 DockWidgetArea_Mask = 0xf,
14421 AllDockWidgetAreas = DockWidgetArea_Mask,
14422 NoDockWidgetArea = 0
14424 enum DockWidgetAreaSizes {
14425 NDockWidgetAreas = 4
14427 typedef QFlags<DockWidgetArea> DockWidgetAreas;
14429 LeftToolBarArea = 0x1,
14430 RightToolBarArea = 0x2,
14431 TopToolBarArea = 0x4,
14432 BottomToolBarArea = 0x8,
14433 ToolBarArea_Mask = 0xf,
14434 AllToolBarAreas = ToolBarArea_Mask,
14437 enum ToolBarAreaSizes {
14440 typedef QFlags<ToolBarArea> ToolBarAreas;
14445 LocalDate = SystemLocaleDate,
14447 SystemLocaleShortDate,
14448 SystemLocaleLongDate,
14449 DefaultLocaleShortDate,
14450 DefaultLocaleLongDate
14466 enum ScrollBarPolicy {
14468 ScrollBarAlwaysOff,
14471 enum CaseSensitivity {
14476 TopLeftCorner = 0x00000,
14477 TopRightCorner = 0x00001,
14478 BottomLeftCorner = 0x00002,
14479 BottomRightCorner = 0x00003
14481 enum ConnectionType {
14485 AutoCompatConnection,
14486 BlockingQueuedConnection
14488 enum ShortcutContext {
14491 ApplicationShortcut,
14492 WidgetWithChildrenShortcut
14502 enum ClipOperation {
14508 enum ItemSelectionMode {
14509 ContainsItemShape = 0x0,
14510 IntersectsItemShape = 0x1,
14511 ContainsItemBoundingRect = 0x2,
14512 IntersectsItemBoundingRect = 0x3
14514 enum TransformationMode {
14515 FastTransformation,
14516 SmoothTransformation
14526 BacktabFocusReason,
14527 ActiveWindowFocusReason,
14529 ShortcutFocusReason,
14530 MenuBarFocusReason,
14534 enum ContextMenuPolicy {
14536 DefaultContextMenu,
14537 ActionsContextMenu,
14541 enum InputMethodQuery {
14548 enum ToolButtonStyle {
14549 ToolButtonIconOnly,
14550 ToolButtonTextOnly,
14551 ToolButtonTextBesideIcon,
14552 ToolButtonTextUnderIcon
14554 enum LayoutDirection {
14563 TargetMoveAction = 0x8002,
14566 typedef QFlags<DropAction> DropActions;
14572 enum ItemDataRole {
14574 DecorationRole = 1,
14580 TextAlignmentRole = 7,
14581 BackgroundColorRole = 8,
14582 BackgroundRole = 8,
14584 ForegroundRole = 9,
14585 CheckStateRole = 10,
14586 AccessibleTextRole = 11,
14587 AccessibleDescriptionRole = 12,
14589 DisplayPropertyRole = 27,
14590 DecorationPropertyRole = 28,
14591 ToolTipPropertyRole = 29,
14592 StatusTipPropertyRole = 30,
14593 WhatsThisPropertyRole = 31,
14598 ItemIsSelectable = 1,
14599 ItemIsEditable = 2,
14600 ItemIsDragEnabled = 4,
14601 ItemIsDropEnabled = 8,
14602 ItemIsUserCheckable = 16,
14603 ItemIsEnabled = 32,
14604 ItemIsTristate = 64
14606 typedef QFlags<ItemFlag> ItemFlags;
14610 MatchStartsWith = 2,
14614 MatchFixedString = 8,
14615 MatchCaseSensitive = 16,
14617 MatchRecursive = 64
14619 typedef QFlags<MatchFlag> MatchFlags;
14620 typedef void * HANDLE;
14621 typedef WindowFlags WFlags;
14622 enum WindowModality {
14627 enum TextInteractionFlag {
14628 NoTextInteraction = 0,
14629 TextSelectableByMouse = 1,
14630 TextSelectableByKeyboard = 2,
14631 LinksAccessibleByMouse = 4,
14632 LinksAccessibleByKeyboard = 8,
14634 TextEditorInteraction = TextSelectableByMouse | TextSelectableByKeyboard | TextEditable,
14635 TextBrowserInteraction = TextSelectableByMouse | LinksAccessibleByMouse | LinksAccessibleByKeyboard
14637 typedef QFlags<TextInteractionFlag> TextInteractionFlags;
14638 enum EventPriority {
14639 HighEventPriority = 1,
14640 NormalEventPriority = 0,
14641 LowEventPriority = -1
14650 enum WindowFrameSection {
14657 BottomRightSection,
14663 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); }
14664 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); }
14665 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); }
14666 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); }
14667 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); }
14668 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); }
14669 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); }
14670 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); }
14671 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); }
14672 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); }
14673 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); }
14674 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); }
14675 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); }
14676 typedef bool (*qInternalCallback)(void **);
14677 class __attribute__((visibility("default"))) QInternal {
14679 enum PaintDeviceFlags {
14680 UnknownDevice = 0x00,
14687 FramebufferObject = 0x07,
14688 CustomRaster = 0x08,
14691 enum RelayoutType {
14698 DisconnectCallback,
14699 AdoptCurrentThread,
14700 EventNotifyCallback,
14703 enum InternalFunction {
14704 CreateThreadForAdoption,
14706 DerefAdoptedThread,
14707 SetCurrentThreadToMainThread,
14710 ResetQObjectSender,
14711 LastInternalFunction
14713 enum DockPosition {
14720 static bool registerCallback(Callback, qInternalCallback);
14721 static bool unregisterCallback(Callback, qInternalCallback);
14722 static bool activateCallbacks(Callback, void **);
14723 static bool callFunction(InternalFunction func, void **);
14725 typedef QtValidLicenseForCoreModule QtCoreModule;
14728 template <typename T>
14729 inline int qYouForgotTheQ_OBJECT_Macro(T, T) { return 0; }
14730 template <typename T1, typename T2>
14731 inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {}
14732 __attribute__((visibility("default"))) const char *qFlagLocation(const char *method);
14736 class QMetaProperty;
14737 class QMetaClassInfo;
14738 class __attribute__((visibility("default"))) QGenericArgument
14741 inline QGenericArgument(const char *aName = 0, const void *aData = 0)
14742 : _data(aData), _name(aName) {}
14743 inline void *data() const { return const_cast<void *>(_data); }
14744 inline const char *name() const { return _name; }
14749 class __attribute__((visibility("default"))) QGenericReturnArgument: public QGenericArgument
14752 inline QGenericReturnArgument(const char *aName = 0, void *aData = 0)
14753 : QGenericArgument(aName, aData)
14757 class QArgument: public QGenericArgument
14760 inline QArgument(const char *aName, const T &aData)
14761 : QGenericArgument(aName, static_cast<const void *>(&aData))
14764 template <typename T>
14765 class QReturnArgument: public QGenericReturnArgument
14768 inline QReturnArgument(const char *aName, T &aData)
14769 : QGenericReturnArgument(aName, static_cast<void *>(&aData))
14772 struct __attribute__((visibility("default"))) QMetaObject
14774 const char *className() const;
14775 const QMetaObject *superClass() const;
14776 QObject *cast(QObject *obj) const;
14777 QString tr(const char *s, const char *c) const;
14778 QString trUtf8(const char *s, const char *c) const;
14779 QString tr(const char *s, const char *c, int n) const;
14780 QString trUtf8(const char *s, const char *c, int n) const;
14781 int methodOffset() const;
14782 int enumeratorOffset() const;
14783 int propertyOffset() const;
14784 int classInfoOffset() const;
14785 int constructorCount() const;
14786 int methodCount() const;
14787 int enumeratorCount() const;
14788 int propertyCount() const;
14789 int classInfoCount() const;
14790 int indexOfConstructor(const char *constructor) const;
14791 int indexOfMethod(const char *method) const;
14792 int indexOfSignal(const char *signal) const;
14793 int indexOfSlot(const char *slot) const;
14794 int indexOfEnumerator(const char *name) const;
14795 int indexOfProperty(const char *name) const;
14796 int indexOfClassInfo(const char *name) const;
14797 QMetaMethod constructor(int index) const;
14798 QMetaMethod method(int index) const;
14799 QMetaEnum enumerator(int index) const;
14800 QMetaProperty property(int index) const;
14801 QMetaClassInfo classInfo(int index) const;
14802 QMetaProperty userProperty() const;
14803 static bool checkConnectArgs(const char *signal, const char *method);
14804 static QByteArray normalizedSignature(const char *method);
14805 static QByteArray normalizedType(const char *type);
14806 static bool connect(const QObject *sender, int signal_index,
14807 const QObject *receiver, int method_index,
14808 int type = 0, int *types = 0);
14809 static bool disconnect(const QObject *sender, int signal_index,
14810 const QObject *receiver, int method_index);
14811 static void connectSlotsByName(QObject *o);
14812 static void activate(QObject *sender, int signal_index, void **argv);
14813 static void activate(QObject *sender, int from_signal_index, int to_signal_index, void **argv);
14814 static void activate(QObject *sender, const QMetaObject *, int local_signal_index, void **argv);
14815 static void activate(QObject *sender, const QMetaObject *, int from_local_signal_index, int to_local_signal_index, void **argv);
14816 static void addGuard(QObject **ptr);
14817 static void removeGuard(QObject **ptr);
14818 static void changeGuard(QObject **ptr, QObject *o);
14819 static bool invokeMethod(QObject *obj, const char *member,
14820 Qt::ConnectionType,
14821 QGenericReturnArgument ret,
14822 QGenericArgument val0 = QGenericArgument(0),
14823 QGenericArgument val1 = QGenericArgument(),
14824 QGenericArgument val2 = QGenericArgument(),
14825 QGenericArgument val3 = QGenericArgument(),
14826 QGenericArgument val4 = QGenericArgument(),
14827 QGenericArgument val5 = QGenericArgument(),
14828 QGenericArgument val6 = QGenericArgument(),
14829 QGenericArgument val7 = QGenericArgument(),
14830 QGenericArgument val8 = QGenericArgument(),
14831 QGenericArgument val9 = QGenericArgument());
14832 static inline bool invokeMethod(QObject *obj, const char *member,
14833 QGenericReturnArgument ret,
14834 QGenericArgument val0 = QGenericArgument(0),
14835 QGenericArgument val1 = QGenericArgument(),
14836 QGenericArgument val2 = QGenericArgument(),
14837 QGenericArgument val3 = QGenericArgument(),
14838 QGenericArgument val4 = QGenericArgument(),
14839 QGenericArgument val5 = QGenericArgument(),
14840 QGenericArgument val6 = QGenericArgument(),
14841 QGenericArgument val7 = QGenericArgument(),
14842 QGenericArgument val8 = QGenericArgument(),
14843 QGenericArgument val9 = QGenericArgument())
14845 return invokeMethod(obj, member, Qt::AutoConnection, ret, val0, val1, val2, val3,
14846 val4, val5, val6, val7, val8, val9);
14848 static inline bool invokeMethod(QObject *obj, const char *member,
14849 Qt::ConnectionType type,
14850 QGenericArgument val0 = QGenericArgument(0),
14851 QGenericArgument val1 = QGenericArgument(),
14852 QGenericArgument val2 = QGenericArgument(),
14853 QGenericArgument val3 = QGenericArgument(),
14854 QGenericArgument val4 = QGenericArgument(),
14855 QGenericArgument val5 = QGenericArgument(),
14856 QGenericArgument val6 = QGenericArgument(),
14857 QGenericArgument val7 = QGenericArgument(),
14858 QGenericArgument val8 = QGenericArgument(),
14859 QGenericArgument val9 = QGenericArgument())
14861 return invokeMethod(obj, member, type, QGenericReturnArgument(), val0, val1, val2,
14862 val3, val4, val5, val6, val7, val8, val9);
14864 static inline bool invokeMethod(QObject *obj, const char *member,
14865 QGenericArgument val0 = QGenericArgument(0),
14866 QGenericArgument val1 = QGenericArgument(),
14867 QGenericArgument val2 = QGenericArgument(),
14868 QGenericArgument val3 = QGenericArgument(),
14869 QGenericArgument val4 = QGenericArgument(),
14870 QGenericArgument val5 = QGenericArgument(),
14871 QGenericArgument val6 = QGenericArgument(),
14872 QGenericArgument val7 = QGenericArgument(),
14873 QGenericArgument val8 = QGenericArgument(),
14874 QGenericArgument val9 = QGenericArgument())
14876 return invokeMethod(obj, member, Qt::AutoConnection, QGenericReturnArgument(), val0,
14877 val1, val2, val3, val4, val5, val6, val7, val8, val9);
14879 QObject *newInstance(QGenericArgument val0 = QGenericArgument(0),
14880 QGenericArgument val1 = QGenericArgument(),
14881 QGenericArgument val2 = QGenericArgument(),
14882 QGenericArgument val3 = QGenericArgument(),
14883 QGenericArgument val4 = QGenericArgument(),
14884 QGenericArgument val5 = QGenericArgument(),
14885 QGenericArgument val6 = QGenericArgument(),
14886 QGenericArgument val7 = QGenericArgument(),
14887 QGenericArgument val8 = QGenericArgument(),
14888 QGenericArgument val9 = QGenericArgument()) const;
14894 QueryPropertyDesignable,
14895 QueryPropertyScriptable,
14896 QueryPropertyStored,
14897 QueryPropertyEditable,
14901 int static_metacall(Call, int, void **) const;
14903 const QMetaObject *superdata;
14904 const char *stringdata;
14906 const void *extradata;
14909 struct QMetaObjectExtraData
14911 const QMetaObject **objects;
14912 int (*static_metacall)(QMetaObject::Call, int, void **);
14914 inline const char *QMetaObject::className() const
14915 { return d.stringdata; }
14916 inline const QMetaObject *QMetaObject::superClass() const
14917 { return d.superdata; }
14919 extern void *memcpy (void *__restrict __dest,
14920 __const void *__restrict __src, size_t __n)
14921 throw () __attribute__ ((__nonnull__ (1, 2)));
14922 extern void *memmove (void *__dest, __const void *__src, size_t __n)
14923 throw () __attribute__ ((__nonnull__ (1, 2)));
14924 extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
14925 int __c, size_t __n)
14926 throw () __attribute__ ((__nonnull__ (1, 2)));
14927 extern void *memset (void *__s, int __c, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
14928 extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
14929 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
14930 extern void *memchr (__const void *__s, int __c, size_t __n)
14931 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
14932 extern void *rawmemchr (__const void *__s, int __c)
14933 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
14934 extern void *memrchr (__const void *__s, int __c, size_t __n)
14935 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
14936 extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
14937 throw () __attribute__ ((__nonnull__ (1, 2)));
14938 extern char *strncpy (char *__restrict __dest,
14939 __const char *__restrict __src, size_t __n)
14940 throw () __attribute__ ((__nonnull__ (1, 2)));
14941 extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
14942 throw () __attribute__ ((__nonnull__ (1, 2)));
14943 extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
14944 size_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
14945 extern int strcmp (__const char *__s1, __const char *__s2)
14946 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
14947 extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
14948 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
14949 extern int strcoll (__const char *__s1, __const char *__s2)
14950 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
14951 extern size_t strxfrm (char *__restrict __dest,
14952 __const char *__restrict __src, size_t __n)
14953 throw () __attribute__ ((__nonnull__ (2)));
14954 extern char *strdup (__const char *__s)
14955 throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
14956 extern char *strndup (__const char *__string, size_t __n)
14957 throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
14958 extern char *strchr (__const char *__s, int __c)
14959 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
14960 extern char *strrchr (__const char *__s, int __c)
14961 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
14962 extern char *strchrnul (__const char *__s, int __c)
14963 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
14964 extern size_t strcspn (__const char *__s, __const char *__reject)
14965 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
14966 extern size_t strspn (__const char *__s, __const char *__accept)
14967 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
14968 extern char *strpbrk (__const char *__s, __const char *__accept)
14969 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
14970 extern char *strstr (__const char *__haystack, __const char *__needle)
14971 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
14972 extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
14973 throw () __attribute__ ((__nonnull__ (2)));
14974 extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
14975 char **__restrict __save_ptr)
14976 throw () __attribute__ ((__nonnull__ (2, 3)));
14977 extern char *strcasestr (__const char *__haystack, __const char *__needle)
14978 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
14979 extern void *memmem (__const void *__haystack, size_t __haystacklen,
14980 __const void *__needle, size_t __needlelen)
14981 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)));
14982 extern void *mempcpy (void *__restrict __dest,
14983 __const void *__restrict __src, size_t __n)
14984 throw () __attribute__ ((__nonnull__ (1, 2)));
14985 extern size_t strlen (__const char *__s)
14986 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
14987 extern size_t strnlen (__const char *__string, size_t __maxlen)
14988 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
14989 extern char *strerror (int __errnum) throw ();
14990 extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen)
14991 throw () __attribute__ ((__nonnull__ (2)));
14992 extern char * strerror_r (int __errnum, char *__buf, size_t __buflen) throw () __asm__ ("_" "__glibc_strerror_r") __attribute__ ((__nonnull__ (2)));
14993 extern void bcopy (__const void *__src, void *__dest, size_t __n)
14994 throw () __attribute__ ((__nonnull__ (1, 2)));
14995 extern void bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
14996 extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
14997 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
14998 extern char *index (__const char *__s, int __c)
14999 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
15000 extern char *rindex (__const char *__s, int __c)
15001 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
15002 extern int ffs (int __i) throw () __attribute__ ((__const__));
15003 extern int strcasecmp (__const char *__s1, __const char *__s2)
15004 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
15005 extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
15006 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
15007 extern char *strsep (char **__restrict __stringp,
15008 __const char *__restrict __delim)
15009 throw () __attribute__ ((__nonnull__ (1, 2)));
15010 extern char *strsignal (int __sig) throw ();
15011 extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
15012 throw () __attribute__ ((__nonnull__ (1, 2)));
15013 extern char *stpncpy (char *__restrict __dest,
15014 __const char *__restrict __src, size_t __n)
15015 throw () __attribute__ ((__nonnull__ (1, 2)));
15016 extern char *basename (__const char *__filename) throw () __attribute__ ((__nonnull__ (1)));
15017 extern size_t strlcat(char *__restrict dst, const char *__restrict src,
15018 size_t n) throw () __attribute__ ((__nonnull__ (1, 2)));
15019 extern size_t strlcpy(char *__restrict dst, const char *__restrict src,
15020 size_t n) throw () __attribute__ ((__nonnull__ (1, 2)));
15022 typedef __gnuc_va_list va_list;
15023 typedef QtValidLicenseForCoreModule QtCoreModule;
15024 __attribute__((visibility("default"))) char *qstrdup(const char *);
15025 inline uint qstrlen(const char *str)
15026 { return str ? uint(strlen(str)) : 0; }
15027 inline uint qstrnlen(const char *str, uint maxlen)
15031 while (length < maxlen && *str++)
15036 __attribute__((visibility("default"))) char *qstrcpy(char *dst, const char *src);
15037 __attribute__((visibility("default"))) char *qstrncpy(char *dst, const char *src, uint len);
15038 __attribute__((visibility("default"))) int qstrcmp(const char *str1, const char *str2);
15039 __attribute__((visibility("default"))) int qstrcmp(const QByteArray &str1, const QByteArray &str2);
15040 __attribute__((visibility("default"))) int qstrcmp(const QByteArray &str1, const char *str2);
15041 static inline int qstrcmp(const char *str1, const QByteArray &str2)
15042 { return -qstrcmp(str2, str1); }
15043 inline int qstrncmp(const char *str1, const char *str2, uint len)
15045 return (str1 && str2) ? strncmp(str1, str2, len)
15046 : (str1 ? 1 : (str2 ? -1 : 0));
15048 __attribute__((visibility("default"))) int qstricmp(const char *, const char *);
15049 __attribute__((visibility("default"))) int qstrnicmp(const char *, const char *, uint len);
15050 __attribute__((visibility("default"))) int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap);
15051 __attribute__((visibility("default"))) int qsnprintf(char *str, size_t n, const char *fmt, ...);
15052 __attribute__((visibility("default"))) quint16 qChecksum(const char *s, uint len);
15056 template <typename T> class QList;
15057 class __attribute__((visibility("default"))) QByteArray
15060 inline QByteArray();
15061 QByteArray(const char *);
15062 QByteArray(const char *, int size);
15063 QByteArray(int size, char c);
15064 inline QByteArray(const QByteArray &);
15065 inline ~QByteArray();
15066 QByteArray &operator=(const QByteArray &);
15067 QByteArray &operator=(const char *str);
15068 inline int size() const;
15069 bool isEmpty() const;
15070 void resize(int size);
15071 QByteArray &fill(char c, int size = -1);
15072 int capacity() const;
15073 void reserve(int size);
15075 operator const char *() const;
15076 operator const void *() const;
15078 const char *data() const;
15079 inline const char *constData() const;
15080 inline void detach();
15081 bool isDetached() const;
15083 char at(int i) const;
15084 char operator[](int i) const;
15085 char operator[](uint i) const;
15086 QByteRef operator[](int i);
15087 QByteRef operator[](uint i);
15088 int indexOf(char c, int from = 0) const;
15089 int indexOf(const char *c, int from = 0) const;
15090 int indexOf(const QByteArray &a, int from = 0) const;
15091 int lastIndexOf(char c, int from = -1) const;
15092 int lastIndexOf(const char *c, int from = -1) const;
15093 int lastIndexOf(const QByteArray &a, int from = -1) const;
15094 QBool contains(char c) const;
15095 QBool contains(const char *a) const;
15096 QBool contains(const QByteArray &a) const;
15097 int count(char c) const;
15098 int count(const char *a) const;
15099 int count(const QByteArray &a) const;
15100 QByteArray left(int len) const;
15101 QByteArray right(int len) const;
15102 QByteArray mid(int index, int len = -1) const;
15103 bool startsWith(const QByteArray &a) const;
15104 bool startsWith(char c) const;
15105 bool startsWith(const char *c) const;
15106 bool endsWith(const QByteArray &a) const;
15107 bool endsWith(char c) const;
15108 bool endsWith(const char *c) const;
15109 void truncate(int pos);
15111 QByteArray toLower() const;
15112 QByteArray toUpper() const;
15113 QByteArray trimmed() const;
15114 QByteArray simplified() const;
15115 QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const;
15116 QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const;
15117 QByteArray &prepend(char c);
15118 QByteArray &prepend(const char *s);
15119 QByteArray &prepend(const QByteArray &a);
15120 QByteArray &append(char c);
15121 QByteArray &append(const char *s);
15122 QByteArray &append(const char *s, int len);
15123 QByteArray &append(const QByteArray &a);
15124 QByteArray &insert(int i, char c);
15125 QByteArray &insert(int i, const char *s);
15126 QByteArray &insert(int i, const QByteArray &a);
15127 QByteArray &remove(int index, int len);
15128 QByteArray &replace(int index, int len, const char *s);
15129 QByteArray &replace(int index, int len, const QByteArray &s);
15130 QByteArray &replace(char before, const char *after);
15131 QByteArray &replace(char before, const QByteArray &after);
15132 QByteArray &replace(const char *before, const char *after);
15133 QByteArray &replace(const char *before, int bsize, const char *after, int asize);
15134 QByteArray &replace(const QByteArray &before, const QByteArray &after);
15135 QByteArray &replace(const QByteArray &before, const char *after);
15136 QByteArray &replace(const char *before, const QByteArray &after);
15137 QByteArray &replace(char before, char after);
15138 QByteArray &operator+=(char c);
15139 QByteArray &operator+=(const char *s);
15140 QByteArray &operator+=(const QByteArray &a);
15141 QList<QByteArray> split(char sep) const;
15142 QByteArray repeated(int times) const;
15143 inline __attribute__ ((__deprecated__)) bool operator==(const QString &s2) const;
15144 inline __attribute__ ((__deprecated__)) bool operator!=(const QString &s2) const;
15145 inline __attribute__ ((__deprecated__)) bool operator<(const QString &s2) const;
15146 inline __attribute__ ((__deprecated__)) bool operator>(const QString &s2) const;
15147 inline __attribute__ ((__deprecated__)) bool operator<=(const QString &s2) const;
15148 inline __attribute__ ((__deprecated__)) bool operator>=(const QString &s2) const;
15149 short toShort(bool *ok = 0, int base = 10) const;
15150 ushort toUShort(bool *ok = 0, int base = 10) const;
15151 int toInt(bool *ok = 0, int base = 10) const;
15152 uint toUInt(bool *ok = 0, int base = 10) const;
15153 long toLong(bool *ok = 0, int base = 10) const;
15154 ulong toULong(bool *ok = 0, int base = 10) const;
15155 qlonglong toLongLong(bool *ok = 0, int base = 10) const;
15156 qulonglong toULongLong(bool *ok = 0, int base = 10) const;
15157 float toFloat(bool *ok = 0) const;
15158 double toDouble(bool *ok = 0) const;
15159 QByteArray toBase64() const;
15160 QByteArray toHex() const;
15161 QByteArray toPercentEncoding(const QByteArray &exclude = QByteArray(),
15162 const QByteArray &include = QByteArray(),
15163 char percent = '%') const;
15164 QByteArray &setNum(short, int base = 10);
15165 QByteArray &setNum(ushort, int base = 10);
15166 QByteArray &setNum(int, int base = 10);
15167 QByteArray &setNum(uint, int base = 10);
15168 QByteArray &setNum(qlonglong, int base = 10);
15169 QByteArray &setNum(qulonglong, int base = 10);
15170 QByteArray &setNum(float, char f = 'g', int prec = 6);
15171 QByteArray &setNum(double, char f = 'g', int prec = 6);
15172 static QByteArray number(int, int base = 10);
15173 static QByteArray number(uint, int base = 10);
15174 static QByteArray number(qlonglong, int base = 10);
15175 static QByteArray number(qulonglong, int base = 10);
15176 static QByteArray number(double, char f = 'g', int prec = 6);
15177 static QByteArray fromRawData(const char *, int size);
15178 static QByteArray fromBase64(const QByteArray &base64);
15179 static QByteArray fromHex(const QByteArray &hexEncoded);
15180 static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%');
15181 typedef char *iterator;
15182 typedef const char *const_iterator;
15183 typedef iterator Iterator;
15184 typedef const_iterator ConstIterator;
15186 const_iterator begin() const;
15187 const_iterator constBegin() const;
15189 const_iterator end() const;
15190 const_iterator constEnd() const;
15191 typedef const char & const_reference;
15192 typedef char & reference;
15193 void push_back(char c);
15194 void push_back(const char *c);
15195 void push_back(const QByteArray &a);
15196 void push_front(char c);
15197 void push_front(const char *c);
15198 void push_front(const QByteArray &a);
15199 inline int count() const { return d->size; }
15200 int length() const { return d->size; }
15201 bool isNull() const;
15203 operator QNoImplicitBoolCast() const;
15205 QBasicAtomicInt ref;
15210 static Data shared_null;
15211 static Data shared_empty;
15213 QByteArray(Data *dd, int , int ) : d(dd) {}
15214 void realloc(int alloc);
15215 void expand(int i);
15216 QByteArray nulTerminated() const;
15217 friend class QByteRef;
15218 friend class QString;
15220 typedef Data * DataPtr;
15221 inline DataPtr &data_ptr() { return d; }
15223 inline QByteArray::QByteArray(): d(&shared_null) { d->ref.ref(); }
15224 inline QByteArray::~QByteArray() { if (!d->ref.deref()) qFree(d); }
15225 inline int QByteArray::size() const
15226 { return d->size; }
15227 inline char QByteArray::at(int i) const
15228 { qt_noop(); return d->data[i]; }
15229 inline char QByteArray::operator[](int i) const
15230 { qt_noop(); return d->data[i]; }
15231 inline char QByteArray::operator[](uint i) const
15232 { qt_noop(); return d->data[i]; }
15233 inline bool QByteArray::isEmpty() const
15234 { return d->size == 0; }
15235 inline QByteArray::operator const char *() const
15236 { return d->data; }
15237 inline QByteArray::operator const void *() const
15238 { return d->data; }
15239 inline char *QByteArray::data()
15240 { detach(); return d->data; }
15241 inline const char *QByteArray::data() const
15242 { return d->data; }
15243 inline const char *QByteArray::constData() const
15244 { return d->data; }
15245 inline void QByteArray::detach()
15246 { if (d->ref != 1 || d->data != d->array) realloc(d->size); }
15247 inline bool QByteArray::isDetached() const
15248 { return d->ref == 1; }
15249 inline QByteArray::QByteArray(const QByteArray &a) : d(a.d)
15251 inline int QByteArray::capacity() const
15252 { return d->alloc; }
15253 inline void QByteArray::reserve(int asize)
15254 { if (d->ref != 1 || asize > d->alloc) realloc(asize); }
15255 inline void QByteArray::squeeze()
15256 { if (d->size < d->alloc) realloc(d->size); }
15257 class __attribute__((visibility("default"))) QByteRef {
15260 inline QByteRef(QByteArray &array, int idx)
15261 : a(array),i(idx) {}
15262 friend class QByteArray;
15264 inline operator char() const
15265 { return i < a.d->size ? a.d->data[i] : 0; }
15266 inline QByteRef &operator=(char c)
15267 { if (i >= a.d->size) a.expand(i); else a.detach();
15268 a.d->data[i] = c; return *this; }
15269 inline QByteRef &operator=(const QByteRef &c)
15270 { if (i >= a.d->size) a.expand(i); else a.detach();
15271 a.d->data[i] = c.a.d->data[c.i]; return *this; }
15272 inline bool operator==(char c) const
15273 { return a.d->data[i] == c; }
15274 inline bool operator!=(char c) const
15275 { return a.d->data[i] != c; }
15276 inline bool operator>(char c) const
15277 { return a.d->data[i] > c; }
15278 inline bool operator>=(char c) const
15279 { return a.d->data[i] >= c; }
15280 inline bool operator<(char c) const
15281 { return a.d->data[i] < c; }
15282 inline bool operator<=(char c) const
15283 { return a.d->data[i] <= c; }
15285 inline QByteRef QByteArray::operator[](int i)
15286 { qt_noop(); return QByteRef(*this, i); }
15287 inline QByteRef QByteArray::operator[](uint i)
15288 { return QByteRef(*this, i); }
15289 inline QByteArray::iterator QByteArray::begin()
15290 { detach(); return d->data; }
15291 inline QByteArray::const_iterator QByteArray::begin() const
15292 { return d->data; }
15293 inline QByteArray::const_iterator QByteArray::constBegin() const
15294 { return d->data; }
15295 inline QByteArray::iterator QByteArray::end()
15296 { detach(); return d->data + d->size; }
15297 inline QByteArray::const_iterator QByteArray::end() const
15298 { return d->data + d->size; }
15299 inline QByteArray::const_iterator QByteArray::constEnd() const
15300 { return d->data + d->size; }
15301 inline QByteArray &QByteArray::operator+=(char c)
15302 { return append(c); }
15303 inline QByteArray &QByteArray::operator+=(const char *s)
15304 { return append(s); }
15305 inline QByteArray &QByteArray::operator+=(const QByteArray &a)
15306 { return append(a); }
15307 inline void QByteArray::push_back(char c)
15309 inline void QByteArray::push_back(const char *c)
15311 inline void QByteArray::push_back(const QByteArray &a)
15313 inline void QByteArray::push_front(char c)
15315 inline void QByteArray::push_front(const char *c)
15317 inline void QByteArray::push_front(const QByteArray &a)
15319 inline QBool QByteArray::contains(const QByteArray &a) const
15320 { return QBool(indexOf(a) != -1); }
15321 inline QBool QByteArray::contains(char c) const
15322 { return QBool(indexOf(c) != -1); }
15323 inline bool operator==(const QByteArray &a1, const QByteArray &a2)
15324 { return (a1.size() == a2.size()) && (memcmp(a1.constData(), a2.constData(), a1.size())==0); }
15325 inline bool operator==(const QByteArray &a1, const char *a2)
15326 { return a2 ? qstrcmp(a1,a2) == 0 : a1.isEmpty(); }
15327 inline bool operator==(const char *a1, const QByteArray &a2)
15328 { return a1 ? qstrcmp(a1,a2) == 0 : a2.isEmpty(); }
15329 inline bool operator!=(const QByteArray &a1, const QByteArray &a2)
15330 { return !(a1==a2); }
15331 inline bool operator!=(const QByteArray &a1, const char *a2)
15332 { return a2 ? qstrcmp(a1,a2) != 0 : !a1.isEmpty(); }
15333 inline bool operator!=(const char *a1, const QByteArray &a2)
15334 { return a1 ? qstrcmp(a1,a2) != 0 : !a2.isEmpty(); }
15335 inline bool operator<(const QByteArray &a1, const QByteArray &a2)
15336 { return qstrcmp(a1, a2) < 0; }
15337 inline bool operator<(const QByteArray &a1, const char *a2)
15338 { return qstrcmp(a1, a2) < 0; }
15339 inline bool operator<(const char *a1, const QByteArray &a2)
15340 { return qstrcmp(a1, a2) < 0; }
15341 inline bool operator<=(const QByteArray &a1, const QByteArray &a2)
15342 { return qstrcmp(a1, a2) <= 0; }
15343 inline bool operator<=(const QByteArray &a1, const char *a2)
15344 { return qstrcmp(a1, a2) <= 0; }
15345 inline bool operator<=(const char *a1, const QByteArray &a2)
15346 { return qstrcmp(a1, a2) <= 0; }
15347 inline bool operator>(const QByteArray &a1, const QByteArray &a2)
15348 { return qstrcmp(a1, a2) > 0; }
15349 inline bool operator>(const QByteArray &a1, const char *a2)
15350 { return qstrcmp(a1, a2) > 0; }
15351 inline bool operator>(const char *a1, const QByteArray &a2)
15352 { return qstrcmp(a1, a2) > 0; }
15353 inline bool operator>=(const QByteArray &a1, const QByteArray &a2)
15354 { return qstrcmp(a1, a2) >= 0; }
15355 inline bool operator>=(const QByteArray &a1, const char *a2)
15356 { return qstrcmp(a1, a2) >= 0; }
15357 inline bool operator>=(const char *a1, const QByteArray &a2)
15358 { return qstrcmp(a1, a2) >= 0; }
15359 inline const QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
15360 { return QByteArray(a1) += a2; }
15361 inline const QByteArray operator+(const QByteArray &a1, const char *a2)
15362 { return QByteArray(a1) += a2; }
15363 inline const QByteArray operator+(const QByteArray &a1, char a2)
15364 { return QByteArray(a1) += a2; }
15365 inline const QByteArray operator+(const char *a1, const QByteArray &a2)
15366 { return QByteArray(a1) += a2; }
15367 inline const QByteArray operator+(char a1, const QByteArray &a2)
15368 { return QByteArray(&a1, 1) += a2; }
15369 inline QBool QByteArray::contains(const char *c) const
15370 { return QBool(indexOf(c) != -1); }
15371 inline QByteArray &QByteArray::replace(char before, const char *c)
15372 { return replace(&before, 1, c, qstrlen(c)); }
15373 inline QByteArray &QByteArray::replace(const QByteArray &before, const char *c)
15374 { return replace(before.constData(), before.size(), c, qstrlen(c)); }
15375 inline QByteArray &QByteArray::replace(const char *before, const char *after)
15376 { return replace(before, qstrlen(before), after, qstrlen(after)); }
15377 inline QByteArray &QByteArray::setNum(short n, int base)
15378 { return setNum(qlonglong(n), base); }
15379 inline QByteArray &QByteArray::setNum(ushort n, int base)
15380 { return setNum(qulonglong(n), base); }
15381 inline QByteArray &QByteArray::setNum(int n, int base)
15382 { return setNum(qlonglong(n), base); }
15383 inline QByteArray &QByteArray::setNum(uint n, int base)
15384 { return setNum(qulonglong(n), base); }
15385 inline QByteArray &QByteArray::setNum(float n, char f, int prec)
15386 { return setNum(double(n),f,prec); }
15387 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QByteArray &);
15388 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QByteArray &);
15389 __attribute__((visibility("default"))) QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel = -1);
15390 __attribute__((visibility("default"))) QByteArray qUncompress(const uchar* data, int nbytes);
15391 inline QByteArray qCompress(const QByteArray& data, int compressionLevel = -1)
15392 { return qCompress(reinterpret_cast<const uchar *>(data.constData()), data.size(), compressionLevel); }
15393 inline QByteArray qUncompress(const QByteArray& data)
15394 { return qUncompress(reinterpret_cast<const uchar*>(data.constData()), data.size()); }
15395 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"; } };
15396 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; }
15397 typedef std::basic_string<wchar_t> QStdWString;
15398 typedef QtValidLicenseForCoreModule QtCoreModule;
15403 class QLatin1String;
15405 template <typename T> class QVector;
15406 class __attribute__((visibility("default"))) QString
15410 QString(const QChar *unicode, int size);
15412 QString(int size, QChar c);
15413 inline QString(const QLatin1String &latin1);
15414 inline QString(const QString &);
15416 QString &operator=(QChar c);
15417 QString &operator=(const QString &);
15418 inline QString &operator=(const QLatin1String &);
15419 inline int size() const { return d->size; }
15420 inline int count() const { return d->size; }
15421 inline int length() const;
15422 inline bool isEmpty() const;
15423 void resize(int size);
15424 QString &fill(QChar c, int size = -1);
15425 void truncate(int pos);
15427 int capacity() const;
15428 inline void reserve(int size);
15429 inline void squeeze() { if (d->size < d->alloc) realloc(); d->capacity = 0;}
15430 inline const QChar *unicode() const;
15431 inline QChar *data();
15432 inline const QChar *data() const;
15433 inline const QChar *constData() const;
15434 inline void detach();
15435 inline bool isDetached() const;
15437 inline const QChar at(int i) const;
15438 const QChar operator[](int i) const;
15439 QCharRef operator[](int i);
15440 const QChar operator[](uint i) const;
15441 QCharRef operator[](uint i);
15442 QString arg(qlonglong a, int fieldwidth=0, int base=10,
15443 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
15444 QString arg(qulonglong a, int fieldwidth=0, int base=10,
15445 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
15446 QString arg(long a, int fieldwidth=0, int base=10,
15447 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
15448 QString arg(ulong a, int fieldwidth=0, int base=10,
15449 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
15450 QString arg(int a, int fieldWidth = 0, int base = 10,
15451 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
15452 QString arg(uint a, int fieldWidth = 0, int base = 10,
15453 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
15454 QString arg(short a, int fieldWidth = 0, int base = 10,
15455 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
15456 QString arg(ushort a, int fieldWidth = 0, int base = 10,
15457 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
15458 QString arg(double a, int fieldWidth = 0, char fmt = 'g', int prec = -1,
15459 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
15460 QString arg(char a, int fieldWidth = 0,
15461 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
15462 QString arg(QChar a, int fieldWidth = 0,
15463 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
15464 QString arg(const QString &a, int fieldWidth = 0,
15465 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
15466 QString arg(const QString &a1, const QString &a2) const __attribute__ ((warn_unused_result));
15467 QString arg(const QString &a1, const QString &a2, const QString &a3) const __attribute__ ((warn_unused_result));
15468 QString arg(const QString &a1, const QString &a2, const QString &a3,
15469 const QString &a4) const __attribute__ ((warn_unused_result));
15470 QString arg(const QString &a1, const QString &a2, const QString &a3,
15471 const QString &a4, const QString &a5) const __attribute__ ((warn_unused_result));
15472 QString arg(const QString &a1, const QString &a2, const QString &a3,
15473 const QString &a4, const QString &a5, const QString &a6) const __attribute__ ((warn_unused_result));
15474 QString arg(const QString &a1, const QString &a2, const QString &a3,
15475 const QString &a4, const QString &a5, const QString &a6,
15476 const QString &a7) const __attribute__ ((warn_unused_result));
15477 QString arg(const QString &a1, const QString &a2, const QString &a3,
15478 const QString &a4, const QString &a5, const QString &a6,
15479 const QString &a7, const QString &a8) const __attribute__ ((warn_unused_result));
15480 QString arg(const QString &a1, const QString &a2, const QString &a3,
15481 const QString &a4, const QString &a5, const QString &a6,
15482 const QString &a7, const QString &a8, const QString &a9) const __attribute__ ((warn_unused_result));
15483 QString &vsprintf(const char *format, va_list ap)
15484 __attribute__ ((format (printf, 2, 0)))
15486 QString &sprintf(const char *format, ...)
15487 __attribute__ ((format (printf, 2, 3)))
15489 int indexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15490 int indexOf(const QString &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15491 int indexOf(const QLatin1String &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15492 int lastIndexOf(QChar c, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15493 int lastIndexOf(const QString &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15494 int lastIndexOf(const QLatin1String &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15495 inline QBool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15496 inline QBool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15497 int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15498 int count(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15499 int indexOf(const QRegExp &, int from = 0) const;
15500 int lastIndexOf(const QRegExp &, int from = -1) const;
15501 inline QBool contains(const QRegExp &rx) const { return QBool(indexOf(rx) != -1); }
15502 int count(const QRegExp &) const;
15503 int indexOf(QRegExp &, int from = 0) const;
15504 int lastIndexOf(QRegExp &, int from = -1) const;
15505 inline QBool contains(QRegExp &rx) const { return QBool(indexOf(rx) != -1); }
15507 SectionDefault = 0x00,
15508 SectionSkipEmpty = 0x01,
15509 SectionIncludeLeadingSep = 0x02,
15510 SectionIncludeTrailingSep = 0x04,
15511 SectionCaseInsensitiveSeps = 0x08
15513 typedef QFlags<SectionFlag> SectionFlags;
15514 QString section(QChar sep, int start, int end = -1, SectionFlags flags = SectionDefault) const;
15515 QString section(const QString &in_sep, int start, int end = -1, SectionFlags flags = SectionDefault) const;
15516 QString section(const QRegExp ®, int start, int end = -1, SectionFlags flags = SectionDefault) const;
15517 QString left(int n) const __attribute__ ((warn_unused_result));
15518 QString right(int n) const __attribute__ ((warn_unused_result));
15519 QString mid(int position, int n = -1) const __attribute__ ((warn_unused_result));
15520 QStringRef leftRef(int n) const __attribute__ ((warn_unused_result));
15521 QStringRef rightRef(int n) const __attribute__ ((warn_unused_result));
15522 QStringRef midRef(int position, int n = -1) const __attribute__ ((warn_unused_result));
15523 bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15524 bool startsWith(const QLatin1String &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15525 bool startsWith(const QChar &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15526 bool endsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15527 bool endsWith(const QLatin1String &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15528 bool endsWith(const QChar &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15529 QString leftJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const __attribute__ ((warn_unused_result));
15530 QString rightJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const __attribute__ ((warn_unused_result));
15531 QString toLower() const __attribute__ ((warn_unused_result));
15532 QString toUpper() const __attribute__ ((warn_unused_result));
15533 QString toCaseFolded() const __attribute__ ((warn_unused_result));
15534 QString trimmed() const __attribute__ ((warn_unused_result));
15535 QString simplified() const __attribute__ ((warn_unused_result));
15536 QString &insert(int i, QChar c);
15537 QString &insert(int i, const QChar *uc, int len);
15538 inline QString &insert(int i, const QString &s) { return insert(i, s.constData(), s.length()); }
15539 QString &insert(int i, const QLatin1String &s);
15540 QString &append(QChar c);
15541 QString &append(const QString &s);
15542 QString &append(const QStringRef &s);
15543 QString &append(const QLatin1String &s);
15544 inline QString &prepend(QChar c) { return insert(0, c); }
15545 inline QString &prepend(const QString &s) { return insert(0, s); }
15546 inline QString &prepend(const QLatin1String &s) { return insert(0, s); }
15547 inline QString &operator+=(QChar c) {
15548 if (d->ref != 1 || d->size + 1 > d->alloc)
15549 realloc(grow(d->size + 1));
15550 d->data[d->size++] = c.unicode();
15551 d->data[d->size] = '\0';
15554 inline QString &operator+=(QChar::SpecialCharacter c) { return append(QChar(c)); }
15555 inline QString &operator+=(const QString &s) { return append(s); }
15556 inline QString &operator+=(const QStringRef &s) { return append(s); }
15557 inline QString &operator+=(const QLatin1String &s) { return append(s); }
15558 QString &remove(int i, int len);
15559 QString &remove(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive);
15560 QString &remove(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive);
15561 QString &replace(int i, int len, QChar after);
15562 QString &replace(int i, int len, const QChar *s, int slen);
15563 QString &replace(int i, int len, const QString &after);
15564 QString &replace(QChar before, QChar after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
15565 QString &replace(const QChar *before, int blen, const QChar *after, int alen, Qt::CaseSensitivity cs = Qt::CaseSensitive);
15566 QString &replace(const QLatin1String &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
15567 QString &replace(const QLatin1String &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
15568 QString &replace(const QString &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
15569 QString &replace(const QString &before, const QString &after,
15570 Qt::CaseSensitivity cs = Qt::CaseSensitive);
15571 QString &replace(QChar c, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
15572 QString &replace(QChar c, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
15573 QString &replace(const QRegExp &rx, const QString &after);
15574 inline QString &remove(const QRegExp &rx)
15575 { return replace(rx, QString()); }
15576 enum SplitBehavior { KeepEmptyParts, SkipEmptyParts };
15577 QStringList split(const QString &sep, SplitBehavior behavior = KeepEmptyParts,
15578 Qt::CaseSensitivity cs = Qt::CaseSensitive) const __attribute__ ((warn_unused_result));
15579 QStringList split(const QChar &sep, SplitBehavior behavior = KeepEmptyParts,
15580 Qt::CaseSensitivity cs = Qt::CaseSensitive) const __attribute__ ((warn_unused_result));
15581 QStringList split(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const __attribute__ ((warn_unused_result));
15582 enum NormalizationForm {
15583 NormalizationForm_D,
15584 NormalizationForm_C,
15585 NormalizationForm_KD,
15586 NormalizationForm_KC
15588 QString normalized(NormalizationForm mode) const __attribute__ ((warn_unused_result));
15589 QString normalized(NormalizationForm mode, QChar::UnicodeVersion version) const __attribute__ ((warn_unused_result));
15590 QString repeated(int times) const;
15591 const ushort *utf16() const;
15592 QByteArray toAscii() const __attribute__ ((warn_unused_result));
15593 QByteArray toLatin1() const __attribute__ ((warn_unused_result));
15594 QByteArray toUtf8() const __attribute__ ((warn_unused_result));
15595 QByteArray toLocal8Bit() const __attribute__ ((warn_unused_result));
15596 QVector<uint> toUcs4() const __attribute__ ((warn_unused_result));
15597 static QString fromAscii(const char *, int size = -1);
15598 static QString fromLatin1(const char *, int size = -1);
15599 static QString fromUtf8(const char *, int size = -1);
15600 static QString fromLocal8Bit(const char *, int size = -1);
15601 static QString fromUtf16(const ushort *, int size = -1);
15602 static QString fromUcs4(const uint *, int size = -1);
15603 static QString fromRawData(const QChar *, int size);
15604 int toWCharArray(wchar_t *array) const;
15605 static QString fromWCharArray(const wchar_t *, int size = -1);
15606 QString &setUnicode(const QChar *unicode, int size);
15607 inline QString &setUtf16(const ushort *utf16, int size);
15608 int compare(const QString &s) const;
15609 int compare(const QString &s, Qt::CaseSensitivity cs) const;
15610 int compare(const QLatin1String &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15611 static inline int compare(const QString &s1, const QString &s2)
15612 { return s1.compare(s2); }
15613 static inline int compare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs)
15614 { return s1.compare(s2, cs); }
15615 static inline int compare(const QString& s1, const QLatin1String &s2,
15616 Qt::CaseSensitivity cs = Qt::CaseSensitive)
15617 { return s1.compare(s2, cs); }
15618 static inline int compare(const QLatin1String& s1, const QString &s2,
15619 Qt::CaseSensitivity cs = Qt::CaseSensitive)
15620 { return -s2.compare(s1, cs); }
15621 int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
15622 static int compare(const QString &s1, const QStringRef &s2,
15623 Qt::CaseSensitivity = Qt::CaseSensitive);
15624 int localeAwareCompare(const QString& s) const;
15625 static int localeAwareCompare(const QString& s1, const QString& s2)
15626 { return s1.localeAwareCompare(s2); }
15627 int localeAwareCompare(const QStringRef &s) const;
15628 static int localeAwareCompare(const QString& s1, const QStringRef& s2);
15629 short toShort(bool *ok=0, int base=10) const;
15630 ushort toUShort(bool *ok=0, int base=10) const;
15631 int toInt(bool *ok=0, int base=10) const;
15632 uint toUInt(bool *ok=0, int base=10) const;
15633 long toLong(bool *ok=0, int base=10) const;
15634 ulong toULong(bool *ok=0, int base=10) const;
15635 qlonglong toLongLong(bool *ok=0, int base=10) const;
15636 qulonglong toULongLong(bool *ok=0, int base=10) const;
15637 float toFloat(bool *ok=0) const;
15638 double toDouble(bool *ok=0) const;
15639 QString &setNum(short, int base=10);
15640 QString &setNum(ushort, int base=10);
15641 QString &setNum(int, int base=10);
15642 QString &setNum(uint, int base=10);
15643 QString &setNum(long, int base=10);
15644 QString &setNum(ulong, int base=10);
15645 QString &setNum(qlonglong, int base=10);
15646 QString &setNum(qulonglong, int base=10);
15647 QString &setNum(float, char f='g', int prec=6);
15648 QString &setNum(double, char f='g', int prec=6);
15649 static QString number(int, int base=10);
15650 static QString number(uint, int base=10);
15651 static QString number(long, int base=10);
15652 static QString number(ulong, int base=10);
15653 static QString number(qlonglong, int base=10);
15654 static QString number(qulonglong, int base=10);
15655 static QString number(double, char f='g', int prec=6);
15656 bool operator==(const QString &s) const;
15657 bool operator<(const QString &s) const;
15658 inline bool operator>(const QString &s) const { return s < *this; }
15659 inline bool operator!=(const QString &s) const { return !operator==(s); }
15660 inline bool operator<=(const QString &s) const { return !operator>(s); }
15661 inline bool operator>=(const QString &s) const { return !operator<(s); }
15662 bool operator==(const QLatin1String &s) const;
15663 bool operator<(const QLatin1String &s) const;
15664 bool operator>(const QLatin1String &s) const;
15665 inline bool operator!=(const QLatin1String &s) const { return !operator==(s); }
15666 inline bool operator<=(const QLatin1String &s) const { return !operator>(s); }
15667 inline bool operator>=(const QLatin1String &s) const { return !operator<(s); }
15668 inline __attribute__ ((__deprecated__)) QString(const char *ch) : d(fromAscii_helper(ch))
15670 inline __attribute__ ((__deprecated__)) QString(const QByteArray &a)
15671 : d(fromAscii_helper(a.constData(), qstrnlen(a.constData(), a.size())))
15673 inline __attribute__ ((__deprecated__)) QString &operator=(const char *ch)
15674 { return (*this = fromAscii(ch)); }
15675 inline __attribute__ ((__deprecated__)) QString &operator=(const QByteArray &a)
15676 { return (*this = fromAscii(a.constData(), qstrnlen(a.constData(), a.size()))); }
15677 inline __attribute__ ((__deprecated__)) QString &operator=(char c)
15678 { return (*this = QChar::fromAscii(c)); }
15679 inline __attribute__ ((__deprecated__)) QString &prepend(const char *s)
15680 { return prepend(QString::fromAscii(s)); }
15681 inline __attribute__ ((__deprecated__)) QString &prepend(const QByteArray &s)
15682 { return prepend(QString::fromAscii(s.constData(), qstrnlen(s.constData(), s.size()))); }
15683 inline __attribute__ ((__deprecated__)) QString &append(const char *s)
15684 { return append(QString::fromAscii(s)); }
15685 inline __attribute__ ((__deprecated__)) QString &append(const QByteArray &s)
15686 { return append(QString::fromAscii(s.constData(), qstrnlen(s.constData(), s.size()))); }
15687 inline __attribute__ ((__deprecated__)) QString &operator+=(const char *s)
15688 { return append(QString::fromAscii(s)); }
15689 inline __attribute__ ((__deprecated__)) QString &operator+=(const QByteArray &s)
15690 { return append(QString::fromAscii(s.constData(), qstrnlen(s.constData(), s.size()))); }
15691 inline __attribute__ ((__deprecated__)) QString &operator+=(char c)
15692 { return append(QChar::fromAscii(c)); }
15693 inline __attribute__ ((__deprecated__)) bool operator==(const char *s) const;
15694 inline __attribute__ ((__deprecated__)) bool operator!=(const char *s) const;
15695 inline __attribute__ ((__deprecated__)) bool operator<(const char *s) const;
15696 inline __attribute__ ((__deprecated__)) bool operator<=(const char *s2) const;
15697 inline __attribute__ ((__deprecated__)) bool operator>(const char *s2) const;
15698 inline __attribute__ ((__deprecated__)) bool operator>=(const char *s2) const;
15699 inline __attribute__ ((__deprecated__)) bool operator==(const QByteArray &s) const;
15700 inline __attribute__ ((__deprecated__)) bool operator!=(const QByteArray &s) const;
15701 inline __attribute__ ((__deprecated__)) bool operator<(const QByteArray &s) const
15702 { return *this < QString::fromAscii(s.constData(), s.size()); }
15703 inline __attribute__ ((__deprecated__)) bool operator>(const QByteArray &s) const
15704 { return *this > QString::fromAscii(s.constData(), s.size()); }
15705 inline __attribute__ ((__deprecated__)) bool operator<=(const QByteArray &s) const
15706 { return *this <= QString::fromAscii(s.constData(), s.size()); }
15707 inline __attribute__ ((__deprecated__)) bool operator>=(const QByteArray &s) const
15708 { return *this >= QString::fromAscii(s.constData(), s.size()); }
15709 typedef QChar *iterator;
15710 typedef const QChar *const_iterator;
15711 typedef iterator Iterator;
15712 typedef const_iterator ConstIterator;
15714 const_iterator begin() const;
15715 const_iterator constBegin() const;
15717 const_iterator end() const;
15718 const_iterator constEnd() const;
15719 inline void push_back(QChar c) { append(c); }
15720 inline void push_back(const QString &s) { append(s); }
15721 inline void push_front(QChar c) { prepend(c); }
15722 inline void push_front(const QString &s) { prepend(s); }
15723 static inline QString fromStdString(const std::string &s);
15724 inline std::string toStdString() const;
15725 static inline QString fromStdWString(const QStdWString &s);
15726 inline QStdWString toStdWString() const;
15728 static const Null null;
15729 inline QString(const Null &): d(&shared_null) { d->ref.ref(); }
15730 inline QString &operator=(const Null &) { *this = QString(); return *this; }
15731 inline bool isNull() const { return d == &shared_null; }
15732 bool isSimpleText() const { if (!d->clean) updateProperties(); return d->simpletext; }
15733 bool isRightToLeft() const { if (!d->clean) updateProperties(); return d->righttoleft; }
15736 QBasicAtomicInt ref;
15740 ushort simpletext : 1;
15741 ushort righttoleft : 1;
15742 ushort asciiCache : 1;
15743 ushort capacity : 1;
15744 ushort reserved : 11;
15747 static Data shared_null;
15748 static Data shared_empty;
15750 QString(Data *dd, int ) : d(dd) {}
15751 static QTextCodec *codecForCStrings;
15752 static int grow(int);
15753 static void free(Data *);
15755 void realloc(int alloc);
15756 void expand(int i);
15757 void updateProperties() const;
15758 QString multiArg(int numArgs, const QString **args) const;
15759 static int compare_helper(const QChar *data1, int length1,
15760 const QChar *data2, int length2,
15761 Qt::CaseSensitivity cs = Qt::CaseSensitive);
15762 static int compare_helper(const QChar *data1, int length1,
15764 Qt::CaseSensitivity cs = Qt::CaseSensitive);
15765 static int localeAwareCompare_helper(const QChar *data1, int length1,
15766 const QChar *data2, int length2);
15767 static Data *fromLatin1_helper(const char *str, int size = -1);
15768 static Data *fromAscii_helper(const char *str, int size = -1);
15769 void replace_helper(uint *indices, int nIndices, int blen, const QChar *after, int alen);
15770 friend class QCharRef;
15771 friend class QTextCodec;
15772 friend class QStringRef;
15773 friend inline bool qStringComparisonHelper(const QString &s1, const char *s2);
15774 friend inline bool qStringComparisonHelper(const QStringRef &s1, const char *s2);
15776 typedef Data * DataPtr;
15777 inline DataPtr &data_ptr() { return d; }
15779 class __attribute__((visibility("default"))) QLatin1String
15782 inline explicit QLatin1String(const char *s) : chars(s) {}
15783 inline QLatin1String &operator=(const QLatin1String &other)
15784 { chars = other.chars; return *this; }
15785 inline const char *latin1() const { return chars; }
15786 inline bool operator==(const QString &s) const
15787 { return s == *this; }
15788 inline bool operator!=(const QString &s) const
15789 { return s != *this; }
15790 inline bool operator>(const QString &s) const
15791 { return s < *this; }
15792 inline bool operator<(const QString &s) const
15793 { return s > *this; }
15794 inline bool operator>=(const QString &s) const
15795 { return s <= *this; }
15796 inline bool operator<=(const QString &s) const
15797 { return s >= *this; }
15798 inline __attribute__ ((__deprecated__)) bool operator==(const char *s) const
15799 { return QString::fromAscii(s) == *this; }
15800 inline __attribute__ ((__deprecated__)) bool operator!=(const char *s) const
15801 { return QString::fromAscii(s) != *this; }
15802 inline __attribute__ ((__deprecated__)) bool operator<(const char *s) const
15803 { return QString::fromAscii(s) > *this; }
15804 inline __attribute__ ((__deprecated__)) bool operator>(const char *s) const
15805 { return QString::fromAscii(s) < *this; }
15806 inline __attribute__ ((__deprecated__)) bool operator<=(const char *s) const
15807 { return QString::fromAscii(s) >= *this; }
15808 inline __attribute__ ((__deprecated__)) bool operator>=(const char *s) const
15809 { return QString::fromAscii(s) <= *this; }
15813 inline QString::QString(const QLatin1String &aLatin1) : d(fromLatin1_helper(aLatin1.latin1()))
15815 inline int QString::length() const
15816 { return d->size; }
15817 inline const QChar QString::at(int i) const
15818 { qt_noop(); return d->data[i]; }
15819 inline const QChar QString::operator[](int i) const
15820 { qt_noop(); return d->data[i]; }
15821 inline const QChar QString::operator[](uint i) const
15822 { qt_noop(); return d->data[i]; }
15823 inline bool QString::isEmpty() const
15824 { return d->size == 0; }
15825 inline const QChar *QString::unicode() const
15826 { return reinterpret_cast<const QChar*>(d->data); }
15827 inline const QChar *QString::data() const
15828 { return reinterpret_cast<const QChar*>(d->data); }
15829 inline QChar *QString::data()
15830 { detach(); return reinterpret_cast<QChar*>(d->data); }
15831 inline const QChar *QString::constData() const
15832 { return reinterpret_cast<const QChar*>(d->data); }
15833 inline void QString::detach()
15834 { if (d->ref != 1 || d->data != d->array) realloc(); }
15835 inline bool QString::isDetached() const
15836 { return d->ref == 1; }
15837 inline QString &QString::operator=(const QLatin1String &s)
15839 *this = fromLatin1(s.latin1());
15842 inline void QString::clear()
15843 { if (!isNull()) *this = QString(); }
15844 inline QString::QString(const QString &other) : d(other.d)
15845 { qt_noop(); d->ref.ref(); }
15846 inline int QString::capacity() const
15847 { return d->alloc; }
15848 inline QString &QString::setNum(short n, int base)
15849 { return setNum(qlonglong(n), base); }
15850 inline QString &QString::setNum(ushort n, int base)
15851 { return setNum(qulonglong(n), base); }
15852 inline QString &QString::setNum(int n, int base)
15853 { return setNum(qlonglong(n), base); }
15854 inline QString &QString::setNum(uint n, int base)
15855 { return setNum(qulonglong(n), base); }
15856 inline QString &QString::setNum(long n, int base)
15857 { return setNum(qlonglong(n), base); }
15858 inline QString &QString::setNum(ulong n, int base)
15859 { return setNum(qulonglong(n), base); }
15860 inline QString &QString::setNum(float n, char f, int prec)
15861 { return setNum(double(n),f,prec); }
15862 inline QString QString::arg(int a, int fieldWidth, int base, const QChar &fillChar) const
15863 { return arg(qlonglong(a), fieldWidth, base, fillChar); }
15864 inline QString QString::arg(uint a, int fieldWidth, int base, const QChar &fillChar) const
15865 { return arg(qulonglong(a), fieldWidth, base, fillChar); }
15866 inline QString QString::arg(long a, int fieldWidth, int base, const QChar &fillChar) const
15867 { return arg(qlonglong(a), fieldWidth, base, fillChar); }
15868 inline QString QString::arg(ulong a, int fieldWidth, int base, const QChar &fillChar) const
15869 { return arg(qulonglong(a), fieldWidth, base, fillChar); }
15870 inline QString QString::arg(short a, int fieldWidth, int base, const QChar &fillChar) const
15871 { return arg(qlonglong(a), fieldWidth, base, fillChar); }
15872 inline QString QString::arg(ushort a, int fieldWidth, int base, const QChar &fillChar) const
15873 { return arg(qulonglong(a), fieldWidth, base, fillChar); }
15874 inline QString QString::arg(const QString &a1, const QString &a2) const
15875 { const QString *args[2] = { &a1, &a2 }; return multiArg(2, args); }
15876 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3) const
15877 { const QString *args[3] = { &a1, &a2, &a3 }; return multiArg(3, args); }
15878 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
15879 const QString &a4) const
15880 { const QString *args[4] = { &a1, &a2, &a3, &a4 }; return multiArg(4, args); }
15881 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
15882 const QString &a4, const QString &a5) const
15883 { const QString *args[5] = { &a1, &a2, &a3, &a4, &a5 }; return multiArg(5, args); }
15884 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
15885 const QString &a4, const QString &a5, const QString &a6) const
15886 { const QString *args[6] = { &a1, &a2, &a3, &a4, &a5, &a6 }; return multiArg(6, args); }
15887 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
15888 const QString &a4, const QString &a5, const QString &a6,
15889 const QString &a7) const
15890 { const QString *args[7] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7 }; return multiArg(7, args); }
15891 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
15892 const QString &a4, const QString &a5, const QString &a6,
15893 const QString &a7, const QString &a8) const
15894 { const QString *args[8] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8 }; return multiArg(8, args); }
15895 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
15896 const QString &a4, const QString &a5, const QString &a6,
15897 const QString &a7, const QString &a8, const QString &a9) const
15898 { const QString *args[9] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9 }; return multiArg(9, args); }
15899 inline QString QString::section(QChar asep, int astart, int aend, SectionFlags aflags) const
15900 { return section(QString(asep), astart, aend, aflags); }
15901 class __attribute__((visibility("default"))) QCharRef {
15904 inline QCharRef(QString &str, int idx)
15906 friend class QString;
15908 inline operator QChar() const
15909 { return i < s.d->size ? s.d->data[i] : 0; }
15910 inline QCharRef &operator=(const QChar &c)
15911 { if (i >= s.d->size) s.expand(i); else s.detach();
15912 s.d->data[i] = c.unicode(); return *this; }
15913 inline __attribute__ ((__deprecated__)) QCharRef &operator=(char c)
15914 { return operator=(QChar::fromAscii(c)); }
15915 inline __attribute__ ((__deprecated__)) QCharRef &operator=(uchar c)
15916 { return operator=(QChar::fromAscii(c)); }
15917 inline QCharRef &operator=(const QCharRef &c) { return operator=(QChar(c)); }
15918 inline QCharRef &operator=(ushort rc) { return operator=(QChar(rc)); }
15919 inline QCharRef &operator=(short rc) { return operator=(QChar(rc)); }
15920 inline QCharRef &operator=(uint rc) { return operator=(QChar(rc)); }
15921 inline QCharRef &operator=(int rc) { return operator=(QChar(rc)); }
15922 inline bool isNull() const { return QChar(*this).isNull(); }
15923 inline bool isPrint() const { return QChar(*this).isPrint(); }
15924 inline bool isPunct() const { return QChar(*this).isPunct(); }
15925 inline bool isSpace() const { return QChar(*this).isSpace(); }
15926 inline bool isMark() const { return QChar(*this).isMark(); }
15927 inline bool isLetter() const { return QChar(*this).isLetter(); }
15928 inline bool isNumber() const { return QChar(*this).isNumber(); }
15929 inline bool isLetterOrNumber() { return QChar(*this).isLetterOrNumber(); }
15930 inline bool isDigit() const { return QChar(*this).isDigit(); }
15931 inline bool isLower() const { return QChar(*this).isLower(); }
15932 inline bool isUpper() const { return QChar(*this).isUpper(); }
15933 inline bool isTitleCase() const { return QChar(*this).isTitleCase(); }
15934 inline int digitValue() const { return QChar(*this).digitValue(); }
15935 QChar toLower() const { return QChar(*this).toLower(); }
15936 QChar toUpper() const { return QChar(*this).toUpper(); }
15937 QChar toTitleCase () const { return QChar(*this).toTitleCase(); }
15938 QChar::Category category() const { return QChar(*this).category(); }
15939 QChar::Direction direction() const { return QChar(*this).direction(); }
15940 QChar::Joining joining() const { return QChar(*this).joining(); }
15941 bool hasMirrored() const { return QChar(*this).hasMirrored(); }
15942 QChar mirroredChar() const { return QChar(*this).mirroredChar(); }
15943 QString decomposition() const { return QChar(*this).decomposition(); }
15944 QChar::Decomposition decompositionTag() const { return QChar(*this).decompositionTag(); }
15945 uchar combiningClass() const { return QChar(*this).combiningClass(); }
15946 QChar::UnicodeVersion unicodeVersion() const { return QChar(*this).unicodeVersion(); }
15947 inline uchar cell() const { return QChar(*this).cell(); }
15948 inline uchar row() const { return QChar(*this).row(); }
15949 inline void setCell(uchar cell);
15950 inline void setRow(uchar row);
15951 char toAscii() const { return QChar(*this).toAscii(); }
15952 char toLatin1() const { return QChar(*this).toLatin1(); }
15953 ushort unicode() const { return QChar(*this).unicode(); }
15954 ushort& unicode() { return s.data()[i].unicode(); }
15956 inline void QCharRef::setRow(uchar arow) { QChar(*this).setRow(arow); }
15957 inline void QCharRef::setCell(uchar acell) { QChar(*this).setCell(acell); }
15958 inline QString::QString() : d(&shared_null) { d->ref.ref(); }
15959 inline QString::~QString() { if (!d->ref.deref()) free(d); }
15960 inline void QString::reserve(int asize) { if (d->ref != 1 || asize > d->alloc) realloc(asize); d->capacity = 1;}
15961 inline QString &QString::setUtf16(const ushort *autf16, int asize)
15962 { return setUnicode(reinterpret_cast<const QChar *>(autf16), asize); }
15963 inline QCharRef QString::operator[](int i)
15964 { qt_noop(); return QCharRef(*this, i); }
15965 inline QCharRef QString::operator[](uint i)
15966 { return QCharRef(*this, i); }
15967 inline QString::iterator QString::begin()
15968 { detach(); return reinterpret_cast<QChar*>(d->data); }
15969 inline QString::const_iterator QString::begin() const
15970 { return reinterpret_cast<const QChar*>(d->data); }
15971 inline QString::const_iterator QString::constBegin() const
15972 { return reinterpret_cast<const QChar*>(d->data); }
15973 inline QString::iterator QString::end()
15974 { detach(); return reinterpret_cast<QChar*>(d->data + d->size); }
15975 inline QString::const_iterator QString::end() const
15976 { return reinterpret_cast<const QChar*>(d->data + d->size); }
15977 inline QString::const_iterator QString::constEnd() const
15978 { return reinterpret_cast<const QChar*>(d->data + d->size); }
15979 inline QBool QString::contains(const QString &s, Qt::CaseSensitivity cs) const
15980 { return QBool(indexOf(s, 0, cs) != -1); }
15981 inline QBool QString::contains(QChar c, Qt::CaseSensitivity cs) const
15982 { return QBool(indexOf(c, 0, cs) != -1); }
15983 inline bool operator==(QString::Null, QString::Null) { return true; }
15984 inline bool operator==(QString::Null, const QString &s) { return s.isNull(); }
15985 inline bool operator==(const QString &s, QString::Null) { return s.isNull(); }
15986 inline bool operator!=(QString::Null, QString::Null) { return false; }
15987 inline bool operator!=(QString::Null, const QString &s) { return !s.isNull(); }
15988 inline bool operator!=(const QString &s, QString::Null) { return !s.isNull(); }
15989 inline bool qStringComparisonHelper(const QString &s1, const char *s2)
15991 if (QString::codecForCStrings) return (s1 == QString::fromAscii(s2));
15992 return (s1 == QLatin1String(s2));
15994 inline bool QString::operator==(const char *s) const
15995 { return qStringComparisonHelper(*this, s); }
15996 inline bool QString::operator!=(const char *s) const
15997 { return !qStringComparisonHelper(*this, s); }
15998 inline bool QString::operator<(const char *s) const
15999 { return *this < QString::fromAscii(s); }
16000 inline bool QString::operator>(const char *s) const
16001 { return *this > QString::fromAscii(s); }
16002 inline bool QString::operator<=(const char *s) const
16003 { return *this <= QString::fromAscii(s); }
16004 inline bool QString::operator>=(const char *s) const
16005 { return *this >= QString::fromAscii(s); }
16006 inline __attribute__ ((__deprecated__)) bool operator==(const char *s1, const QString &s2)
16007 { return qStringComparisonHelper(s2, s1); }
16008 inline __attribute__ ((__deprecated__)) bool operator!=(const char *s1, const QString &s2)
16009 { return !qStringComparisonHelper(s2, s1); }
16010 inline __attribute__ ((__deprecated__)) bool operator<(const char *s1, const QString &s2)
16011 { return (QString::fromAscii(s1) < s2); }
16012 inline __attribute__ ((__deprecated__)) bool operator>(const char *s1, const QString &s2)
16013 { return (QString::fromAscii(s1) > s2); }
16014 inline __attribute__ ((__deprecated__)) bool operator<=(const char *s1, const QString &s2)
16015 { return (QString::fromAscii(s1) <= s2); }
16016 inline __attribute__ ((__deprecated__)) bool operator>=(const char *s1, const QString &s2)
16017 { return (QString::fromAscii(s1) >= s2); }
16018 inline __attribute__ ((__deprecated__)) bool operator==(const char *s1, const QLatin1String &s2)
16019 { return QString::fromAscii(s1) == s2; }
16020 inline __attribute__ ((__deprecated__)) bool operator!=(const char *s1, const QLatin1String &s2)
16021 { return QString::fromAscii(s1) != s2; }
16022 inline __attribute__ ((__deprecated__)) bool operator<(const char *s1, const QLatin1String &s2)
16023 { return (QString::fromAscii(s1) < s2); }
16024 inline __attribute__ ((__deprecated__)) bool operator>(const char *s1, const QLatin1String &s2)
16025 { return (QString::fromAscii(s1) > s2); }
16026 inline __attribute__ ((__deprecated__)) bool operator<=(const char *s1, const QLatin1String &s2)
16027 { return (QString::fromAscii(s1) <= s2); }
16028 inline __attribute__ ((__deprecated__)) bool operator>=(const char *s1, const QLatin1String &s2)
16029 { return (QString::fromAscii(s1) >= s2); }
16030 inline bool operator==(const QLatin1String &s1, const QLatin1String &s2)
16031 { return (qstrcmp(s1.latin1(), s2.latin1()) == 0); }
16032 inline bool operator!=(const QLatin1String &s1, const QLatin1String &s2)
16033 { return (qstrcmp(s1.latin1(), s2.latin1()) != 0); }
16034 inline bool operator<(const QLatin1String &s1, const QLatin1String &s2)
16035 { return (qstrcmp(s1.latin1(), s2.latin1()) < 0); }
16036 inline bool operator<=(const QLatin1String &s1, const QLatin1String &s2)
16037 { return (qstrcmp(s1.latin1(), s2.latin1()) <= 0); }
16038 inline bool operator>(const QLatin1String &s1, const QLatin1String &s2)
16039 { return (qstrcmp(s1.latin1(), s2.latin1()) > 0); }
16040 inline bool operator>=(const QLatin1String &s1, const QLatin1String &s2)
16041 { return (qstrcmp(s1.latin1(), s2.latin1()) >= 0); }
16042 inline bool QString::operator==(const QByteArray &s) const
16043 { return qStringComparisonHelper(*this, s.constData()); }
16044 inline bool QString::operator!=(const QByteArray &s) const
16045 { return !qStringComparisonHelper(*this, s.constData()); }
16046 inline bool QByteArray::operator==(const QString &s) const
16047 { return qStringComparisonHelper(s, constData()); }
16048 inline bool QByteArray::operator!=(const QString &s) const
16049 { return !qStringComparisonHelper(s, constData()); }
16050 inline bool QByteArray::operator<(const QString &s) const
16051 { return QString::fromAscii(constData(), size()) < s; }
16052 inline bool QByteArray::operator>(const QString &s) const
16053 { return QString::fromAscii(constData(), size()) > s; }
16054 inline bool QByteArray::operator<=(const QString &s) const
16055 { return QString::fromAscii(constData(), size()) <= s; }
16056 inline bool QByteArray::operator>=(const QString &s) const
16057 { return QString::fromAscii(constData(), size()) >= s; }
16058 inline const QString operator+(const QString &s1, const QString &s2)
16059 { QString t(s1); t += s2; return t; }
16060 inline const QString operator+(const QString &s1, QChar s2)
16061 { QString t(s1); t += s2; return t; }
16062 inline const QString operator+(QChar s1, const QString &s2)
16063 { QString t(s1); t += s2; return t; }
16064 inline __attribute__ ((__deprecated__)) const QString operator+(const QString &s1, const char *s2)
16065 { QString t(s1); t += QString::fromAscii(s2); return t; }
16066 inline __attribute__ ((__deprecated__)) const QString operator+(const char *s1, const QString &s2)
16067 { QString t = QString::fromAscii(s1); t += s2; return t; }
16068 inline __attribute__ ((__deprecated__)) const QString operator+(char c, const QString &s)
16069 { QString t = s; t.prepend(QChar::fromAscii(c)); return t; }
16070 inline __attribute__ ((__deprecated__)) const QString operator+(const QString &s, char c)
16071 { QString t = s; t += QChar::fromAscii(c); return t; }
16072 inline __attribute__ ((__deprecated__)) const QString operator+(const QByteArray &ba, const QString &s)
16073 { QString t = QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); t += s; return t; }
16074 inline __attribute__ ((__deprecated__)) const QString operator+(const QString &s, const QByteArray &ba)
16075 { QString t(s); t += QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); return t; }
16076 inline std::string QString::toStdString() const
16077 { const QByteArray asc = toAscii(); return std::string(asc.constData(), asc.length()); }
16078 inline QString QString::fromStdString(const std::string &s)
16079 { return fromAscii(s.data(), int(s.size())); }
16080 inline QStdWString QString::toStdWString() const
16083 str.resize(length());
16084 str.resize(toWCharArray(&(*str.begin())));
16087 inline QString QString::fromStdWString(const QStdWString &s)
16088 { return fromWCharArray(s.data(), int(s.size())); }
16089 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QString &);
16090 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QString &);
16091 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"; } };
16092 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; }
16093 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); }
16094 class __attribute__((visibility("default"))) QStringRef {
16095 const QString *m_string;
16099 inline QStringRef():m_string(0), m_position(0), m_size(0){}
16100 inline QStringRef(const QString *string, int position, int size);
16101 inline QStringRef(const QString *string);
16102 inline QStringRef(const QStringRef &other)
16103 :m_string(other.m_string), m_position(other.m_position), m_size(other.m_size)
16105 inline ~QStringRef(){}
16106 inline const QString *string() const { return m_string; }
16107 inline int position() const { return m_position; }
16108 inline int size() const { return m_size; }
16109 inline int count() const { return m_size; }
16110 inline int length() const { return m_size; }
16111 inline QStringRef &operator=(const QStringRef &other) {
16112 m_string = other.m_string; m_position = other.m_position;
16113 m_size = other.m_size; return *this;
16115 inline QStringRef &operator=(const QString *string);
16116 inline const QChar *unicode() const {
16118 return reinterpret_cast<const QChar *>(QString::shared_null.data);
16119 return m_string->unicode() + m_position;
16121 inline const QChar *data() const { return unicode(); }
16122 inline const QChar *constData() const { return unicode(); }
16123 inline void clear() { m_string = 0; m_position = m_size = 0; }
16124 QString toString() const;
16125 inline bool isEmpty() const { return m_size == 0; }
16126 inline bool isNull() const { return m_string == 0 || m_string->isNull(); }
16127 QStringRef appendTo(QString *string) const;
16128 inline const QChar at(int i) const
16129 { qt_noop(); return m_string->at(i + m_position); }
16130 int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
16131 int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
16132 int compare(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
16133 static int compare(const QStringRef &s1, const QString &s2,
16134 Qt::CaseSensitivity = Qt::CaseSensitive);
16135 static int compare(const QStringRef &s1, const QStringRef &s2,
16136 Qt::CaseSensitivity = Qt::CaseSensitive);
16137 static int compare(const QStringRef &s1, QLatin1String s2,
16138 Qt::CaseSensitivity cs = Qt::CaseSensitive);
16139 int localeAwareCompare(const QString &s) const;
16140 int localeAwareCompare(const QStringRef &s) const;
16141 static int localeAwareCompare(const QStringRef &s1, const QString &s2);
16142 static int localeAwareCompare(const QStringRef &s1, const QStringRef &s2);
16144 inline QStringRef &QStringRef::operator=(const QString *aString)
16145 { m_string = aString; m_position = 0; m_size = aString?aString->size():0; return *this; }
16146 inline QStringRef::QStringRef(const QString *aString, int aPosition, int aSize)
16147 :m_string(aString), m_position(aPosition), m_size(aSize){}
16148 inline QStringRef::QStringRef(const QString *aString)
16149 :m_string(aString), m_position(0), m_size(aString?aString->size() : 0){}
16150 __attribute__((visibility("default"))) bool operator==(const QStringRef &s1,const QStringRef &s2);
16151 inline bool operator!=(const QStringRef &s1,const QStringRef &s2)
16152 { return !(s1 == s2); }
16153 __attribute__((visibility("default"))) bool operator==(const QString &s1,const QStringRef &s2);
16154 inline bool operator!=(const QString &s1,const QStringRef &s2)
16155 { return !(s1 == s2); }
16156 inline bool operator==(const QStringRef &s1,const QString &s2)
16157 { return s2 == s1; }
16158 inline bool operator!=(const QStringRef &s1,const QString &s2)
16159 { return s2 != s1; }
16160 __attribute__((visibility("default"))) bool operator==(const QLatin1String &s1, const QStringRef &s2);
16161 inline bool operator!=(const QLatin1String &s1,const QStringRef &s2)
16162 { return !(s1 == s2); }
16163 inline bool operator==(const QStringRef &s1,const QLatin1String &s2)
16164 { return s2 == s1; }
16165 inline bool operator!=(const QStringRef &s1,const QLatin1String &s2)
16166 { return s2 != s1; }
16167 __attribute__((visibility("default"))) bool operator<(const QStringRef &s1,const QStringRef &s2);
16168 inline bool operator>(const QStringRef &s1, const QStringRef &s2)
16169 { return s2 < s1; }
16170 inline bool operator<=(const QStringRef &s1, const QStringRef &s2)
16171 { return !(s1 > s2); }
16172 inline bool operator>=(const QStringRef &s1, const QStringRef &s2)
16173 { return !(s1 < s2); }
16174 inline bool qStringComparisonHelper(const QStringRef &s1, const char *s2)
16176 if (QString::codecForCStrings) return (s1 == QString::fromAscii(s2));
16177 return (s1 == QLatin1String(s2));
16179 inline __attribute__ ((__deprecated__)) bool operator==(const char *s1, const QStringRef &s2)
16180 { return qStringComparisonHelper(s2, s1); }
16181 inline __attribute__ ((__deprecated__)) bool operator==(const QStringRef &s1, const char *s2)
16182 { return qStringComparisonHelper(s1, s2); }
16183 inline __attribute__ ((__deprecated__)) bool operator!=(const char *s1, const QStringRef &s2)
16184 { return !qStringComparisonHelper(s2, s1); }
16185 inline __attribute__ ((__deprecated__)) bool operator!=(const QStringRef &s1, const char *s2)
16186 { return !qStringComparisonHelper(s1, s2); }
16187 inline int QString::compare(const QStringRef &s, Qt::CaseSensitivity cs) const
16188 { return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
16189 inline int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs)
16190 { return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
16191 inline int QStringRef::compare(const QString &s, Qt::CaseSensitivity cs) const
16192 { return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
16193 inline int QStringRef::compare(const QStringRef &s, Qt::CaseSensitivity cs) const
16194 { return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
16195 inline int QStringRef::compare(QLatin1String s, Qt::CaseSensitivity cs) const
16196 { return QString::compare_helper(constData(), length(), s, cs); }
16197 inline int QStringRef::compare(const QStringRef &s1, const QString &s2, Qt::CaseSensitivity cs)
16198 { return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
16199 inline int QStringRef::compare(const QStringRef &s1, const QStringRef &s2, Qt::CaseSensitivity cs)
16200 { return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
16201 inline int QStringRef::compare(const QStringRef &s1, QLatin1String s2, Qt::CaseSensitivity cs)
16202 { return QString::compare_helper(s1.constData(), s1.length(), s2, cs); }
16203 inline int QString::localeAwareCompare(const QStringRef &s) const
16204 { return localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
16205 inline int QString::localeAwareCompare(const QString& s1, const QStringRef& s2)
16206 { return localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
16207 inline int QStringRef::localeAwareCompare(const QString &s) const
16208 { return QString::localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
16209 inline int QStringRef::localeAwareCompare(const QStringRef &s) const
16210 { return QString::localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
16211 inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QString &s2)
16212 { return QString::localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
16213 inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QStringRef &s2)
16214 { return QString::localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
16215 typedef QtValidLicenseForCoreModule QtCoreModule;
16219 struct QMetaObject;
16221 class QObjectPrivate;
16226 class QObjectUserData;
16227 typedef QList<QObject*> QObjectList;
16228 template<typename T> inline T qFindChild(const QObject *, const QString & = QString());
16229 template<typename T> inline QList<T> qFindChildren(const QObject *, const QString & = QString());
16230 template<typename T> inline QList<T> qFindChildren(const QObject *, const QRegExp &);
16231 class QObjectData {
16233 virtual ~QObjectData() = 0;
16236 QObjectList children;
16238 uint pendTimer : 1;
16240 uint wasDeleted : 1;
16241 uint ownObjectName : 1;
16242 uint sendChildEvents : 1;
16243 uint receiveChildEvents : 1;
16244 uint inEventHandler : 1;
16245 uint inThreadChangeEvent : 1;
16249 class __attribute__((visibility("default"))) QObject
16251 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:
16252 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;
16254 explicit QObject(QObject *parent=0);
16255 virtual ~QObject();
16256 virtual bool event(QEvent *);
16257 virtual bool eventFilter(QObject *, QEvent *);
16258 QString objectName() const;
16259 void setObjectName(const QString &name);
16260 inline bool isWidgetType() const { return d_ptr->isWidget; }
16261 inline bool signalsBlocked() const { return d_ptr->blockSig; }
16262 bool blockSignals(bool b);
16263 QThread *thread() const;
16264 void moveToThread(QThread *thread);
16265 int startTimer(int interval);
16266 void killTimer(int id);
16267 template<typename T>
16268 inline T findChild(const QString &aName = QString()) const
16269 { return qFindChild<T>(this, aName); }
16270 template<typename T>
16271 inline QList<T> findChildren(const QString &aName = QString()) const
16272 { return qFindChildren<T>(this, aName); }
16273 template<typename T>
16274 inline QList<T> findChildren(const QRegExp &re) const
16275 { return qFindChildren<T>(this, re); }
16276 inline const QObjectList &children() const { return d_ptr->children; }
16277 void setParent(QObject *);
16278 void installEventFilter(QObject *);
16279 void removeEventFilter(QObject *);
16280 static bool connect(const QObject *sender, const char *signal,
16281 const QObject *receiver, const char *member, Qt::ConnectionType =
16284 inline bool connect(const QObject *sender, const char *signal,
16285 const char *member, Qt::ConnectionType type =
16288 static bool disconnect(const QObject *sender, const char *signal,
16289 const QObject *receiver, const char *member);
16290 inline bool disconnect(const char *signal = 0,
16291 const QObject *receiver = 0, const char *member = 0)
16292 { return disconnect(this, signal, receiver, member); }
16293 inline bool disconnect(const QObject *receiver, const char *member = 0)
16294 { return disconnect(this, 0, receiver, member); }
16295 void dumpObjectTree();
16296 void dumpObjectInfo();
16297 bool setProperty(const char *name, const QVariant &value);
16298 QVariant property(const char *name) const;
16299 QList<QByteArray> dynamicPropertyNames() const;
16300 static uint registerUserData();
16301 void setUserData(uint id, QObjectUserData* data);
16302 QObjectUserData* userData(uint id) const;
16304 void destroyed(QObject * = 0);
16306 inline QObject *parent() const { return d_ptr->parent; }
16307 inline bool inherits(const char *classname) const
16308 { return const_cast<QObject *>(this)->qt_metacast(classname) != 0; }
16310 void deleteLater();
16312 QObject *sender() const;
16313 int receivers(const char* signal) const;
16314 virtual void timerEvent(QTimerEvent *);
16315 virtual void childEvent(QChildEvent *);
16316 virtual void customEvent(QEvent *);
16317 virtual void connectNotify(const char *signal);
16318 virtual void disconnectNotify(const char *signal);
16320 QObject(QObjectPrivate &dd, QObject *parent = 0);
16322 QObjectData *d_ptr;
16323 static const QMetaObject staticQtMetaObject;
16324 friend struct QMetaObject;
16325 friend class QApplication;
16326 friend class QApplicationPrivate;
16327 friend class QCoreApplication;
16328 friend class QCoreApplicationPrivate;
16329 friend class QWidget;
16330 friend class QThreadData;
16332 QObject(const QObject &); QObject &operator=(const QObject &);
16334 inline bool QObject::connect(const QObject *asender, const char *asignal,
16335 const char *amember, Qt::ConnectionType atype) const
16336 { return connect(asender, asignal, this, amember, atype); }
16337 class __attribute__((visibility("default"))) QObjectUserData {
16339 virtual ~QObjectUserData();
16341 __attribute__((visibility("default"))) void qt_qFindChildren_helper(const QObject *parent, const QString &name, const QRegExp *re,
16342 const QMetaObject &mo, QList<void *> *list);
16343 __attribute__((visibility("default"))) QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo);
16344 template<typename T>
16345 inline T qFindChild(const QObject *o, const QString &name)
16346 { return static_cast<T>(qt_qFindChild_helper(o, name, reinterpret_cast<T>(0)->staticMetaObject)); }
16347 template<typename T>
16348 inline QList<T> qFindChildren(const QObject *o, const QString &name)
16352 QList<T> *typedList;
16353 QList<void *> *voidList;
16355 u.typedList = &list;
16356 qt_qFindChildren_helper(o, name, 0, reinterpret_cast<T>(0)->staticMetaObject, u.voidList);
16359 template<typename T>
16360 inline QList<T> qFindChildren(const QObject *o, const QRegExp &re)
16364 QList<T> *typedList;
16365 QList<void *> *voidList;
16367 u.typedList = &list;
16368 qt_qFindChildren_helper(o, QString(), &re, reinterpret_cast<T>(0)->staticMetaObject, u.voidList);
16372 inline T qobject_cast(QObject *object)
16374 reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(object));
16375 return static_cast<T>(reinterpret_cast<T>(0)->staticMetaObject.cast(object));
16378 inline T qobject_cast(const QObject *object)
16380 register T ptr = static_cast<T>(object);
16382 reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(const_cast<QObject *>(object)));
16383 return static_cast<T>(const_cast<QObject *>(reinterpret_cast<T>(0)->staticMetaObject.cast(const_cast<QObject *>(object))));
16385 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QObject *);
16386 typedef QtValidLicenseForCoreModule QtCoreModule;
16388 class QIODevicePrivate;
16389 class __attribute__((visibility("default"))) QIODevice
16392 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:
16394 enum OpenModeFlag {
16397 WriteOnly = 0x0002,
16398 ReadWrite = ReadOnly | WriteOnly,
16402 Unbuffered = 0x0020
16404 typedef QFlags<OpenModeFlag> OpenMode;
16406 explicit QIODevice(QObject *parent);
16407 virtual ~QIODevice();
16408 OpenMode openMode() const;
16409 void setTextModeEnabled(bool enabled);
16410 bool isTextModeEnabled() const;
16411 bool isOpen() const;
16412 bool isReadable() const;
16413 bool isWritable() const;
16414 virtual bool isSequential() const;
16415 virtual bool open(OpenMode mode);
16416 virtual void close();
16417 virtual qint64 pos() const;
16418 virtual qint64 size() const;
16419 virtual bool seek(qint64 pos);
16420 virtual bool atEnd() const;
16421 virtual bool reset();
16422 virtual qint64 bytesAvailable() const;
16423 virtual qint64 bytesToWrite() const;
16424 qint64 read(char *data, qint64 maxlen);
16425 QByteArray read(qint64 maxlen);
16426 QByteArray readAll();
16427 qint64 readLine(char *data, qint64 maxlen);
16428 QByteArray readLine(qint64 maxlen = 0);
16429 virtual bool canReadLine() const;
16430 qint64 write(const char *data, qint64 len);
16431 qint64 write(const char *data);
16432 inline qint64 write(const QByteArray &data)
16433 { return write(data.constData(), data.size()); }
16434 qint64 peek(char *data, qint64 maxlen);
16435 QByteArray peek(qint64 maxlen);
16436 virtual bool waitForReadyRead(int msecs);
16437 virtual bool waitForBytesWritten(int msecs);
16438 void ungetChar(char c);
16439 bool putChar(char c);
16440 bool getChar(char *c);
16441 QString errorString() const;
16444 void bytesWritten(qint64 bytes);
16445 void aboutToClose();
16446 void readChannelFinished();
16448 QIODevice(QIODevicePrivate &dd, QObject *parent = 0);
16449 virtual qint64 readData(char *data, qint64 maxlen) = 0;
16450 virtual qint64 readLineData(char *data, qint64 maxlen);
16451 virtual qint64 writeData(const char *data, qint64 len) = 0;
16452 void setOpenMode(OpenMode openMode);
16453 void setErrorString(const QString &errorString);
16455 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;
16456 QIODevice(const QIODevice &); QIODevice &operator=(const QIODevice &);
16458 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); }
16460 __attribute__((visibility("default"))) QDebug operator<<(QDebug debug, QIODevice::OpenMode modes);
16461 typedef QtValidLicenseForCoreModule QtCoreModule;
16464 template <typename T> class QList;
16465 template <typename T> class QLinkedList;
16466 template <typename T> class QVector;
16467 template <typename T> class QSet;
16468 template <class Key, class T> class QHash;
16469 template <class Key, class T> class QMap;
16470 class QDataStreamPrivate;
16471 class __attribute__((visibility("default"))) QDataStream
16489 BigEndian = QSysInfo::BigEndian,
16490 LittleEndian = QSysInfo::LittleEndian
16498 explicit QDataStream(QIODevice *);
16499 QDataStream(QByteArray *, QIODevice::OpenMode flags);
16500 QDataStream(const QByteArray &);
16501 virtual ~QDataStream();
16502 QIODevice *device() const;
16503 void setDevice(QIODevice *);
16504 void unsetDevice();
16505 bool atEnd() const;
16506 Status status() const;
16507 void setStatus(Status status);
16508 void resetStatus();
16509 ByteOrder byteOrder() const;
16510 void setByteOrder(ByteOrder);
16511 int version() const;
16512 void setVersion(int);
16513 QDataStream &operator>>(qint8 &i);
16514 QDataStream &operator>>(quint8 &i);
16515 QDataStream &operator>>(qint16 &i);
16516 QDataStream &operator>>(quint16 &i);
16517 QDataStream &operator>>(qint32 &i);
16518 QDataStream &operator>>(quint32 &i);
16519 QDataStream &operator>>(qint64 &i);
16520 QDataStream &operator>>(quint64 &i);
16521 QDataStream &operator>>(bool &i);
16522 QDataStream &operator>>(float &f);
16523 QDataStream &operator>>(double &f);
16524 QDataStream &operator>>(char *&str);
16525 QDataStream &operator<<(qint8 i);
16526 QDataStream &operator<<(quint8 i);
16527 QDataStream &operator<<(qint16 i);
16528 QDataStream &operator<<(quint16 i);
16529 QDataStream &operator<<(qint32 i);
16530 QDataStream &operator<<(quint32 i);
16531 QDataStream &operator<<(qint64 i);
16532 QDataStream &operator<<(quint64 i);
16533 QDataStream &operator<<(bool i);
16534 QDataStream &operator<<(float f);
16535 QDataStream &operator<<(double f);
16536 QDataStream &operator<<(const char *str);
16537 QDataStream &readBytes(char *&, uint &len);
16538 int readRawData(char *, int len);
16539 QDataStream &writeBytes(const char *, uint len);
16540 int writeRawData(const char *, int len);
16541 int skipRawData(int len);
16543 QDataStream(const QDataStream &); QDataStream &operator=(const QDataStream &);
16544 QDataStreamPrivate *d;
16548 ByteOrder byteorder;
16552 inline QIODevice *QDataStream::device() const
16554 inline QDataStream::ByteOrder QDataStream::byteOrder() const
16555 { return byteorder; }
16556 inline int QDataStream::version() const
16558 inline void QDataStream::setVersion(int v)
16560 inline QDataStream &QDataStream::operator>>(quint8 &i)
16561 { return *this >> reinterpret_cast<qint8&>(i); }
16562 inline QDataStream &QDataStream::operator>>(quint16 &i)
16563 { return *this >> reinterpret_cast<qint16&>(i); }
16564 inline QDataStream &QDataStream::operator>>(quint32 &i)
16565 { return *this >> reinterpret_cast<qint32&>(i); }
16566 inline QDataStream &QDataStream::operator>>(quint64 &i)
16567 { return *this >> reinterpret_cast<qint64&>(i); }
16568 inline QDataStream &QDataStream::operator<<(quint8 i)
16569 { return *this << qint8(i); }
16570 inline QDataStream &QDataStream::operator<<(quint16 i)
16571 { return *this << qint16(i); }
16572 inline QDataStream &QDataStream::operator<<(quint32 i)
16573 { return *this << qint32(i); }
16574 inline QDataStream &QDataStream::operator<<(quint64 i)
16575 { return *this << qint64(i); }
16576 template <typename T>
16577 QDataStream& operator>>(QDataStream& s, QList<T>& l)
16582 for(quint32 i = 0; i < c; ++i)
16592 template <typename T>
16593 QDataStream& operator<<(QDataStream& s, const QList<T>& l)
16595 s << quint32(l.size());
16596 for (int i = 0; i < l.size(); ++i)
16600 template <typename T>
16601 QDataStream& operator>>(QDataStream& s, QLinkedList<T>& l)
16606 for(quint32 i = 0; i < c; ++i)
16616 template <typename T>
16617 QDataStream& operator<<(QDataStream& s, const QLinkedList<T>& l)
16619 s << quint32(l.size());
16620 typename QLinkedList<T>::ConstIterator it = l.constBegin();
16621 for(; it != l.constEnd(); ++it)
16625 template<typename T>
16626 QDataStream& operator>>(QDataStream& s, QVector<T>& v)
16632 for(quint32 i = 0; i < c; ++i) {
16639 template<typename T>
16640 QDataStream& operator<<(QDataStream& s, const QVector<T>& v)
16642 s << quint32(v.size());
16643 for (typename QVector<T>::const_iterator it = v.begin(); it != v.end(); ++it)
16647 template <typename T>
16648 QDataStream &operator>>(QDataStream &in, QSet<T> &set)
16653 for (quint32 i = 0; i < c; ++i) {
16662 template <typename T>
16663 QDataStream& operator<<(QDataStream &out, const QSet<T> &set)
16665 out << quint32(set.size());
16666 typename QSet<T>::const_iterator i = set.constBegin();
16667 while (i != set.constEnd()) {
16673 template <class Key, class T>
16674 QDataStream &operator>>(QDataStream &in, QHash<Key, T> &hash)
16676 QDataStream::Status oldStatus = in.status();
16681 for (quint32 i = 0; i < n; ++i) {
16682 if (in.status() != QDataStream::Ok)
16687 hash.insertMulti(k, t);
16689 if (in.status() != QDataStream::Ok)
16691 if (oldStatus != QDataStream::Ok)
16692 in.setStatus(oldStatus);
16695 template <class Key, class T>
16696 QDataStream &operator<<(QDataStream &out, const QHash<Key, T>& hash)
16698 out << quint32(hash.size());
16699 typename QHash<Key, T>::ConstIterator it = hash.end();
16700 typename QHash<Key, T>::ConstIterator begin = hash.begin();
16701 while (it != begin) {
16703 out << it.key() << it.value();
16707 template <class aKey, class aT>
16708 QDataStream &operator>>(QDataStream &in, QMap<aKey, aT> &map)
16710 QDataStream::Status oldStatus = in.status();
16716 map.setInsertInOrder(true);
16717 for (quint32 i = 0; i < n; ++i) {
16718 if (in.status() != QDataStream::Ok)
16722 in >> key >> value;
16723 map.insertMulti(key, value);
16725 map.setInsertInOrder(false);
16726 if (in.status() != QDataStream::Ok)
16728 if (oldStatus != QDataStream::Ok)
16729 in.setStatus(oldStatus);
16732 template <class Key, class T>
16733 QDataStream &operator<<(QDataStream &out, const QMap<Key, T> &map)
16735 out << quint32(map.size());
16736 typename QMap<Key, T>::ConstIterator it = map.end();
16737 typename QMap<Key, T>::ConstIterator begin = map.begin();
16738 while (it != begin) {
16740 out << it.key() << it.value();
16744 typedef QtValidLicenseForCoreModule QtCoreModule;
16745 template <class T1, class T2>
16748 typedef T1 first_type;
16749 typedef T2 second_type;
16750 QPair() : first(T1()), second(T2()) {}
16751 QPair(const T1 &t1, const T2 &t2) : first(t1), second(t2) {}
16752 QPair<T1, T2> &operator=(const QPair<T1, T2> &other)
16753 { first = other.first; second = other.second; return *this; }
16757 template <class T1, class T2>
16758 inline bool operator==(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
16759 { return p1.first == p2.first && p1.second == p2.second; }
16760 template <class T1, class T2>
16761 inline bool operator!=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
16762 { return !(p1 == p2); }
16763 template <class T1, class T2>
16764 inline bool operator<(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
16766 return p1.first < p2.first || (!(p2.first < p1.first) && p1.second < p2.second);
16768 template <class T1, class T2>
16769 inline bool operator>(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
16773 template <class T1, class T2>
16774 inline bool operator<=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
16778 template <class T1, class T2>
16779 inline bool operator>=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
16783 template <class T1, class T2>
16784 QPair<T1, T2> qMakePair(const T1 &x, const T2 &y)
16786 return QPair<T1, T2>(x, y);
16788 template <class T1, class T2>
16789 inline QDataStream& operator>>(QDataStream& s, QPair<T1, T2>& p)
16791 s >> p.first >> p.second;
16794 template <class T1, class T2>
16795 inline QDataStream& operator<<(QDataStream& s, const QPair<T1, T2>& p)
16797 s << p.first << p.second;
16800 typedef QtValidLicenseForCoreModule QtCoreModule;
16805 inline uint qHash(char key) { return uint(key); }
16806 inline uint qHash(uchar key) { return uint(key); }
16807 inline uint qHash(signed char key) { return uint(key); }
16808 inline uint qHash(ushort key) { return uint(key); }
16809 inline uint qHash(short key) { return uint(key); }
16810 inline uint qHash(uint key) { return key; }
16811 inline uint qHash(int key) { return uint(key); }
16812 inline uint qHash(ulong key)
16814 if (sizeof(ulong) > sizeof(uint)) {
16815 return uint((key >> (8 * sizeof(uint) - 1)) ^ key);
16820 inline uint qHash(long key) { return qHash(ulong(key)); }
16821 inline uint qHash(quint64 key)
16823 if (sizeof(quint64) > sizeof(uint)) {
16824 return uint((key >> (8 * sizeof(uint) - 1)) ^ key);
16829 inline uint qHash(qint64 key) { return qHash(quint64(key)); }
16830 inline uint qHash(QChar key) { return qHash(key.unicode()); }
16831 __attribute__((visibility("default"))) uint qHash(const QByteArray &key);
16832 __attribute__((visibility("default"))) uint qHash(const QString &key);
16833 __attribute__((visibility("default"))) uint qHash(const QStringRef &key);
16834 __attribute__((visibility("default"))) uint qHash(const QBitArray &key);
16835 template <class T> inline uint qHash(const T *key)
16837 if (sizeof(const T *) > sizeof(uint))
16838 return qHash(reinterpret_cast<quint64>(key));
16840 return uint(reinterpret_cast<ulong>(key));
16842 template <typename T1, typename T2> inline uint qHash(const QPair<T1, T2> &key)
16844 uint h1 = qHash(key.first);
16845 uint h2 = qHash(key.second);
16846 return ((h1 << 16) | (h1 >> 16)) ^ h2;
16848 struct __attribute__((visibility("default"))) QHashData
16856 QBasicAtomicInt ref;
16863 void *allocateNode();
16864 void freeNode(void *node);
16865 QHashData *detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize);
16869 void rehash(int hint);
16870 void destroyAndFree();
16872 static Node *nextNode(Node *node);
16873 static Node *previousNode(Node *node);
16874 static QHashData shared_null;
16876 inline void QHashData::mightGrow()
16878 if (size >= numBuckets)
16879 rehash(numBits + 1);
16881 inline bool QHashData::willGrow()
16883 if (size >= numBuckets) {
16884 rehash(numBits + 1);
16890 inline void QHashData::hasShrunk()
16892 if (size <= (numBuckets >> 3) && numBits > userNumBits)
16893 rehash(qMax(int(numBits) - 2, int(userNumBits)));
16895 inline QHashData::Node *QHashData::firstNode()
16897 Node *e = reinterpret_cast<Node *>(this);
16898 Node **bucket = buckets;
16899 int n = numBuckets;
16907 struct QHashDummyValue
16910 inline bool operator==(const QHashDummyValue & , const QHashDummyValue & )
16914 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"; } };
16915 template <class Key, class T>
16916 struct QHashDummyNode
16918 QHashDummyNode *next;
16921 inline QHashDummyNode(const Key &key0) : key(key0) {}
16923 template <class Key, class T>
16930 inline QHashNode(const Key &key0) : key(key0) {}
16931 inline QHashNode(const Key &key0, const T &value0) : key(key0), value(value0) {}
16932 inline bool same_key(uint h0, const Key &key0) { return h0 == h && key0 == key; }
16934 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; } };
16935 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; } };
16936 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; } };
16937 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; } };
16938 template <class Key, class T>
16941 typedef QHashDummyNode<Key, T> DummyNode;
16942 typedef QHashNode<Key, T> Node;
16945 QHashNode<Key, T> *e;
16947 static inline Node *concrete(QHashData::Node *node) {
16948 return reinterpret_cast<Node *>(node);
16951 inline QHash() : d(&QHashData::shared_null) { d->ref.ref(); }
16952 inline QHash(const QHash<Key, T> &other) : d(other.d) { d->ref.ref(); if (!d->sharable) detach(); }
16953 inline ~QHash() { if (!d->ref.deref()) freeData(d); }
16954 QHash<Key, T> &operator=(const QHash<Key, T> &other);
16955 bool operator==(const QHash<Key, T> &other) const;
16956 inline bool operator!=(const QHash<Key, T> &other) const { return !(*this == other); }
16957 inline int size() const { return d->size; }
16958 inline bool isEmpty() const { return d->size == 0; }
16959 inline int capacity() const { return d->numBuckets; }
16960 void reserve(int size);
16961 inline void squeeze() { reserve(1); }
16962 inline void detach() { if (d->ref != 1) detach_helper(); }
16963 inline bool isDetached() const { return d->ref == 1; }
16964 inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
16966 int remove(const Key &key);
16967 T take(const Key &key);
16968 bool contains(const Key &key) const;
16969 const Key key(const T &value) const;
16970 const Key key(const T &value, const Key &defaultKey) const;
16971 const T value(const Key &key) const;
16972 const T value(const Key &key, const T &defaultValue) const;
16973 T &operator[](const Key &key);
16974 const T operator[](const Key &key) const;
16975 QList<Key> uniqueKeys() const;
16976 QList<Key> keys() const;
16977 QList<Key> keys(const T &value) const;
16978 QList<T> values() const;
16979 QList<T> values(const Key &key) const;
16980 int count(const Key &key) const;
16981 class const_iterator;
16984 friend class const_iterator;
16985 QHashData::Node *i;
16987 typedef std::bidirectional_iterator_tag iterator_category;
16988 typedef ptrdiff_t difference_type;
16989 typedef T value_type;
16990 typedef T *pointer;
16991 typedef T &reference;
16992 inline operator Node *() const { return concrete(i); }
16993 inline iterator() : i(0) { }
16994 explicit inline iterator(void *node) : i(reinterpret_cast<QHashData::Node *>(node)) { }
16995 inline const Key &key() const { return concrete(i)->key; }
16996 inline T &value() const { return concrete(i)->value; }
16997 inline T &operator*() const { return concrete(i)->value; }
16998 inline T *operator->() const { return &concrete(i)->value; }
16999 inline bool operator==(const iterator &o) const { return i == o.i; }
17000 inline bool operator!=(const iterator &o) const { return i != o.i; }
17001 inline iterator &operator++() {
17002 i = QHashData::nextNode(i);
17005 inline iterator operator++(int) {
17006 iterator r = *this;
17007 i = QHashData::nextNode(i);
17010 inline iterator &operator--() {
17011 i = QHashData::previousNode(i);
17014 inline iterator operator--(int) {
17015 iterator r = *this;
17016 i = QHashData::previousNode(i);
17019 inline iterator operator+(int j) const
17020 { iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
17021 inline iterator operator-(int j) const { return operator+(-j); }
17022 inline iterator &operator+=(int j) { return *this = *this + j; }
17023 inline iterator &operator-=(int j) { return *this = *this - j; }
17025 inline bool operator==(const const_iterator &o) const
17026 { return i == o.i; }
17027 inline bool operator!=(const const_iterator &o) const
17028 { return i != o.i; }
17030 inline operator bool() const { return false; }
17032 friend class iterator;
17033 class const_iterator
17035 friend class iterator;
17036 QHashData::Node *i;
17038 typedef std::bidirectional_iterator_tag iterator_category;
17039 typedef ptrdiff_t difference_type;
17040 typedef T value_type;
17041 typedef const T *pointer;
17042 typedef const T &reference;
17043 inline operator Node *() const { return concrete(i); }
17044 inline const_iterator() : i(0) { }
17045 explicit inline const_iterator(void *node)
17046 : i(reinterpret_cast<QHashData::Node *>(node)) { }
17047 inline const_iterator(const iterator &o)
17049 inline const Key &key() const { return concrete(i)->key; }
17050 inline const T &value() const { return concrete(i)->value; }
17051 inline const T &operator*() const { return concrete(i)->value; }
17052 inline const T *operator->() const { return &concrete(i)->value; }
17053 inline bool operator==(const const_iterator &o) const { return i == o.i; }
17054 inline bool operator!=(const const_iterator &o) const { return i != o.i; }
17055 inline const_iterator &operator++() {
17056 i = QHashData::nextNode(i);
17059 inline const_iterator operator++(int) {
17060 const_iterator r = *this;
17061 i = QHashData::nextNode(i);
17064 inline const_iterator &operator--() {
17065 i = QHashData::previousNode(i);
17068 inline const_iterator operator--(int) {
17069 const_iterator r = *this;
17070 i = QHashData::previousNode(i);
17073 inline const_iterator operator+(int j) const
17074 { const_iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
17075 inline const_iterator operator-(int j) const { return operator+(-j); }
17076 inline const_iterator &operator+=(int j) { return *this = *this + j; }
17077 inline const_iterator &operator-=(int j) { return *this = *this - j; }
17079 inline operator bool() const { return false; }
17081 friend class const_iterator;
17082 inline iterator begin() { detach(); return iterator(d->firstNode()); }
17083 inline const_iterator begin() const { return const_iterator(d->firstNode()); }
17084 inline const_iterator constBegin() const { return const_iterator(d->firstNode()); }
17085 inline iterator end() { detach(); return iterator(e); }
17086 inline const_iterator end() const { return const_iterator(e); }
17087 inline const_iterator constEnd() const { return const_iterator(e); }
17088 iterator erase(iterator it);
17089 typedef iterator Iterator;
17090 typedef const_iterator ConstIterator;
17091 inline int count() const { return d->size; }
17092 iterator find(const Key &key);
17093 const_iterator find(const Key &key) const;
17094 const_iterator constFind(const Key &key) const;
17095 iterator insert(const Key &key, const T &value);
17096 iterator insertMulti(const Key &key, const T &value);
17097 QHash<Key, T> &unite(const QHash<Key, T> &other);
17098 typedef T mapped_type;
17099 typedef Key key_type;
17100 typedef ptrdiff_t difference_type;
17101 typedef int size_type;
17102 inline bool empty() const { return isEmpty(); }
17104 void detach_helper();
17105 void freeData(QHashData *d);
17106 Node **findNode(const Key &key, uint *hp = 0) const;
17107 Node *createNode(uint h, const Key &key, const T &value, Node **nextNode);
17108 void deleteNode(Node *node);
17109 static void duplicateNode(QHashData::Node *originalNode, void *newNode);
17111 template <class Key, class T>
17112 inline void QHash<Key, T>::deleteNode(Node *node)
17117 template <class Key, class T>
17118 inline void QHash<Key, T>::duplicateNode(QHashData::Node *node, void *newNode)
17120 Node *concreteNode = concrete(node);
17121 if (QTypeInfo<T>::isDummy) {
17122 (void) new (newNode) DummyNode(concreteNode->key);
17124 (void) new (newNode) Node(concreteNode->key, concreteNode->value);
17127 template <class Key, class T>
17128 inline typename QHash<Key, T>::Node *
17129 QHash<Key, T>::createNode(uint ah, const Key &akey, const T &avalue, Node **anextNode)
17132 if (QTypeInfo<T>::isDummy) {
17133 node = reinterpret_cast<Node *>(new (d->allocateNode()) DummyNode(akey));
17135 node = new (d->allocateNode()) Node(akey, avalue);
17138 node->next = *anextNode;
17143 template <class Key, class T>
17144 inline QHash<Key, T> &QHash<Key, T>::unite(const QHash<Key, T> &other)
17146 QHash<Key, T> copy(other);
17147 const_iterator it = copy.constEnd();
17148 while (it != copy.constBegin()) {
17150 insertMulti(it.key(), it.value());
17154 template <class Key, class T>
17155 void QHash<Key, T>::freeData(QHashData *x)
17157 Node *e_for_x = reinterpret_cast<Node *>(x);
17158 Node **bucket = reinterpret_cast<Node **>(x->buckets);
17159 int n = x->numBuckets;
17161 Node *cur = *bucket++;
17162 while (cur != e_for_x) {
17163 Node *next = cur->next;
17168 x->destroyAndFree();
17170 template <class Key, class T>
17171 inline void QHash<Key, T>::clear()
17173 *this = QHash<Key,T>();
17175 template <class Key, class T>
17176 void QHash<Key, T>::detach_helper()
17178 QHashData *x = d->detach_helper(duplicateNode,
17179 QTypeInfo<T>::isDummy ? sizeof(DummyNode) : sizeof(Node));
17180 if (!d->ref.deref())
17184 template <class Key, class T>
17185 inline QHash<Key, T> &QHash<Key, T>::operator=(const QHash<Key, T> &other)
17187 if (d != other.d) {
17188 other.d->ref.ref();
17189 if (!d->ref.deref())
17197 template <class Key, class T>
17198 inline const T QHash<Key, T>::value(const Key &akey) const
17201 if (d->size == 0 || (node = *findNode(akey)) == e) {
17204 return node->value;
17207 template <class Key, class T>
17208 inline const T QHash<Key, T>::value(const Key &akey, const T &adefaultValue) const
17211 if (d->size == 0 || (node = *findNode(akey)) == e) {
17212 return adefaultValue;
17214 return node->value;
17217 template <class Key, class T>
17218 QList<Key> QHash<Key, T>::uniqueKeys() const
17221 const_iterator i = begin();
17224 const Key &aKey = i.key();
17228 goto break_out_of_outer_loop;
17229 } while (aKey == i.key());
17232 break_out_of_outer_loop:
17235 template <class Key, class T>
17236 QList<Key> QHash<Key, T>::keys() const
17239 const_iterator i = begin();
17240 while (i != end()) {
17241 res.append(i.key());
17246 template <class Key, class T>
17247 QList<Key> QHash<Key, T>::keys(const T &avalue) const
17250 const_iterator i = begin();
17251 while (i != end()) {
17252 if (i.value() == avalue)
17253 res.append(i.key());
17258 template <class Key, class T>
17259 const Key QHash<Key, T>::key(const T &avalue) const
17261 return key(avalue, Key());
17263 template <class Key, class T>
17264 const Key QHash<Key, T>::key(const T &avalue, const Key &defaultValue) const
17266 const_iterator i = begin();
17267 while (i != end()) {
17268 if (i.value() == avalue)
17272 return defaultValue;
17274 template <class Key, class T>
17275 QList<T> QHash<Key, T>::values() const
17278 const_iterator i = begin();
17279 while (i != end()) {
17280 res.append(i.value());
17285 template <class Key, class T>
17286 QList<T> QHash<Key, T>::values(const Key &akey) const
17289 Node *node = *findNode(akey);
17292 res.append(node->value);
17293 } while ((node = node->next) != e && node->key == akey);
17297 template <class Key, class T>
17298 int QHash<Key, T>::count(const Key &akey) const
17301 Node *node = *findNode(akey);
17305 } while ((node = node->next) != e && node->key == akey);
17309 template <class Key, class T>
17310 inline const T QHash<Key, T>::operator[](const Key &akey) const
17312 return value(akey);
17314 template <class Key, class T>
17315 inline T &QHash<Key, T>::operator[](const Key &akey)
17319 Node **node = findNode(akey, &h);
17322 node = findNode(akey, &h);
17323 return createNode(h, akey, T(), node)->value;
17325 return (*node)->value;
17327 template <class Key, class T>
17328 inline typename QHash<Key, T>::iterator QHash<Key, T>::insert(const Key &akey,
17333 Node **node = findNode(akey, &h);
17336 node = findNode(akey, &h);
17337 return iterator(createNode(h, akey, avalue, node));
17339 if (!QTypeInfo<T>::isDummy)
17340 (*node)->value = avalue;
17341 return iterator(*node);
17343 template <class Key, class T>
17344 inline typename QHash<Key, T>::iterator QHash<Key, T>::insertMulti(const Key &akey,
17350 Node **nextNode = findNode(akey, &h);
17351 return iterator(createNode(h, akey, avalue, nextNode));
17353 template <class Key, class T>
17354 int QHash<Key, T>::remove(const Key &akey)
17357 int oldSize = d->size;
17358 Node **node = findNode(akey);
17360 bool deleteNext = true;
17362 Node *next = (*node)->next;
17363 deleteNext = (next != e && next->key == (*node)->key);
17367 } while (deleteNext);
17370 return oldSize - d->size;
17372 template <class Key, class T>
17373 T QHash<Key, T>::take(const Key &akey)
17376 Node **node = findNode(akey);
17378 T t = (*node)->value;
17379 Node *next = (*node)->next;
17388 template <class Key, class T>
17389 typename QHash<Key, T>::iterator QHash<Key, T>::erase(iterator it)
17391 if (it == iterator(e))
17396 Node **node_ptr = reinterpret_cast<Node **>(&d->buckets[node->h % d->numBuckets]);
17397 while (*node_ptr != node)
17398 node_ptr = &(*node_ptr)->next;
17399 *node_ptr = node->next;
17404 template <class Key, class T>
17405 inline void QHash<Key, T>::reserve(int asize)
17408 d->rehash(-qMax(asize, 1));
17410 template <class Key, class T>
17411 inline typename QHash<Key, T>::const_iterator QHash<Key, T>::find(const Key &akey) const
17413 return const_iterator(*findNode(akey));
17415 template <class Key, class T>
17416 inline typename QHash<Key, T>::const_iterator QHash<Key, T>::constFind(const Key &akey) const
17418 return const_iterator(*findNode(akey));
17420 template <class Key, class T>
17421 inline typename QHash<Key, T>::iterator QHash<Key, T>::find(const Key &akey)
17424 return iterator(*findNode(akey));
17426 template <class Key, class T>
17427 inline bool QHash<Key, T>::contains(const Key &akey) const
17429 return *findNode(akey) != e;
17431 template <class Key, class T>
17432 typename QHash<Key, T>::Node **QHash<Key, T>::findNode(const Key &akey,
17436 uint h = qHash(akey);
17437 if (d->numBuckets) {
17438 node = reinterpret_cast<Node **>(&d->buckets[h % d->numBuckets]);
17440 while (*node != e && !(*node)->same_key(h, akey))
17441 node = &(*node)->next;
17443 node = const_cast<Node **>(reinterpret_cast<const Node * const *>(&e));
17449 template <class Key, class T>
17450 bool QHash<Key, T>::operator==(const QHash<Key, T> &other) const
17452 if (size() != other.size())
17456 const_iterator it = begin();
17457 while (it != end()) {
17458 const Key &akey = it.key();
17459 const_iterator it2 = other.find(akey);
17461 if (it2 == other.end() || !(it2.key() == akey))
17463 if (!QTypeInfo<T>::isDummy && !(it.value() == it2.value()))
17467 } while (it != end() && it.key() == akey);
17471 template <class Key, class T>
17472 class QMultiHash : public QHash<Key, T>
17476 QMultiHash(const QHash<Key, T> &other) : QHash<Key, T>(other) {}
17477 inline typename QHash<Key, T>::iterator replace(const Key &key, const T &value)
17478 { return QHash<Key, T>::insert(key, value); }
17479 inline typename QHash<Key, T>::iterator insert(const Key &key, const T &value)
17480 { return QHash<Key, T>::insertMulti(key, value); }
17481 inline QMultiHash &operator+=(const QMultiHash &other)
17482 { unite(other); return *this; }
17483 inline QMultiHash operator+(const QMultiHash &other) const
17484 { QMultiHash result = *this; result += other; return result; }
17485 using QHash<Key, T>::contains;
17486 using QHash<Key, T>::remove;
17487 using QHash<Key, T>::count;
17488 using QHash<Key, T>::find;
17489 using QHash<Key, T>::constFind;
17490 bool contains(const Key &key, const T &value) const;
17491 int remove(const Key &key, const T &value);
17492 int count(const Key &key, const T &value) const;
17493 typename QHash<Key, T>::iterator find(const Key &key, const T &value) {
17494 typename QHash<Key, T>::iterator i(find(key));
17495 typename QHash<Key, T>::iterator end(this->end());
17496 while (i != end && i.key() == key) {
17497 if (i.value() == value)
17503 typename QHash<Key, T>::const_iterator find(const Key &key, const T &value) const {
17504 typename QHash<Key, T>::const_iterator i(constFind(key));
17505 typename QHash<Key, T>::const_iterator end(QHash<Key, T>::constEnd());
17506 while (i != end && i.key() == key) {
17507 if (i.value() == value)
17513 typename QHash<Key, T>::const_iterator constFind(const Key &key, const T &value) const
17514 { return find(key, value); }
17516 T &operator[](const Key &key);
17517 const T operator[](const Key &key) const;
17519 template <class Key, class T>
17520 inline bool QMultiHash<Key, T>::contains(const Key &key, const T &value) const
17522 return constFind(key, value) != QHash<Key, T>::constEnd();
17524 template <class Key, class T>
17525 inline int QMultiHash<Key, T>::remove(const Key &key, const T &value)
17528 typename QHash<Key, T>::iterator i(find(key));
17529 typename QHash<Key, T>::iterator end(QHash<Key, T>::end());
17530 while (i != end && i.key() == key) {
17531 if (i.value() == value) {
17540 template <class Key, class T>
17541 inline int QMultiHash<Key, T>::count(const Key &key, const T &value) const
17544 typename QHash<Key, T>::const_iterator i(constFind(key));
17545 typename QHash<Key, T>::const_iterator end(QHash<Key, T>::constEnd());
17546 while (i != end && i.key() == key) {
17547 if (i.value() == value)
17553 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; } };
17554 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; } };
17555 namespace std __attribute__ ((__visibility__ ("default"))) {
17556 enum _Rb_tree_color { _S_red = false, _S_black = true };
17557 struct _Rb_tree_node_base
17559 typedef _Rb_tree_node_base* _Base_ptr;
17560 typedef const _Rb_tree_node_base* _Const_Base_ptr;
17561 _Rb_tree_color _M_color;
17562 _Base_ptr _M_parent;
17564 _Base_ptr _M_right;
17566 _S_minimum(_Base_ptr __x)
17568 while (__x->_M_left != 0) __x = __x->_M_left;
17571 static _Const_Base_ptr
17572 _S_minimum(_Const_Base_ptr __x)
17574 while (__x->_M_left != 0) __x = __x->_M_left;
17578 _S_maximum(_Base_ptr __x)
17580 while (__x->_M_right != 0) __x = __x->_M_right;
17583 static _Const_Base_ptr
17584 _S_maximum(_Const_Base_ptr __x)
17586 while (__x->_M_right != 0) __x = __x->_M_right;
17590 template<typename _Val>
17591 struct _Rb_tree_node : public _Rb_tree_node_base
17593 typedef _Rb_tree_node<_Val>* _Link_type;
17594 _Val _M_value_field;
17596 _Rb_tree_node_base*
17597 _Rb_tree_increment(_Rb_tree_node_base* __x);
17598 const _Rb_tree_node_base*
17599 _Rb_tree_increment(const _Rb_tree_node_base* __x);
17600 _Rb_tree_node_base*
17601 _Rb_tree_decrement(_Rb_tree_node_base* __x);
17602 const _Rb_tree_node_base*
17603 _Rb_tree_decrement(const _Rb_tree_node_base* __x);
17604 template<typename _Tp>
17605 struct _Rb_tree_iterator
17607 typedef _Tp value_type;
17608 typedef _Tp& reference;
17609 typedef _Tp* pointer;
17610 typedef bidirectional_iterator_tag iterator_category;
17611 typedef ptrdiff_t difference_type;
17612 typedef _Rb_tree_iterator<_Tp> _Self;
17613 typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
17614 typedef _Rb_tree_node<_Tp>* _Link_type;
17615 _Rb_tree_iterator()
17618 _Rb_tree_iterator(_Link_type __x)
17622 { return static_cast<_Link_type>(_M_node)->_M_value_field; }
17625 { return &static_cast<_Link_type>(_M_node)->_M_value_field; }
17629 _M_node = _Rb_tree_increment(_M_node);
17635 _Self __tmp = *this;
17636 _M_node = _Rb_tree_increment(_M_node);
17642 _M_node = _Rb_tree_decrement(_M_node);
17648 _Self __tmp = *this;
17649 _M_node = _Rb_tree_decrement(_M_node);
17653 operator==(const _Self& __x) const
17654 { return _M_node == __x._M_node; }
17656 operator!=(const _Self& __x) const
17657 { return _M_node != __x._M_node; }
17660 template<typename _Tp>
17661 struct _Rb_tree_const_iterator
17663 typedef _Tp value_type;
17664 typedef const _Tp& reference;
17665 typedef const _Tp* pointer;
17666 typedef _Rb_tree_iterator<_Tp> iterator;
17667 typedef bidirectional_iterator_tag iterator_category;
17668 typedef ptrdiff_t difference_type;
17669 typedef _Rb_tree_const_iterator<_Tp> _Self;
17670 typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr;
17671 typedef const _Rb_tree_node<_Tp>* _Link_type;
17672 _Rb_tree_const_iterator()
17675 _Rb_tree_const_iterator(_Link_type __x)
17677 _Rb_tree_const_iterator(const iterator& __it)
17678 : _M_node(__it._M_node) { }
17681 { return static_cast<_Link_type>(_M_node)->_M_value_field; }
17684 { return &static_cast<_Link_type>(_M_node)->_M_value_field; }
17688 _M_node = _Rb_tree_increment(_M_node);
17694 _Self __tmp = *this;
17695 _M_node = _Rb_tree_increment(_M_node);
17701 _M_node = _Rb_tree_decrement(_M_node);
17707 _Self __tmp = *this;
17708 _M_node = _Rb_tree_decrement(_M_node);
17712 operator==(const _Self& __x) const
17713 { return _M_node == __x._M_node; }
17715 operator!=(const _Self& __x) const
17716 { return _M_node != __x._M_node; }
17719 template<typename _Val>
17721 operator==(const _Rb_tree_iterator<_Val>& __x,
17722 const _Rb_tree_const_iterator<_Val>& __y)
17723 { return __x._M_node == __y._M_node; }
17724 template<typename _Val>
17726 operator!=(const _Rb_tree_iterator<_Val>& __x,
17727 const _Rb_tree_const_iterator<_Val>& __y)
17728 { return __x._M_node != __y._M_node; }
17730 _Rb_tree_insert_and_rebalance(const bool __insert_left,
17731 _Rb_tree_node_base* __x,
17732 _Rb_tree_node_base* __p,
17733 _Rb_tree_node_base& __header);
17734 _Rb_tree_node_base*
17735 _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
17736 _Rb_tree_node_base& __header);
17737 template<typename _Key, typename _Val, typename _KeyOfValue,
17738 typename _Compare, typename _Alloc = allocator<_Val> >
17741 typedef typename _Alloc::template rebind<_Rb_tree_node<_Val> >::other
17744 typedef _Rb_tree_node_base* _Base_ptr;
17745 typedef const _Rb_tree_node_base* _Const_Base_ptr;
17747 typedef _Key key_type;
17748 typedef _Val value_type;
17749 typedef value_type* pointer;
17750 typedef const value_type* const_pointer;
17751 typedef value_type& reference;
17752 typedef const value_type& const_reference;
17753 typedef _Rb_tree_node<_Val>* _Link_type;
17754 typedef const _Rb_tree_node<_Val>* _Const_Link_type;
17755 typedef size_t size_type;
17756 typedef ptrdiff_t difference_type;
17757 typedef _Alloc allocator_type;
17759 _M_get_Node_allocator()
17760 { return *static_cast<_Node_allocator*>(&this->_M_impl); }
17761 const _Node_allocator&
17762 _M_get_Node_allocator() const
17763 { return *static_cast<const _Node_allocator*>(&this->_M_impl); }
17765 get_allocator() const
17766 { return allocator_type(_M_get_Node_allocator()); }
17770 { return _M_impl._Node_allocator::allocate(1); }
17772 _M_put_node(_Link_type __p)
17773 { _M_impl._Node_allocator::deallocate(__p, 1); }
17775 _M_create_node(const value_type& __x)
17777 _Link_type __tmp = _M_get_node();
17779 { get_allocator().construct(&__tmp->_M_value_field, __x); }
17782 _M_put_node(__tmp);
17788 _M_clone_node(_Const_Link_type __x)
17790 _Link_type __tmp = _M_create_node(__x->_M_value_field);
17791 __tmp->_M_color = __x->_M_color;
17792 __tmp->_M_left = 0;
17793 __tmp->_M_right = 0;
17797 _M_destroy_node(_Link_type __p)
17799 get_allocator().destroy(&__p->_M_value_field);
17803 template<typename _Key_compare,
17804 bool _Is_pod_comparator = __is_pod(_Key_compare)>
17805 struct _Rb_tree_impl : public _Node_allocator
17807 _Key_compare _M_key_compare;
17808 _Rb_tree_node_base _M_header;
17809 size_type _M_node_count;
17811 : _Node_allocator(), _M_key_compare(), _M_header(),
17813 { _M_initialize(); }
17814 _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
17815 : _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
17817 { _M_initialize(); }
17822 this->_M_header._M_color = _S_red;
17823 this->_M_header._M_parent = 0;
17824 this->_M_header._M_left = &this->_M_header;
17825 this->_M_header._M_right = &this->_M_header;
17828 _Rb_tree_impl<_Compare> _M_impl;
17832 { return this->_M_impl._M_header._M_parent; }
17835 { return this->_M_impl._M_header._M_parent; }
17838 { return this->_M_impl._M_header._M_left; }
17840 _M_leftmost() const
17841 { return this->_M_impl._M_header._M_left; }
17844 { return this->_M_impl._M_header._M_right; }
17846 _M_rightmost() const
17847 { return this->_M_impl._M_header._M_right; }
17850 { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); }
17854 return static_cast<_Const_Link_type>
17855 (this->_M_impl._M_header._M_parent);
17859 { return static_cast<_Link_type>(&this->_M_impl._M_header); }
17862 { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }
17863 static const_reference
17864 _S_value(_Const_Link_type __x)
17865 { return __x->_M_value_field; }
17867 _S_key(_Const_Link_type __x)
17868 { return _KeyOfValue()(_S_value(__x)); }
17870 _S_left(_Base_ptr __x)
17871 { return static_cast<_Link_type>(__x->_M_left); }
17872 static _Const_Link_type
17873 _S_left(_Const_Base_ptr __x)
17874 { return static_cast<_Const_Link_type>(__x->_M_left); }
17876 _S_right(_Base_ptr __x)
17877 { return static_cast<_Link_type>(__x->_M_right); }
17878 static _Const_Link_type
17879 _S_right(_Const_Base_ptr __x)
17880 { return static_cast<_Const_Link_type>(__x->_M_right); }
17881 static const_reference
17882 _S_value(_Const_Base_ptr __x)
17883 { return static_cast<_Const_Link_type>(__x)->_M_value_field; }
17885 _S_key(_Const_Base_ptr __x)
17886 { return _KeyOfValue()(_S_value(__x)); }
17888 _S_minimum(_Base_ptr __x)
17889 { return _Rb_tree_node_base::_S_minimum(__x); }
17890 static _Const_Base_ptr
17891 _S_minimum(_Const_Base_ptr __x)
17892 { return _Rb_tree_node_base::_S_minimum(__x); }
17894 _S_maximum(_Base_ptr __x)
17895 { return _Rb_tree_node_base::_S_maximum(__x); }
17896 static _Const_Base_ptr
17897 _S_maximum(_Const_Base_ptr __x)
17898 { return _Rb_tree_node_base::_S_maximum(__x); }
17900 typedef _Rb_tree_iterator<value_type> iterator;
17901 typedef _Rb_tree_const_iterator<value_type> const_iterator;
17902 typedef std::reverse_iterator<iterator> reverse_iterator;
17903 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
17906 _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __y,
17907 const value_type& __v);
17909 _M_insert_lower(_Base_ptr __x, _Base_ptr __y, const value_type& __v);
17911 _M_insert_equal_lower(const value_type& __x);
17913 _M_copy(_Const_Link_type __x, _Link_type __p);
17915 _M_erase(_Link_type __x);
17917 _M_lower_bound(_Link_type __x, _Link_type __y,
17920 _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
17921 const _Key& __k) const;
17923 _M_upper_bound(_Link_type __x, _Link_type __y,
17926 _M_upper_bound(_Const_Link_type __x, _Const_Link_type __y,
17927 const _Key& __k) const;
17930 _Rb_tree(const _Compare& __comp,
17931 const allocator_type& __a = allocator_type())
17932 : _M_impl(__comp, __a) { }
17933 _Rb_tree(const _Rb_tree& __x)
17934 : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator())
17936 if (__x._M_root() != 0)
17938 _M_root() = _M_copy(__x._M_begin(), _M_end());
17939 _M_leftmost() = _S_minimum(_M_root());
17940 _M_rightmost() = _S_maximum(_M_root());
17941 _M_impl._M_node_count = __x._M_impl._M_node_count;
17945 { _M_erase(_M_begin()); }
17947 operator=(const _Rb_tree& __x);
17950 { return _M_impl._M_key_compare; }
17954 return iterator(static_cast<_Link_type>
17955 (this->_M_impl._M_header._M_left));
17960 return const_iterator(static_cast<_Const_Link_type>
17961 (this->_M_impl._M_header._M_left));
17965 { return iterator(static_cast<_Link_type>(&this->_M_impl._M_header)); }
17969 return const_iterator(static_cast<_Const_Link_type>
17970 (&this->_M_impl._M_header));
17974 { return reverse_iterator(end()); }
17975 const_reverse_iterator
17977 { return const_reverse_iterator(end()); }
17980 { return reverse_iterator(begin()); }
17981 const_reverse_iterator
17983 { return const_reverse_iterator(begin()); }
17986 { return _M_impl._M_node_count == 0; }
17989 { return _M_impl._M_node_count; }
17992 { return get_allocator().max_size(); }
17994 swap(_Rb_tree& __t);
17995 pair<iterator, bool>
17996 _M_insert_unique(const value_type& __x);
17998 _M_insert_equal(const value_type& __x);
18000 _M_insert_unique_(const_iterator __position, const value_type& __x);
18002 _M_insert_equal_(const_iterator __position, const value_type& __x);
18003 template<typename _InputIterator>
18005 _M_insert_unique(_InputIterator __first, _InputIterator __last);
18006 template<typename _InputIterator>
18008 _M_insert_equal(_InputIterator __first, _InputIterator __last);
18010 erase(iterator __position);
18012 erase(const_iterator __position);
18014 erase(const key_type& __x);
18016 erase(iterator __first, iterator __last);
18018 erase(const_iterator __first, const_iterator __last);
18020 erase(const key_type* __first, const key_type* __last);
18024 _M_erase(_M_begin());
18025 _M_leftmost() = _M_end();
18027 _M_rightmost() = _M_end();
18028 _M_impl._M_node_count = 0;
18031 find(const key_type& __k);
18033 find(const key_type& __k) const;
18035 count(const key_type& __k) const;
18037 lower_bound(const key_type& __k)
18038 { return _M_lower_bound(_M_begin(), _M_end(), __k); }
18040 lower_bound(const key_type& __k) const
18041 { return _M_lower_bound(_M_begin(), _M_end(), __k); }
18043 upper_bound(const key_type& __k)
18044 { return _M_upper_bound(_M_begin(), _M_end(), __k); }
18046 upper_bound(const key_type& __k) const
18047 { return _M_upper_bound(_M_begin(), _M_end(), __k); }
18048 pair<iterator, iterator>
18049 equal_range(const key_type& __k);
18050 pair<const_iterator, const_iterator>
18051 equal_range(const key_type& __k) const;
18053 __rb_verify() const;
18055 template<typename _Key, typename _Val, typename _KeyOfValue,
18056 typename _Compare, typename _Alloc>
18058 operator==(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
18059 const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
18061 return __x.size() == __y.size()
18062 && std::equal(__x.begin(), __x.end(), __y.begin());
18064 template<typename _Key, typename _Val, typename _KeyOfValue,
18065 typename _Compare, typename _Alloc>
18067 operator<(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
18068 const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
18070 return std::lexicographical_compare(__x.begin(), __x.end(),
18071 __y.begin(), __y.end());
18073 template<typename _Key, typename _Val, typename _KeyOfValue,
18074 typename _Compare, typename _Alloc>
18076 operator!=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
18077 const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
18078 { return !(__x == __y); }
18079 template<typename _Key, typename _Val, typename _KeyOfValue,
18080 typename _Compare, typename _Alloc>
18082 operator>(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
18083 const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
18084 { return __y < __x; }
18085 template<typename _Key, typename _Val, typename _KeyOfValue,
18086 typename _Compare, typename _Alloc>
18088 operator<=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
18089 const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
18090 { return !(__y < __x); }
18091 template<typename _Key, typename _Val, typename _KeyOfValue,
18092 typename _Compare, typename _Alloc>
18094 operator>=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
18095 const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
18096 { return !(__x < __y); }
18097 template<typename _Key, typename _Val, typename _KeyOfValue,
18098 typename _Compare, typename _Alloc>
18100 swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
18101 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
18103 template<typename _Key, typename _Val, typename _KeyOfValue,
18104 typename _Compare, typename _Alloc>
18105 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&
18106 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18107 operator=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x)
18112 _M_impl._M_key_compare = __x._M_impl._M_key_compare;
18113 if (__x._M_root() != 0)
18115 _M_root() = _M_copy(__x._M_begin(), _M_end());
18116 _M_leftmost() = _S_minimum(_M_root());
18117 _M_rightmost() = _S_maximum(_M_root());
18118 _M_impl._M_node_count = __x._M_impl._M_node_count;
18123 template<typename _Key, typename _Val, typename _KeyOfValue,
18124 typename _Compare, typename _Alloc>
18125 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
18126 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18127 _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __p, const _Val& __v)
18129 bool __insert_left = (__x != 0 || __p == _M_end()
18130 || _M_impl._M_key_compare(_KeyOfValue()(__v),
18132 _Link_type __z = _M_create_node(__v);
18133 _Rb_tree_insert_and_rebalance(__insert_left, __z,
18134 const_cast<_Base_ptr>(__p),
18135 this->_M_impl._M_header);
18136 ++_M_impl._M_node_count;
18137 return iterator(__z);
18139 template<typename _Key, typename _Val, typename _KeyOfValue,
18140 typename _Compare, typename _Alloc>
18141 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
18142 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18143 _M_insert_lower(_Base_ptr __x, _Base_ptr __p, const _Val& __v)
18145 bool __insert_left = (__x != 0 || __p == _M_end()
18146 || !_M_impl._M_key_compare(_S_key(__p),
18147 _KeyOfValue()(__v)));
18148 _Link_type __z = _M_create_node(__v);
18149 _Rb_tree_insert_and_rebalance(__insert_left, __z, __p,
18150 this->_M_impl._M_header);
18151 ++_M_impl._M_node_count;
18152 return iterator(__z);
18154 template<typename _Key, typename _Val, typename _KeyOfValue,
18155 typename _Compare, typename _Alloc>
18156 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
18157 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18158 _M_insert_equal_lower(const _Val& __v)
18160 _Link_type __x = _M_begin();
18161 _Link_type __y = _M_end();
18165 __x = !_M_impl._M_key_compare(_S_key(__x), _KeyOfValue()(__v)) ?
18166 _S_left(__x) : _S_right(__x);
18168 return _M_insert_lower(__x, __y, __v);
18170 template<typename _Key, typename _Val, typename _KoV,
18171 typename _Compare, typename _Alloc>
18172 typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type
18173 _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::
18174 _M_copy(_Const_Link_type __x, _Link_type __p)
18176 _Link_type __top = _M_clone_node(__x);
18177 __top->_M_parent = __p;
18181 __top->_M_right = _M_copy(_S_right(__x), __top);
18183 __x = _S_left(__x);
18186 _Link_type __y = _M_clone_node(__x);
18187 __p->_M_left = __y;
18188 __y->_M_parent = __p;
18190 __y->_M_right = _M_copy(_S_right(__x), __y);
18192 __x = _S_left(__x);
18202 template<typename _Key, typename _Val, typename _KeyOfValue,
18203 typename _Compare, typename _Alloc>
18205 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18206 _M_erase(_Link_type __x)
18210 _M_erase(_S_right(__x));
18211 _Link_type __y = _S_left(__x);
18212 _M_destroy_node(__x);
18216 template<typename _Key, typename _Val, typename _KeyOfValue,
18217 typename _Compare, typename _Alloc>
18218 typename _Rb_tree<_Key, _Val, _KeyOfValue,
18219 _Compare, _Alloc>::iterator
18220 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18221 _M_lower_bound(_Link_type __x, _Link_type __y,
18225 if (!_M_impl._M_key_compare(_S_key(__x), __k))
18226 __y = __x, __x = _S_left(__x);
18228 __x = _S_right(__x);
18229 return iterator(__y);
18231 template<typename _Key, typename _Val, typename _KeyOfValue,
18232 typename _Compare, typename _Alloc>
18233 typename _Rb_tree<_Key, _Val, _KeyOfValue,
18234 _Compare, _Alloc>::const_iterator
18235 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18236 _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
18237 const _Key& __k) const
18240 if (!_M_impl._M_key_compare(_S_key(__x), __k))
18241 __y = __x, __x = _S_left(__x);
18243 __x = _S_right(__x);
18244 return const_iterator(__y);
18246 template<typename _Key, typename _Val, typename _KeyOfValue,
18247 typename _Compare, typename _Alloc>
18248 typename _Rb_tree<_Key, _Val, _KeyOfValue,
18249 _Compare, _Alloc>::iterator
18250 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18251 _M_upper_bound(_Link_type __x, _Link_type __y,
18255 if (_M_impl._M_key_compare(__k, _S_key(__x)))
18256 __y = __x, __x = _S_left(__x);
18258 __x = _S_right(__x);
18259 return iterator(__y);
18261 template<typename _Key, typename _Val, typename _KeyOfValue,
18262 typename _Compare, typename _Alloc>
18263 typename _Rb_tree<_Key, _Val, _KeyOfValue,
18264 _Compare, _Alloc>::const_iterator
18265 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18266 _M_upper_bound(_Const_Link_type __x, _Const_Link_type __y,
18267 const _Key& __k) const
18270 if (_M_impl._M_key_compare(__k, _S_key(__x)))
18271 __y = __x, __x = _S_left(__x);
18273 __x = _S_right(__x);
18274 return const_iterator(__y);
18276 template<typename _Key, typename _Val, typename _KeyOfValue,
18277 typename _Compare, typename _Alloc>
18278 pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
18279 _Compare, _Alloc>::iterator,
18280 typename _Rb_tree<_Key, _Val, _KeyOfValue,
18281 _Compare, _Alloc>::iterator>
18282 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18283 equal_range(const _Key& __k)
18285 _Link_type __x = _M_begin();
18286 _Link_type __y = _M_end();
18289 if (_M_impl._M_key_compare(_S_key(__x), __k))
18290 __x = _S_right(__x);
18291 else if (_M_impl._M_key_compare(__k, _S_key(__x)))
18292 __y = __x, __x = _S_left(__x);
18295 _Link_type __xu(__x), __yu(__y);
18296 __y = __x, __x = _S_left(__x);
18297 __xu = _S_right(__xu);
18298 return pair<iterator,
18299 iterator>(_M_lower_bound(__x, __y, __k),
18300 _M_upper_bound(__xu, __yu, __k));
18303 return pair<iterator, iterator>(iterator(__y),
18306 template<typename _Key, typename _Val, typename _KeyOfValue,
18307 typename _Compare, typename _Alloc>
18308 pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
18309 _Compare, _Alloc>::const_iterator,
18310 typename _Rb_tree<_Key, _Val, _KeyOfValue,
18311 _Compare, _Alloc>::const_iterator>
18312 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18313 equal_range(const _Key& __k) const
18315 _Const_Link_type __x = _M_begin();
18316 _Const_Link_type __y = _M_end();
18319 if (_M_impl._M_key_compare(_S_key(__x), __k))
18320 __x = _S_right(__x);
18321 else if (_M_impl._M_key_compare(__k, _S_key(__x)))
18322 __y = __x, __x = _S_left(__x);
18325 _Const_Link_type __xu(__x), __yu(__y);
18326 __y = __x, __x = _S_left(__x);
18327 __xu = _S_right(__xu);
18328 return pair<const_iterator,
18329 const_iterator>(_M_lower_bound(__x, __y, __k),
18330 _M_upper_bound(__xu, __yu, __k));
18333 return pair<const_iterator, const_iterator>(const_iterator(__y),
18334 const_iterator(__y));
18336 template<typename _Key, typename _Val, typename _KeyOfValue,
18337 typename _Compare, typename _Alloc>
18339 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18340 swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t)
18342 if (_M_root() == 0)
18344 if (__t._M_root() != 0)
18346 _M_root() = __t._M_root();
18347 _M_leftmost() = __t._M_leftmost();
18348 _M_rightmost() = __t._M_rightmost();
18349 _M_root()->_M_parent = _M_end();
18351 __t._M_leftmost() = __t._M_end();
18352 __t._M_rightmost() = __t._M_end();
18355 else if (__t._M_root() == 0)
18357 __t._M_root() = _M_root();
18358 __t._M_leftmost() = _M_leftmost();
18359 __t._M_rightmost() = _M_rightmost();
18360 __t._M_root()->_M_parent = __t._M_end();
18362 _M_leftmost() = _M_end();
18363 _M_rightmost() = _M_end();
18367 std::swap(_M_root(),__t._M_root());
18368 std::swap(_M_leftmost(),__t._M_leftmost());
18369 std::swap(_M_rightmost(),__t._M_rightmost());
18370 _M_root()->_M_parent = _M_end();
18371 __t._M_root()->_M_parent = __t._M_end();
18373 std::swap(this->_M_impl._M_node_count, __t._M_impl._M_node_count);
18374 std::swap(this->_M_impl._M_key_compare, __t._M_impl._M_key_compare);
18375 std::__alloc_swap<_Node_allocator>::
18376 _S_do_it(_M_get_Node_allocator(), __t._M_get_Node_allocator());
18378 template<typename _Key, typename _Val, typename _KeyOfValue,
18379 typename _Compare, typename _Alloc>
18380 pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
18381 _Compare, _Alloc>::iterator, bool>
18382 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18383 _M_insert_unique(const _Val& __v)
18385 _Link_type __x = _M_begin();
18386 _Link_type __y = _M_end();
18387 bool __comp = true;
18391 __comp = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x));
18392 __x = __comp ? _S_left(__x) : _S_right(__x);
18394 iterator __j = iterator(__y);
18397 if (__j == begin())
18398 return pair<iterator, bool>(_M_insert_(__x, __y, __v), true);
18402 if (_M_impl._M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v)))
18403 return pair<iterator, bool>(_M_insert_(__x, __y, __v), true);
18404 return pair<iterator, bool>(__j, false);
18406 template<typename _Key, typename _Val, typename _KeyOfValue,
18407 typename _Compare, typename _Alloc>
18408 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
18409 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18410 _M_insert_equal(const _Val& __v)
18412 _Link_type __x = _M_begin();
18413 _Link_type __y = _M_end();
18417 __x = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x)) ?
18418 _S_left(__x) : _S_right(__x);
18420 return _M_insert_(__x, __y, __v);
18422 template<typename _Key, typename _Val, typename _KeyOfValue,
18423 typename _Compare, typename _Alloc>
18424 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
18425 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18426 _M_insert_unique_(const_iterator __position, const _Val& __v)
18428 if (__position._M_node == _M_end())
18431 && _M_impl._M_key_compare(_S_key(_M_rightmost()),
18432 _KeyOfValue()(__v)))
18433 return _M_insert_(0, _M_rightmost(), __v);
18435 return _M_insert_unique(__v).first;
18437 else if (_M_impl._M_key_compare(_KeyOfValue()(__v),
18438 _S_key(__position._M_node)))
18440 const_iterator __before = __position;
18441 if (__position._M_node == _M_leftmost())
18442 return _M_insert_(_M_leftmost(), _M_leftmost(), __v);
18443 else if (_M_impl._M_key_compare(_S_key((--__before)._M_node),
18444 _KeyOfValue()(__v)))
18446 if (_S_right(__before._M_node) == 0)
18447 return _M_insert_(0, __before._M_node, __v);
18449 return _M_insert_(__position._M_node,
18450 __position._M_node, __v);
18453 return _M_insert_unique(__v).first;
18455 else if (_M_impl._M_key_compare(_S_key(__position._M_node),
18456 _KeyOfValue()(__v)))
18458 const_iterator __after = __position;
18459 if (__position._M_node == _M_rightmost())
18460 return _M_insert_(0, _M_rightmost(), __v);
18461 else if (_M_impl._M_key_compare(_KeyOfValue()(__v),
18462 _S_key((++__after)._M_node)))
18464 if (_S_right(__position._M_node) == 0)
18465 return _M_insert_(0, __position._M_node, __v);
18467 return _M_insert_(__after._M_node, __after._M_node, __v);
18470 return _M_insert_unique(__v).first;
18473 return iterator(static_cast<_Link_type>
18474 (const_cast<_Base_ptr>(__position._M_node)));
18476 template<typename _Key, typename _Val, typename _KeyOfValue,
18477 typename _Compare, typename _Alloc>
18478 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
18479 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18480 _M_insert_equal_(const_iterator __position, const _Val& __v)
18482 if (__position._M_node == _M_end())
18485 && !_M_impl._M_key_compare(_KeyOfValue()(__v),
18486 _S_key(_M_rightmost())))
18487 return _M_insert_(0, _M_rightmost(), __v);
18489 return _M_insert_equal(__v);
18491 else if (!_M_impl._M_key_compare(_S_key(__position._M_node),
18492 _KeyOfValue()(__v)))
18494 const_iterator __before = __position;
18495 if (__position._M_node == _M_leftmost())
18496 return _M_insert_(_M_leftmost(), _M_leftmost(), __v);
18497 else if (!_M_impl._M_key_compare(_KeyOfValue()(__v),
18498 _S_key((--__before)._M_node)))
18500 if (_S_right(__before._M_node) == 0)
18501 return _M_insert_(0, __before._M_node, __v);
18503 return _M_insert_(__position._M_node,
18504 __position._M_node, __v);
18507 return _M_insert_equal(__v);
18511 const_iterator __after = __position;
18512 if (__position._M_node == _M_rightmost())
18513 return _M_insert_(0, _M_rightmost(), __v);
18514 else if (!_M_impl._M_key_compare(_S_key((++__after)._M_node),
18515 _KeyOfValue()(__v)))
18517 if (_S_right(__position._M_node) == 0)
18518 return _M_insert_(0, __position._M_node, __v);
18520 return _M_insert_(__after._M_node, __after._M_node, __v);
18523 return _M_insert_equal_lower(__v);
18526 template<typename _Key, typename _Val, typename _KoV,
18527 typename _Cmp, typename _Alloc>
18528 template<class _II>
18530 _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
18531 _M_insert_unique(_II __first, _II __last)
18533 for (; __first != __last; ++__first)
18534 _M_insert_unique_(end(), *__first);
18536 template<typename _Key, typename _Val, typename _KoV,
18537 typename _Cmp, typename _Alloc>
18538 template<class _II>
18540 _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
18541 _M_insert_equal(_II __first, _II __last)
18543 for (; __first != __last; ++__first)
18544 _M_insert_equal_(end(), *__first);
18546 template<typename _Key, typename _Val, typename _KeyOfValue,
18547 typename _Compare, typename _Alloc>
18549 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18550 erase(iterator __position)
18553 static_cast<_Link_type>(_Rb_tree_rebalance_for_erase
18554 (__position._M_node,
18555 this->_M_impl._M_header));
18556 _M_destroy_node(__y);
18557 --_M_impl._M_node_count;
18559 template<typename _Key, typename _Val, typename _KeyOfValue,
18560 typename _Compare, typename _Alloc>
18562 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18563 erase(const_iterator __position)
18566 static_cast<_Link_type>(_Rb_tree_rebalance_for_erase
18567 (const_cast<_Base_ptr>(__position._M_node),
18568 this->_M_impl._M_header));
18569 _M_destroy_node(__y);
18570 --_M_impl._M_node_count;
18572 template<typename _Key, typename _Val, typename _KeyOfValue,
18573 typename _Compare, typename _Alloc>
18574 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
18575 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18576 erase(const _Key& __x)
18578 pair<iterator, iterator> __p = equal_range(__x);
18579 const size_type __old_size = size();
18580 erase(__p.first, __p.second);
18581 return __old_size - size();
18583 template<typename _Key, typename _Val, typename _KeyOfValue,
18584 typename _Compare, typename _Alloc>
18586 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18587 erase(iterator __first, iterator __last)
18589 if (__first == begin() && __last == end())
18592 while (__first != __last)
18595 template<typename _Key, typename _Val, typename _KeyOfValue,
18596 typename _Compare, typename _Alloc>
18598 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18599 erase(const_iterator __first, const_iterator __last)
18601 if (__first == begin() && __last == end())
18604 while (__first != __last)
18607 template<typename _Key, typename _Val, typename _KeyOfValue,
18608 typename _Compare, typename _Alloc>
18610 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18611 erase(const _Key* __first, const _Key* __last)
18613 while (__first != __last)
18616 template<typename _Key, typename _Val, typename _KeyOfValue,
18617 typename _Compare, typename _Alloc>
18618 typename _Rb_tree<_Key, _Val, _KeyOfValue,
18619 _Compare, _Alloc>::iterator
18620 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18621 find(const _Key& __k)
18623 iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
18624 return (__j == end()
18625 || _M_impl._M_key_compare(__k,
18626 _S_key(__j._M_node))) ? end() : __j;
18628 template<typename _Key, typename _Val, typename _KeyOfValue,
18629 typename _Compare, typename _Alloc>
18630 typename _Rb_tree<_Key, _Val, _KeyOfValue,
18631 _Compare, _Alloc>::const_iterator
18632 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18633 find(const _Key& __k) const
18635 const_iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
18636 return (__j == end()
18637 || _M_impl._M_key_compare(__k,
18638 _S_key(__j._M_node))) ? end() : __j;
18640 template<typename _Key, typename _Val, typename _KeyOfValue,
18641 typename _Compare, typename _Alloc>
18642 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
18643 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
18644 count(const _Key& __k) const
18646 pair<const_iterator, const_iterator> __p = equal_range(__k);
18647 const size_type __n = std::distance(__p.first, __p.second);
18651 _Rb_tree_black_count(const _Rb_tree_node_base* __node,
18652 const _Rb_tree_node_base* __root);
18653 template<typename _Key, typename _Val, typename _KeyOfValue,
18654 typename _Compare, typename _Alloc>
18656 _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const
18658 if (_M_impl._M_node_count == 0 || begin() == end())
18659 return _M_impl._M_node_count == 0 && begin() == end()
18660 && this->_M_impl._M_header._M_left == _M_end()
18661 && this->_M_impl._M_header._M_right == _M_end();
18662 unsigned int __len = _Rb_tree_black_count(_M_leftmost(), _M_root());
18663 for (const_iterator __it = begin(); __it != end(); ++__it)
18665 _Const_Link_type __x = static_cast<_Const_Link_type>(__it._M_node);
18666 _Const_Link_type __L = _S_left(__x);
18667 _Const_Link_type __R = _S_right(__x);
18668 if (__x->_M_color == _S_red)
18669 if ((__L && __L->_M_color == _S_red)
18670 || (__R && __R->_M_color == _S_red))
18672 if (__L && _M_impl._M_key_compare(_S_key(__x), _S_key(__L)))
18674 if (__R && _M_impl._M_key_compare(_S_key(__R), _S_key(__x)))
18676 if (!__L && !__R && _Rb_tree_black_count(__x, _M_root()) != __len)
18679 if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root()))
18681 if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root()))
18686 namespace std __attribute__ ((__visibility__ ("default"))) {
18687 template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
18688 typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
18692 typedef _Key key_type;
18693 typedef _Tp mapped_type;
18694 typedef std::pair<const _Key, _Tp> value_type;
18695 typedef _Compare key_compare;
18696 typedef _Alloc allocator_type;
18698 typedef typename _Alloc::value_type _Alloc_value_type;
18700 class value_compare
18701 : public std::binary_function<value_type, value_type, bool>
18703 friend class map<_Key, _Tp, _Compare, _Alloc>;
18706 value_compare(_Compare __c)
18709 bool operator()(const value_type& __x, const value_type& __y) const
18710 { return comp(__x.first, __y.first); }
18713 typedef typename _Alloc::template rebind<value_type>::other
18715 typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
18716 key_compare, _Pair_alloc_type> _Rep_type;
18719 typedef typename _Pair_alloc_type::pointer pointer;
18720 typedef typename _Pair_alloc_type::const_pointer const_pointer;
18721 typedef typename _Pair_alloc_type::reference reference;
18722 typedef typename _Pair_alloc_type::const_reference const_reference;
18723 typedef typename _Rep_type::iterator iterator;
18724 typedef typename _Rep_type::const_iterator const_iterator;
18725 typedef typename _Rep_type::size_type size_type;
18726 typedef typename _Rep_type::difference_type difference_type;
18727 typedef typename _Rep_type::reverse_iterator reverse_iterator;
18728 typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
18732 map(const _Compare& __comp,
18733 const allocator_type& __a = allocator_type())
18734 : _M_t(__comp, __a) { }
18735 map(const map& __x)
18736 : _M_t(__x._M_t) { }
18737 template<typename _InputIterator>
18738 map(_InputIterator __first, _InputIterator __last)
18740 { _M_t._M_insert_unique(__first, __last); }
18741 template<typename _InputIterator>
18742 map(_InputIterator __first, _InputIterator __last,
18743 const _Compare& __comp,
18744 const allocator_type& __a = allocator_type())
18745 : _M_t(__comp, __a)
18746 { _M_t._M_insert_unique(__first, __last); }
18748 operator=(const map& __x)
18754 get_allocator() const
18755 { return _M_t.get_allocator(); }
18758 { return _M_t.begin(); }
18761 { return _M_t.begin(); }
18764 { return _M_t.end(); }
18767 { return _M_t.end(); }
18770 { return _M_t.rbegin(); }
18771 const_reverse_iterator
18773 { return _M_t.rbegin(); }
18776 { return _M_t.rend(); }
18777 const_reverse_iterator
18779 { return _M_t.rend(); }
18782 { return _M_t.empty(); }
18785 { return _M_t.size(); }
18788 { return _M_t.max_size(); }
18790 operator[](const key_type& __k)
18792 iterator __i = lower_bound(__k);
18793 if (__i == end() || key_comp()(__k, (*__i).first))
18794 __i = insert(__i, value_type(__k, mapped_type()));
18795 return (*__i).second;
18798 at(const key_type& __k)
18800 iterator __i = lower_bound(__k);
18801 if (__i == end() || key_comp()(__k, (*__i).first))
18802 __throw_out_of_range(("map::at"));
18803 return (*__i).second;
18806 at(const key_type& __k) const
18808 const_iterator __i = lower_bound(__k);
18809 if (__i == end() || key_comp()(__k, (*__i).first))
18810 __throw_out_of_range(("map::at"));
18811 return (*__i).second;
18813 std::pair<iterator, bool>
18814 insert(const value_type& __x)
18815 { return _M_t._M_insert_unique(__x); }
18817 insert(iterator __position, const value_type& __x)
18818 { return _M_t._M_insert_unique_(__position, __x); }
18819 template<typename _InputIterator>
18821 insert(_InputIterator __first, _InputIterator __last)
18822 { _M_t._M_insert_unique(__first, __last); }
18824 erase(iterator __position)
18825 { _M_t.erase(__position); }
18827 erase(const key_type& __x)
18828 { return _M_t.erase(__x); }
18830 erase(iterator __first, iterator __last)
18831 { _M_t.erase(__first, __last); }
18834 { _M_t.swap(__x._M_t); }
18840 { return _M_t.key_comp(); }
18843 { return value_compare(_M_t.key_comp()); }
18845 find(const key_type& __x)
18846 { return _M_t.find(__x); }
18848 find(const key_type& __x) const
18849 { return _M_t.find(__x); }
18851 count(const key_type& __x) const
18852 { return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
18854 lower_bound(const key_type& __x)
18855 { return _M_t.lower_bound(__x); }
18857 lower_bound(const key_type& __x) const
18858 { return _M_t.lower_bound(__x); }
18860 upper_bound(const key_type& __x)
18861 { return _M_t.upper_bound(__x); }
18863 upper_bound(const key_type& __x) const
18864 { return _M_t.upper_bound(__x); }
18865 std::pair<iterator, iterator>
18866 equal_range(const key_type& __x)
18867 { return _M_t.equal_range(__x); }
18868 std::pair<const_iterator, const_iterator>
18869 equal_range(const key_type& __x) const
18870 { return _M_t.equal_range(__x); }
18871 template<typename _K1, typename _T1, typename _C1, typename _A1>
18873 operator==(const map<_K1, _T1, _C1, _A1>&,
18874 const map<_K1, _T1, _C1, _A1>&);
18875 template<typename _K1, typename _T1, typename _C1, typename _A1>
18877 operator<(const map<_K1, _T1, _C1, _A1>&,
18878 const map<_K1, _T1, _C1, _A1>&);
18880 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
18882 operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
18883 const map<_Key, _Tp, _Compare, _Alloc>& __y)
18884 { return __x._M_t == __y._M_t; }
18885 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
18887 operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
18888 const map<_Key, _Tp, _Compare, _Alloc>& __y)
18889 { return __x._M_t < __y._M_t; }
18890 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
18892 operator!=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
18893 const map<_Key, _Tp, _Compare, _Alloc>& __y)
18894 { return !(__x == __y); }
18895 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
18897 operator>(const map<_Key, _Tp, _Compare, _Alloc>& __x,
18898 const map<_Key, _Tp, _Compare, _Alloc>& __y)
18899 { return __y < __x; }
18900 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
18902 operator<=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
18903 const map<_Key, _Tp, _Compare, _Alloc>& __y)
18904 { return !(__y < __x); }
18905 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
18907 operator>=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
18908 const map<_Key, _Tp, _Compare, _Alloc>& __y)
18909 { return !(__x < __y); }
18910 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
18912 swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
18913 map<_Key, _Tp, _Compare, _Alloc>& __y)
18916 namespace std __attribute__ ((__visibility__ ("default"))) {
18917 template <typename _Key, typename _Tp,
18918 typename _Compare = std::less<_Key>,
18919 typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
18923 typedef _Key key_type;
18924 typedef _Tp mapped_type;
18925 typedef std::pair<const _Key, _Tp> value_type;
18926 typedef _Compare key_compare;
18927 typedef _Alloc allocator_type;
18929 typedef typename _Alloc::value_type _Alloc_value_type;
18931 class value_compare
18932 : public std::binary_function<value_type, value_type, bool>
18934 friend class multimap<_Key, _Tp, _Compare, _Alloc>;
18937 value_compare(_Compare __c)
18940 bool operator()(const value_type& __x, const value_type& __y) const
18941 { return comp(__x.first, __y.first); }
18944 typedef typename _Alloc::template rebind<value_type>::other
18946 typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
18947 key_compare, _Pair_alloc_type> _Rep_type;
18950 typedef typename _Pair_alloc_type::pointer pointer;
18951 typedef typename _Pair_alloc_type::const_pointer const_pointer;
18952 typedef typename _Pair_alloc_type::reference reference;
18953 typedef typename _Pair_alloc_type::const_reference const_reference;
18954 typedef typename _Rep_type::iterator iterator;
18955 typedef typename _Rep_type::const_iterator const_iterator;
18956 typedef typename _Rep_type::size_type size_type;
18957 typedef typename _Rep_type::difference_type difference_type;
18958 typedef typename _Rep_type::reverse_iterator reverse_iterator;
18959 typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
18963 multimap(const _Compare& __comp,
18964 const allocator_type& __a = allocator_type())
18965 : _M_t(__comp, __a) { }
18966 multimap(const multimap& __x)
18967 : _M_t(__x._M_t) { }
18968 template<typename _InputIterator>
18969 multimap(_InputIterator __first, _InputIterator __last)
18971 { _M_t._M_insert_equal(__first, __last); }
18972 template<typename _InputIterator>
18973 multimap(_InputIterator __first, _InputIterator __last,
18974 const _Compare& __comp,
18975 const allocator_type& __a = allocator_type())
18976 : _M_t(__comp, __a)
18977 { _M_t._M_insert_equal(__first, __last); }
18979 operator=(const multimap& __x)
18985 get_allocator() const
18986 { return _M_t.get_allocator(); }
18989 { return _M_t.begin(); }
18992 { return _M_t.begin(); }
18995 { return _M_t.end(); }
18998 { return _M_t.end(); }
19001 { return _M_t.rbegin(); }
19002 const_reverse_iterator
19004 { return _M_t.rbegin(); }
19007 { return _M_t.rend(); }
19008 const_reverse_iterator
19010 { return _M_t.rend(); }
19013 { return _M_t.empty(); }
19016 { return _M_t.size(); }
19019 { return _M_t.max_size(); }
19021 insert(const value_type& __x)
19022 { return _M_t._M_insert_equal(__x); }
19024 insert(iterator __position, const value_type& __x)
19025 { return _M_t._M_insert_equal_(__position, __x); }
19026 template<typename _InputIterator>
19028 insert(_InputIterator __first, _InputIterator __last)
19029 { _M_t._M_insert_equal(__first, __last); }
19031 erase(iterator __position)
19032 { _M_t.erase(__position); }
19034 erase(const key_type& __x)
19035 { return _M_t.erase(__x); }
19037 erase(iterator __first, iterator __last)
19038 { _M_t.erase(__first, __last); }
19040 swap(multimap& __x)
19041 { _M_t.swap(__x._M_t); }
19047 { return _M_t.key_comp(); }
19050 { return value_compare(_M_t.key_comp()); }
19052 find(const key_type& __x)
19053 { return _M_t.find(__x); }
19055 find(const key_type& __x) const
19056 { return _M_t.find(__x); }
19058 count(const key_type& __x) const
19059 { return _M_t.count(__x); }
19061 lower_bound(const key_type& __x)
19062 { return _M_t.lower_bound(__x); }
19064 lower_bound(const key_type& __x) const
19065 { return _M_t.lower_bound(__x); }
19067 upper_bound(const key_type& __x)
19068 { return _M_t.upper_bound(__x); }
19070 upper_bound(const key_type& __x) const
19071 { return _M_t.upper_bound(__x); }
19072 std::pair<iterator, iterator>
19073 equal_range(const key_type& __x)
19074 { return _M_t.equal_range(__x); }
19075 std::pair<const_iterator, const_iterator>
19076 equal_range(const key_type& __x) const
19077 { return _M_t.equal_range(__x); }
19078 template<typename _K1, typename _T1, typename _C1, typename _A1>
19080 operator==(const multimap<_K1, _T1, _C1, _A1>&,
19081 const multimap<_K1, _T1, _C1, _A1>&);
19082 template<typename _K1, typename _T1, typename _C1, typename _A1>
19084 operator<(const multimap<_K1, _T1, _C1, _A1>&,
19085 const multimap<_K1, _T1, _C1, _A1>&);
19087 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
19089 operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
19090 const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
19091 { return __x._M_t == __y._M_t; }
19092 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
19094 operator<(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
19095 const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
19096 { return __x._M_t < __y._M_t; }
19097 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
19099 operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
19100 const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
19101 { return !(__x == __y); }
19102 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
19104 operator>(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
19105 const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
19106 { return __y < __x; }
19107 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
19109 operator<=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
19110 const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
19111 { return !(__y < __x); }
19112 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
19114 operator>=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
19115 const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
19116 { return !(__x < __y); }
19117 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
19119 swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
19120 multimap<_Key, _Tp, _Compare, _Alloc>& __y)
19123 typedef QtValidLicenseForCoreModule QtCoreModule;
19124 struct __attribute__((visibility("default"))) QMapData
19130 enum { LastLevel = 11, Sparseness = 3 };
19131 QMapData *backward;
19132 QMapData *forward[QMapData::LastLevel + 1];
19133 QBasicAtomicInt ref;
19137 uint insertInOrder : 1;
19139 static QMapData *createData();
19140 void continueFreeData(int offset);
19141 Node *node_create(Node *update[], int offset);
19142 void node_delete(Node *update[], int offset, Node *node);
19143 static QMapData shared_null;
19145 template <class Key> inline bool qMapLessThanKey(const Key &key1, const Key &key2)
19147 return key1 < key2;
19149 template <class Ptr> inline bool qMapLessThanKey(Ptr *key1, Ptr *key2)
19152 return quintptr(key1) < quintptr(key2);
19154 template <class Ptr> inline bool qMapLessThanKey(const Ptr *key1, const Ptr *key2)
19157 return quintptr(key1) < quintptr(key2);
19159 template <class Key, class T>
19163 QMapData::Node *backward;
19164 QMapData::Node *forward[1];
19166 template <class Key, class T>
19167 struct QMapPayloadNode
19171 QMapData::Node *backward;
19173 template <class Key, class T>
19176 typedef QMapNode<Key, T> Node;
19177 typedef QMapPayloadNode<Key, T> PayloadNode;
19182 static inline int payload() { return sizeof(PayloadNode) - sizeof(QMapData::Node *); }
19183 static inline Node *concrete(QMapData::Node *node) {
19184 return reinterpret_cast<Node *>(reinterpret_cast<char *>(node) - payload());
19187 inline QMap() : d(&QMapData::shared_null) { d->ref.ref(); }
19188 inline QMap(const QMap<Key, T> &other) : d(other.d)
19189 { d->ref.ref(); if (!d->sharable) detach(); }
19190 inline ~QMap() { if (!d) return; if (!d->ref.deref()) freeData(d); }
19191 QMap<Key, T> &operator=(const QMap<Key, T> &other);
19192 explicit QMap(const typename std::map<Key, T> &other);
19193 std::map<Key, T> toStdMap() const;
19194 bool operator==(const QMap<Key, T> &other) const;
19195 inline bool operator!=(const QMap<Key, T> &other) const { return !(*this == other); }
19196 inline int size() const { return d->size; }
19197 inline bool isEmpty() const { return d->size == 0; }
19198 inline void detach() { if (d->ref != 1) detach_helper(); }
19199 inline bool isDetached() const { return d->ref == 1; }
19200 inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
19201 inline void setInsertInOrder(bool ordered) { d->insertInOrder = ordered; }
19203 int remove(const Key &key);
19204 T take(const Key &key);
19205 bool contains(const Key &key) const;
19206 const Key key(const T &value) const;
19207 const Key key(const T &value, const Key &defaultKey) const;
19208 const T value(const Key &key) const;
19209 const T value(const Key &key, const T &defaultValue) const;
19210 T &operator[](const Key &key);
19211 const T operator[](const Key &key) const;
19212 QList<Key> uniqueKeys() const;
19213 QList<Key> keys() const;
19214 QList<Key> keys(const T &value) const;
19215 QList<T> values() const;
19216 QList<T> values(const Key &key) const;
19217 int count(const Key &key) const;
19218 class const_iterator;
19221 friend class const_iterator;
19224 typedef std::bidirectional_iterator_tag iterator_category;
19225 typedef ptrdiff_t difference_type;
19226 typedef T value_type;
19227 typedef T *pointer;
19228 typedef T &reference;
19229 inline operator QMapData::Node *() const { return i; }
19230 inline iterator() : i(0) { }
19231 inline iterator(QMapData::Node *node) : i(node) { }
19232 inline const Key &key() const { return concrete(i)->key; }
19233 inline T &value() const { return concrete(i)->value; }
19234 inline T &operator*() const { return concrete(i)->value; }
19235 inline T *operator->() const { return &concrete(i)->value; }
19236 inline bool operator==(const iterator &o) const { return i == o.i; }
19237 inline bool operator!=(const iterator &o) const { return i != o.i; }
19238 inline iterator &operator++() {
19242 inline iterator operator++(int) {
19243 iterator r = *this;
19247 inline iterator &operator--() {
19251 inline iterator operator--(int) {
19252 iterator r = *this;
19256 inline iterator operator+(int j) const
19257 { iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
19258 inline iterator operator-(int j) const { return operator+(-j); }
19259 inline iterator &operator+=(int j) { return *this = *this + j; }
19260 inline iterator &operator-=(int j) { return *this = *this - j; }
19262 inline bool operator==(const const_iterator &o) const
19263 { return i == o.i; }
19264 inline bool operator!=(const const_iterator &o) const
19265 { return i != o.i; }
19267 inline operator bool() const { return false; }
19269 friend class iterator;
19270 class const_iterator
19272 friend class iterator;
19275 typedef std::bidirectional_iterator_tag iterator_category;
19276 typedef ptrdiff_t difference_type;
19277 typedef T value_type;
19278 typedef const T *pointer;
19279 typedef const T &reference;
19280 inline operator QMapData::Node *() const { return i; }
19281 inline const_iterator() : i(0) { }
19282 inline const_iterator(QMapData::Node *node) : i(node) { }
19283 inline const_iterator(const iterator &o)
19285 inline const Key &key() const { return concrete(i)->key; }
19286 inline const T &value() const { return concrete(i)->value; }
19287 inline const T &operator*() const { return concrete(i)->value; }
19288 inline const T *operator->() const { return &concrete(i)->value; }
19289 inline bool operator==(const const_iterator &o) const { return i == o.i; }
19290 inline bool operator!=(const const_iterator &o) const { return i != o.i; }
19291 inline const_iterator &operator++() {
19295 inline const_iterator operator++(int) {
19296 const_iterator r = *this;
19300 inline const_iterator &operator--() {
19304 inline const_iterator operator--(int) {
19305 const_iterator r = *this;
19309 inline const_iterator operator+(int j) const
19310 { const_iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
19311 inline const_iterator operator-(int j) const { return operator+(-j); }
19312 inline const_iterator &operator+=(int j) { return *this = *this + j; }
19313 inline const_iterator &operator-=(int j) { return *this = *this - j; }
19315 inline operator bool() const { return false; }
19317 friend class const_iterator;
19318 inline iterator begin() { detach(); return iterator(e->forward[0]); }
19319 inline const_iterator begin() const { return const_iterator(e->forward[0]); }
19320 inline const_iterator constBegin() const { return const_iterator(e->forward[0]); }
19321 inline iterator end() {
19323 return iterator(e);
19325 inline const_iterator end() const { return const_iterator(e); }
19326 inline const_iterator constEnd() const { return const_iterator(e); }
19327 iterator erase(iterator it);
19328 typedef iterator Iterator;
19329 typedef const_iterator ConstIterator;
19330 inline int count() const { return d->size; }
19331 iterator find(const Key &key);
19332 const_iterator find(const Key &key) const;
19333 const_iterator constFind(const Key &key) const;
19334 iterator lowerBound(const Key &key);
19335 const_iterator lowerBound(const Key &key) const;
19336 iterator upperBound(const Key &key);
19337 const_iterator upperBound(const Key &key) const;
19338 iterator insert(const Key &key, const T &value);
19339 iterator insertMulti(const Key &key, const T &value);
19340 QMap<Key, T> &unite(const QMap<Key, T> &other);
19341 typedef Key key_type;
19342 typedef T mapped_type;
19343 typedef ptrdiff_t difference_type;
19344 typedef int size_type;
19345 inline bool empty() const { return isEmpty(); }
19347 void detach_helper();
19348 void freeData(QMapData *d);
19349 QMapData::Node *findNode(const Key &key) const;
19350 QMapData::Node *mutableFindNode(QMapData::Node *update[], const Key &key) const;
19351 QMapData::Node *node_create(QMapData *d, QMapData::Node *update[], const Key &key,
19354 template <class Key, class T>
19355 inline QMap<Key, T> &QMap<Key, T>::operator=(const QMap<Key, T> &other)
19357 if (d != other.d) {
19358 other.d->ref.ref();
19359 if (!d->ref.deref())
19367 template <class Key, class T>
19368 inline void QMap<Key, T>::clear()
19370 *this = QMap<Key, T>();
19372 template <class Key, class T>
19373 inline typename QMapData::Node *
19374 QMap<Key, T>::node_create(QMapData *adt, QMapData::Node *aupdate[], const Key &akey, const T &avalue)
19376 QMapData::Node *abstractNode = adt->node_create(aupdate, payload());
19377 Node *concreteNode = concrete(abstractNode);
19378 new (&concreteNode->key) Key(akey);
19379 new (&concreteNode->value) T(avalue);
19380 return abstractNode;
19382 template <class Key, class T>
19383 inline QMapData::Node *QMap<Key, T>::findNode(const Key &akey) const
19385 QMapData::Node *cur = e;
19386 QMapData::Node *next = e;
19387 for (int i = d->topLevel; i >= 0; i--) {
19388 while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, akey))
19391 if (next != e && !qMapLessThanKey<Key>(akey, concrete(next)->key)) {
19397 template <class Key, class T>
19398 inline const T QMap<Key, T>::value(const Key &akey) const
19400 QMapData::Node *node;
19401 if (d->size == 0 || (node = findNode(akey)) == e) {
19404 return concrete(node)->value;
19407 template <class Key, class T>
19408 inline const T QMap<Key, T>::value(const Key &akey, const T &adefaultValue) const
19410 QMapData::Node *node;
19411 if (d->size == 0 || (node = findNode(akey)) == e) {
19412 return adefaultValue;
19414 return concrete(node)->value;
19417 template <class Key, class T>
19418 inline const T QMap<Key, T>::operator[](const Key &akey) const
19420 return value(akey);
19422 template <class Key, class T>
19423 inline T &QMap<Key, T>::operator[](const Key &akey)
19426 QMapData::Node *update[QMapData::LastLevel + 1];
19427 QMapData::Node *node = mutableFindNode(update, akey);
19429 node = node_create(d, update, akey, T());
19430 return concrete(node)->value;
19432 template <class Key, class T>
19433 inline int QMap<Key, T>::count(const Key &akey) const
19436 QMapData::Node *node = findNode(akey);
19440 node = node->forward[0];
19441 } while (node != e && !qMapLessThanKey<Key>(akey, concrete(node)->key));
19445 template <class Key, class T>
19446 inline bool QMap<Key, T>::contains(const Key &akey) const
19448 return findNode(akey) != e;
19450 template <class Key, class T>
19451 inline typename QMap<Key, T>::iterator QMap<Key, T>::insert(const Key &akey,
19455 QMapData::Node *update[QMapData::LastLevel + 1];
19456 QMapData::Node *node = mutableFindNode(update, akey);
19458 node = node_create(d, update, akey, avalue);
19460 concrete(node)->value = avalue;
19462 return iterator(node);
19464 template <class Key, class T>
19465 inline typename QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const Key &akey,
19469 QMapData::Node *update[QMapData::LastLevel + 1];
19470 mutableFindNode(update, akey);
19471 return iterator(node_create(d, update, akey, avalue));
19473 template <class Key, class T>
19474 inline typename QMap<Key, T>::const_iterator QMap<Key, T>::find(const Key &akey) const
19476 return const_iterator(findNode(akey));
19478 template <class Key, class T>
19479 inline typename QMap<Key, T>::const_iterator QMap<Key, T>::constFind(const Key &akey) const
19481 return const_iterator(findNode(akey));
19483 template <class Key, class T>
19484 inline typename QMap<Key, T>::iterator QMap<Key, T>::find(const Key &akey)
19487 return iterator(findNode(akey));
19489 template <class Key, class T>
19490 inline QMap<Key, T> &QMap<Key, T>::unite(const QMap<Key, T> &other)
19492 QMap<Key, T> copy(other);
19493 const_iterator it = copy.constEnd();
19494 const const_iterator b = copy.constBegin();
19497 insertMulti(it.key(), it.value());
19501 template <class Key, class T>
19502 void QMap<Key, T>::freeData(QMapData *x)
19504 if (QTypeInfo<Key>::isComplex || QTypeInfo<T>::isComplex) {
19505 QMapData::Node *y = reinterpret_cast<QMapData::Node *>(x);
19506 QMapData::Node *cur = y;
19507 QMapData::Node *next = cur->forward[0];
19508 while (next != y) {
19510 next = cur->forward[0];
19511 Node *concreteNode = concrete(cur);
19512 concreteNode->key.~Key();
19513 concreteNode->value.~T();
19516 x->continueFreeData(payload());
19518 template <class Key, class T>
19519 int QMap<Key, T>::remove(const Key &akey)
19522 QMapData::Node *update[QMapData::LastLevel + 1];
19523 QMapData::Node *cur = e;
19524 QMapData::Node *next = e;
19525 int oldSize = d->size;
19526 for (int i = d->topLevel; i >= 0; i--) {
19527 while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, akey))
19531 if (next != e && !qMapLessThanKey<Key>(akey, concrete(next)->key)) {
19532 bool deleteNext = true;
19535 next = cur->forward[0];
19536 deleteNext = (next != e && !qMapLessThanKey<Key>(concrete(cur)->key, concrete(next)->key));
19537 concrete(cur)->key.~Key();
19538 concrete(cur)->value.~T();
19539 d->node_delete(update, payload(), cur);
19540 } while (deleteNext);
19542 return oldSize - d->size;
19544 template <class Key, class T>
19545 T QMap<Key, T>::take(const Key &akey)
19548 QMapData::Node *update[QMapData::LastLevel + 1];
19549 QMapData::Node *cur = e;
19550 QMapData::Node *next = e;
19551 for (int i = d->topLevel; i >= 0; i--) {
19552 while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, akey))
19556 if (next != e && !qMapLessThanKey<Key>(akey, concrete(next)->key)) {
19557 T t = concrete(next)->value;
19558 concrete(next)->key.~Key();
19559 concrete(next)->value.~T();
19560 d->node_delete(update, payload(), next);
19565 template <class Key, class T>
19566 typename QMap<Key, T>::iterator QMap<Key, T>::erase(iterator it)
19568 QMapData::Node *update[QMapData::LastLevel + 1];
19569 QMapData::Node *cur = e;
19570 QMapData::Node *next = e;
19571 if (it == iterator(e))
19573 for (int i = d->topLevel; i >= 0; i--) {
19574 while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, it.key()))
19578 while (next != e) {
19580 next = cur->forward[0];
19582 concrete(cur)->key.~Key();
19583 concrete(cur)->value.~T();
19584 d->node_delete(update, payload(), cur);
19585 return iterator(next);
19587 for (int i = 0; i <= d->topLevel; ++i) {
19588 if (update[i]->forward[i] != cur)
19595 template <class Key, class T>
19596 void QMap<Key, T>::detach_helper()
19598 union { QMapData *d; QMapData::Node *e; } x;
19599 x.d = QMapData::createData();
19601 x.d->insertInOrder = true;
19602 QMapData::Node *update[QMapData::LastLevel + 1];
19603 QMapData::Node *cur = e->forward[0];
19606 Node *concreteNode = concrete(cur);
19607 node_create(x.d, update, concreteNode->key, concreteNode->value);
19608 cur = cur->forward[0];
19610 x.d->insertInOrder = false;
19612 if (!d->ref.deref())
19616 template <class Key, class T>
19617 QMapData::Node *QMap<Key, T>::mutableFindNode(QMapData::Node *aupdate[],
19618 const Key &akey) const
19620 QMapData::Node *cur = e;
19621 QMapData::Node *next = e;
19622 for (int i = d->topLevel; i >= 0; i--) {
19623 while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, akey))
19627 if (next != e && !qMapLessThanKey<Key>(akey, concrete(next)->key)) {
19633 template <class Key, class T>
19634 QList<Key> QMap<Key, T>::uniqueKeys() const
19637 const_iterator i = begin();
19640 const Key &aKey = i.key();
19644 goto break_out_of_outer_loop;
19645 } while (!(aKey < i.key()));
19648 break_out_of_outer_loop:
19651 template <class Key, class T>
19652 QList<Key> QMap<Key, T>::keys() const
19655 const_iterator i = begin();
19656 while (i != end()) {
19657 res.append(i.key());
19662 template <class Key, class T>
19663 QList<Key> QMap<Key, T>::keys(const T &avalue) const
19666 const_iterator i = begin();
19667 while (i != end()) {
19668 if (i.value() == avalue)
19669 res.append(i.key());
19674 template <class Key, class T>
19675 const Key QMap<Key, T>::key(const T &avalue) const
19677 return key(avalue, Key());
19679 template <class Key, class T>
19680 const Key QMap<Key, T>::key(const T &avalue, const Key &defaultKey) const
19682 const_iterator i = begin();
19683 while (i != end()) {
19684 if (i.value() == avalue)
19690 template <class Key, class T>
19691 QList<T> QMap<Key, T>::values() const
19694 const_iterator i = begin();
19695 while (i != end()) {
19696 res.append(i.value());
19701 template <class Key, class T>
19702 QList<T> QMap<Key, T>::values(const Key &akey) const
19705 QMapData::Node *node = findNode(akey);
19708 res.append(concrete(node)->value);
19709 node = node->forward[0];
19710 } while (node != e && !qMapLessThanKey<Key>(akey, concrete(node)->key));
19714 template <class Key, class T>
19715 inline typename QMap<Key, T>::const_iterator
19716 QMap<Key, T>::lowerBound(const Key &akey) const
19718 QMapData::Node *update[QMapData::LastLevel + 1];
19719 mutableFindNode(update, akey);
19720 return const_iterator(update[0]->forward[0]);
19722 template <class Key, class T>
19723 inline typename QMap<Key, T>::iterator QMap<Key, T>::lowerBound(const Key &akey)
19726 return static_cast<QMapData::Node *>(const_cast<const QMap *>(this)->lowerBound(akey));
19728 template <class Key, class T>
19729 inline typename QMap<Key, T>::const_iterator
19730 QMap<Key, T>::upperBound(const Key &akey) const
19732 QMapData::Node *update[QMapData::LastLevel + 1];
19733 mutableFindNode(update, akey);
19734 QMapData::Node *node = update[0]->forward[0];
19735 while (node != e && !qMapLessThanKey<Key>(akey, concrete(node)->key))
19736 node = node->forward[0];
19737 return const_iterator(node);
19739 template <class Key, class T>
19740 inline typename QMap<Key, T>::iterator QMap<Key, T>::upperBound(const Key &akey)
19743 return static_cast<QMapData::Node *>(const_cast<const QMap *>(this)->upperBound(akey));
19745 template <class Key, class T>
19746 bool QMap<Key, T>::operator==(const QMap<Key, T> &other) const
19748 if (size() != other.size())
19752 const_iterator it1 = begin();
19753 const_iterator it2 = other.begin();
19754 while (it1 != end()) {
19755 if (!(it1.value() == it2.value()) || qMapLessThanKey(it1.key(), it2.key()) || qMapLessThanKey(it2.key(), it1.key()))
19762 template <class Key, class T>
19763 QMap<Key, T>::QMap(const std::map<Key, T> &other)
19765 d = QMapData::createData();
19766 d->insertInOrder = true;
19767 typename std::map<Key,T>::const_iterator it = other.end();
19768 while (it != other.begin()) {
19770 insert((*it).first, (*it).second);
19772 d->insertInOrder = false;
19774 template <class Key, class T>
19775 std::map<Key, T> QMap<Key, T>::toStdMap() const
19777 std::map<Key, T> map;
19778 const_iterator it = end();
19779 while (it != begin()) {
19781 map.insert(std::pair<Key, T>(it.key(), it.value()));
19785 template <class Key, class T>
19786 class QMultiMap : public QMap<Key, T>
19790 QMultiMap(const QMap<Key, T> &other) : QMap<Key, T>(other) {}
19791 inline typename QMap<Key, T>::iterator replace(const Key &key, const T &value)
19792 { return QMap<Key, T>::insert(key, value); }
19793 inline typename QMap<Key, T>::iterator insert(const Key &key, const T &value)
19794 { return QMap<Key, T>::insertMulti(key, value); }
19795 inline QMultiMap &operator+=(const QMultiMap &other)
19796 { unite(other); return *this; }
19797 inline QMultiMap operator+(const QMultiMap &other) const
19798 { QMultiMap result = *this; result += other; return result; }
19799 using QMap<Key, T>::contains;
19800 using QMap<Key, T>::remove;
19801 using QMap<Key, T>::count;
19802 using QMap<Key, T>::find;
19803 using QMap<Key, T>::constFind;
19804 bool contains(const Key &key, const T &value) const;
19805 int remove(const Key &key, const T &value);
19806 int count(const Key &key, const T &value) const;
19807 typename QMap<Key, T>::iterator find(const Key &key, const T &value) {
19808 typename QMap<Key, T>::iterator i(find(key));
19809 typename QMap<Key, T>::iterator end(this->end());
19810 while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
19811 if (i.value() == value)
19817 typename QMap<Key, T>::const_iterator find(const Key &key, const T &value) const {
19818 typename QMap<Key, T>::const_iterator i(constFind(key));
19819 typename QMap<Key, T>::const_iterator end(QMap<Key, T>::constEnd());
19820 while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
19821 if (i.value() == value)
19827 typename QMap<Key, T>::const_iterator constFind(const Key &key, const T &value) const
19828 { return find(key, value); }
19830 T &operator[](const Key &key);
19831 const T operator[](const Key &key) const;
19833 template <class Key, class T>
19834 inline bool QMultiMap<Key, T>::contains(const Key &key, const T &value) const
19836 return constFind(key, value) != QMap<Key, T>::constEnd();
19838 template <class Key, class T>
19839 inline int QMultiMap<Key, T>::remove(const Key &key, const T &value)
19842 typename QMap<Key, T>::iterator i(find(key));
19843 typename QMap<Key, T>::const_iterator end(QMap<Key, T>::constEnd());
19844 while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
19845 if (i.value() == value) {
19854 template <class Key, class T>
19855 inline int QMultiMap<Key, T>::count(const Key &key, const T &value) const
19858 typename QMap<Key, T>::const_iterator i(constFind(key));
19859 typename QMap<Key, T>::const_iterator end(QMap<Key, T>::constEnd());
19860 while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
19861 if (i.value() == value)
19867 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; } };
19868 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; } };
19869 typedef QtValidLicenseForCoreModule QtCoreModule;
19876 class QTextStreamPrivate;
19878 class __attribute__((visibility("default"))) QSystemLocale
19882 virtual ~QSystemLocale();
19902 DateTimeFormatLong,
19903 DateTimeFormatShort,
19904 DateTimeToStringLong,
19905 DateTimeToStringShort,
19911 virtual QVariant query(QueryType type, QVariant in) const;
19912 virtual QLocale fallbackLocale() const;
19914 struct QLocalePrivate;
19915 class __attribute__((visibility("default"))) QLocale
19917 public: static const QMetaObject staticMetaObject; private:
19918 friend class QString;
19919 friend class QByteArray;
19920 friend class QIntValidator;
19921 friend class QDoubleValidator;
19922 friend class QTextStream;
19923 friend class QTextStreamPrivate;
20008 NauruLanguage = 83,
20011 NorwegianBokmal = Norwegian,
20020 RhaetoRomance = 94,
20027 SerboCroatian = 101,
20049 TongaLanguage = 123,
20067 NorwegianNynorsk = 141,
20068 Nynorsk = NorwegianNynorsk,
20093 LastLanguage = Chewa
20105 AntiguaAndBarbuda = 9,
20123 BosniaAndHerzegowina = 27,
20127 BritishIndianOceanTerritory = 31,
20128 BruneiDarussalam = 32,
20136 CaymanIslands = 40,
20137 CentralAfricanRepublic = 41,
20141 ChristmasIsland = 45,
20145 DemocraticRepublicOfCongo = 49,
20146 PeoplesRepublicOfCongo = 50,
20153 CzechRepublic = 57,
20157 DominicanRepublic = 61,
20162 EquatorialGuinea = 66,
20166 FalklandIslands = 70,
20171 MetropolitanFrance = 75,
20173 FrenchPolynesia = 77,
20174 FrenchSouthernTerritories = 78,
20191 HeardAndMcDonaldIslands = 95,
20209 DemocraticRepublicOfKorea = 113,
20210 RepublicOfKorea = 114,
20218 LibyanArabJamahiriya = 122,
20219 Liechtenstein = 123,
20230 MarshallIslands = 134,
20245 NauruCountry = 149,
20248 NetherlandsAntilles = 152,
20249 NewCaledonia = 153,
20255 NorfolkIsland = 159,
20256 NorthernMarianaIslands = 160,
20261 PalestinianTerritory = 165,
20263 PapuaNewGuinea = 167,
20274 RussianFederation = 178,
20276 SaintKittsAndNevis = 180,
20278 StVincentAndTheGrenadines = 182,
20281 SaoTomeAndPrincipe = 185,
20289 SolomonIslands = 193,
20292 SouthGeorgiaAndTheSouthSandwichIslands = 196,
20296 StPierreAndMiquelon = 200,
20299 SvalbardAndJanMayenIslands = 203,
20303 SyrianArabRepublic = 207,
20310 TongaCountry = 214,
20311 TrinidadAndTobago = 215,
20314 Turkmenistan = 218,
20315 TurksAndCaicosIslands = 219,
20319 UnitedArabEmirates = 223,
20320 UnitedKingdom = 224,
20321 UnitedStates = 225,
20322 UnitedStatesMinorOutlyingIslands = 226,
20326 VaticanCityState = 230,
20329 BritishVirginIslands = 233,
20330 USVirginIslands = 234,
20331 WallisAndFutunaIslands = 235,
20332 WesternSahara = 236,
20337 SerbiaAndMontenegro = 241,
20338 LastCountry = SerbiaAndMontenegro
20340 enum MeasurementSystem { MetricSystem, ImperialSystem };
20341 enum FormatType { LongFormat, ShortFormat, NarrowFormat };
20342 enum NumberOption {
20343 OmitGroupSeparator = 0x01,
20344 RejectGroupSeparator = 0x02
20346 typedef QFlags<NumberOption> NumberOptions;
20348 QLocale(const QString &name);
20349 QLocale(Language language, Country country = AnyCountry);
20350 QLocale(const QLocale &other);
20351 QLocale &operator=(const QLocale &other);
20352 Language language() const;
20353 Country country() const;
20354 QString name() const;
20355 short toShort(const QString &s, bool *ok = 0, int base = 0) const;
20356 ushort toUShort(const QString &s, bool *ok = 0, int base = 0) const;
20357 int toInt(const QString &s, bool *ok = 0, int base = 0) const;
20358 uint toUInt(const QString &s, bool *ok = 0, int base = 0) const;
20359 qlonglong toLongLong(const QString &s, bool *ok = 0, int base = 0) const;
20360 qlonglong toULongLong(const QString &s, bool *ok = 0, int base = 0) const;
20361 float toFloat(const QString &s, bool *ok = 0) const;
20362 double toDouble(const QString &s, bool *ok = 0) const;
20363 QString toString(qlonglong i) const;
20364 QString toString(qulonglong i) const;
20365 inline QString toString(short i) const;
20366 inline QString toString(ushort i) const;
20367 inline QString toString(int i) const;
20368 inline QString toString(uint i) const;
20369 QString toString(double i, char f = 'g', int prec = 6) const;
20370 inline QString toString(float i, char f = 'g', int prec = 6) const;
20371 QString toString(const QDate &date, const QString &formatStr) const;
20372 QString toString(const QDate &date, FormatType format = LongFormat) const;
20373 QString toString(const QTime &time, const QString &formatStr) const;
20374 QString toString(const QTime &time, FormatType format = LongFormat) const;
20375 QString toString(const QDateTime &dateTime, FormatType format = LongFormat) const;
20376 QString toString(const QDateTime &dateTime, const QString &format) const;
20377 QString dateFormat(FormatType format = LongFormat) const;
20378 QString timeFormat(FormatType format = LongFormat) const;
20379 QString dateTimeFormat(FormatType format = LongFormat) const;
20380 QDate toDate(const QString &string, FormatType = LongFormat) const;
20381 QTime toTime(const QString &string, FormatType = LongFormat) const;
20382 QDateTime toDateTime(const QString &string, FormatType format = LongFormat) const;
20383 QDate toDate(const QString &string, const QString &format) const;
20384 QTime toTime(const QString &string, const QString &format) const;
20385 QDateTime toDateTime(const QString &string, const QString &format) const;
20386 QChar decimalPoint() const;
20387 QChar groupSeparator() const;
20388 QChar percent() const;
20389 QChar zeroDigit() const;
20390 QChar negativeSign() const;
20391 QChar positiveSign() const;
20392 QChar exponential() const;
20393 QString monthName(int, FormatType format = LongFormat) const;
20394 QString standaloneMonthName(int, FormatType format = LongFormat) const;
20395 QString dayName(int, FormatType format = LongFormat) const;
20396 QString standaloneDayName(int, FormatType format = LongFormat) const;
20397 QString amText() const;
20398 QString pmText() const;
20399 MeasurementSystem measurementSystem() const;
20400 inline bool operator==(const QLocale &other) const;
20401 inline bool operator!=(const QLocale &other) const;
20402 static QString languageToString(Language language);
20403 static QString countryToString(Country country);
20404 static void setDefault(const QLocale &locale);
20405 static QLocale c() { return QLocale(C); }
20406 static QLocale system();
20407 static QList<Country> countriesForLanguage(Language lang);
20408 void setNumberOptions(NumberOptions options);
20409 NumberOptions numberOptions() const;
20412 quint16 numberOptions;
20416 friend struct QLocalePrivate;
20421 const QLocalePrivate *d() const;
20423 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"; } };
20424 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); }
20425 inline QString QLocale::toString(short i) const
20426 { return toString(qlonglong(i)); }
20427 inline QString QLocale::toString(ushort i) const
20428 { return toString(qulonglong(i)); }
20429 inline QString QLocale::toString(int i) const
20430 { return toString(qlonglong(i)); }
20431 inline QString QLocale::toString(uint i) const
20432 { return toString(qulonglong(i)); }
20433 inline QString QLocale::toString(float i, char f, int prec) const
20434 { return toString(double(i), f, prec); }
20435 inline bool QLocale::operator==(const QLocale &other) const
20436 { return d() == other.d() && numberOptions() == other.numberOptions(); }
20437 inline bool QLocale::operator!=(const QLocale &other) const
20438 { return d() != other.d() || numberOptions() != other.numberOptions(); }
20439 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QLocale &);
20440 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QLocale &);
20441 typedef QtValidLicenseForCoreModule QtCoreModule;
20443 class QTextDecoder;
20444 class QTextStreamPrivate;
20445 class __attribute__((visibility("default"))) QTextStream
20447 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;
20449 enum RealNumberNotation {
20454 enum FieldAlignment {
20458 AlignAccountingStyle
20469 UppercaseBase = 0x8,
20470 UppercaseDigits = 0x10
20472 typedef QFlags<NumberFlag> NumberFlags;
20474 explicit QTextStream(QIODevice *device);
20475 explicit QTextStream(FILE *fileHandle, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
20476 explicit QTextStream(QString *string, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
20477 explicit QTextStream(QByteArray *array, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
20478 explicit QTextStream(const QByteArray &array, QIODevice::OpenMode openMode = QIODevice::ReadOnly);
20479 virtual ~QTextStream();
20480 void setCodec(QTextCodec *codec);
20481 void setCodec(const char *codecName);
20482 QTextCodec *codec() const;
20483 void setAutoDetectUnicode(bool enabled);
20484 bool autoDetectUnicode() const;
20485 void setGenerateByteOrderMark(bool generate);
20486 bool generateByteOrderMark() const;
20487 void setLocale(const QLocale &locale);
20488 QLocale locale() const;
20489 void setDevice(QIODevice *device);
20490 QIODevice *device() const;
20491 void setString(QString *string, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
20492 QString *string() const;
20493 Status status() const;
20494 void setStatus(Status status);
20495 void resetStatus();
20496 bool atEnd() const;
20499 bool seek(qint64 pos);
20500 qint64 pos() const;
20501 void skipWhiteSpace();
20502 QString readLine(qint64 maxlen = 0);
20504 QString read(qint64 maxlen);
20505 void setFieldAlignment(FieldAlignment alignment);
20506 FieldAlignment fieldAlignment() const;
20507 void setPadChar(QChar ch);
20508 QChar padChar() const;
20509 void setFieldWidth(int width);
20510 int fieldWidth() const;
20511 void setNumberFlags(NumberFlags flags);
20512 NumberFlags numberFlags() const;
20513 void setIntegerBase(int base);
20514 int integerBase() const;
20515 void setRealNumberNotation(RealNumberNotation notation);
20516 RealNumberNotation realNumberNotation() const;
20517 void setRealNumberPrecision(int precision);
20518 int realNumberPrecision() const;
20519 QTextStream &operator>>(QChar &ch);
20520 QTextStream &operator>>(char &ch);
20521 QTextStream &operator>>(signed short &i);
20522 QTextStream &operator>>(unsigned short &i);
20523 QTextStream &operator>>(signed int &i);
20524 QTextStream &operator>>(unsigned int &i);
20525 QTextStream &operator>>(signed long &i);
20526 QTextStream &operator>>(unsigned long &i);
20527 QTextStream &operator>>(qlonglong &i);
20528 QTextStream &operator>>(qulonglong &i);
20529 QTextStream &operator>>(float &f);
20530 QTextStream &operator>>(double &f);
20531 QTextStream &operator>>(QString &s);
20532 QTextStream &operator>>(QByteArray &array);
20533 QTextStream &operator>>(char *c);
20534 QTextStream &operator<<(QBool b);
20535 QTextStream &operator<<(QChar ch);
20536 QTextStream &operator<<(char ch);
20537 QTextStream &operator<<(signed short i);
20538 QTextStream &operator<<(unsigned short i);
20539 QTextStream &operator<<(signed int i);
20540 QTextStream &operator<<(unsigned int i);
20541 QTextStream &operator<<(signed long i);
20542 QTextStream &operator<<(unsigned long i);
20543 QTextStream &operator<<(qlonglong i);
20544 QTextStream &operator<<(qulonglong i);
20545 QTextStream &operator<<(float f);
20546 QTextStream &operator<<(double f);
20547 QTextStream &operator<<(const QString &s);
20548 QTextStream &operator<<(const QByteArray &array);
20549 QTextStream &operator<<(const char *c);
20550 QTextStream &operator<<(const void *ptr);
20552 QTextStream(const QTextStream &); QTextStream &operator=(const QTextStream &);
20553 QTextStreamPrivate *d_ptr;
20555 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); }
20556 typedef QTextStream & (*QTextStreamFunction)(QTextStream &);
20557 typedef void (QTextStream::*QTSMFI)(int);
20558 typedef void (QTextStream::*QTSMFC)(QChar);
20559 class __attribute__((visibility("default"))) QTextStreamManipulator
20562 QTextStreamManipulator(QTSMFI m, int a) { mf = m; mc = 0; arg = a; }
20563 QTextStreamManipulator(QTSMFC m, QChar c) { mf = 0; mc = m; ch = c; }
20564 void exec(QTextStream &s) { if (mf) { (s.*mf)(arg); } else { (s.*mc)(ch); } }
20571 inline QTextStream &operator>>(QTextStream &s, QTextStreamFunction f)
20572 { return (*f)(s); }
20573 inline QTextStream &operator<<(QTextStream &s, QTextStreamFunction f)
20574 { return (*f)(s); }
20575 inline QTextStream &operator<<(QTextStream &s, QTextStreamManipulator m)
20576 { m.exec(s); return s; }
20577 __attribute__((visibility("default"))) QTextStream &bin(QTextStream &s);
20578 __attribute__((visibility("default"))) QTextStream &oct(QTextStream &s);
20579 __attribute__((visibility("default"))) QTextStream &dec(QTextStream &s);
20580 __attribute__((visibility("default"))) QTextStream &hex(QTextStream &s);
20581 __attribute__((visibility("default"))) QTextStream &showbase(QTextStream &s);
20582 __attribute__((visibility("default"))) QTextStream &forcesign(QTextStream &s);
20583 __attribute__((visibility("default"))) QTextStream &forcepoint(QTextStream &s);
20584 __attribute__((visibility("default"))) QTextStream &noshowbase(QTextStream &s);
20585 __attribute__((visibility("default"))) QTextStream &noforcesign(QTextStream &s);
20586 __attribute__((visibility("default"))) QTextStream &noforcepoint(QTextStream &s);
20587 __attribute__((visibility("default"))) QTextStream &uppercasebase(QTextStream &s);
20588 __attribute__((visibility("default"))) QTextStream &uppercasedigits(QTextStream &s);
20589 __attribute__((visibility("default"))) QTextStream &lowercasebase(QTextStream &s);
20590 __attribute__((visibility("default"))) QTextStream &lowercasedigits(QTextStream &s);
20591 __attribute__((visibility("default"))) QTextStream &fixed(QTextStream &s);
20592 __attribute__((visibility("default"))) QTextStream &scientific(QTextStream &s);
20593 __attribute__((visibility("default"))) QTextStream &left(QTextStream &s);
20594 __attribute__((visibility("default"))) QTextStream &right(QTextStream &s);
20595 __attribute__((visibility("default"))) QTextStream ¢er(QTextStream &s);
20596 __attribute__((visibility("default"))) QTextStream &endl(QTextStream &s);
20597 __attribute__((visibility("default"))) QTextStream &flush(QTextStream &s);
20598 __attribute__((visibility("default"))) QTextStream &reset(QTextStream &s);
20599 __attribute__((visibility("default"))) QTextStream &bom(QTextStream &s);
20600 __attribute__((visibility("default"))) QTextStream &ws(QTextStream &s);
20601 inline QTextStreamManipulator qSetFieldWidth(int width)
20603 QTSMFI func = &QTextStream::setFieldWidth;
20604 return QTextStreamManipulator(func,width);
20606 inline QTextStreamManipulator qSetPadChar(QChar ch)
20608 QTSMFC func = &QTextStream::setPadChar;
20609 return QTextStreamManipulator(func, ch);
20611 inline QTextStreamManipulator qSetRealNumberPrecision(int precision)
20613 QTSMFI func = &QTextStream::setRealNumberPrecision;
20614 return QTextStreamManipulator(func, precision);
20616 namespace std __attribute__ ((__visibility__ ("default"))) {
20617 template<typename _T1, typename _T2>
20619 _Construct(_T1* __p, const _T2& __value)
20621 ::new(static_cast<void*>(__p)) _T1(__value);
20623 template<typename _Tp>
20625 _Destroy(_Tp* __pointer)
20626 { __pointer->~_Tp(); }
20627 template<typename _ForwardIterator>
20629 _Destroy(_ForwardIterator __first, _ForwardIterator __last)
20631 typedef typename iterator_traits<_ForwardIterator>::value_type
20633 if (!__has_trivial_destructor(_Value_type))
20634 for (; __first != __last; ++__first)
20635 std::_Destroy(&*__first);
20637 template <typename _Tp> class allocator;
20638 template<typename _ForwardIterator, typename _Allocator>
20640 _Destroy(_ForwardIterator __first, _ForwardIterator __last,
20641 _Allocator& __alloc)
20643 for (; __first != __last; ++__first)
20644 __alloc.destroy(&*__first);
20646 template<typename _ForwardIterator, typename _Tp>
20648 _Destroy(_ForwardIterator __first, _ForwardIterator __last,
20651 _Destroy(__first, __last);
20654 namespace std __attribute__ ((__visibility__ ("default"))) {
20656 struct __uninitialized_copy
20658 template<typename _InputIterator, typename _ForwardIterator>
20659 static _ForwardIterator
20660 uninitialized_copy(_InputIterator __first, _InputIterator __last,
20661 _ForwardIterator __result)
20663 _ForwardIterator __cur = __result;
20666 for (; __first != __last; ++__first, ++__cur)
20667 ::new(static_cast<void*>(&*__cur)) typename
20668 iterator_traits<_ForwardIterator>::value_type(*__first);
20673 std::_Destroy(__result, __cur);
20679 struct __uninitialized_copy<true>
20681 template<typename _InputIterator, typename _ForwardIterator>
20682 static _ForwardIterator
20683 uninitialized_copy(_InputIterator __first, _InputIterator __last,
20684 _ForwardIterator __result)
20685 { return std::copy(__first, __last, __result); }
20687 template<typename _InputIterator, typename _ForwardIterator>
20688 inline _ForwardIterator
20689 uninitialized_copy(_InputIterator __first, _InputIterator __last,
20690 _ForwardIterator __result)
20692 typedef typename iterator_traits<_InputIterator>::value_type
20694 typedef typename iterator_traits<_ForwardIterator>::value_type
20696 return std::__uninitialized_copy<(__is_pod(_ValueType1)
20697 && __is_pod(_ValueType2))>::
20698 uninitialized_copy(__first, __last, __result);
20701 struct __uninitialized_fill
20703 template<typename _ForwardIterator, typename _Tp>
20705 uninitialized_fill(_ForwardIterator __first,
20706 _ForwardIterator __last, const _Tp& __x)
20708 _ForwardIterator __cur = __first;
20711 for (; __cur != __last; ++__cur)
20712 std::_Construct(&*__cur, __x);
20716 std::_Destroy(__first, __cur);
20722 struct __uninitialized_fill<true>
20724 template<typename _ForwardIterator, typename _Tp>
20726 uninitialized_fill(_ForwardIterator __first,
20727 _ForwardIterator __last, const _Tp& __x)
20728 { std::fill(__first, __last, __x); }
20730 template<typename _ForwardIterator, typename _Tp>
20732 uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
20735 typedef typename iterator_traits<_ForwardIterator>::value_type
20737 std::__uninitialized_fill<__is_pod(_ValueType)>::
20738 uninitialized_fill(__first, __last, __x);
20741 struct __uninitialized_fill_n
20743 template<typename _ForwardIterator, typename _Size, typename _Tp>
20745 uninitialized_fill_n(_ForwardIterator __first, _Size __n,
20748 _ForwardIterator __cur = __first;
20751 for (; __n > 0; --__n, ++__cur)
20752 std::_Construct(&*__cur, __x);
20756 std::_Destroy(__first, __cur);
20762 struct __uninitialized_fill_n<true>
20764 template<typename _ForwardIterator, typename _Size, typename _Tp>
20766 uninitialized_fill_n(_ForwardIterator __first, _Size __n,
20768 { std::fill_n(__first, __n, __x); }
20770 template<typename _ForwardIterator, typename _Size, typename _Tp>
20772 uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
20774 typedef typename iterator_traits<_ForwardIterator>::value_type
20776 std::__uninitialized_fill_n<__is_pod(_ValueType)>::
20777 uninitialized_fill_n(__first, __n, __x);
20779 template<typename _InputIterator, typename _ForwardIterator,
20780 typename _Allocator>
20782 __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
20783 _ForwardIterator __result, _Allocator& __alloc)
20785 _ForwardIterator __cur = __result;
20788 for (; __first != __last; ++__first, ++__cur)
20789 __alloc.construct(&*__cur, *__first);
20794 std::_Destroy(__result, __cur, __alloc);
20798 template<typename _InputIterator, typename _ForwardIterator, typename _Tp>
20799 inline _ForwardIterator
20800 __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
20801 _ForwardIterator __result, allocator<_Tp>&)
20802 { return std::uninitialized_copy(__first, __last, __result); }
20803 template<typename _InputIterator, typename _ForwardIterator,
20804 typename _Allocator>
20805 inline _ForwardIterator
20806 __uninitialized_move_a(_InputIterator __first, _InputIterator __last,
20807 _ForwardIterator __result, _Allocator& __alloc)
20809 return std::__uninitialized_copy_a((__first),
20811 __result, __alloc);
20813 template<typename _ForwardIterator, typename _Tp, typename _Allocator>
20815 __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
20816 const _Tp& __x, _Allocator& __alloc)
20818 _ForwardIterator __cur = __first;
20821 for (; __cur != __last; ++__cur)
20822 __alloc.construct(&*__cur, __x);
20826 std::_Destroy(__first, __cur, __alloc);
20830 template<typename _ForwardIterator, typename _Tp, typename _Tp2>
20832 __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
20833 const _Tp& __x, allocator<_Tp2>&)
20834 { std::uninitialized_fill(__first, __last, __x); }
20835 template<typename _ForwardIterator, typename _Size, typename _Tp,
20836 typename _Allocator>
20838 __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
20839 const _Tp& __x, _Allocator& __alloc)
20841 _ForwardIterator __cur = __first;
20844 for (; __n > 0; --__n, ++__cur)
20845 __alloc.construct(&*__cur, __x);
20849 std::_Destroy(__first, __cur, __alloc);
20853 template<typename _ForwardIterator, typename _Size, typename _Tp,
20856 __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
20857 const _Tp& __x, allocator<_Tp2>&)
20858 { std::uninitialized_fill_n(__first, __n, __x); }
20859 template<typename _InputIterator1, typename _InputIterator2,
20860 typename _ForwardIterator, typename _Allocator>
20861 inline _ForwardIterator
20862 __uninitialized_copy_move(_InputIterator1 __first1,
20863 _InputIterator1 __last1,
20864 _InputIterator2 __first2,
20865 _InputIterator2 __last2,
20866 _ForwardIterator __result,
20867 _Allocator& __alloc)
20869 _ForwardIterator __mid = std::__uninitialized_copy_a(__first1, __last1,
20874 return std::__uninitialized_move_a(__first2, __last2, __mid, __alloc);
20878 std::_Destroy(__result, __mid, __alloc);
20882 template<typename _InputIterator1, typename _InputIterator2,
20883 typename _ForwardIterator, typename _Allocator>
20884 inline _ForwardIterator
20885 __uninitialized_move_copy(_InputIterator1 __first1,
20886 _InputIterator1 __last1,
20887 _InputIterator2 __first2,
20888 _InputIterator2 __last2,
20889 _ForwardIterator __result,
20890 _Allocator& __alloc)
20892 _ForwardIterator __mid = std::__uninitialized_move_a(__first1, __last1,
20897 return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc);
20901 std::_Destroy(__result, __mid, __alloc);
20905 template<typename _ForwardIterator, typename _Tp, typename _InputIterator,
20906 typename _Allocator>
20907 inline _ForwardIterator
20908 __uninitialized_fill_move(_ForwardIterator __result, _ForwardIterator __mid,
20909 const _Tp& __x, _InputIterator __first,
20910 _InputIterator __last, _Allocator& __alloc)
20912 std::__uninitialized_fill_a(__result, __mid, __x, __alloc);
20915 return std::__uninitialized_move_a(__first, __last, __mid, __alloc);
20919 std::_Destroy(__result, __mid, __alloc);
20923 template<typename _InputIterator, typename _ForwardIterator, typename _Tp,
20924 typename _Allocator>
20926 __uninitialized_move_fill(_InputIterator __first1, _InputIterator __last1,
20927 _ForwardIterator __first2,
20928 _ForwardIterator __last2, const _Tp& __x,
20929 _Allocator& __alloc)
20931 _ForwardIterator __mid2 = std::__uninitialized_move_a(__first1, __last1,
20936 std::__uninitialized_fill_a(__mid2, __last2, __x, __alloc);
20940 std::_Destroy(__first2, __mid2, __alloc);
20945 namespace std __attribute__ ((__visibility__ ("default"))) {
20946 template<typename _Tp, typename _Alloc>
20947 struct _Vector_base
20949 typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
20950 struct _Vector_impl
20951 : public _Tp_alloc_type
20955 _Tp* _M_end_of_storage;
20957 : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
20959 _Vector_impl(_Tp_alloc_type const& __a)
20960 : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
20964 typedef _Alloc allocator_type;
20966 _M_get_Tp_allocator()
20967 { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); }
20968 const _Tp_alloc_type&
20969 _M_get_Tp_allocator() const
20970 { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); }
20972 get_allocator() const
20973 { return allocator_type(_M_get_Tp_allocator()); }
20976 _Vector_base(const allocator_type& __a)
20978 _Vector_base(size_t __n, const allocator_type& __a)
20981 this->_M_impl._M_start = this->_M_allocate(__n);
20982 this->_M_impl._M_finish = this->_M_impl._M_start;
20983 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
20986 { _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage
20987 - this->_M_impl._M_start); }
20989 _Vector_impl _M_impl;
20991 _M_allocate(size_t __n)
20992 { return __n != 0 ? _M_impl.allocate(__n) : 0; }
20994 _M_deallocate(_Tp* __p, size_t __n)
20997 _M_impl.deallocate(__p, __n);
21000 template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
21001 class vector : protected _Vector_base<_Tp, _Alloc>
21003 typedef typename _Alloc::value_type _Alloc_value_type;
21004 typedef _Vector_base<_Tp, _Alloc> _Base;
21005 typedef vector<_Tp, _Alloc> vector_type;
21006 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
21008 typedef _Tp value_type;
21009 typedef typename _Tp_alloc_type::pointer pointer;
21010 typedef typename _Tp_alloc_type::const_pointer const_pointer;
21011 typedef typename _Tp_alloc_type::reference reference;
21012 typedef typename _Tp_alloc_type::const_reference const_reference;
21013 typedef __gnu_cxx::__normal_iterator<pointer, vector_type> iterator;
21014 typedef __gnu_cxx::__normal_iterator<const_pointer, vector_type>
21016 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
21017 typedef std::reverse_iterator<iterator> reverse_iterator;
21018 typedef size_t size_type;
21019 typedef ptrdiff_t difference_type;
21020 typedef _Alloc allocator_type;
21022 using _Base::_M_allocate;
21023 using _Base::_M_deallocate;
21024 using _Base::_M_impl;
21025 using _Base::_M_get_Tp_allocator;
21030 vector(const allocator_type& __a)
21033 vector(size_type __n, const value_type& __value = value_type(),
21034 const allocator_type& __a = allocator_type())
21036 { _M_fill_initialize(__n, __value); }
21037 vector(const vector& __x)
21038 : _Base(__x.size(), __x._M_get_Tp_allocator())
21039 { this->_M_impl._M_finish =
21040 std::__uninitialized_copy_a(__x.begin(), __x.end(),
21041 this->_M_impl._M_start,
21042 _M_get_Tp_allocator());
21044 template<typename _InputIterator>
21045 vector(_InputIterator __first, _InputIterator __last,
21046 const allocator_type& __a = allocator_type())
21049 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
21050 _M_initialize_dispatch(__first, __last, _Integral());
21053 { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
21054 _M_get_Tp_allocator()); }
21056 operator=(const vector& __x);
21058 assign(size_type __n, const value_type& __val)
21059 { _M_fill_assign(__n, __val); }
21060 template<typename _InputIterator>
21062 assign(_InputIterator __first, _InputIterator __last)
21064 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
21065 _M_assign_dispatch(__first, __last, _Integral());
21067 using _Base::get_allocator;
21070 { return iterator(this->_M_impl._M_start); }
21073 { return const_iterator(this->_M_impl._M_start); }
21076 { return iterator(this->_M_impl._M_finish); }
21079 { return const_iterator(this->_M_impl._M_finish); }
21082 { return reverse_iterator(end()); }
21083 const_reverse_iterator
21085 { return const_reverse_iterator(end()); }
21088 { return reverse_iterator(begin()); }
21089 const_reverse_iterator
21091 { return const_reverse_iterator(begin()); }
21094 { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
21097 { return _M_get_Tp_allocator().max_size(); }
21099 resize(size_type __new_size, value_type __x = value_type())
21101 if (__new_size < size())
21102 _M_erase_at_end(this->_M_impl._M_start + __new_size);
21104 insert(end(), __new_size - size(), __x);
21108 { return size_type(this->_M_impl._M_end_of_storage
21109 - this->_M_impl._M_start); }
21112 { return begin() == end(); }
21114 reserve(size_type __n);
21116 operator[](size_type __n)
21117 { return *(this->_M_impl._M_start + __n); }
21119 operator[](size_type __n) const
21120 { return *(this->_M_impl._M_start + __n); }
21123 _M_range_check(size_type __n) const
21125 if (__n >= this->size())
21126 __throw_out_of_range(("vector::_M_range_check"));
21132 _M_range_check(__n);
21133 return (*this)[__n];
21136 at(size_type __n) const
21138 _M_range_check(__n);
21139 return (*this)[__n];
21143 { return *begin(); }
21146 { return *begin(); }
21149 { return *(end() - 1); }
21152 { return *(end() - 1); }
21155 { return pointer(this->_M_impl._M_start); }
21158 { return const_pointer(this->_M_impl._M_start); }
21160 push_back(const value_type& __x)
21162 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
21164 this->_M_impl.construct(this->_M_impl._M_finish, __x);
21165 ++this->_M_impl._M_finish;
21168 _M_insert_aux(end(), __x);
21173 --this->_M_impl._M_finish;
21174 this->_M_impl.destroy(this->_M_impl._M_finish);
21177 insert(iterator __position, const value_type& __x);
21179 insert(iterator __position, size_type __n, const value_type& __x)
21180 { _M_fill_insert(__position, __n, __x); }
21181 template<typename _InputIterator>
21183 insert(iterator __position, _InputIterator __first,
21184 _InputIterator __last)
21186 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
21187 _M_insert_dispatch(__position, __first, __last, _Integral());
21190 erase(iterator __position);
21192 erase(iterator __first, iterator __last);
21196 std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
21197 std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
21198 std::swap(this->_M_impl._M_end_of_storage,
21199 __x._M_impl._M_end_of_storage);
21200 std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
21201 __x._M_get_Tp_allocator());
21205 { _M_erase_at_end(this->_M_impl._M_start); }
21207 template<typename _ForwardIterator>
21209 _M_allocate_and_copy(size_type __n,
21210 _ForwardIterator __first, _ForwardIterator __last)
21212 pointer __result = this->_M_allocate(__n);
21215 std::__uninitialized_copy_a(__first, __last, __result,
21216 _M_get_Tp_allocator());
21221 _M_deallocate(__result, __n);
21225 template<typename _Integer>
21227 _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
21229 this->_M_impl._M_start = _M_allocate(static_cast<size_type>(__n));
21230 this->_M_impl._M_end_of_storage =
21231 this->_M_impl._M_start + static_cast<size_type>(__n);
21232 _M_fill_initialize(static_cast<size_type>(__n), __value);
21234 template<typename _InputIterator>
21236 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
21239 typedef typename std::iterator_traits<_InputIterator>::
21240 iterator_category _IterCategory;
21241 _M_range_initialize(__first, __last, _IterCategory());
21243 template<typename _InputIterator>
21245 _M_range_initialize(_InputIterator __first,
21246 _InputIterator __last, std::input_iterator_tag)
21248 for (; __first != __last; ++__first)
21249 push_back(*__first);
21251 template<typename _ForwardIterator>
21253 _M_range_initialize(_ForwardIterator __first,
21254 _ForwardIterator __last, std::forward_iterator_tag)
21256 const size_type __n = std::distance(__first, __last);
21257 this->_M_impl._M_start = this->_M_allocate(__n);
21258 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
21259 this->_M_impl._M_finish =
21260 std::__uninitialized_copy_a(__first, __last,
21261 this->_M_impl._M_start,
21262 _M_get_Tp_allocator());
21265 _M_fill_initialize(size_type __n, const value_type& __value)
21267 std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
21268 _M_get_Tp_allocator());
21269 this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
21271 template<typename _Integer>
21273 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
21274 { _M_fill_assign(__n, __val); }
21275 template<typename _InputIterator>
21277 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
21280 typedef typename std::iterator_traits<_InputIterator>::
21281 iterator_category _IterCategory;
21282 _M_assign_aux(__first, __last, _IterCategory());
21284 template<typename _InputIterator>
21286 _M_assign_aux(_InputIterator __first, _InputIterator __last,
21287 std::input_iterator_tag);
21288 template<typename _ForwardIterator>
21290 _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
21291 std::forward_iterator_tag);
21293 _M_fill_assign(size_type __n, const value_type& __val);
21294 template<typename _Integer>
21296 _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
21298 { _M_fill_insert(__pos, __n, __val); }
21299 template<typename _InputIterator>
21301 _M_insert_dispatch(iterator __pos, _InputIterator __first,
21302 _InputIterator __last, __false_type)
21304 typedef typename std::iterator_traits<_InputIterator>::
21305 iterator_category _IterCategory;
21306 _M_range_insert(__pos, __first, __last, _IterCategory());
21308 template<typename _InputIterator>
21310 _M_range_insert(iterator __pos, _InputIterator __first,
21311 _InputIterator __last, std::input_iterator_tag);
21312 template<typename _ForwardIterator>
21314 _M_range_insert(iterator __pos, _ForwardIterator __first,
21315 _ForwardIterator __last, std::forward_iterator_tag);
21317 _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
21319 _M_insert_aux(iterator __position, const value_type& __x);
21321 _M_check_len(size_type __n, const char* __s) const
21323 if (max_size() - size() < __n)
21324 __throw_length_error((__s));
21325 const size_type __len = size() + std::max(size(), __n);
21326 return (__len < size() || __len > max_size()) ? max_size() : __len;
21329 _M_erase_at_end(pointer __pos)
21331 std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator());
21332 this->_M_impl._M_finish = __pos;
21335 template<typename _Tp, typename _Alloc>
21337 operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
21338 { return (__x.size() == __y.size()
21339 && std::equal(__x.begin(), __x.end(), __y.begin())); }
21340 template<typename _Tp, typename _Alloc>
21342 operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
21343 { return std::lexicographical_compare(__x.begin(), __x.end(),
21344 __y.begin(), __y.end()); }
21345 template<typename _Tp, typename _Alloc>
21347 operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
21348 { return !(__x == __y); }
21349 template<typename _Tp, typename _Alloc>
21351 operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
21352 { return __y < __x; }
21353 template<typename _Tp, typename _Alloc>
21355 operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
21356 { return !(__y < __x); }
21357 template<typename _Tp, typename _Alloc>
21359 operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
21360 { return !(__x < __y); }
21361 template<typename _Tp, typename _Alloc>
21363 swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
21366 namespace std __attribute__ ((__visibility__ ("default"))) {
21367 typedef unsigned long _Bit_type;
21368 enum { _S_word_bit = int(8 * sizeof(_Bit_type)) };
21369 struct _Bit_reference
21373 _Bit_reference(_Bit_type * __x, _Bit_type __y)
21374 : _M_p(__x), _M_mask(__y) { }
21375 _Bit_reference() : _M_p(0), _M_mask(0) { }
21376 operator bool() const
21377 { return !!(*_M_p & _M_mask); }
21379 operator=(bool __x)
21388 operator=(const _Bit_reference& __x)
21389 { return *this = bool(__x); }
21391 operator==(const _Bit_reference& __x) const
21392 { return bool(*this) == bool(__x); }
21394 operator<(const _Bit_reference& __x) const
21395 { return !bool(*this) && bool(__x); }
21398 { *_M_p ^= _M_mask; }
21400 struct _Bit_iterator_base
21401 : public std::iterator<std::random_access_iterator_tag, bool>
21404 unsigned int _M_offset;
21405 _Bit_iterator_base(_Bit_type * __x, unsigned int __y)
21406 : _M_p(__x), _M_offset(__y) { }
21410 if (_M_offset++ == int(_S_word_bit) - 1)
21419 if (_M_offset-- == 0)
21421 _M_offset = int(_S_word_bit) - 1;
21426 _M_incr(ptrdiff_t __i)
21428 difference_type __n = __i + _M_offset;
21429 _M_p += __n / int(_S_word_bit);
21430 __n = __n % int(_S_word_bit);
21433 __n += int(_S_word_bit);
21436 _M_offset = static_cast<unsigned int>(__n);
21439 operator==(const _Bit_iterator_base& __i) const
21440 { return _M_p == __i._M_p && _M_offset == __i._M_offset; }
21442 operator<(const _Bit_iterator_base& __i) const
21444 return _M_p < __i._M_p
21445 || (_M_p == __i._M_p && _M_offset < __i._M_offset);
21448 operator!=(const _Bit_iterator_base& __i) const
21449 { return !(*this == __i); }
21451 operator>(const _Bit_iterator_base& __i) const
21452 { return __i < *this; }
21454 operator<=(const _Bit_iterator_base& __i) const
21455 { return !(__i < *this); }
21457 operator>=(const _Bit_iterator_base& __i) const
21458 { return !(*this < __i); }
21461 operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y)
21463 return (int(_S_word_bit) * (__x._M_p - __y._M_p)
21464 + __x._M_offset - __y._M_offset);
21466 struct _Bit_iterator : public _Bit_iterator_base
21468 typedef _Bit_reference reference;
21469 typedef _Bit_reference* pointer;
21470 typedef _Bit_iterator iterator;
21471 _Bit_iterator() : _Bit_iterator_base(0, 0) { }
21472 _Bit_iterator(_Bit_type * __x, unsigned int __y)
21473 : _Bit_iterator_base(__x, __y) { }
21476 { return reference(_M_p, 1UL << _M_offset); }
21486 iterator __tmp = *this;
21499 iterator __tmp = *this;
21504 operator+=(difference_type __i)
21510 operator-=(difference_type __i)
21516 operator+(difference_type __i) const
21518 iterator __tmp = *this;
21519 return __tmp += __i;
21522 operator-(difference_type __i) const
21524 iterator __tmp = *this;
21525 return __tmp -= __i;
21528 operator[](difference_type __i) const
21529 { return *(*this + __i); }
21531 inline _Bit_iterator
21532 operator+(ptrdiff_t __n, const _Bit_iterator& __x)
21533 { return __x + __n; }
21534 struct _Bit_const_iterator : public _Bit_iterator_base
21536 typedef bool reference;
21537 typedef bool const_reference;
21538 typedef const bool* pointer;
21539 typedef _Bit_const_iterator const_iterator;
21540 _Bit_const_iterator() : _Bit_iterator_base(0, 0) { }
21541 _Bit_const_iterator(_Bit_type * __x, unsigned int __y)
21542 : _Bit_iterator_base(__x, __y) { }
21543 _Bit_const_iterator(const _Bit_iterator& __x)
21544 : _Bit_iterator_base(__x._M_p, __x._M_offset) { }
21547 { return _Bit_reference(_M_p, 1UL << _M_offset); }
21557 const_iterator __tmp = *this;
21570 const_iterator __tmp = *this;
21575 operator+=(difference_type __i)
21581 operator-=(difference_type __i)
21587 operator+(difference_type __i) const
21589 const_iterator __tmp = *this;
21590 return __tmp += __i;
21593 operator-(difference_type __i) const
21595 const_iterator __tmp = *this;
21596 return __tmp -= __i;
21599 operator[](difference_type __i) const
21600 { return *(*this + __i); }
21602 inline _Bit_const_iterator
21603 operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
21604 { return __x + __n; }
21606 __fill_bvector(_Bit_iterator __first, _Bit_iterator __last, bool __x)
21608 for (; __first != __last; ++__first)
21612 fill(_Bit_iterator __first, _Bit_iterator __last, const bool& __x)
21614 if (__first._M_p != __last._M_p)
21616 std::fill(__first._M_p + 1, __last._M_p, __x ? ~0 : 0);
21617 __fill_bvector(__first, _Bit_iterator(__first._M_p + 1, 0), __x);
21618 __fill_bvector(_Bit_iterator(__last._M_p, 0), __last, __x);
21621 __fill_bvector(__first, __last, __x);
21623 template<typename _Alloc>
21624 struct _Bvector_base
21626 typedef typename _Alloc::template rebind<_Bit_type>::other
21628 struct _Bvector_impl
21629 : public _Bit_alloc_type
21631 _Bit_iterator _M_start;
21632 _Bit_iterator _M_finish;
21633 _Bit_type* _M_end_of_storage;
21635 : _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage(0)
21637 _Bvector_impl(const _Bit_alloc_type& __a)
21638 : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0)
21642 typedef _Alloc allocator_type;
21644 _M_get_Bit_allocator()
21645 { return *static_cast<_Bit_alloc_type*>(&this->_M_impl); }
21646 const _Bit_alloc_type&
21647 _M_get_Bit_allocator() const
21648 { return *static_cast<const _Bit_alloc_type*>(&this->_M_impl); }
21650 get_allocator() const
21651 { return allocator_type(_M_get_Bit_allocator()); }
21654 _Bvector_base(const allocator_type& __a)
21657 { this->_M_deallocate(); }
21659 _Bvector_impl _M_impl;
21661 _M_allocate(size_t __n)
21662 { return _M_impl.allocate((__n + int(_S_word_bit) - 1)
21663 / int(_S_word_bit)); }
21667 if (_M_impl._M_start._M_p)
21668 _M_impl.deallocate(_M_impl._M_start._M_p,
21669 _M_impl._M_end_of_storage - _M_impl._M_start._M_p);
21673 namespace std __attribute__ ((__visibility__ ("default"))) {
21674 template<typename _Alloc>
21675 class vector<bool, _Alloc> : protected _Bvector_base<_Alloc>
21677 typedef _Bvector_base<_Alloc> _Base;
21679 typedef bool value_type;
21680 typedef size_t size_type;
21681 typedef ptrdiff_t difference_type;
21682 typedef _Bit_reference reference;
21683 typedef bool const_reference;
21684 typedef _Bit_reference* pointer;
21685 typedef const bool* const_pointer;
21686 typedef _Bit_iterator iterator;
21687 typedef _Bit_const_iterator const_iterator;
21688 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
21689 typedef std::reverse_iterator<iterator> reverse_iterator;
21690 typedef _Alloc allocator_type;
21691 allocator_type get_allocator() const
21692 { return _Base::get_allocator(); }
21694 using _Base::_M_allocate;
21695 using _Base::_M_deallocate;
21696 using _Base::_M_get_Bit_allocator;
21701 vector(const allocator_type& __a)
21704 vector(size_type __n, const bool& __value = bool(),
21705 const allocator_type& __a = allocator_type())
21708 _M_initialize(__n);
21709 std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage,
21712 vector(const vector& __x)
21713 : _Base(__x._M_get_Bit_allocator())
21715 _M_initialize(__x.size());
21716 _M_copy_aligned(__x.begin(), __x.end(), this->_M_impl._M_start);
21718 template<typename _InputIterator>
21719 vector(_InputIterator __first, _InputIterator __last,
21720 const allocator_type& __a = allocator_type())
21723 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
21724 _M_initialize_dispatch(__first, __last, _Integral());
21728 operator=(const vector& __x)
21732 if (__x.size() > capacity())
21734 this->_M_deallocate();
21735 _M_initialize(__x.size());
21737 this->_M_impl._M_finish = _M_copy_aligned(__x.begin(), __x.end(),
21742 assign(size_type __n, const bool& __x)
21743 { _M_fill_assign(__n, __x); }
21744 template<typename _InputIterator>
21746 assign(_InputIterator __first, _InputIterator __last)
21748 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
21749 _M_assign_dispatch(__first, __last, _Integral());
21753 { return this->_M_impl._M_start; }
21756 { return this->_M_impl._M_start; }
21759 { return this->_M_impl._M_finish; }
21762 { return this->_M_impl._M_finish; }
21765 { return reverse_iterator(end()); }
21766 const_reverse_iterator
21768 { return const_reverse_iterator(end()); }
21771 { return reverse_iterator(begin()); }
21772 const_reverse_iterator
21774 { return const_reverse_iterator(begin()); }
21777 { return size_type(end() - begin()); }
21781 const size_type __isize =
21782 __gnu_cxx::__numeric_traits<difference_type>::__max
21783 - int(_S_word_bit) + 1;
21784 const size_type __asize = _M_get_Bit_allocator().max_size();
21785 return (__asize <= __isize / int(_S_word_bit)
21786 ? __asize * int(_S_word_bit) : __isize);
21790 { return size_type(const_iterator(this->_M_impl._M_end_of_storage, 0)
21794 { return begin() == end(); }
21796 operator[](size_type __n)
21798 return *iterator(this->_M_impl._M_start._M_p
21799 + __n / int(_S_word_bit), __n % int(_S_word_bit));
21802 operator[](size_type __n) const
21804 return *const_iterator(this->_M_impl._M_start._M_p
21805 + __n / int(_S_word_bit), __n % int(_S_word_bit));
21809 _M_range_check(size_type __n) const
21811 if (__n >= this->size())
21812 __throw_out_of_range(("vector<bool>::_M_range_check"));
21817 { _M_range_check(__n); return (*this)[__n]; }
21819 at(size_type __n) const
21820 { _M_range_check(__n); return (*this)[__n]; }
21822 reserve(size_type __n);
21825 { return *begin(); }
21828 { return *begin(); }
21831 { return *(end() - 1); }
21834 { return *(end() - 1); }
21838 push_back(bool __x)
21840 if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
21841 *this->_M_impl._M_finish++ = __x;
21843 _M_insert_aux(end(), __x);
21848 std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
21849 std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
21850 std::swap(this->_M_impl._M_end_of_storage,
21851 __x._M_impl._M_end_of_storage);
21852 std::__alloc_swap<typename _Base::_Bit_alloc_type>::
21853 _S_do_it(_M_get_Bit_allocator(), __x._M_get_Bit_allocator());
21856 swap(reference __x, reference __y)
21863 insert(iterator __position, const bool& __x = bool())
21865 const difference_type __n = __position - begin();
21866 if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage
21867 && __position == end())
21868 *this->_M_impl._M_finish++ = __x;
21870 _M_insert_aux(__position, __x);
21871 return begin() + __n;
21873 template<typename _InputIterator>
21875 insert(iterator __position,
21876 _InputIterator __first, _InputIterator __last)
21878 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
21879 _M_insert_dispatch(__position, __first, __last, _Integral());
21882 insert(iterator __position, size_type __n, const bool& __x)
21883 { _M_fill_insert(__position, __n, __x); }
21886 { --this->_M_impl._M_finish; }
21888 erase(iterator __position)
21890 if (__position + 1 != end())
21891 std::copy(__position + 1, end(), __position);
21892 --this->_M_impl._M_finish;
21896 erase(iterator __first, iterator __last)
21898 _M_erase_at_end(std::copy(__last, end(), __first));
21902 resize(size_type __new_size, bool __x = bool())
21904 if (__new_size < size())
21905 _M_erase_at_end(begin() + difference_type(__new_size));
21907 insert(end(), __new_size - size(), __x);
21912 for (_Bit_type * __p = this->_M_impl._M_start._M_p;
21913 __p != this->_M_impl._M_end_of_storage; ++__p)
21918 { _M_erase_at_end(begin()); }
21921 _M_copy_aligned(const_iterator __first, const_iterator __last,
21924 _Bit_type* __q = std::copy(__first._M_p, __last._M_p, __result._M_p);
21925 return std::copy(const_iterator(__last._M_p, 0), __last,
21929 _M_initialize(size_type __n)
21931 _Bit_type* __q = this->_M_allocate(__n);
21932 this->_M_impl._M_end_of_storage = (__q
21933 + ((__n + int(_S_word_bit) - 1)
21934 / int(_S_word_bit)));
21935 this->_M_impl._M_start = iterator(__q, 0);
21936 this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n);
21938 template<typename _Integer>
21940 _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
21942 _M_initialize(static_cast<size_type>(__n));
21943 std::fill(this->_M_impl._M_start._M_p,
21944 this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
21946 template<typename _InputIterator>
21948 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
21950 { _M_initialize_range(__first, __last,
21951 std::__iterator_category(__first)); }
21952 template<typename _InputIterator>
21954 _M_initialize_range(_InputIterator __first, _InputIterator __last,
21955 std::input_iterator_tag)
21957 for (; __first != __last; ++__first)
21958 push_back(*__first);
21960 template<typename _ForwardIterator>
21962 _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
21963 std::forward_iterator_tag)
21965 const size_type __n = std::distance(__first, __last);
21966 _M_initialize(__n);
21967 std::copy(__first, __last, this->_M_impl._M_start);
21969 template<typename _Integer>
21971 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
21972 { _M_fill_assign(__n, __val); }
21973 template<class _InputIterator>
21975 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
21977 { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
21979 _M_fill_assign(size_t __n, bool __x)
21983 std::fill(this->_M_impl._M_start._M_p,
21984 this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
21985 insert(end(), __n - size(), __x);
21989 _M_erase_at_end(begin() + __n);
21990 std::fill(this->_M_impl._M_start._M_p,
21991 this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
21994 template<typename _InputIterator>
21996 _M_assign_aux(_InputIterator __first, _InputIterator __last,
21997 std::input_iterator_tag)
21999 iterator __cur = begin();
22000 for (; __first != __last && __cur != end(); ++__cur, ++__first)
22002 if (__first == __last)
22003 _M_erase_at_end(__cur);
22005 insert(end(), __first, __last);
22007 template<typename _ForwardIterator>
22009 _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
22010 std::forward_iterator_tag)
22012 const size_type __len = std::distance(__first, __last);
22013 if (__len < size())
22014 _M_erase_at_end(std::copy(__first, __last, begin()));
22017 _ForwardIterator __mid = __first;
22018 std::advance(__mid, size());
22019 std::copy(__first, __mid, begin());
22020 insert(end(), __mid, __last);
22023 template<typename _Integer>
22025 _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
22027 { _M_fill_insert(__pos, __n, __x); }
22028 template<typename _InputIterator>
22030 _M_insert_dispatch(iterator __pos,
22031 _InputIterator __first, _InputIterator __last,
22033 { _M_insert_range(__pos, __first, __last,
22034 std::__iterator_category(__first)); }
22036 _M_fill_insert(iterator __position, size_type __n, bool __x);
22037 template<typename _InputIterator>
22039 _M_insert_range(iterator __pos, _InputIterator __first,
22040 _InputIterator __last, std::input_iterator_tag)
22042 for (; __first != __last; ++__first)
22044 __pos = insert(__pos, *__first);
22048 template<typename _ForwardIterator>
22050 _M_insert_range(iterator __position, _ForwardIterator __first,
22051 _ForwardIterator __last, std::forward_iterator_tag);
22053 _M_insert_aux(iterator __position, bool __x);
22055 _M_check_len(size_type __n, const char* __s) const
22057 if (max_size() - size() < __n)
22058 __throw_length_error((__s));
22059 const size_type __len = size() + std::max(size(), __n);
22060 return (__len < size() || __len > max_size()) ? max_size() : __len;
22063 _M_erase_at_end(iterator __pos)
22064 { this->_M_impl._M_finish = __pos; }
22067 namespace std __attribute__ ((__visibility__ ("default"))) {
22068 template<typename _Tp, typename _Alloc>
22070 vector<_Tp, _Alloc>::
22071 reserve(size_type __n)
22073 if (__n > this->max_size())
22074 __throw_length_error(("vector::reserve"));
22075 if (this->capacity() < __n)
22077 const size_type __old_size = size();
22078 pointer __tmp = _M_allocate_and_copy(__n,
22079 (this->_M_impl._M_start),
22080 (this->_M_impl._M_finish));
22081 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
22082 _M_get_Tp_allocator());
22083 _M_deallocate(this->_M_impl._M_start,
22084 this->_M_impl._M_end_of_storage
22085 - this->_M_impl._M_start);
22086 this->_M_impl._M_start = __tmp;
22087 this->_M_impl._M_finish = __tmp + __old_size;
22088 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
22091 template<typename _Tp, typename _Alloc>
22092 typename vector<_Tp, _Alloc>::iterator
22093 vector<_Tp, _Alloc>::
22094 insert(iterator __position, const value_type& __x)
22096 const size_type __n = __position - begin();
22097 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
22098 && __position == end())
22100 this->_M_impl.construct(this->_M_impl._M_finish, __x);
22101 ++this->_M_impl._M_finish;
22105 _M_insert_aux(__position, __x);
22107 return iterator(this->_M_impl._M_start + __n);
22109 template<typename _Tp, typename _Alloc>
22110 typename vector<_Tp, _Alloc>::iterator
22111 vector<_Tp, _Alloc>::
22112 erase(iterator __position)
22114 if (__position + 1 != end())
22115 std::copy(__position + 1, end(), __position);
22116 --this->_M_impl._M_finish;
22117 this->_M_impl.destroy(this->_M_impl._M_finish);
22120 template<typename _Tp, typename _Alloc>
22121 typename vector<_Tp, _Alloc>::iterator
22122 vector<_Tp, _Alloc>::
22123 erase(iterator __first, iterator __last)
22125 if (__last != end())
22126 std::copy(__last, end(), __first);
22127 _M_erase_at_end(__first.base() + (end() - __last));
22130 template<typename _Tp, typename _Alloc>
22131 vector<_Tp, _Alloc>&
22132 vector<_Tp, _Alloc>::
22133 operator=(const vector<_Tp, _Alloc>& __x)
22137 const size_type __xlen = __x.size();
22138 if (__xlen > capacity())
22140 pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(),
22142 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
22143 _M_get_Tp_allocator());
22144 _M_deallocate(this->_M_impl._M_start,
22145 this->_M_impl._M_end_of_storage
22146 - this->_M_impl._M_start);
22147 this->_M_impl._M_start = __tmp;
22148 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __xlen;
22150 else if (size() >= __xlen)
22152 std::_Destroy(std::copy(__x.begin(), __x.end(), begin()),
22153 end(), _M_get_Tp_allocator());
22157 std::copy(__x._M_impl._M_start, __x._M_impl._M_start + size(),
22158 this->_M_impl._M_start);
22159 std::__uninitialized_copy_a(__x._M_impl._M_start + size(),
22160 __x._M_impl._M_finish,
22161 this->_M_impl._M_finish,
22162 _M_get_Tp_allocator());
22164 this->_M_impl._M_finish = this->_M_impl._M_start + __xlen;
22168 template<typename _Tp, typename _Alloc>
22170 vector<_Tp, _Alloc>::
22171 _M_fill_assign(size_t __n, const value_type& __val)
22173 if (__n > capacity())
22175 vector __tmp(__n, __val, _M_get_Tp_allocator());
22178 else if (__n > size())
22180 std::fill(begin(), end(), __val);
22181 std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
22182 __n - size(), __val,
22183 _M_get_Tp_allocator());
22184 this->_M_impl._M_finish += __n - size();
22187 _M_erase_at_end(std::fill_n(this->_M_impl._M_start, __n, __val));
22189 template<typename _Tp, typename _Alloc>
22190 template<typename _InputIterator>
22192 vector<_Tp, _Alloc>::
22193 _M_assign_aux(_InputIterator __first, _InputIterator __last,
22194 std::input_iterator_tag)
22196 pointer __cur(this->_M_impl._M_start);
22197 for (; __first != __last && __cur != this->_M_impl._M_finish;
22198 ++__cur, ++__first)
22200 if (__first == __last)
22201 _M_erase_at_end(__cur);
22203 insert(end(), __first, __last);
22205 template<typename _Tp, typename _Alloc>
22206 template<typename _ForwardIterator>
22208 vector<_Tp, _Alloc>::
22209 _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
22210 std::forward_iterator_tag)
22212 const size_type __len = std::distance(__first, __last);
22213 if (__len > capacity())
22215 pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
22216 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
22217 _M_get_Tp_allocator());
22218 _M_deallocate(this->_M_impl._M_start,
22219 this->_M_impl._M_end_of_storage
22220 - this->_M_impl._M_start);
22221 this->_M_impl._M_start = __tmp;
22222 this->_M_impl._M_finish = this->_M_impl._M_start + __len;
22223 this->_M_impl._M_end_of_storage = this->_M_impl._M_finish;
22225 else if (size() >= __len)
22226 _M_erase_at_end(std::copy(__first, __last, this->_M_impl._M_start));
22229 _ForwardIterator __mid = __first;
22230 std::advance(__mid, size());
22231 std::copy(__first, __mid, this->_M_impl._M_start);
22232 this->_M_impl._M_finish =
22233 std::__uninitialized_copy_a(__mid, __last,
22234 this->_M_impl._M_finish,
22235 _M_get_Tp_allocator());
22238 template<typename _Tp, typename _Alloc>
22240 vector<_Tp, _Alloc>::
22241 _M_insert_aux(iterator __position, const _Tp& __x)
22243 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
22245 this->_M_impl.construct(this->_M_impl._M_finish,
22246 (*(this->_M_impl._M_finish - 1)));
22247 ++this->_M_impl._M_finish;
22248 _Tp __x_copy = __x;
22249 std::copy_backward(__position.base(), this->_M_impl._M_finish - 2, this->_M_impl._M_finish - 1);
22250 *__position = __x_copy;
22254 const size_type __len =
22255 _M_check_len(size_type(1), "vector::_M_insert_aux");
22256 pointer __new_start(this->_M_allocate(__len));
22257 pointer __new_finish(__new_start);
22261 std::__uninitialized_move_a(this->_M_impl._M_start,
22262 __position.base(), __new_start,
22263 _M_get_Tp_allocator());
22264 this->_M_impl.construct(__new_finish, __x);
22267 std::__uninitialized_move_a(__position.base(),
22268 this->_M_impl._M_finish,
22270 _M_get_Tp_allocator());
22274 std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator());
22275 _M_deallocate(__new_start, __len);
22278 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
22279 _M_get_Tp_allocator());
22280 _M_deallocate(this->_M_impl._M_start,
22281 this->_M_impl._M_end_of_storage
22282 - this->_M_impl._M_start);
22283 this->_M_impl._M_start = __new_start;
22284 this->_M_impl._M_finish = __new_finish;
22285 this->_M_impl._M_end_of_storage = __new_start + __len;
22288 template<typename _Tp, typename _Alloc>
22290 vector<_Tp, _Alloc>::
22291 _M_fill_insert(iterator __position, size_type __n, const value_type& __x)
22295 if (size_type(this->_M_impl._M_end_of_storage
22296 - this->_M_impl._M_finish) >= __n)
22298 value_type __x_copy = __x;
22299 const size_type __elems_after = end() - __position;
22300 pointer __old_finish(this->_M_impl._M_finish);
22301 if (__elems_after > __n)
22303 std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
22304 this->_M_impl._M_finish,
22305 this->_M_impl._M_finish,
22306 _M_get_Tp_allocator());
22307 this->_M_impl._M_finish += __n;
22308 std::copy_backward(__position.base(), __old_finish - __n, __old_finish);
22309 std::fill(__position.base(), __position.base() + __n,
22314 std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
22315 __n - __elems_after,
22317 _M_get_Tp_allocator());
22318 this->_M_impl._M_finish += __n - __elems_after;
22319 std::__uninitialized_move_a(__position.base(), __old_finish,
22320 this->_M_impl._M_finish,
22321 _M_get_Tp_allocator());
22322 this->_M_impl._M_finish += __elems_after;
22323 std::fill(__position.base(), __old_finish, __x_copy);
22328 const size_type __len =
22329 _M_check_len(__n, "vector::_M_fill_insert");
22330 pointer __new_start(this->_M_allocate(__len));
22331 pointer __new_finish(__new_start);
22335 std::__uninitialized_move_a(this->_M_impl._M_start,
22338 _M_get_Tp_allocator());
22339 std::__uninitialized_fill_n_a(__new_finish, __n, __x,
22340 _M_get_Tp_allocator());
22341 __new_finish += __n;
22343 std::__uninitialized_move_a(__position.base(),
22344 this->_M_impl._M_finish,
22346 _M_get_Tp_allocator());
22350 std::_Destroy(__new_start, __new_finish,
22351 _M_get_Tp_allocator());
22352 _M_deallocate(__new_start, __len);
22355 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
22356 _M_get_Tp_allocator());
22357 _M_deallocate(this->_M_impl._M_start,
22358 this->_M_impl._M_end_of_storage
22359 - this->_M_impl._M_start);
22360 this->_M_impl._M_start = __new_start;
22361 this->_M_impl._M_finish = __new_finish;
22362 this->_M_impl._M_end_of_storage = __new_start + __len;
22366 template<typename _Tp, typename _Alloc>
22367 template<typename _InputIterator>
22369 vector<_Tp, _Alloc>::
22370 _M_range_insert(iterator __pos, _InputIterator __first,
22371 _InputIterator __last, std::input_iterator_tag)
22373 for (; __first != __last; ++__first)
22375 __pos = insert(__pos, *__first);
22379 template<typename _Tp, typename _Alloc>
22380 template<typename _ForwardIterator>
22382 vector<_Tp, _Alloc>::
22383 _M_range_insert(iterator __position, _ForwardIterator __first,
22384 _ForwardIterator __last, std::forward_iterator_tag)
22386 if (__first != __last)
22388 const size_type __n = std::distance(__first, __last);
22389 if (size_type(this->_M_impl._M_end_of_storage
22390 - this->_M_impl._M_finish) >= __n)
22392 const size_type __elems_after = end() - __position;
22393 pointer __old_finish(this->_M_impl._M_finish);
22394 if (__elems_after > __n)
22396 std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
22397 this->_M_impl._M_finish,
22398 this->_M_impl._M_finish,
22399 _M_get_Tp_allocator());
22400 this->_M_impl._M_finish += __n;
22401 std::copy_backward(__position.base(), __old_finish - __n, __old_finish);
22402 std::copy(__first, __last, __position);
22406 _ForwardIterator __mid = __first;
22407 std::advance(__mid, __elems_after);
22408 std::__uninitialized_copy_a(__mid, __last,
22409 this->_M_impl._M_finish,
22410 _M_get_Tp_allocator());
22411 this->_M_impl._M_finish += __n - __elems_after;
22412 std::__uninitialized_move_a(__position.base(),
22414 this->_M_impl._M_finish,
22415 _M_get_Tp_allocator());
22416 this->_M_impl._M_finish += __elems_after;
22417 std::copy(__first, __mid, __position);
22422 const size_type __len =
22423 _M_check_len(__n, "vector::_M_range_insert");
22424 pointer __new_start(this->_M_allocate(__len));
22425 pointer __new_finish(__new_start);
22429 std::__uninitialized_move_a(this->_M_impl._M_start,
22432 _M_get_Tp_allocator());
22434 std::__uninitialized_copy_a(__first, __last,
22436 _M_get_Tp_allocator());
22438 std::__uninitialized_move_a(__position.base(),
22439 this->_M_impl._M_finish,
22441 _M_get_Tp_allocator());
22445 std::_Destroy(__new_start, __new_finish,
22446 _M_get_Tp_allocator());
22447 _M_deallocate(__new_start, __len);
22450 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
22451 _M_get_Tp_allocator());
22452 _M_deallocate(this->_M_impl._M_start,
22453 this->_M_impl._M_end_of_storage
22454 - this->_M_impl._M_start);
22455 this->_M_impl._M_start = __new_start;
22456 this->_M_impl._M_finish = __new_finish;
22457 this->_M_impl._M_end_of_storage = __new_start + __len;
22461 template<typename _Alloc>
22463 vector<bool, _Alloc>::
22464 reserve(size_type __n)
22466 if (__n > this->max_size())
22467 __throw_length_error(("vector::reserve"));
22468 if (this->capacity() < __n)
22470 _Bit_type* __q = this->_M_allocate(__n);
22471 this->_M_impl._M_finish = _M_copy_aligned(begin(), end(),
22473 this->_M_deallocate();
22474 this->_M_impl._M_start = iterator(__q, 0);
22475 this->_M_impl._M_end_of_storage = (__q + (__n + int(_S_word_bit) - 1)
22476 / int(_S_word_bit));
22479 template<typename _Alloc>
22481 vector<bool, _Alloc>::
22482 _M_fill_insert(iterator __position, size_type __n, bool __x)
22486 if (capacity() - size() >= __n)
22488 std::copy_backward(__position, end(),
22489 this->_M_impl._M_finish + difference_type(__n));
22490 std::fill(__position, __position + difference_type(__n), __x);
22491 this->_M_impl._M_finish += difference_type(__n);
22495 const size_type __len =
22496 _M_check_len(__n, "vector<bool>::_M_fill_insert");
22497 _Bit_type * __q = this->_M_allocate(__len);
22498 iterator __i = _M_copy_aligned(begin(), __position,
22500 std::fill(__i, __i + difference_type(__n), __x);
22501 this->_M_impl._M_finish = std::copy(__position, end(),
22502 __i + difference_type(__n));
22503 this->_M_deallocate();
22504 this->_M_impl._M_end_of_storage = (__q + ((__len
22505 + int(_S_word_bit) - 1)
22506 / int(_S_word_bit)));
22507 this->_M_impl._M_start = iterator(__q, 0);
22510 template<typename _Alloc>
22511 template<typename _ForwardIterator>
22513 vector<bool, _Alloc>::
22514 _M_insert_range(iterator __position, _ForwardIterator __first,
22515 _ForwardIterator __last, std::forward_iterator_tag)
22517 if (__first != __last)
22519 size_type __n = std::distance(__first, __last);
22520 if (capacity() - size() >= __n)
22522 std::copy_backward(__position, end(),
22523 this->_M_impl._M_finish
22524 + difference_type(__n));
22525 std::copy(__first, __last, __position);
22526 this->_M_impl._M_finish += difference_type(__n);
22530 const size_type __len =
22531 _M_check_len(__n, "vector<bool>::_M_insert_range");
22532 _Bit_type * __q = this->_M_allocate(__len);
22533 iterator __i = _M_copy_aligned(begin(), __position,
22535 __i = std::copy(__first, __last, __i);
22536 this->_M_impl._M_finish = std::copy(__position, end(), __i);
22537 this->_M_deallocate();
22538 this->_M_impl._M_end_of_storage = (__q
22540 + int(_S_word_bit) - 1)
22541 / int(_S_word_bit)));
22542 this->_M_impl._M_start = iterator(__q, 0);
22546 template<typename _Alloc>
22548 vector<bool, _Alloc>::
22549 _M_insert_aux(iterator __position, bool __x)
22551 if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
22553 std::copy_backward(__position, this->_M_impl._M_finish,
22554 this->_M_impl._M_finish + 1);
22556 ++this->_M_impl._M_finish;
22560 const size_type __len =
22561 _M_check_len(size_type(1), "vector<bool>::_M_insert_aux");
22562 _Bit_type * __q = this->_M_allocate(__len);
22563 iterator __i = _M_copy_aligned(begin(), __position,
22566 this->_M_impl._M_finish = std::copy(__position, end(), __i);
22567 this->_M_deallocate();
22568 this->_M_impl._M_end_of_storage = (__q + ((__len
22569 + int(_S_word_bit) - 1)
22570 / int(_S_word_bit)));
22571 this->_M_impl._M_start = iterator(__q, 0);
22581 unsigned int __w_termsig:7;
22582 unsigned int __w_coredump:1;
22583 unsigned int __w_retcode:8;
22585 } __wait_terminated;
22588 unsigned int __w_stopval:8;
22589 unsigned int __w_stopsig:8;
22603 __extension__ typedef struct
22605 long long int quot;
22608 extern double atof (__const char *__nptr)
22609 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
22610 extern int atoi (__const char *__nptr)
22611 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
22612 extern long int atol (__const char *__nptr)
22613 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
22614 __extension__ extern long long int atoll (__const char *__nptr)
22615 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
22616 extern double strtod (__const char *__restrict __nptr,
22617 char **__restrict __endptr)
22618 throw () __attribute__ ((__nonnull__ (1))) ;
22619 extern float strtof (__const char *__restrict __nptr,
22620 char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))) ;
22621 extern long double strtold (__const char *__restrict __nptr,
22622 char **__restrict __endptr)
22623 throw () __attribute__ ((__nonnull__ (1))) ;
22624 extern long int strtol (__const char *__restrict __nptr,
22625 char **__restrict __endptr, int __base)
22626 throw () __attribute__ ((__nonnull__ (1))) ;
22627 extern unsigned long int strtoul (__const char *__restrict __nptr,
22628 char **__restrict __endptr, int __base)
22629 throw () __attribute__ ((__nonnull__ (1))) ;
22631 extern long long int strtoq (__const char *__restrict __nptr,
22632 char **__restrict __endptr, int __base)
22633 throw () __attribute__ ((__nonnull__ (1))) ;
22635 extern unsigned long long int strtouq (__const char *__restrict __nptr,
22636 char **__restrict __endptr, int __base)
22637 throw () __attribute__ ((__nonnull__ (1))) ;
22639 extern long long int strtoll (__const char *__restrict __nptr,
22640 char **__restrict __endptr, int __base)
22641 throw () __attribute__ ((__nonnull__ (1))) ;
22643 extern unsigned long long int strtoull (__const char *__restrict __nptr,
22644 char **__restrict __endptr, int __base)
22645 throw () __attribute__ ((__nonnull__ (1))) ;
22646 extern char *l64a (long int __n) throw () ;
22647 extern long int a64l (__const char *__s)
22648 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
22650 typedef __u_char u_char;
22651 typedef __u_short u_short;
22652 typedef __u_int u_int;
22653 typedef __u_long u_long;
22654 typedef __quad_t quad_t;
22655 typedef __u_quad_t u_quad_t;
22656 typedef __fsid_t fsid_t;
22657 typedef __loff_t loff_t;
22658 typedef __ino_t ino_t;
22659 typedef __ino64_t ino64_t;
22660 typedef __dev_t dev_t;
22661 typedef __mode_t mode_t;
22662 typedef __nlink_t nlink_t;
22663 typedef __id_t id_t;
22664 typedef __daddr_t daddr_t;
22665 typedef __caddr_t caddr_t;
22666 typedef __key_t key_t;
22667 typedef __suseconds_t suseconds_t;
22668 typedef unsigned long int ulong;
22669 typedef unsigned short int ushort;
22670 typedef unsigned int uint;
22671 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
22672 typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
22673 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
22674 typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
22675 typedef int register_t __attribute__ ((__mode__ (__word__)));
22679 __suseconds_t tv_usec;
22681 typedef long int __fd_mask;
22684 __fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask))];
22686 typedef __fd_mask fd_mask;
22688 extern int select (int __nfds, fd_set *__restrict __readfds,
22689 fd_set *__restrict __writefds,
22690 fd_set *__restrict __exceptfds,
22691 struct timeval *__restrict __timeout);
22692 extern int pselect (int __nfds, fd_set *__restrict __readfds,
22693 fd_set *__restrict __writefds,
22694 fd_set *__restrict __exceptfds,
22695 const struct timespec *__restrict __timeout,
22696 const __sigset_t *__restrict __sigmask);
22699 static __inline unsigned int gnu_dev_major (unsigned long long int __dev)
22702 static __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
22705 static __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
22706 unsigned int __minor)
22708 __extension__ static __inline unsigned int
22709 gnu_dev_major (unsigned long long int __dev) throw ()
22711 return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
22713 __extension__ static __inline unsigned int
22714 gnu_dev_minor (unsigned long long int __dev) throw ()
22716 return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
22718 __extension__ static __inline unsigned long long int
22719 gnu_dev_makedev (unsigned int __major, unsigned int __minor) throw ()
22721 return ((__minor & 0xff) | ((__major & 0xfff) << 8)
22722 | (((unsigned long long int) (__minor & ~0xff)) << 12)
22723 | (((unsigned long long int) (__major & ~0xfff)) << 32));
22725 typedef __blksize_t blksize_t;
22726 typedef __blkcnt_t blkcnt_t;
22727 typedef __fsblkcnt_t fsblkcnt_t;
22728 typedef __fsfilcnt_t fsfilcnt_t;
22729 typedef __blkcnt64_t blkcnt64_t;
22730 typedef __fsblkcnt64_t fsblkcnt64_t;
22731 typedef __fsfilcnt64_t fsfilcnt64_t;
22733 extern long int random (void) throw ();
22734 extern void srandom (unsigned int __seed) throw ();
22735 extern char *initstate (unsigned int __seed, char *__statebuf,
22736 size_t __statelen) throw () __attribute__ ((__nonnull__ (2)));
22737 extern char *setstate (char *__statebuf) throw () __attribute__ ((__nonnull__ (1)));
22748 extern int random_r (struct random_data *__restrict __buf,
22749 int32_t *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
22750 extern int srandom_r (unsigned int __seed, struct random_data *__buf)
22751 throw () __attribute__ ((__nonnull__ (2)));
22752 extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
22754 struct random_data *__restrict __buf)
22755 throw () __attribute__ ((__nonnull__ (2, 4)));
22756 extern int setstate_r (char *__restrict __statebuf,
22757 struct random_data *__restrict __buf)
22758 throw () __attribute__ ((__nonnull__ (1, 2)));
22759 extern int rand (void) throw ();
22760 extern void srand (unsigned int __seed) throw ();
22761 extern int rand_r (unsigned int *__seed) throw ();
22762 extern double drand48 (void) throw ();
22763 extern double erand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1)));
22764 extern long int lrand48 (void) throw ();
22765 extern long int nrand48 (unsigned short int __xsubi[3])
22766 throw () __attribute__ ((__nonnull__ (1)));
22767 extern long int mrand48 (void) throw ();
22768 extern long int jrand48 (unsigned short int __xsubi[3])
22769 throw () __attribute__ ((__nonnull__ (1)));
22770 extern void srand48 (long int __seedval) throw ();
22771 extern unsigned short int *seed48 (unsigned short int __seed16v[3])
22772 throw () __attribute__ ((__nonnull__ (1)));
22773 extern void lcong48 (unsigned short int __param[7]) throw () __attribute__ ((__nonnull__ (1)));
22774 struct drand48_data
22776 unsigned short int __x[3];
22777 unsigned short int __old_x[3];
22778 unsigned short int __c;
22779 unsigned short int __init;
22780 unsigned long long int __a;
22782 extern int drand48_r (struct drand48_data *__restrict __buffer,
22783 double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
22784 extern int erand48_r (unsigned short int __xsubi[3],
22785 struct drand48_data *__restrict __buffer,
22786 double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
22787 extern int lrand48_r (struct drand48_data *__restrict __buffer,
22788 long int *__restrict __result)
22789 throw () __attribute__ ((__nonnull__ (1, 2)));
22790 extern int nrand48_r (unsigned short int __xsubi[3],
22791 struct drand48_data *__restrict __buffer,
22792 long int *__restrict __result)
22793 throw () __attribute__ ((__nonnull__ (1, 2)));
22794 extern int mrand48_r (struct drand48_data *__restrict __buffer,
22795 long int *__restrict __result)
22796 throw () __attribute__ ((__nonnull__ (1, 2)));
22797 extern int jrand48_r (unsigned short int __xsubi[3],
22798 struct drand48_data *__restrict __buffer,
22799 long int *__restrict __result)
22800 throw () __attribute__ ((__nonnull__ (1, 2)));
22801 extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
22802 throw () __attribute__ ((__nonnull__ (2)));
22803 extern int seed48_r (unsigned short int __seed16v[3],
22804 struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2)));
22805 extern int lcong48_r (unsigned short int __param[7],
22806 struct drand48_data *__buffer)
22807 throw () __attribute__ ((__nonnull__ (1, 2)));
22808 extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__)) ;
22809 extern void *calloc (size_t __nmemb, size_t __size)
22810 throw () __attribute__ ((__malloc__)) ;
22811 extern void *realloc (void *__ptr, size_t __size)
22812 throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
22813 extern void free (void *__ptr) throw ();
22814 extern void cfree (void *__ptr) throw ();
22816 extern void *alloca (size_t __size) throw ();
22818 extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__)) ;
22819 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
22820 throw () __attribute__ ((__nonnull__ (1))) ;
22821 extern void abort (void) throw () __attribute__ ((__noreturn__));
22822 extern int atexit (void (*__func) (void)) throw () __attribute__ ((__nonnull__ (1)));
22823 extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
22824 throw () __attribute__ ((__nonnull__ (1)));
22825 extern void exit (int __status) throw () __attribute__ ((__noreturn__));
22826 extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));
22827 extern char *getenv (__const char *__name) throw () __attribute__ ((__nonnull__ (1))) ;
22828 extern char *__secure_getenv (__const char *__name)
22829 throw () __attribute__ ((__nonnull__ (1))) ;
22830 extern int putenv (char *__string) throw () __attribute__ ((__nonnull__ (1)));
22831 extern int setenv (__const char *__name, __const char *__value, int __replace)
22832 throw () __attribute__ ((__nonnull__ (2)));
22833 extern int unsetenv (__const char *__name) throw ();
22834 extern int clearenv (void) throw ();
22835 extern char *mktemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) ;
22836 extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
22837 extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
22838 extern char *mkdtemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) ;
22839 extern int system (__const char *__command) ;
22840 extern char *realpath (__const char *__restrict __name,
22841 char *__restrict __resolved) throw () __attribute__ ((__nonnull__ (2)));
22842 typedef int (*__compar_fn_t) (__const void *, __const void *);
22843 typedef __compar_fn_t comparison_fn_t;
22844 extern void *bsearch (__const void *__key, __const void *__base,
22845 size_t __nmemb, size_t __size, __compar_fn_t __compar)
22846 __attribute__ ((__nonnull__ (1, 2, 5))) ;
22847 extern void qsort (void *__base, size_t __nmemb, size_t __size,
22848 __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
22849 extern int abs (int __x) throw () __attribute__ ((__const__)) ;
22850 extern long int labs (long int __x) throw () __attribute__ ((__const__)) ;
22851 __extension__ extern long long int llabs (long long int __x)
22852 throw () __attribute__ ((__const__)) ;
22853 extern div_t div (int __numer, int __denom)
22854 throw () __attribute__ ((__const__)) ;
22855 extern ldiv_t ldiv (long int __numer, long int __denom)
22856 throw () __attribute__ ((__const__)) ;
22857 __extension__ extern lldiv_t lldiv (long long int __numer,
22858 long long int __denom)
22859 throw () __attribute__ ((__const__)) ;
22860 extern char *gcvt (double __value, int __ndigit, char *__buf)
22861 throw () __attribute__ ((__nonnull__ (3))) ;
22862 extern int rpmatch (__const char *__response) throw () __attribute__ ((__nonnull__ (1))) ;
22863 extern int getsubopt (char **__restrict __optionp,
22864 char *__const *__restrict __tokens,
22865 char **__restrict __valuep)
22866 throw () __attribute__ ((__nonnull__ (1, 2, 3))) ;
22867 extern void setkey (__const char *__key) throw () __attribute__ ((__nonnull__ (1)));
22868 extern int posix_openpt (int __oflag) ;
22869 extern int grantpt (int __fd) throw ();
22870 extern int unlockpt (int __fd) throw ();
22871 extern char *ptsname (int __fd) throw () ;
22872 extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
22873 throw () __attribute__ ((__nonnull__ (2)));
22875 typedef QtValidLicenseForCoreModule QtCoreModule;
22876 struct __attribute__((visibility("default"))) QVectorData
22878 QBasicAtomicInt ref;
22883 static QVectorData shared_null;
22884 static QVectorData *malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init);
22885 static int grow(int sizeofTypedData, int size, int sizeofT, bool excessive);
22887 template <typename T>
22888 struct QVectorTypedData
22890 QBasicAtomicInt ref;
22898 template <typename T>
22901 typedef QVectorTypedData<T> Data;
22902 union { QVectorData *p; QVectorTypedData<T> *d; };
22904 inline QVector() : p(&QVectorData::shared_null) { d->ref.ref(); }
22905 explicit QVector(int size);
22906 QVector(int size, const T &t);
22907 inline QVector(const QVector<T> &v) : d(v.d) { d->ref.ref(); if (!d->sharable) detach_helper(); }
22908 inline ~QVector() { if (!d) return; if (!d->ref.deref()) free(d); }
22909 QVector<T> &operator=(const QVector<T> &v);
22910 bool operator==(const QVector<T> &v) const;
22911 inline bool operator!=(const QVector<T> &v) const { return !(*this == v); }
22912 inline int size() const { return d->size; }
22913 inline bool isEmpty() const { return d->size == 0; }
22914 void resize(int size);
22915 inline int capacity() const { return d->alloc; }
22916 void reserve(int size);
22917 inline void squeeze() { realloc(d->size, d->size); d->capacity = 0; }
22918 inline void detach() { if (d->ref != 1) detach_helper(); }
22919 inline bool isDetached() const { return d->ref == 1; }
22920 inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
22921 inline T *data() { detach(); return d->array; }
22922 inline const T *data() const { return d->array; }
22923 inline const T *constData() const { return d->array; }
22925 const T &at(int i) const;
22926 T &operator[](int i);
22927 const T &operator[](int i) const;
22928 void append(const T &t);
22929 void prepend(const T &t);
22930 void insert(int i, const T &t);
22931 void insert(int i, int n, const T &t);
22932 void replace(int i, const T &t);
22933 void remove(int i);
22934 void remove(int i, int n);
22935 QVector<T> &fill(const T &t, int size = -1);
22936 int indexOf(const T &t, int from = 0) const;
22937 int lastIndexOf(const T &t, int from = -1) const;
22938 bool contains(const T &t) const;
22939 int count(const T &t) const;
22940 typedef T* iterator;
22941 typedef const T* const_iterator;
22942 inline iterator begin() { detach(); return d->array; }
22943 inline const_iterator begin() const { return d->array; }
22944 inline const_iterator constBegin() const { return d->array; }
22945 inline iterator end() { detach(); return d->array + d->size; }
22946 inline const_iterator end() const { return d->array + d->size; }
22947 inline const_iterator constEnd() const { return d->array + d->size; }
22948 iterator insert(iterator before, int n, const T &x);
22949 inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); }
22950 iterator erase(iterator begin, iterator end);
22951 inline iterator erase(iterator pos) { return erase(pos, pos+1); }
22952 inline int count() const { return d->size; }
22953 inline T& first() { qt_noop(); return *begin(); }
22954 inline const T &first() const { qt_noop(); return *begin(); }
22955 inline T& last() { qt_noop(); return *(end()-1); }
22956 inline const T &last() const { qt_noop(); return *(end()-1); }
22957 inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; }
22958 inline bool endsWith(const T &t) const { return !isEmpty() && last() == t; }
22959 QVector<T> mid(int pos, int length = -1) const;
22960 T value(int i) const;
22961 T value(int i, const T &defaultValue) const;
22962 typedef T value_type;
22963 typedef value_type* pointer;
22964 typedef const value_type* const_pointer;
22965 typedef value_type& reference;
22966 typedef const value_type& const_reference;
22967 typedef ptrdiff_t difference_type;
22968 typedef iterator Iterator;
22969 typedef const_iterator ConstIterator;
22970 typedef int size_type;
22971 inline void push_back(const T &t) { append(t); }
22972 inline void push_front(const T &t) { prepend(t); }
22973 void pop_back() { qt_noop(); erase(end()-1); }
22974 void pop_front() { qt_noop(); erase(begin()); }
22975 inline bool empty() const
22976 { return d->size == 0; }
22977 inline T& front() { return first(); }
22978 inline const_reference front() const { return first(); }
22979 inline reference back() { return last(); }
22980 inline const_reference back() const { return last(); }
22981 QVector<T> &operator+=(const QVector<T> &l);
22982 inline QVector<T> operator+(const QVector<T> &l) const
22983 { QVector n = *this; n += l; return n; }
22984 inline QVector<T> &operator+=(const T &t)
22985 { append(t); return *this; }
22986 inline QVector<T> &operator<< (const T &t)
22987 { append(t); return *this; }
22988 inline QVector<T> &operator<<(const QVector<T> &l)
22989 { *this += l; return *this; }
22990 QList<T> toList() const;
22991 static QVector<T> fromList(const QList<T> &list);
22992 static inline QVector<T> fromStdVector(const std::vector<T> &vector)
22993 { QVector<T> tmp; qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; }
22994 inline std::vector<T> toStdVector() const
22995 { std::vector<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
22997 friend class QRegion;
22998 void detach_helper();
22999 QVectorData *malloc(int alloc);
23000 void realloc(int size, int alloc);
23001 void free(Data *d);
23002 int sizeOfTypedData() {
23003 return reinterpret_cast<const char *>(&(reinterpret_cast<const Data *>(this))->array[1]) - reinterpret_cast<const char *>(this);
23006 template <typename T>
23007 void QVector<T>::detach_helper()
23008 { realloc(d->size, d->alloc); }
23009 template <typename T>
23010 void QVector<T>::reserve(int asize)
23011 { if (asize > d->alloc) realloc(d->size, asize); d->capacity = 1; }
23012 template <typename T>
23013 void QVector<T>::resize(int asize)
23014 { realloc(asize, (asize > d->alloc || (!d->capacity && asize < d->size && asize < (d->alloc >> 1))) ?
23015 QVectorData::grow(sizeOfTypedData(), asize, sizeof(T), QTypeInfo<T>::isStatic)
23017 template <typename T>
23018 inline void QVector<T>::clear()
23019 { *this = QVector<T>(); }
23020 template <typename T>
23021 inline const T &QVector<T>::at(int i) const
23023 return d->array[i]; }
23024 template <typename T>
23025 inline const T &QVector<T>::operator[](int i) const
23027 return d->array[i]; }
23028 template <typename T>
23029 inline T &QVector<T>::operator[](int i)
23031 return data()[i]; }
23032 template <typename T>
23033 inline void QVector<T>::insert(int i, const T &t)
23035 insert(begin() + i, 1, t); }
23036 template <typename T>
23037 inline void QVector<T>::insert(int i, int n, const T &t)
23039 insert(begin() + i, n, t); }
23040 template <typename T>
23041 inline void QVector<T>::remove(int i, int n)
23043 erase(begin() + i, begin() + i + n); }
23044 template <typename T>
23045 inline void QVector<T>::remove(int i)
23047 erase(begin() + i, begin() + i + 1); }
23048 template <typename T>
23049 inline void QVector<T>::prepend(const T &t)
23050 { insert(begin(), 1, t); }
23051 template <typename T>
23052 inline void QVector<T>::replace(int i, const T &t)
23058 template <typename T>
23059 QVector<T> &QVector<T>::operator=(const QVector<T> &v)
23062 if (!d->ref.deref())
23069 template <typename T>
23070 inline QVectorData *QVector<T>::malloc(int aalloc)
23072 return static_cast<QVectorData *>(qMalloc(sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
23074 template <typename T>
23075 QVector<T>::QVector(int asize)
23079 d->alloc = d->size = asize;
23080 d->sharable = true;
23081 d->capacity = false;
23082 if (QTypeInfo<T>::isComplex) {
23084 T* i = d->array + d->size;
23088 qMemSet(d->array, 0, asize * sizeof(T));
23091 template <typename T>
23092 QVector<T>::QVector(int asize, const T &t)
23096 d->alloc = d->size = asize;
23097 d->sharable = true;
23098 d->capacity = false;
23099 T* i = d->array + d->size;
23100 while (i != d->array)
23103 template <typename T>
23104 void QVector<T>::free(Data *x)
23106 if (QTypeInfo<T>::isComplex) {
23108 T* i = b + x->size;
23114 template <typename T>
23115 void QVector<T>::realloc(int asize, int aalloc)
23118 union { QVectorData *p; Data *d; } x;
23120 if (QTypeInfo<T>::isComplex && aalloc == d->alloc && d->ref == 1) {
23121 i = d->array + d->size;
23122 j = d->array + asize;
23133 if (aalloc != d->alloc || d->ref != 1) {
23134 if (QTypeInfo<T>::isStatic) {
23135 x.p = malloc(aalloc);
23136 } else if (d->ref != 1) {
23137 x.p = QVectorData::malloc(sizeOfTypedData(), aalloc, sizeof(T), p);
23139 if (QTypeInfo<T>::isComplex) {
23140 if (asize < d->size) {
23141 j = d->array + asize;
23142 i = d->array + d->size;
23145 i = d->array + asize;
23148 x.p = p = static_cast<QVectorData *>(qRealloc(p, sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
23151 x.d->sharable = true;
23152 x.d->capacity = d->capacity;
23154 if (QTypeInfo<T>::isComplex) {
23155 if (asize < d->size) {
23156 j = d->array + asize;
23157 i = x.d->array + asize;
23159 i = x.d->array + asize;
23160 j = x.d->array + d->size;
23163 j = d->array + d->size;
23170 } else if (asize > d->size) {
23171 qMemSet(x.d->array + d->size, 0, (asize - d->size) * sizeof(T));
23174 x.d->alloc = aalloc;
23176 if (!d->ref.deref())
23181 template<typename T>
23182 T QVector<T>::value(int i) const
23184 if (i < 0 || i >= p->size) {
23187 return d->array[i];
23189 template<typename T>
23190 T QVector<T>::value(int i, const T &defaultValue) const
23192 return ((i < 0 || i >= p->size) ? defaultValue : d->array[i]);
23194 template <typename T>
23195 void QVector<T>::append(const T &t)
23197 if (d->ref != 1 || d->size + 1 > d->alloc) {
23199 realloc(d->size, QVectorData::grow(sizeOfTypedData(), d->size + 1, sizeof(T),
23200 QTypeInfo<T>::isStatic));
23201 if (QTypeInfo<T>::isComplex)
23202 new (d->array + d->size) T(copy);
23204 d->array[d->size] = copy;
23206 if (QTypeInfo<T>::isComplex)
23207 new (d->array + d->size) T(t);
23209 d->array[d->size] = t;
23213 template <typename T>
23214 typename QVector<T>::iterator QVector<T>::insert(iterator before, size_type n, const T &t)
23216 int offset = before - d->array;
23219 if (d->ref != 1 || d->size + n > d->alloc)
23220 realloc(d->size, QVectorData::grow(sizeOfTypedData(), d->size + n, sizeof(T),
23221 QTypeInfo<T>::isStatic));
23222 if (QTypeInfo<T>::isStatic) {
23223 T *b = d->array + d->size;
23224 T *i = d->array + d->size + n;
23227 i = d->array + d->size;
23229 b = d->array + offset;
23236 T *b = d->array + offset;
23238 memmove(i, b, (d->size - offset) * sizeof(T));
23244 return d->array + offset;
23246 template <typename T>
23247 typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
23249 int f = abegin - d->array;
23250 int l = aend - d->array;
23253 if (QTypeInfo<T>::isComplex) {
23254 qCopy(d->array+l, d->array+d->size, d->array+f);
23255 T *i = d->array+d->size;
23256 T* b = d->array+d->size-n;
23262 memmove(d->array + f, d->array + l, (d->size-l)*sizeof(T));
23265 return d->array + f;
23267 template <typename T>
23268 bool QVector<T>::operator==(const QVector<T> &v) const
23270 if (d->size != v.d->size)
23275 T* i = b + d->size;
23276 T* j = v.d->array + d->size;
23278 if (!(*--i == *--j))
23282 template <typename T>
23283 QVector<T> &QVector<T>::fill(const T &from, int asize)
23285 const T copy(from);
23286 resize(asize < 0 ? d->size : asize);
23288 T *i = d->array + d->size;
23295 template <typename T>
23296 QVector<T> &QVector<T>::operator+=(const QVector &l)
23298 int newSize = d->size + l.d->size;
23299 realloc(d->size, newSize);
23300 T *w = d->array + newSize;
23301 T *i = l.d->array + l.d->size;
23304 if (QTypeInfo<T>::isComplex)
23312 template <typename T>
23313 int QVector<T>::indexOf(const T &t, int from) const
23316 from = qMax(from + d->size, 0);
23317 if (from < d->size) {
23318 T* n = d->array + from - 1;
23319 T* e = d->array + d->size;
23322 return n - d->array;
23326 template <typename T>
23327 int QVector<T>::lastIndexOf(const T &t, int from) const
23331 else if (from >= d->size)
23335 T* n = d->array + from + 1;
23343 template <typename T>
23344 bool QVector<T>::contains(const T &t) const
23347 T* i = d->array + d->size;
23353 template <typename T>
23354 int QVector<T>::count(const T &t) const
23358 T* i = d->array + d->size;
23364 template <typename T>
23365 QVector<T> QVector<T>::mid(int pos, int length) const
23368 length = size() - pos;
23369 if (pos == 0 && length == size())
23372 if (pos + length > size())
23373 length = size() - pos;
23374 for (int i = pos; i < pos + length; ++i)
23378 template <typename T>
23379 QList<T> QVector<T>::toList() const
23382 for (int i = 0; i < size(); ++i)
23383 result.append(at(i));
23386 template <typename T>
23387 QVector<T> QList<T>::toVector() const
23389 QVector<T> result(size());
23390 for (int i = 0; i < size(); ++i)
23394 template <typename T>
23395 QVector<T> QVector<T>::fromList(const QList<T> &list)
23397 return list.toVector();
23399 template <typename T>
23400 QList<T> QList<T>::fromVector(const QVector<T> &vector)
23402 return vector.toList();
23404 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; } };
23405 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; } };
23406 typedef QtValidLicenseForCoreModule QtCoreModule;
23410 typedef QHash<T, QHashDummyValue> Hash;
23413 inline QSet(const QSet<T> &other) : q_hash(other.q_hash) {}
23414 inline QSet<T> &operator=(const QSet<T> &other)
23415 { q_hash = other.q_hash; return *this; }
23416 inline bool operator==(const QSet<T> &other) const
23417 { return q_hash == other.q_hash; }
23418 inline bool operator!=(const QSet<T> &other) const
23419 { return q_hash != other.q_hash; }
23420 inline int size() const { return q_hash.size(); }
23421 inline bool isEmpty() const { return q_hash.isEmpty(); }
23422 inline int capacity() const { return q_hash.capacity(); }
23423 inline void reserve(int size);
23424 inline void squeeze() { q_hash.squeeze(); }
23425 inline void detach() { q_hash.detach(); }
23426 inline bool isDetached() const { return q_hash.isDetached(); }
23427 inline void setSharable(bool sharable) { q_hash.setSharable(sharable); }
23428 inline void clear() { q_hash.clear(); }
23429 inline bool remove(const T &value) { return q_hash.remove(value) != 0; }
23430 inline bool contains(const T &value) const { return q_hash.contains(value); }
23431 class const_iterator;
23434 typedef QHash<T, QHashDummyValue> Hash;
23435 typename Hash::iterator i;
23436 friend class const_iterator;
23438 typedef std::bidirectional_iterator_tag iterator_category;
23439 typedef ptrdiff_t difference_type;
23440 typedef T value_type;
23441 typedef const T *pointer;
23442 typedef const T &reference;
23443 inline iterator() {}
23444 inline iterator(typename Hash::iterator o) : i(o) {}
23445 inline iterator(const iterator &o) : i(o.i) {}
23446 inline iterator &operator=(const iterator &o) { i = o.i; return *this; }
23447 inline const T &operator*() const { return i.key(); }
23448 inline const T *operator->() const { return &i.key(); }
23449 inline bool operator==(const iterator &o) const { return i == o.i; }
23450 inline bool operator!=(const iterator &o) const { return i != o.i; }
23451 inline bool operator==(const const_iterator &o) const
23452 { return i == o.i; }
23453 inline bool operator!=(const const_iterator &o) const
23454 { return i != o.i; }
23455 inline iterator &operator++() { ++i; return *this; }
23456 inline iterator operator++(int) { iterator r = *this; ++i; return r; }
23457 inline iterator &operator--() { --i; return *this; }
23458 inline iterator operator--(int) { iterator r = *this; --i; return r; }
23459 inline iterator operator+(int j) const { return i + j; }
23460 inline iterator operator-(int j) const { return i - j; }
23461 inline iterator &operator+=(int j) { i += j; return *this; }
23462 inline iterator &operator-=(int j) { i -= j; return *this; }
23464 class const_iterator
23466 typedef QHash<T, QHashDummyValue> Hash;
23467 typename Hash::const_iterator i;
23468 friend class iterator;
23470 typedef std::bidirectional_iterator_tag iterator_category;
23471 typedef ptrdiff_t difference_type;
23472 typedef T value_type;
23473 typedef const T *pointer;
23474 typedef const T &reference;
23475 inline const_iterator() {}
23476 inline const_iterator(typename Hash::const_iterator o) : i(o) {}
23477 inline const_iterator(const const_iterator &o) : i(o.i) {}
23478 inline const_iterator(const iterator &o)
23480 inline const_iterator &operator=(const const_iterator &o) { i = o.i; return *this; }
23481 inline const T &operator*() const { return i.key(); }
23482 inline const T *operator->() const { return &i.key(); }
23483 inline bool operator==(const const_iterator &o) const { return i == o.i; }
23484 inline bool operator!=(const const_iterator &o) const { return i != o.i; }
23485 inline const_iterator &operator++() { ++i; return *this; }
23486 inline const_iterator operator++(int) { const_iterator r = *this; ++i; return r; }
23487 inline const_iterator &operator--() { --i; return *this; }
23488 inline const_iterator operator--(int) { const_iterator r = *this; --i; return r; }
23489 inline const_iterator operator+(int j) const { return i + j; }
23490 inline const_iterator operator-(int j) const { return i - j; }
23491 inline const_iterator &operator+=(int j) { i += j; return *this; }
23492 inline const_iterator &operator-=(int j) { i -= j; return *this; }
23494 inline iterator begin() { return q_hash.begin(); }
23495 inline const_iterator begin() const { return q_hash.begin(); }
23496 inline const_iterator constBegin() const { return q_hash.constBegin(); }
23497 inline iterator end() { return q_hash.end(); }
23498 inline const_iterator end() const { return q_hash.end(); }
23499 inline const_iterator constEnd() const { return q_hash.constEnd(); }
23500 iterator erase(iterator i)
23501 { return q_hash.erase(reinterpret_cast<typename Hash::iterator &>(i)); }
23502 typedef iterator Iterator;
23503 typedef const_iterator ConstIterator;
23504 inline int count() const { return q_hash.count(); }
23505 inline const_iterator insert(const T &value)
23506 { return static_cast<typename Hash::const_iterator>(q_hash.insert(value,
23507 QHashDummyValue())); }
23508 iterator find(const T &value) { return q_hash.find(value); }
23509 const_iterator find(const T &value) const { return q_hash.find(value); }
23510 inline const_iterator constFind(const T &value) const { return find(value); }
23511 QSet<T> &unite(const QSet<T> &other);
23512 QSet<T> &intersect(const QSet<T> &other);
23513 QSet<T> &subtract(const QSet<T> &other);
23514 typedef T key_type;
23515 typedef T value_type;
23516 typedef value_type *pointer;
23517 typedef const value_type *const_pointer;
23518 typedef value_type &reference;
23519 typedef const value_type &const_reference;
23520 typedef ptrdiff_t difference_type;
23521 typedef int size_type;
23522 inline bool empty() const { return isEmpty(); }
23523 inline QSet<T> &operator<<(const T &value) { insert(value); return *this; }
23524 inline QSet<T> &operator|=(const QSet<T> &other) { unite(other); return *this; }
23525 inline QSet<T> &operator|=(const T &value) { insert(value); return *this; }
23526 inline QSet<T> &operator&=(const QSet<T> &other) { intersect(other); return *this; }
23527 inline QSet<T> &operator&=(const T &value)
23528 { QSet<T> result; if (contains(value)) result.insert(value); return (*this = result); }
23529 inline QSet<T> &operator+=(const QSet<T> &other) { unite(other); return *this; }
23530 inline QSet<T> &operator+=(const T &value) { insert(value); return *this; }
23531 inline QSet<T> &operator-=(const QSet<T> &other) { subtract(other); return *this; }
23532 inline QSet<T> &operator-=(const T &value) { remove(value); return *this; }
23533 inline QSet<T> operator|(const QSet<T> &other) const
23534 { QSet<T> result = *this; result |= other; return result; }
23535 inline QSet<T> operator&(const QSet<T> &other) const
23536 { QSet<T> result = *this; result &= other; return result; }
23537 inline QSet<T> operator+(const QSet<T> &other) const
23538 { QSet<T> result = *this; result += other; return result; }
23539 inline QSet<T> operator-(const QSet<T> &other) const
23540 { QSet<T> result = *this; result -= other; return result; }
23541 inline QSet<T> operator|(const QSet<T> &other)
23542 { QSet<T> result = *this; result |= other; return result; }
23543 inline QSet<T> operator&(const QSet<T> &other)
23544 { QSet<T> result = *this; result &= other; return result; }
23545 inline QSet<T> operator+(const QSet<T> &other)
23546 { QSet<T> result = *this; result += other; return result; }
23547 inline QSet<T> operator-(const QSet<T> &other)
23548 { QSet<T> result = *this; result -= other; return result; }
23549 QList<T> toList() const;
23550 inline QList<T> values() const { return toList(); }
23551 static QSet<T> fromList(const QList<T> &list);
23556 inline void QSet<T>::reserve(int asize) { q_hash.reserve(asize); }
23558 inline QSet<T> &QSet<T>::unite(const QSet<T> &other)
23560 QSet<T> copy(other);
23561 typename QSet<T>::const_iterator i = copy.constEnd();
23562 while (i != copy.constBegin()) {
23569 inline QSet<T> &QSet<T>::intersect(const QSet<T> &other)
23571 QSet<T> copy1(*this);
23572 QSet<T> copy2(other);
23573 typename QSet<T>::const_iterator i = copy1.constEnd();
23574 while (i != copy1.constBegin()) {
23576 if (!copy2.contains(*i))
23582 inline QSet<T> &QSet<T>::subtract(const QSet<T> &other)
23584 QSet<T> copy1(*this);
23585 QSet<T> copy2(other);
23586 typename QSet<T>::const_iterator i = copy1.constEnd();
23587 while (i != copy1.constBegin()) {
23589 if (copy2.contains(*i))
23594 template <typename T>
23595 QList<T> QSet<T>::toList() const
23598 typename QSet<T>::const_iterator i = constBegin();
23599 while (i != constEnd()) {
23605 template <typename T>
23606 QSet<T> QList<T>::toSet() const
23609 result.reserve(size());
23610 for (int i = 0; i < size(); ++i)
23611 result.insert(at(i));
23614 template <typename T>
23615 QSet<T> QSet<T>::fromList(const QList<T> &list)
23617 return list.toSet();
23619 template <typename T>
23620 QList<T> QList<T>::fromSet(const QSet<T> &set)
23622 return set.toList();
23624 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; } };
23625 template <typename T>
23626 class QMutableSetIterator
23628 typedef typename QSet<T>::iterator iterator;
23631 inline bool item_exists() const { return n != c->constEnd(); }
23633 inline QMutableSetIterator(QSet<T> &container)
23635 { c->setSharable(false); i = c->begin(); n = c->end(); }
23636 inline ~QMutableSetIterator()
23637 { c->setSharable(true); }
23638 inline QMutableSetIterator &operator=(QSet<T> &container)
23639 { c->setSharable(true); c = &container; c->setSharable(false);
23640 i = c->begin(); n = c->end(); return *this; }
23641 inline void toFront() { i = c->begin(); n = c->end(); }
23642 inline void toBack() { i = c->end(); n = i; }
23643 inline bool hasNext() const { return c->constEnd() != i; }
23644 inline const T &next() { n = i++; return *n; }
23645 inline const T &peekNext() const { return *i; }
23646 inline bool hasPrevious() const { return c->constBegin() != i; }
23647 inline const T &previous() { n = --i; return *n; }
23648 inline const T &peekPrevious() const { iterator p = i; return *--p; }
23649 inline void remove()
23650 { if (c->constEnd() != n) { i = c->erase(n); n = c->end(); } }
23651 inline const T &value() const { qt_noop(); return *n; }
23652 inline bool findNext(const T &t)
23653 { while (c->constEnd() != (n = i)) if (*i++ == t) return true; return false; }
23654 inline bool findPrevious(const T &t)
23655 { while (c->constBegin() != i) if (*(n = --i) == t) return true;
23656 n = c->end(); return false; }
23658 typedef QtValidLicenseForCoreModule QtCoreModule;
23659 class __attribute__((visibility("default"))) QDebug
23662 Stream(QIODevice *device) : ts(device), ref(1), type(QtDebugMsg), space(true), message_output(false) {}
23663 Stream(QString *string) : ts(string, QIODevice::WriteOnly), ref(1), type(QtDebugMsg), space(true), message_output(false) {}
23664 Stream(QtMsgType t) : ts(&buffer, QIODevice::WriteOnly), ref(1), type(t), space(true), message_output(true) {}
23670 bool message_output;
23673 inline QDebug(QIODevice *device) : stream(new Stream(device)) {}
23674 inline QDebug(QString *string) : stream(new Stream(string)) {}
23675 inline QDebug(QtMsgType t) : stream(new Stream(t)) {}
23676 inline QDebug(const QDebug &o):stream(o.stream) { ++stream->ref; }
23677 inline QDebug &operator=(const QDebug &other);
23679 if (!--stream->ref) {
23680 if(stream->message_output)
23681 qt_message_output(stream->type, stream->buffer.toLocal8Bit().data());
23685 inline QDebug &space() { stream->space = true; stream->ts << " "; return *this; }
23686 inline QDebug &nospace() { stream->space = false; return *this; }
23687 inline QDebug &maybeSpace() { if (stream->space) stream->ts << " "; return *this; }
23688 inline QDebug &operator<<(QChar t) { stream->ts << "\'" << t << "\'"; return maybeSpace(); }
23689 inline QDebug &operator<<(QBool t) { stream->ts << (bool(t) ? "true" : "false"); return maybeSpace(); }
23690 inline QDebug &operator<<(bool t) { stream->ts << (t ? "true" : "false"); return maybeSpace(); }
23691 inline QDebug &operator<<(char t) { stream->ts << t; return maybeSpace(); }
23692 inline QDebug &operator<<(signed short t) { stream->ts << t; return maybeSpace(); }
23693 inline QDebug &operator<<(unsigned short t) { stream->ts << t; return maybeSpace(); }
23694 inline QDebug &operator<<(signed int t) { stream->ts << t; return maybeSpace(); }
23695 inline QDebug &operator<<(unsigned int t) { stream->ts << t; return maybeSpace(); }
23696 inline QDebug &operator<<(signed long t) { stream->ts << t; return maybeSpace(); }
23697 inline QDebug &operator<<(unsigned long t) { stream->ts << t; return maybeSpace(); }
23698 inline QDebug &operator<<(qint64 t)
23699 { stream->ts << QString::number(t); return maybeSpace(); }
23700 inline QDebug &operator<<(quint64 t)
23701 { stream->ts << QString::number(t); return maybeSpace(); }
23702 inline QDebug &operator<<(float t) { stream->ts << t; return maybeSpace(); }
23703 inline QDebug &operator<<(double t) { stream->ts << t; return maybeSpace(); }
23704 inline QDebug &operator<<(const char* t) { stream->ts << QString::fromAscii(t); return maybeSpace(); }
23705 inline QDebug &operator<<(const QString & t) { stream->ts << "\"" << t << "\""; return maybeSpace(); }
23706 inline QDebug &operator<<(const QStringRef & t) { return operator<<(t.toString()); }
23707 inline QDebug &operator<<(const QLatin1String &t) { stream->ts << "\"" << t.latin1() << "\""; return maybeSpace(); }
23708 inline QDebug &operator<<(const QByteArray & t) { stream->ts << "\"" << t << "\""; return maybeSpace(); }
23709 inline QDebug &operator<<(const void * t) { stream->ts << t; return maybeSpace(); }
23710 inline QDebug &operator<<(QTextStreamFunction f) {
23714 inline QDebug &operator<<(QTextStreamManipulator m)
23715 { stream->ts << m; return *this; }
23720 inline QNoDebug(){}
23721 inline QNoDebug(const QDebug &){}
23722 inline ~QNoDebug(){}
23723 inline QNoDebug &operator<<(QTextStreamFunction) { return *this; }
23724 inline QNoDebug &operator<<(QTextStreamManipulator) { return *this; }
23725 inline QNoDebug &space() { return *this; }
23726 inline QNoDebug &nospace() { return *this; }
23727 inline QNoDebug &maybeSpace() { return *this; }
23728 template<typename T>
23729 inline QNoDebug &operator<<(const T &) { return *this; }
23731 __attribute__((visibility("default"))) inline QDebug qCritical() { return QDebug(QtCriticalMsg); }
23732 inline QDebug &QDebug::operator=(const QDebug &other)
23734 if (this != &other) {
23735 QDebug copy(other);
23736 qSwap(stream, copy.stream);
23741 inline QDebug operator<<(QDebug debug, const QList<T> &list)
23743 debug.nospace() << "(";
23744 for (typename QList<T>::size_type i = 0; i < list.count(); ++i) {
23747 debug << list.at(i);
23750 return debug.space();
23752 template <typename T>
23753 inline QDebug operator<<(QDebug debug, const QVector<T> &vec)
23755 debug.nospace() << "QVector";
23756 return operator<<(debug, vec.toList());
23758 template <class aKey, class aT>
23759 inline QDebug operator<<(QDebug debug, const QMap<aKey, aT> &map)
23761 debug.nospace() << "QMap(";
23762 for (typename QMap<aKey, aT>::const_iterator it = map.constBegin();
23763 it != map.constEnd(); ++it) {
23764 debug << "(" << it.key() << ", " << it.value() << ")";
23767 return debug.space();
23769 template <class aKey, class aT>
23770 inline QDebug operator<<(QDebug debug, const QHash<aKey, aT> &hash)
23772 debug.nospace() << "QHash(";
23773 for (typename QHash<aKey, aT>::const_iterator it = hash.constBegin();
23774 it != hash.constEnd(); ++it)
23775 debug << "(" << it.key() << ", " << it.value() << ")";
23777 return debug.space();
23779 template <class T1, class T2>
23780 inline QDebug operator<<(QDebug debug, const QPair<T1, T2> &pair)
23782 debug.nospace() << "QPair(" << pair.first << "," << pair.second << ")";
23783 return debug.space();
23785 template <typename T>
23786 inline QDebug operator<<(QDebug debug, const QSet<T> &set)
23788 debug.nospace() << "QSet";
23789 return operator<<(debug, set.toList());
23791 __attribute__((visibility("default"))) inline QDebug qDebug() { return QDebug(QtDebugMsg); }
23792 __attribute__((visibility("default"))) inline QDebug qWarning() { return QDebug(QtWarningMsg); }
23793 typedef QtValidLicenseForCoreModule QtCoreModule;
23794 template <class Key, class T> class QCache;
23795 template <class Key, class T> class QHash;
23796 template <class T> class QLinkedList;
23797 template <class T> class QList;
23798 template <class Key, class T> class QMap;
23799 template <class Key, class T> class QMultiHash;
23800 template <class Key, class T> class QMultiMap;
23801 template <class T1, class T2> struct QPair;
23802 template <class T> class QQueue;
23803 template <class T> class QSet;
23804 template <class T> class QStack;
23805 template<class T, int Prealloc = 256> class QVarLengthArray;
23806 template <class T> class QVector;
23807 typedef QtValidLicenseForCoreModule QtCoreModule;
23808 template<class T, int Prealloc>
23809 class QVarLengthArray
23812 inline explicit QVarLengthArray(int size = 0);
23813 inline QVarLengthArray(const QVarLengthArray<T, Prealloc> &other)
23814 : a(Prealloc), s(0), ptr(reinterpret_cast<T *>(array))
23816 append(other.constData(), other.size());
23818 inline ~QVarLengthArray() {
23819 if (QTypeInfo<T>::isComplex) {
23824 if (ptr != reinterpret_cast<T *>(array))
23827 inline QVarLengthArray<T, Prealloc> &operator=(const QVarLengthArray<T, Prealloc> &other)
23829 if (this != &other) {
23831 append(other.constData(), other.size());
23835 inline void removeLast() {
23839 inline int size() const { return s; }
23840 inline int count() const { return s; }
23841 inline bool isEmpty() const { return (s == 0); }
23842 inline void resize(int size);
23843 inline void clear() { resize(0); }
23844 inline int capacity() const { return a; }
23845 inline void reserve(int size);
23846 inline T &operator[](int idx) {
23850 inline const T &operator[](int idx) const {
23854 inline void append(const T &t) {
23857 const int idx = s++;
23858 if (QTypeInfo<T>::isComplex) {
23859 new (ptr + idx) T(t);
23864 void append(const T *buf, int size);
23865 inline T *data() { return ptr; }
23866 inline const T *data() const { return ptr; }
23867 inline const T * constData() const { return ptr; }
23869 void realloc(int size, int alloc);
23874 char array[sizeof(qint64) * (((Prealloc * sizeof(T)) / sizeof(qint64)) + 1)];
23875 qint64 q_for_alignment_1;
23876 double q_for_alignment_2;
23879 template <class T, int Prealloc>
23880 inline QVarLengthArray<T, Prealloc>::QVarLengthArray(int asize)
23882 if (s > Prealloc) {
23883 ptr = reinterpret_cast<T *>(qMalloc(s * sizeof(T)));
23886 ptr = reinterpret_cast<T *>(array);
23889 if (QTypeInfo<T>::isComplex) {
23895 template <class T, int Prealloc>
23896 inline void QVarLengthArray<T, Prealloc>::resize(int asize)
23897 { realloc(asize, qMax(asize, a)); }
23898 template <class T, int Prealloc>
23899 inline void QVarLengthArray<T, Prealloc>::reserve(int asize)
23900 { if (asize > a) realloc(s, asize); }
23901 template <class T, int Prealloc>
23902 void QVarLengthArray<T, Prealloc>::append(const T *abuf, int asize)
23908 const int news = s + asize;
23910 realloc(s, qMax(s<<1, news));
23912 if (QTypeInfo<T>::isComplex) {
23916 new (i++) T(*abuf++);
23918 qMemCopy(&ptr[idx], abuf, asize * sizeof(T));
23921 template <class T, int Prealloc>
23922 void QVarLengthArray<T, Prealloc>::realloc(int asize, int aalloc)
23929 ptr = reinterpret_cast<T *>(qMalloc(aalloc * sizeof(T)));
23932 if (QTypeInfo<T>::isStatic) {
23933 T *i = ptr + osize;
23934 T *j = oldPtr + osize;
23940 qMemCopy(ptr, oldPtr, osize * sizeof(T));
23948 if (QTypeInfo<T>::isComplex) {
23949 if (asize < osize) {
23950 T *i = oldPtr + osize;
23951 T *j = oldPtr + asize;
23955 T *i = ptr + asize;
23956 T *j = ptr + osize;
23961 if (oldPtr != reinterpret_cast<T *>(array) && oldPtr != ptr)
23964 typedef QtValidLicenseForCoreModule QtCoreModule;
23965 class __attribute__((visibility("default"))) QSize
23969 QSize(int w, int h);
23970 bool isNull() const;
23971 bool isEmpty() const;
23972 bool isValid() const;
23974 int height() const;
23975 void setWidth(int w);
23976 void setHeight(int h);
23978 void scale(int w, int h, Qt::AspectRatioMode mode);
23979 void scale(const QSize &s, Qt::AspectRatioMode mode);
23980 QSize expandedTo(const QSize &) const;
23981 QSize boundedTo(const QSize &) const;
23984 QSize &operator+=(const QSize &);
23985 QSize &operator-=(const QSize &);
23986 QSize &operator*=(qreal c);
23987 QSize &operator/=(qreal c);
23988 friend inline bool operator==(const QSize &, const QSize &);
23989 friend inline bool operator!=(const QSize &, const QSize &);
23990 friend inline const QSize operator+(const QSize &, const QSize &);
23991 friend inline const QSize operator-(const QSize &, const QSize &);
23992 friend inline const QSize operator*(const QSize &, qreal);
23993 friend inline const QSize operator*(qreal, const QSize &);
23994 friend inline const QSize operator/(const QSize &, qreal);
23999 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"; } };
24000 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QSize &);
24001 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QSize &);
24002 inline QSize::QSize()
24004 inline QSize::QSize(int w, int h)
24005 { wd = w; ht = h; }
24006 inline bool QSize::isNull() const
24007 { return wd==0 && ht==0; }
24008 inline bool QSize::isEmpty() const
24009 { return wd<1 || ht<1; }
24010 inline bool QSize::isValid() const
24011 { return wd>=0 && ht>=0; }
24012 inline int QSize::width() const
24014 inline int QSize::height() const
24016 inline void QSize::setWidth(int w)
24018 inline void QSize::setHeight(int h)
24020 inline void QSize::scale(int w, int h, Qt::AspectRatioMode mode)
24021 { scale(QSize(w, h), mode); }
24022 inline int &QSize::rwidth()
24024 inline int &QSize::rheight()
24026 inline QSize &QSize::operator+=(const QSize &s)
24027 { wd+=s.wd; ht+=s.ht; return *this; }
24028 inline QSize &QSize::operator-=(const QSize &s)
24029 { wd-=s.wd; ht-=s.ht; return *this; }
24030 inline QSize &QSize::operator*=(qreal c)
24031 { wd = qRound(wd*c); ht = qRound(ht*c); return *this; }
24032 inline bool operator==(const QSize &s1, const QSize &s2)
24033 { return s1.wd == s2.wd && s1.ht == s2.ht; }
24034 inline bool operator!=(const QSize &s1, const QSize &s2)
24035 { return s1.wd != s2.wd || s1.ht != s2.ht; }
24036 inline const QSize operator+(const QSize & s1, const QSize & s2)
24037 { return QSize(s1.wd+s2.wd, s1.ht+s2.ht); }
24038 inline const QSize operator-(const QSize &s1, const QSize &s2)
24039 { return QSize(s1.wd-s2.wd, s1.ht-s2.ht); }
24040 inline const QSize operator*(const QSize &s, qreal c)
24041 { return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
24042 inline const QSize operator*(qreal c, const QSize &s)
24043 { return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
24044 inline QSize &QSize::operator/=(qreal c)
24047 wd = qRound(wd/c); ht = qRound(ht/c);
24050 inline const QSize operator/(const QSize &s, qreal c)
24053 return QSize(qRound(s.wd/c), qRound(s.ht/c));
24055 inline QSize QSize::expandedTo(const QSize & otherSize) const
24057 return QSize(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
24059 inline QSize QSize::boundedTo(const QSize & otherSize) const
24061 return QSize(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
24063 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QSize &);
24064 class __attribute__((visibility("default"))) QSizeF
24068 QSizeF(const QSize &sz);
24069 QSizeF(qreal w, qreal h);
24070 bool isNull() const;
24071 bool isEmpty() const;
24072 bool isValid() const;
24073 qreal width() const;
24074 qreal height() const;
24075 void setWidth(qreal w);
24076 void setHeight(qreal h);
24078 void scale(qreal w, qreal h, Qt::AspectRatioMode mode);
24079 void scale(const QSizeF &s, Qt::AspectRatioMode mode);
24080 QSizeF expandedTo(const QSizeF &) const;
24081 QSizeF boundedTo(const QSizeF &) const;
24084 QSizeF &operator+=(const QSizeF &);
24085 QSizeF &operator-=(const QSizeF &);
24086 QSizeF &operator*=(qreal c);
24087 QSizeF &operator/=(qreal c);
24088 friend inline bool operator==(const QSizeF &, const QSizeF &);
24089 friend inline bool operator!=(const QSizeF &, const QSizeF &);
24090 friend inline const QSizeF operator+(const QSizeF &, const QSizeF &);
24091 friend inline const QSizeF operator-(const QSizeF &, const QSizeF &);
24092 friend inline const QSizeF operator*(const QSizeF &, qreal);
24093 friend inline const QSizeF operator*(qreal, const QSizeF &);
24094 friend inline const QSizeF operator/(const QSizeF &, qreal);
24095 inline QSize toSize() const;
24100 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"; } };
24101 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QSizeF &);
24102 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QSizeF &);
24103 inline QSizeF::QSizeF()
24105 inline QSizeF::QSizeF(const QSize &sz)
24106 : wd(sz.width()), ht(sz.height())
24109 inline QSizeF::QSizeF(qreal w, qreal h)
24110 { wd = w; ht = h; }
24111 inline bool QSizeF::isNull() const
24112 { return qIsNull(wd) && qIsNull(ht); }
24113 inline bool QSizeF::isEmpty() const
24114 { return wd <= 0. || ht <= 0.; }
24115 inline bool QSizeF::isValid() const
24116 { return wd >= 0. && ht >= 0.; }
24117 inline qreal QSizeF::width() const
24119 inline qreal QSizeF::height() const
24121 inline void QSizeF::setWidth(qreal w)
24123 inline void QSizeF::setHeight(qreal h)
24125 inline void QSizeF::scale(qreal w, qreal h, Qt::AspectRatioMode mode)
24126 { scale(QSizeF(w, h), mode); }
24127 inline qreal &QSizeF::rwidth()
24129 inline qreal &QSizeF::rheight()
24131 inline QSizeF &QSizeF::operator+=(const QSizeF &s)
24132 { wd += s.wd; ht += s.ht; return *this; }
24133 inline QSizeF &QSizeF::operator-=(const QSizeF &s)
24134 { wd -= s.wd; ht -= s.ht; return *this; }
24135 inline QSizeF &QSizeF::operator*=(qreal c)
24136 { wd *= c; ht *= c; return *this; }
24137 inline bool operator==(const QSizeF &s1, const QSizeF &s2)
24138 { return qFuzzyCompare(s1.wd, s2.wd) && qFuzzyCompare(s1.ht, s2.ht); }
24139 inline bool operator!=(const QSizeF &s1, const QSizeF &s2)
24140 { return !qFuzzyCompare(s1.wd, s2.wd) || !qFuzzyCompare(s1.ht, s2.ht); }
24141 inline const QSizeF operator+(const QSizeF & s1, const QSizeF & s2)
24142 { return QSizeF(s1.wd+s2.wd, s1.ht+s2.ht); }
24143 inline const QSizeF operator-(const QSizeF &s1, const QSizeF &s2)
24144 { return QSizeF(s1.wd-s2.wd, s1.ht-s2.ht); }
24145 inline const QSizeF operator*(const QSizeF &s, qreal c)
24146 { return QSizeF(s.wd*c, s.ht*c); }
24147 inline const QSizeF operator*(qreal c, const QSizeF &s)
24148 { return QSizeF(s.wd*c, s.ht*c); }
24149 inline QSizeF &QSizeF::operator/=(qreal c)
24152 wd = wd/c; ht = ht/c;
24155 inline const QSizeF operator/(const QSizeF &s, qreal c)
24158 return QSizeF(s.wd/c, s.ht/c);
24160 inline QSizeF QSizeF::expandedTo(const QSizeF & otherSize) const
24162 return QSizeF(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
24164 inline QSizeF QSizeF::boundedTo(const QSizeF & otherSize) const
24166 return QSizeF(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
24168 inline QSize QSizeF::toSize() const
24170 return QSize(qRound(wd), qRound(ht));
24172 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QSizeF &);
24173 typedef QtValidLicenseForCoreModule QtCoreModule;
24174 class __attribute__((visibility("default"))) QPoint
24178 QPoint(int xpos, int ypos);
24179 bool isNull() const;
24184 int manhattanLength() const;
24187 QPoint &operator+=(const QPoint &p);
24188 QPoint &operator-=(const QPoint &p);
24189 QPoint &operator*=(qreal c);
24190 QPoint &operator/=(qreal c);
24191 friend inline bool operator==(const QPoint &, const QPoint &);
24192 friend inline bool operator!=(const QPoint &, const QPoint &);
24193 friend inline const QPoint operator+(const QPoint &, const QPoint &);
24194 friend inline const QPoint operator-(const QPoint &, const QPoint &);
24195 friend inline const QPoint operator*(const QPoint &, qreal);
24196 friend inline const QPoint operator*(qreal, const QPoint &);
24197 friend inline const QPoint operator-(const QPoint &);
24198 friend inline const QPoint operator/(const QPoint &, qreal);
24200 friend class QTransform;
24204 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"; } };
24205 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPoint &);
24206 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPoint &);
24207 inline QPoint::QPoint()
24209 inline QPoint::QPoint(int xpos, int ypos)
24210 { xp = xpos; yp = ypos; }
24211 inline bool QPoint::isNull() const
24212 { return xp == 0 && yp == 0; }
24213 inline int QPoint::x() const
24215 inline int QPoint::y() const
24217 inline void QPoint::setX(int xpos)
24219 inline void QPoint::setY(int ypos)
24221 inline int &QPoint::rx()
24223 inline int &QPoint::ry()
24225 inline QPoint &QPoint::operator+=(const QPoint &p)
24226 { xp+=p.xp; yp+=p.yp; return *this; }
24227 inline QPoint &QPoint::operator-=(const QPoint &p)
24228 { xp-=p.xp; yp-=p.yp; return *this; }
24229 inline QPoint &QPoint::operator*=(qreal c)
24230 { xp = qRound(xp*c); yp = qRound(yp*c); return *this; }
24231 inline bool operator==(const QPoint &p1, const QPoint &p2)
24232 { return p1.xp == p2.xp && p1.yp == p2.yp; }
24233 inline bool operator!=(const QPoint &p1, const QPoint &p2)
24234 { return p1.xp != p2.xp || p1.yp != p2.yp; }
24235 inline const QPoint operator+(const QPoint &p1, const QPoint &p2)
24236 { return QPoint(p1.xp+p2.xp, p1.yp+p2.yp); }
24237 inline const QPoint operator-(const QPoint &p1, const QPoint &p2)
24238 { return QPoint(p1.xp-p2.xp, p1.yp-p2.yp); }
24239 inline const QPoint operator*(const QPoint &p, qreal c)
24240 { return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
24241 inline const QPoint operator*(qreal c, const QPoint &p)
24242 { return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
24243 inline const QPoint operator-(const QPoint &p)
24244 { return QPoint(-p.xp, -p.yp); }
24245 inline QPoint &QPoint::operator/=(qreal c)
24251 inline const QPoint operator/(const QPoint &p, qreal c)
24253 return QPoint(qRound(p.xp/c), qRound(p.yp/c));
24255 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QPoint &);
24256 class __attribute__((visibility("default"))) QPointF
24260 QPointF(const QPoint &p);
24261 QPointF(qreal xpos, qreal ypos);
24262 bool isNull() const;
24265 void setX(qreal x);
24266 void setY(qreal y);
24269 QPointF &operator+=(const QPointF &p);
24270 QPointF &operator-=(const QPointF &p);
24271 QPointF &operator*=(qreal c);
24272 QPointF &operator/=(qreal c);
24273 friend inline bool operator==(const QPointF &, const QPointF &);
24274 friend inline bool operator!=(const QPointF &, const QPointF &);
24275 friend inline const QPointF operator+(const QPointF &, const QPointF &);
24276 friend inline const QPointF operator-(const QPointF &, const QPointF &);
24277 friend inline const QPointF operator*(qreal, const QPointF &);
24278 friend inline const QPointF operator*(const QPointF &, qreal);
24279 friend inline const QPointF operator-(const QPointF &);
24280 friend inline const QPointF operator/(const QPointF &, qreal);
24281 QPoint toPoint() const;
24283 friend class QMatrix;
24284 friend class QTransform;
24288 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"; } };
24289 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPointF &);
24290 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPointF &);
24291 inline QPointF::QPointF() : xp(0), yp(0) { }
24292 inline QPointF::QPointF(qreal xpos, qreal ypos) : xp(xpos), yp(ypos) { }
24293 inline QPointF::QPointF(const QPoint &p) : xp(p.x()), yp(p.y()) { }
24294 inline bool QPointF::isNull() const
24296 return qIsNull(xp) && qIsNull(yp);
24298 inline qreal QPointF::x() const
24302 inline qreal QPointF::y() const
24306 inline void QPointF::setX(qreal xpos)
24310 inline void QPointF::setY(qreal ypos)
24314 inline qreal &QPointF::rx()
24318 inline qreal &QPointF::ry()
24322 inline QPointF &QPointF::operator+=(const QPointF &p)
24328 inline QPointF &QPointF::operator-=(const QPointF &p)
24330 xp-=p.xp; yp-=p.yp; return *this;
24332 inline QPointF &QPointF::operator*=(qreal c)
24334 xp*=c; yp*=c; return *this;
24336 inline bool operator==(const QPointF &p1, const QPointF &p2)
24338 return qFuzzyCompare(p1.xp, p2.xp) && qFuzzyCompare(p1.yp, p2.yp);
24340 inline bool operator!=(const QPointF &p1, const QPointF &p2)
24342 return !qFuzzyCompare(p1.xp, p2.xp) || !qFuzzyCompare(p1.yp, p2.yp);
24344 inline const QPointF operator+(const QPointF &p1, const QPointF &p2)
24346 return QPointF(p1.xp+p2.xp, p1.yp+p2.yp);
24348 inline const QPointF operator-(const QPointF &p1, const QPointF &p2)
24350 return QPointF(p1.xp-p2.xp, p1.yp-p2.yp);
24352 inline const QPointF operator*(const QPointF &p, qreal c)
24354 return QPointF(p.xp*c, p.yp*c);
24356 inline const QPointF operator*(qreal c, const QPointF &p)
24358 return QPointF(p.xp*c, p.yp*c);
24360 inline const QPointF operator-(const QPointF &p)
24362 return QPointF(-p.xp, -p.yp);
24364 inline QPointF &QPointF::operator/=(qreal c)
24370 inline const QPointF operator/(const QPointF &p, qreal c)
24372 return QPointF(p.xp/c, p.yp/c);
24374 inline QPoint QPointF::toPoint() const
24376 return QPoint(qRound(xp), qRound(yp));
24378 __attribute__((visibility("default"))) QDebug operator<<(QDebug d, const QPointF &p);
24379 typedef QtValidLicenseForCoreModule QtCoreModule;
24380 class __attribute__((visibility("default"))) QRect
24383 QRect() { x1 = y1 = 0; x2 = y2 = -1; }
24384 QRect(const QPoint &topleft, const QPoint &bottomright);
24385 QRect(const QPoint &topleft, const QSize &size);
24386 QRect(int left, int top, int width, int height);
24387 bool isNull() const;
24388 bool isEmpty() const;
24389 bool isValid() const;
24393 int bottom() const;
24394 QRect normalized() const;
24397 void setLeft(int pos);
24398 void setTop(int pos);
24399 void setRight(int pos);
24400 void setBottom(int pos);
24403 void setTopLeft(const QPoint &p);
24404 void setBottomRight(const QPoint &p);
24405 void setTopRight(const QPoint &p);
24406 void setBottomLeft(const QPoint &p);
24407 QPoint topLeft() const;
24408 QPoint bottomRight() const;
24409 QPoint topRight() const;
24410 QPoint bottomLeft() const;
24411 QPoint center() const;
24412 void moveLeft(int pos);
24413 void moveTop(int pos);
24414 void moveRight(int pos);
24415 void moveBottom(int pos);
24416 void moveTopLeft(const QPoint &p);
24417 void moveBottomRight(const QPoint &p);
24418 void moveTopRight(const QPoint &p);
24419 void moveBottomLeft(const QPoint &p);
24420 void moveCenter(const QPoint &p);
24421 inline void translate(int dx, int dy);
24422 inline void translate(const QPoint &p);
24423 inline QRect translated(int dx, int dy) const;
24424 inline QRect translated(const QPoint &p) const;
24425 void moveTo(int x, int t);
24426 void moveTo(const QPoint &p);
24427 void setRect(int x, int y, int w, int h);
24428 inline void getRect(int *x, int *y, int *w, int *h) const;
24429 void setCoords(int x1, int y1, int x2, int y2);
24430 inline void getCoords(int *x1, int *y1, int *x2, int *y2) const;
24431 inline void adjust(int x1, int y1, int x2, int y2);
24432 inline QRect adjusted(int x1, int y1, int x2, int y2) const;
24433 QSize size() const;
24435 int height() const;
24436 void setWidth(int w);
24437 void setHeight(int h);
24438 void setSize(const QSize &s);
24439 QRect operator|(const QRect &r) const;
24440 QRect operator&(const QRect &r) const;
24441 QRect& operator|=(const QRect &r);
24442 QRect& operator&=(const QRect &r);
24443 bool contains(const QPoint &p, bool proper=false) const;
24444 bool contains(int x, int y) const;
24445 bool contains(int x, int y, bool proper) const;
24446 bool contains(const QRect &r, bool proper = false) const;
24447 QRect unite(const QRect &r) const;
24448 QRect united(const QRect &other) const;
24449 QRect intersect(const QRect &r) const;
24450 QRect intersected(const QRect &other) const;
24451 bool intersects(const QRect &r) const;
24452 friend __attribute__((visibility("default"))) inline bool operator==(const QRect &, const QRect &);
24453 friend __attribute__((visibility("default"))) inline bool operator!=(const QRect &, const QRect &);
24460 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"; } };
24461 __attribute__((visibility("default"))) inline bool operator==(const QRect &, const QRect &);
24462 __attribute__((visibility("default"))) inline bool operator!=(const QRect &, const QRect &);
24463 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QRect &);
24464 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QRect &);
24465 inline QRect::QRect(int aleft, int atop, int awidth, int aheight)
24469 x2 = (aleft + awidth - 1);
24470 y2 = (atop + aheight - 1);
24472 inline QRect::QRect(const QPoint &atopLeft, const QPoint &abottomRight)
24476 x2 = abottomRight.x();
24477 y2 = abottomRight.y();
24479 inline QRect::QRect(const QPoint &atopLeft, const QSize &asize)
24483 x2 = (x1+asize.width() - 1);
24484 y2 = (y1+asize.height() - 1);
24486 inline bool QRect::isNull() const
24487 { return x2 == x1 - 1 && y2 == y1 - 1; }
24488 inline bool QRect::isEmpty() const
24489 { return x1 > x2 || y1 > y2; }
24490 inline bool QRect::isValid() const
24491 { return x1 <= x2 && y1 <= y2; }
24492 inline int QRect::left() const
24494 inline int QRect::top() const
24496 inline int QRect::right() const
24498 inline int QRect::bottom() const
24500 inline int QRect::x() const
24502 inline int QRect::y() const
24504 inline void QRect::setLeft(int pos)
24506 inline void QRect::setTop(int pos)
24508 inline void QRect::setRight(int pos)
24510 inline void QRect::setBottom(int pos)
24512 inline void QRect::setTopLeft(const QPoint &p)
24513 { x1 = p.x(); y1 = p.y(); }
24514 inline void QRect::setBottomRight(const QPoint &p)
24515 { x2 = p.x(); y2 = p.y(); }
24516 inline void QRect::setTopRight(const QPoint &p)
24517 { x2 = p.x(); y1 = p.y(); }
24518 inline void QRect::setBottomLeft(const QPoint &p)
24519 { x1 = p.x(); y2 = p.y(); }
24520 inline void QRect::setX(int ax)
24522 inline void QRect::setY(int ay)
24524 inline QPoint QRect::topLeft() const
24525 { return QPoint(x1, y1); }
24526 inline QPoint QRect::bottomRight() const
24527 { return QPoint(x2, y2); }
24528 inline QPoint QRect::topRight() const
24529 { return QPoint(x2, y1); }
24530 inline QPoint QRect::bottomLeft() const
24531 { return QPoint(x1, y2); }
24532 inline QPoint QRect::center() const
24533 { return QPoint((x1+x2)/2, (y1+y2)/2); }
24534 inline int QRect::width() const
24535 { return x2 - x1 + 1; }
24536 inline int QRect::height() const
24537 { return y2 - y1 + 1; }
24538 inline QSize QRect::size() const
24539 { return QSize(width(), height()); }
24540 inline void QRect::translate(int dx, int dy)
24547 inline void QRect::translate(const QPoint &p)
24554 inline QRect QRect::translated(int dx, int dy) const
24555 { return QRect(QPoint(x1 + dx, y1 + dy), QPoint(x2 + dx, y2 + dy)); }
24556 inline QRect QRect::translated(const QPoint &p) const
24557 { return QRect(QPoint(x1 + p.x(), y1 + p.y()), QPoint(x2 + p.x(), y2 + p.y())); }
24558 inline void QRect::moveTo(int ax, int ay)
24565 inline void QRect::moveTo(const QPoint &p)
24572 inline void QRect::moveLeft(int pos)
24573 { x2 += (pos - x1); x1 = pos; }
24574 inline void QRect::moveTop(int pos)
24575 { y2 += (pos - y1); y1 = pos; }
24576 inline void QRect::moveRight(int pos)
24581 inline void QRect::moveBottom(int pos)
24586 inline void QRect::moveTopLeft(const QPoint &p)
24591 inline void QRect::moveBottomRight(const QPoint &p)
24596 inline void QRect::moveTopRight(const QPoint &p)
24601 inline void QRect::moveBottomLeft(const QPoint &p)
24606 inline void QRect::getRect(int *ax, int *ay, int *aw, int *ah) const
24613 inline void QRect::setRect(int ax, int ay, int aw, int ah)
24617 x2 = (ax + aw - 1);
24618 y2 = (ay + ah - 1);
24620 inline void QRect::getCoords(int *xp1, int *yp1, int *xp2, int *yp2) const
24627 inline void QRect::setCoords(int xp1, int yp1, int xp2, int yp2)
24634 inline QRect QRect::adjusted(int xp1, int yp1, int xp2, int yp2) const
24635 { return QRect(QPoint(x1 + xp1, y1 + yp1), QPoint(x2 + xp2, y2 + yp2)); }
24636 inline void QRect::adjust(int dx1, int dy1, int dx2, int dy2)
24643 inline void QRect::setWidth(int w)
24644 { x2 = (x1 + w - 1); }
24645 inline void QRect::setHeight(int h)
24646 { y2 = (y1 + h - 1); }
24647 inline void QRect::setSize(const QSize &s)
24649 x2 = (s.width() + x1 - 1);
24650 y2 = (s.height() + y1 - 1);
24652 inline bool QRect::contains(int ax, int ay, bool aproper) const
24654 return contains(QPoint(ax, ay), aproper);
24656 inline bool QRect::contains(int ax, int ay) const
24658 return contains(QPoint(ax, ay), false);
24660 inline QRect& QRect::operator|=(const QRect &r)
24665 inline QRect& QRect::operator&=(const QRect &r)
24670 inline QRect QRect::intersect(const QRect &r) const
24674 inline QRect QRect::intersected(const QRect &other) const
24676 return intersect(other);
24678 inline QRect QRect::unite(const QRect &r) const
24682 inline QRect QRect::united(const QRect &r) const
24686 inline bool operator==(const QRect &r1, const QRect &r2)
24688 return r1.x1==r2.x1 && r1.x2==r2.x2 && r1.y1==r2.y1 && r1.y2==r2.y2;
24690 inline bool operator!=(const QRect &r1, const QRect &r2)
24692 return r1.x1!=r2.x1 || r1.x2!=r2.x2 || r1.y1!=r2.y1 || r1.y2!=r2.y2;
24694 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QRect &);
24695 class __attribute__((visibility("default"))) QRectF
24698 QRectF() { xp = yp = 0.; w = h = 0.; }
24699 QRectF(const QPointF &topleft, const QSizeF &size);
24700 QRectF(const QPointF &topleft, const QPointF &bottomRight);
24701 QRectF(qreal left, qreal top, qreal width, qreal height);
24702 QRectF(const QRect &rect);
24703 bool isNull() const;
24704 bool isEmpty() const;
24705 bool isValid() const;
24706 QRectF normalized() const;
24707 inline qreal left() const { return xp; }
24708 inline qreal top() const { return yp; }
24709 inline qreal right() const { return xp + w; }
24710 inline qreal bottom() const { return yp + h; }
24711 inline qreal x() const;
24712 inline qreal y() const;
24713 inline void setLeft(qreal pos);
24714 inline void setTop(qreal pos);
24715 inline void setRight(qreal pos);
24716 inline void setBottom(qreal pos);
24717 inline void setX(qreal pos) { setLeft(pos); }
24718 inline void setY(qreal pos) { setTop(pos); }
24719 inline QPointF topLeft() const { return QPointF(xp, yp); }
24720 inline QPointF bottomRight() const { return QPointF(xp+w, yp+h); }
24721 inline QPointF topRight() const { return QPointF(xp+w, yp); }
24722 inline QPointF bottomLeft() const { return QPointF(xp, yp+h); }
24723 inline QPointF center() const;
24724 void setTopLeft(const QPointF &p);
24725 void setBottomRight(const QPointF &p);
24726 void setTopRight(const QPointF &p);
24727 void setBottomLeft(const QPointF &p);
24728 void moveLeft(qreal pos);
24729 void moveTop(qreal pos);
24730 void moveRight(qreal pos);
24731 void moveBottom(qreal pos);
24732 void moveTopLeft(const QPointF &p);
24733 void moveBottomRight(const QPointF &p);
24734 void moveTopRight(const QPointF &p);
24735 void moveBottomLeft(const QPointF &p);
24736 void moveCenter(const QPointF &p);
24737 void translate(qreal dx, qreal dy);
24738 void translate(const QPointF &p);
24739 QRectF translated(qreal dx, qreal dy) const;
24740 QRectF translated(const QPointF &p) const;
24741 void moveTo(qreal x, qreal t);
24742 void moveTo(const QPointF &p);
24743 void setRect(qreal x, qreal y, qreal w, qreal h);
24744 void getRect(qreal *x, qreal *y, qreal *w, qreal *h) const;
24745 void setCoords(qreal x1, qreal y1, qreal x2, qreal y2);
24746 void getCoords(qreal *x1, qreal *y1, qreal *x2, qreal *y2) const;
24747 inline void adjust(qreal x1, qreal y1, qreal x2, qreal y2);
24748 inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const;
24749 QSizeF size() const;
24750 qreal width() const;
24751 qreal height() const;
24752 void setWidth(qreal w);
24753 void setHeight(qreal h);
24754 void setSize(const QSizeF &s);
24755 QRectF operator|(const QRectF &r) const;
24756 QRectF operator&(const QRectF &r) const;
24757 QRectF& operator|=(const QRectF &r);
24758 QRectF& operator&=(const QRectF &r);
24759 bool contains(const QPointF &p) const;
24760 bool contains(qreal x, qreal y) const;
24761 bool contains(const QRectF &r) const;
24762 QRectF unite(const QRectF &r) const;
24763 QRectF united(const QRectF &other) const;
24764 QRectF intersect(const QRectF &r) const;
24765 QRectF intersected(const QRectF &other) const;
24766 bool intersects(const QRectF &r) const;
24767 friend __attribute__((visibility("default"))) inline bool operator==(const QRectF &, const QRectF &);
24768 friend __attribute__((visibility("default"))) inline bool operator!=(const QRectF &, const QRectF &);
24769 QRect toRect() const;
24770 QRect toAlignedRect() const;
24777 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"; } };
24778 __attribute__((visibility("default"))) inline bool operator==(const QRectF &, const QRectF &);
24779 __attribute__((visibility("default"))) inline bool operator!=(const QRectF &, const QRectF &);
24780 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QRectF &);
24781 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QRectF &);
24782 inline QRectF::QRectF(qreal aleft, qreal atop, qreal awidth, qreal aheight)
24783 : xp(aleft), yp(atop), w(awidth), h(aheight)
24786 inline QRectF::QRectF(const QPointF &atopLeft, const QSizeF &asize)
24791 h = asize.height();
24793 inline QRectF::QRectF(const QPointF &atopLeft, const QPointF &abottomRight)
24797 w = abottomRight.x() - xp;
24798 h = abottomRight.y() - yp;
24800 inline QRectF::QRectF(const QRect &r)
24801 : xp(r.x()), yp(r.y()), w(r.width()), h(r.height())
24804 inline bool QRectF::isNull() const
24805 { return qIsNull(w) && qIsNull(h); }
24806 inline bool QRectF::isEmpty() const
24807 { return w <= 0. || h <= 0.; }
24808 inline bool QRectF::isValid() const
24809 { return w > 0. && h > 0.; }
24810 inline qreal QRectF::x() const
24812 inline qreal QRectF::y() const
24814 inline void QRectF::setLeft(qreal pos) { qreal diff = pos - xp; xp += diff; w -= diff; }
24815 inline void QRectF::setRight(qreal pos) { w = pos - xp; }
24816 inline void QRectF::setTop(qreal pos) { qreal diff = pos - yp; yp += diff; h -= diff; }
24817 inline void QRectF::setBottom(qreal pos) { h = pos - yp; }
24818 inline void QRectF::setTopLeft(const QPointF &p) { setLeft(p.x()); setTop(p.y()); }
24819 inline void QRectF::setTopRight(const QPointF &p) { setRight(p.x()); setTop(p.y()); }
24820 inline void QRectF::setBottomLeft(const QPointF &p) { setLeft(p.x()); setBottom(p.y()); }
24821 inline void QRectF::setBottomRight(const QPointF &p) { setRight(p.x()); setBottom(p.y()); }
24822 inline QPointF QRectF::center() const
24823 { return QPointF(xp + w/2, yp + h/2); }
24824 inline void QRectF::moveLeft(qreal pos) { xp = pos; }
24825 inline void QRectF::moveTop(qreal pos) { yp = pos; }
24826 inline void QRectF::moveRight(qreal pos) { xp = pos - w; }
24827 inline void QRectF::moveBottom(qreal pos) { yp = pos - h; }
24828 inline void QRectF::moveTopLeft(const QPointF &p) { moveLeft(p.x()); moveTop(p.y()); }
24829 inline void QRectF::moveTopRight(const QPointF &p) { moveRight(p.x()); moveTop(p.y()); }
24830 inline void QRectF::moveBottomLeft(const QPointF &p) { moveLeft(p.x()); moveBottom(p.y()); }
24831 inline void QRectF::moveBottomRight(const QPointF &p) { moveRight(p.x()); moveBottom(p.y()); }
24832 inline void QRectF::moveCenter(const QPointF &p) { xp = p.x() - w/2; yp = p.y() - h/2; }
24833 inline qreal QRectF::width() const
24835 inline qreal QRectF::height() const
24837 inline QSizeF QRectF::size() const
24838 { return QSizeF(w, h); }
24839 inline void QRectF::translate(qreal dx, qreal dy)
24844 inline void QRectF::translate(const QPointF &p)
24849 inline void QRectF::moveTo(qreal ax, qreal ay)
24854 inline void QRectF::moveTo(const QPointF &p)
24859 inline QRectF QRectF::translated(qreal dx, qreal dy) const
24860 { return QRectF(xp + dx, yp + dy, w, h); }
24861 inline QRectF QRectF::translated(const QPointF &p) const
24862 { return QRectF(xp + p.x(), yp + p.y(), w, h); }
24863 inline void QRectF::getRect(qreal *ax, qreal *ay, qreal *aaw, qreal *aah) const
24870 inline void QRectF::setRect(qreal ax, qreal ay, qreal aaw, qreal aah)
24877 inline void QRectF::getCoords(qreal *xp1, qreal *yp1, qreal *xp2, qreal *yp2) const
24884 inline void QRectF::setCoords(qreal xp1, qreal yp1, qreal xp2, qreal yp2)
24891 inline void QRectF::adjust(qreal xp1, qreal yp1, qreal xp2, qreal yp2)
24892 { xp += xp1; yp += yp1; w += xp2 - xp1; h += yp2 - yp1; }
24893 inline QRectF QRectF::adjusted(qreal xp1, qreal yp1, qreal xp2, qreal yp2) const
24894 { return QRectF(xp + xp1, yp + yp1, w + xp2 - xp1, h + yp2 - yp1); }
24895 inline void QRectF::setWidth(qreal aw)
24897 inline void QRectF::setHeight(qreal ah)
24899 inline void QRectF::setSize(const QSizeF &s)
24904 inline bool QRectF::contains(qreal ax, qreal ay) const
24906 return contains(QPointF(ax, ay));
24908 inline QRectF& QRectF::operator|=(const QRectF &r)
24913 inline QRectF& QRectF::operator&=(const QRectF &r)
24918 inline QRectF QRectF::intersect(const QRectF &r) const
24922 inline QRectF QRectF::intersected(const QRectF &r) const
24924 return intersect(r);
24926 inline QRectF QRectF::unite(const QRectF &r) const
24930 inline QRectF QRectF::united(const QRectF &r) const
24934 inline bool operator==(const QRectF &r1, const QRectF &r2)
24936 return qFuzzyCompare(r1.xp, r2.xp) && qFuzzyCompare(r1.yp, r2.yp)
24937 && qFuzzyCompare(r1.w, r2.w) && qFuzzyCompare(r1.h, r2.h);
24939 inline bool operator!=(const QRectF &r1, const QRectF &r2)
24941 return !qFuzzyCompare(r1.xp, r2.xp) || !qFuzzyCompare(r1.yp, r2.yp)
24942 || !qFuzzyCompare(r1.w, r2.w) || !qFuzzyCompare(r1.h, r2.h);
24944 inline QRect QRectF::toRect() const
24946 return QRect(qRound(xp), qRound(yp), qRound(w), qRound(h));
24948 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QRectF &);
24949 typedef QtValidLicenseForGuiModule QtGuiModule;
24950 typedef unsigned int QRgb;
24951 const QRgb RGB_MASK = 0x00ffffff;
24952 __attribute__((visibility("default"))) inline int qRed(QRgb rgb)
24953 { return ((rgb >> 16) & 0xff); }
24954 __attribute__((visibility("default"))) inline int qGreen(QRgb rgb)
24955 { return ((rgb >> 8) & 0xff); }
24956 __attribute__((visibility("default"))) inline int qBlue(QRgb rgb)
24957 { return (rgb & 0xff); }
24958 __attribute__((visibility("default"))) inline int qAlpha(QRgb rgb)
24959 { return ((rgb >> 24) & 0xff); }
24960 __attribute__((visibility("default"))) inline QRgb qRgb(int r, int g, int b)
24961 { return (0xffu << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
24962 __attribute__((visibility("default"))) inline QRgb qRgba(int r, int g, int b, int a)
24963 { return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
24964 __attribute__((visibility("default"))) inline int qGray(int r, int g, int b)
24965 { return (r*11+g*16+b*5)/32; }
24966 __attribute__((visibility("default"))) inline int qGray(QRgb rgb)
24967 { return qGray(qRed(rgb), qGreen(rgb), qBlue(rgb)); }
24968 __attribute__((visibility("default"))) inline bool qIsGray(QRgb rgb)
24969 { return qRed(rgb) == qGreen(rgb) && qRed(rgb) == qBlue(rgb); }
24970 typedef QtValidLicenseForCoreModule QtCoreModule;
24971 struct QRegExpPrivate;
24973 class __attribute__((visibility("default"))) QRegExp
24976 enum PatternSyntax { RegExp, Wildcard, FixedString, RegExp2 };
24977 enum CaretMode { CaretAtZero, CaretAtOffset, CaretWontMatch };
24979 explicit QRegExp(const QString &pattern, Qt::CaseSensitivity cs = Qt::CaseSensitive,
24980 PatternSyntax syntax = RegExp);
24981 QRegExp(const QRegExp &rx);
24983 QRegExp &operator=(const QRegExp &rx);
24984 bool operator==(const QRegExp &rx) const;
24985 inline bool operator!=(const QRegExp &rx) const { return !operator==(rx); }
24986 bool isEmpty() const;
24987 bool isValid() const;
24988 QString pattern() const;
24989 void setPattern(const QString &pattern);
24990 Qt::CaseSensitivity caseSensitivity() const;
24991 void setCaseSensitivity(Qt::CaseSensitivity cs);
24992 PatternSyntax patternSyntax() const;
24993 void setPatternSyntax(PatternSyntax syntax);
24994 bool isMinimal() const;
24995 void setMinimal(bool minimal);
24996 bool exactMatch(const QString &str) const;
24997 int indexIn(const QString &str, int offset = 0, CaretMode caretMode = CaretAtZero) const;
24998 int lastIndexIn(const QString &str, int offset = -1, CaretMode caretMode = CaretAtZero) const;
24999 int matchedLength() const;
25000 int numCaptures() const;
25001 QStringList capturedTexts() const;
25002 QStringList capturedTexts();
25003 QString cap(int nth = 0) const;
25004 QString cap(int nth = 0);
25005 int pos(int nth = 0) const;
25006 int pos(int nth = 0);
25007 QString errorString() const;
25008 QString errorString();
25009 static QString escape(const QString &str);
25011 QRegExpPrivate *priv;
25013 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"; } };
25014 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &out, const QRegExp ®Exp);
25015 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &in, QRegExp ®Exp);
25016 typedef QtValidLicenseForCoreModule QtCoreModule;
25017 class QStringMatcherPrivate;
25018 class __attribute__((visibility("default"))) QStringMatcher
25022 QStringMatcher(const QString &pattern,
25023 Qt::CaseSensitivity cs = Qt::CaseSensitive);
25024 QStringMatcher(const QChar *uc, int len,
25025 Qt::CaseSensitivity cs = Qt::CaseSensitive);
25026 QStringMatcher(const QStringMatcher &other);
25028 QStringMatcher &operator=(const QStringMatcher &other);
25029 void setPattern(const QString &pattern);
25030 void setCaseSensitivity(Qt::CaseSensitivity cs);
25031 int indexIn(const QString &str, int from = 0) const;
25032 int indexIn(const QChar *str, int length, int from = 0) const;
25033 QString pattern() const;
25034 inline Qt::CaseSensitivity caseSensitivity() const { return q_cs; }
25036 QStringMatcherPrivate *d_ptr;
25038 Qt::CaseSensitivity q_cs;
25042 uchar q_skiptable[256];
25048 typedef QtValidLicenseForCoreModule QtCoreModule;
25050 typedef QListIterator<QString> QStringListIterator;
25051 typedef QMutableListIterator<QString> QMutableStringListIterator;
25052 class QStringList : public QList<QString>
25055 inline QStringList() { }
25056 inline explicit QStringList(const QString &i) { append(i); }
25057 inline QStringList(const QStringList &l) : QList<QString>(l) { }
25058 inline QStringList(const QList<QString> &l) : QList<QString>(l) { }
25059 inline void sort();
25060 inline int removeDuplicates();
25061 inline QString join(const QString &sep) const;
25062 inline QStringList filter(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
25063 inline QBool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
25064 inline QStringList &replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
25065 inline QStringList operator+(const QStringList &other) const
25066 { QStringList n = *this; n += other; return n; }
25067 inline QStringList &operator<<(const QString &str)
25068 { append(str); return *this; }
25069 inline QStringList &operator<<(const QStringList &l)
25070 { *this += l; return *this; }
25071 inline QStringList filter(const QRegExp &rx) const;
25072 inline QStringList &replaceInStrings(const QRegExp &rx, const QString &after);
25073 inline int indexOf(const QRegExp &rx, int from = 0) const;
25074 inline int lastIndexOf(const QRegExp &rx, int from = -1) const;
25075 inline int indexOf(QRegExp &rx, int from = 0) const;
25076 inline int lastIndexOf(QRegExp &rx, int from = -1) const;
25077 using QList<QString>::indexOf;
25078 using QList<QString>::lastIndexOf;
25080 namespace QtPrivate {
25081 void __attribute__((visibility("default"))) QStringList_sort(QStringList *that);
25082 int __attribute__((visibility("default"))) QStringList_removeDuplicates(QStringList *that);
25083 QString __attribute__((visibility("default"))) QStringList_join(const QStringList *that, const QString &sep);
25084 QStringList __attribute__((visibility("default"))) QStringList_filter(const QStringList *that, const QString &str,
25085 Qt::CaseSensitivity cs);
25086 QBool __attribute__((visibility("default"))) QStringList_contains(const QStringList *that, const QString &str, Qt::CaseSensitivity cs);
25087 void __attribute__((visibility("default"))) QStringList_replaceInStrings(QStringList *that, const QString &before, const QString &after,
25088 Qt::CaseSensitivity cs);
25089 void __attribute__((visibility("default"))) QStringList_replaceInStrings(QStringList *that, const QRegExp &rx, const QString &after);
25090 QStringList __attribute__((visibility("default"))) QStringList_filter(const QStringList *that, const QRegExp &re);
25091 int __attribute__((visibility("default"))) QStringList_indexOf(const QStringList *that, const QRegExp &rx, int from);
25092 int __attribute__((visibility("default"))) QStringList_lastIndexOf(const QStringList *that, const QRegExp &rx, int from);
25093 int __attribute__((visibility("default"))) QStringList_indexOf(const QStringList *that, QRegExp &rx, int from);
25094 int __attribute__((visibility("default"))) QStringList_lastIndexOf(const QStringList *that, QRegExp &rx, int from);
25096 inline void QStringList::sort()
25098 QtPrivate::QStringList_sort(this);
25100 inline int QStringList::removeDuplicates()
25102 return QtPrivate::QStringList_removeDuplicates(this);
25104 inline QString QStringList::join(const QString &sep) const
25106 return QtPrivate::QStringList_join(this, sep);
25108 inline QStringList QStringList::filter(const QString &str, Qt::CaseSensitivity cs) const
25110 return QtPrivate::QStringList_filter(this, str, cs);
25112 inline QBool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const
25114 return QtPrivate::QStringList_contains(this, str, cs);
25116 inline QStringList &QStringList::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs)
25118 QtPrivate::QStringList_replaceInStrings(this, before, after, cs);
25121 inline QStringList &QStringList::replaceInStrings(const QRegExp &rx, const QString &after)
25123 QtPrivate::QStringList_replaceInStrings(this, rx, after);
25126 inline QStringList QStringList::filter(const QRegExp &rx) const
25128 return QtPrivate::QStringList_filter(this, rx);
25130 inline int QStringList::indexOf(const QRegExp &rx, int from) const
25132 return QtPrivate::QStringList_indexOf(this, rx, from);
25134 inline int QStringList::lastIndexOf(const QRegExp &rx, int from) const
25136 return QtPrivate::QStringList_lastIndexOf(this, rx, from);
25138 inline int QStringList::indexOf(QRegExp &rx, int from) const
25140 return QtPrivate::QStringList_indexOf(this, rx, from);
25142 inline int QStringList::lastIndexOf(QRegExp &rx, int from) const
25144 return QtPrivate::QStringList_lastIndexOf(this, rx, from);
25146 inline QDataStream &operator>>(QDataStream &in, QStringList &list)
25148 return operator>>(in, static_cast<QList<QString> &>(list));
25150 inline QDataStream &operator<<(QDataStream &out, const QStringList &list)
25152 return operator<<(out, static_cast<const QList<QString> &>(list));
25154 typedef QtValidLicenseForGuiModule QtGuiModule;
25158 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QColor &);
25159 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QColor &);
25160 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QColor &);
25161 class __attribute__((visibility("default"))) QColor
25164 enum Spec { Invalid, Rgb, Hsv, Cmyk };
25166 QColor(Qt::GlobalColor color);
25167 QColor(int r, int g, int b, int a = 255);
25169 QColor(const QString& name);
25170 QColor(const char *name);
25171 QColor(const QColor &color);
25173 bool isValid() const;
25174 QString name() const;
25175 void setNamedColor(const QString& name);
25176 static QStringList colorNames();
25177 inline Spec spec() const
25180 void setAlpha(int alpha);
25181 qreal alphaF() const;
25182 void setAlphaF(qreal alpha);
25186 void setRed(int red);
25187 void setGreen(int green);
25188 void setBlue(int blue);
25189 qreal redF() const;
25190 qreal greenF() const;
25191 qreal blueF() const;
25192 void setRedF(qreal red);
25193 void setGreenF(qreal green);
25194 void setBlueF(qreal blue);
25195 void getRgb(int *r, int *g, int *b, int *a = 0) const;
25196 void setRgb(int r, int g, int b, int a = 255);
25197 void getRgbF(qreal *r, qreal *g, qreal *b, qreal *a = 0) const;
25198 void setRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
25200 void setRgba(QRgb rgba);
25202 void setRgb(QRgb rgb);
25204 int saturation() const;
25206 qreal hueF() const;
25207 qreal saturationF() const;
25208 qreal valueF() const;
25209 void getHsv(int *h, int *s, int *v, int *a = 0) const;
25210 void setHsv(int h, int s, int v, int a = 255);
25211 void getHsvF(qreal *h, qreal *s, qreal *v, qreal *a = 0) const;
25212 void setHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
25214 int magenta() const;
25215 int yellow() const;
25217 qreal cyanF() const;
25218 qreal magentaF() const;
25219 qreal yellowF() const;
25220 qreal blackF() const;
25221 void getCmyk(int *c, int *m, int *y, int *k, int *a = 0);
25222 void setCmyk(int c, int m, int y, int k, int a = 255);
25223 void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = 0);
25224 void setCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0);
25225 QColor toRgb() const;
25226 QColor toHsv() const;
25227 QColor toCmyk() const;
25228 QColor convertTo(Spec colorSpec) const;
25229 static QColor fromRgb(QRgb rgb);
25230 static QColor fromRgba(QRgb rgba);
25231 static QColor fromRgb(int r, int g, int b, int a = 255);
25232 static QColor fromRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
25233 static QColor fromHsv(int h, int s, int v, int a = 255);
25234 static QColor fromHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
25235 static QColor fromCmyk(int c, int m, int y, int k, int a = 255);
25236 static QColor fromCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0);
25237 QColor light(int f = 150) const;
25238 QColor lighter(int f = 150) const;
25239 QColor dark(int f = 200) const;
25240 QColor darker(int f = 200) const;
25241 QColor &operator=(const QColor &);
25242 QColor &operator=(Qt::GlobalColor color);
25243 bool operator==(const QColor &c) const;
25244 bool operator!=(const QColor &c) const;
25245 operator QVariant() const;
25247 QColor(int, int, int, Spec);
25273 friend class QColormap;
25274 friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QColor &);
25275 friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QColor &);
25277 inline QColor::QColor()
25279 inline QColor::QColor(int r, int g, int b, int a)
25280 { setRgb(r, g, b, a); }
25281 inline QColor::QColor(const char *aname)
25282 { setNamedColor(QLatin1String(aname)); }
25283 inline QColor::QColor(const QString& aname)
25284 { setNamedColor(aname); }
25285 inline QColor::QColor(const QColor &acolor)
25286 : cspec(acolor.cspec)
25287 { ct.argb = acolor.ct.argb; }
25288 inline bool QColor::isValid() const
25289 { return cspec != Invalid; }
25290 inline QColor QColor::lighter(int f) const
25291 { return light(f); }
25292 inline QColor QColor::darker(int f) const
25293 { return dark(f); }
25294 typedef QtValidLicenseForGuiModule QtGuiModule;
25295 class QPaintDevice;
25308 class QFontMetrics;
25324 class QApplication;
25325 template<typename T> class QList;
25326 typedef QList<QWidget *> QWidgetList;
25327 typedef unsigned long WId;
25329 template<class K, class V> class QHash;
25330 typedef QHash<WId, QWidget *> QWidgetMapper;
25331 template<class V> class QSet;
25332 typedef QSet<QWidget *> QWidgetSet;
25333 typedef QtValidLicenseForGuiModule QtGuiModule;
25334 template <class T> class QVector;
25336 struct QRegionPrivate;
25338 class __attribute__((visibility("default"))) QRegion
25341 enum RegionType { Rectangle, Ellipse };
25343 QRegion(int x, int y, int w, int h, RegionType t = Rectangle);
25344 QRegion(const QRect &r, RegionType t = Rectangle);
25345 QRegion(const QPolygon &pa, Qt::FillRule fillRule = Qt::OddEvenFill);
25346 QRegion(const QRegion ®ion);
25347 QRegion(const QBitmap &bitmap);
25349 QRegion &operator=(const QRegion &);
25350 bool isEmpty() const;
25351 bool contains(const QPoint &p) const;
25352 bool contains(const QRect &r) const;
25353 void translate(int dx, int dy);
25354 inline void translate(const QPoint &p) { translate(p.x(), p.y()); }
25355 QRegion translated(int dx, int dy) const;
25356 inline QRegion translated(const QPoint &p) const { return translated(p.x(), p.y()); }
25357 QRegion unite(const QRegion &r) const;
25358 QRegion unite(const QRect &r) const;
25359 QRegion intersect(const QRegion &r) const;
25360 QRegion intersect(const QRect &r) const;
25361 QRegion subtract(const QRegion &r) const;
25362 QRegion eor(const QRegion &r) const;
25363 inline QRegion united(const QRegion &r) const { return unite(r); }
25364 inline QRegion united(const QRect &r) const { return unite(r); }
25365 inline QRegion intersected(const QRegion &r) const { return intersect(r); }
25366 inline QRegion intersected(const QRect &r) const { return intersect(r); }
25367 inline QRegion subtracted(const QRegion &r) const { return subtract(r); }
25368 inline QRegion xored(const QRegion &r) const { return eor(r); }
25369 bool intersects(const QRegion &r) const;
25370 bool intersects(const QRect &r) const;
25371 QRect boundingRect() const;
25372 QVector<QRect> rects() const;
25373 void setRects(const QRect *rect, int num);
25374 int numRects() const;
25375 const QRegion operator|(const QRegion &r) const;
25376 const QRegion operator+(const QRegion &r) const;
25377 const QRegion operator+(const QRect &r) const;
25378 const QRegion operator&(const QRegion &r) const;
25379 const QRegion operator&(const QRect &r) const;
25380 const QRegion operator-(const QRegion &r) const;
25381 const QRegion operator^(const QRegion &r) const;
25382 QRegion& operator|=(const QRegion &r);
25383 QRegion& operator+=(const QRegion &r);
25384 QRegion& operator+=(const QRect &r);
25385 QRegion& operator&=(const QRegion &r);
25386 QRegion& operator&=(const QRect &r);
25387 QRegion& operator-=(const QRegion &r);
25388 QRegion& operator^=(const QRegion &r);
25389 bool operator==(const QRegion &r) const;
25390 inline bool operator!=(const QRegion &r) const { return !(operator==(r)); }
25391 operator QVariant() const;
25392 inline void *handle() const { return d->qt_rgn; }
25393 friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QRegion &);
25394 friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QRegion &);
25396 QRegion copy() const;
25398 friend bool qt_region_strictContains(const QRegion ®ion,
25399 const QRect &rect);
25400 friend struct QRegionPrivate;
25401 void exec(const QByteArray &ba, int ver = 0, QDataStream::ByteOrder byteOrder = QDataStream::BigEndian);
25402 struct QRegionData {
25403 QBasicAtomicInt ref;
25404 QRegionPrivate *qt_rgn;
25406 struct QRegionData *d;
25407 static struct QRegionData shared_empty;
25408 static void cleanUp(QRegionData *x);
25410 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QRegion &);
25411 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QRegion &);
25412 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QRegion &);
25413 typedef QtValidLicenseForGuiModule QtGuiModule;
25414 class QKeySequence;
25415 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
25416 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &out, QKeySequence &ks);
25418 class QKeySequencePrivate;
25419 class __attribute__((visibility("default"))) QKeySequence
25454 MoveToPreviousChar,
25456 MoveToPreviousWord,
25458 MoveToPreviousLine,
25460 MoveToPreviousPage,
25463 MoveToStartOfBlock,
25465 MoveToStartOfDocument,
25466 MoveToEndOfDocument,
25468 SelectPreviousChar,
25470 SelectPreviousWord,
25472 SelectPreviousLine,
25474 SelectPreviousPage,
25477 SelectStartOfBlock,
25479 SelectStartOfDocument,
25480 SelectEndOfDocument,
25484 InsertParagraphSeparator,
25485 InsertLineSeparator,
25489 QKeySequence(const QString &key);
25490 QKeySequence(int k1, int k2 = 0, int k3 = 0, int k4 = 0);
25491 QKeySequence(const QKeySequence &ks);
25492 QKeySequence(StandardKey key);
25494 uint count() const;
25495 bool isEmpty() const;
25496 enum SequenceMatch {
25501 enum SequenceFormat {
25505 QString toString(SequenceFormat format = PortableText) const;
25506 static QKeySequence fromString(const QString &str, SequenceFormat format = PortableText);
25507 SequenceMatch matches(const QKeySequence &seq) const;
25508 static QKeySequence mnemonic(const QString &text);
25509 static QList<QKeySequence> keyBindings(StandardKey key);
25510 operator QString() const;
25511 operator QVariant() const;
25512 operator int() const;
25513 int operator[](uint i) const;
25514 QKeySequence &operator=(const QKeySequence &other);
25515 bool operator==(const QKeySequence &other) const;
25516 inline bool operator!= (const QKeySequence &other) const
25517 { return !(*this == other); }
25518 bool operator< (const QKeySequence &ks) const;
25519 inline bool operator> (const QKeySequence &other) const
25520 { return other < *this; }
25521 inline bool operator<= (const QKeySequence &other) const
25522 { return !(other < *this); }
25523 inline bool operator>= (const QKeySequence &other) const
25524 { return !(*this < other); }
25525 bool isDetached() const;
25527 static int decodeString(const QString &ks);
25528 static QString encodeString(int key);
25529 int assign(const QString &str);
25530 void setKey(int key, int index);
25531 QKeySequencePrivate *d;
25532 friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
25533 friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &in, QKeySequence &ks);
25534 friend class Q3AccelManager;
25535 friend class QShortcutMap;
25536 friend class QShortcut;
25538 typedef QKeySequencePrivate * DataPtr;
25539 inline DataPtr &data_ptr() { return d; }
25541 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"; } };
25542 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; }
25543 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QKeySequence &);
25544 typedef QtValidLicenseForCoreModule QtCoreModule;
25545 class QEventPrivate;
25546 class __attribute__((visibility("default"))) QEvent
25552 MouseButtonPress = 2,
25553 MouseButtonRelease = 3,
25554 MouseButtonDblClick = 4,
25572 ParentAboutToChange = 131,
25574 WindowActivate = 24,
25575 WindowDeactivate = 25,
25579 WindowTitleChange = 33,
25580 WindowIconChange = 34,
25581 ApplicationWindowIconChange = 35,
25582 ApplicationFontChange = 36,
25583 ApplicationLayoutDirectionChange = 37,
25584 ApplicationPaletteChange = 38,
25585 PaletteChange = 39,
25591 DeferredDelete = 52,
25598 ChildPolished = 69,
25600 ShowWindowRequest = 73,
25601 PolishRequest = 74,
25603 LayoutRequest = 76,
25604 UpdateRequest = 77,
25606 EmbeddingControl = 79,
25607 ActivateControl = 80,
25608 DeactivateControl = 81,
25611 AccessibilityPrepare = 86,
25614 LanguageChange = 89,
25615 LayoutDirectionChange = 90,
25618 TabletRelease = 93,
25623 EnabledChange = 98,
25624 ActivationChange = 99,
25626 IconTextChange = 101,
25627 ModifiedChange = 102,
25628 MouseTrackingChange = 109,
25629 WindowBlocked = 103,
25630 WindowUnblocked = 104,
25631 WindowStateChange = 105,
25635 ActionChanged = 113,
25637 ActionRemoved = 115,
25640 ShortcutOverride = 51,
25641 WhatsThisClicked = 118,
25642 ToolBarChange = 120,
25643 ApplicationActivate = 121,
25644 ApplicationActivated = ApplicationActivate,
25645 ApplicationDeactivate = 122,
25646 ApplicationDeactivated = ApplicationDeactivate,
25647 QueryWhatsThis = 123,
25648 EnterWhatsThisMode = 124,
25649 LeaveWhatsThisMode = 125,
25650 ZOrderChange = 126,
25654 AccessibilityHelp = 119,
25655 AccessibilityDescription = 130,
25656 AcceptDropsChange = 152,
25657 MenubarUpdated = 153,
25658 ZeroTimerEvent = 154,
25659 GraphicsSceneMouseMove = 155,
25660 GraphicsSceneMousePress = 156,
25661 GraphicsSceneMouseRelease = 157,
25662 GraphicsSceneMouseDoubleClick = 158,
25663 GraphicsSceneContextMenu = 159,
25664 GraphicsSceneHoverEnter = 160,
25665 GraphicsSceneHoverMove = 161,
25666 GraphicsSceneHoverLeave = 162,
25667 GraphicsSceneHelp = 163,
25668 GraphicsSceneDragEnter = 164,
25669 GraphicsSceneDragMove = 165,
25670 GraphicsSceneDragLeave = 166,
25671 GraphicsSceneDrop = 167,
25672 GraphicsSceneWheel = 168,
25673 KeyboardLayoutChange = 169,
25674 DynamicPropertyChange = 170,
25675 TabletEnterProximity = 171,
25676 TabletLeaveProximity = 172,
25677 NonClientAreaMouseMove = 173,
25678 NonClientAreaMouseButtonPress = 174,
25679 NonClientAreaMouseButtonRelease = 175,
25680 NonClientAreaMouseButtonDblClick = 176,
25681 MacSizeChange = 177,
25682 ContentsRectChange = 178,
25683 MacGLWindowChange = 179,
25684 FutureCallOut = 180,
25685 GraphicsSceneResize = 181,
25686 GraphicsSceneMove = 182,
25687 CursorChange = 183,
25688 ToolTipChange = 184,
25689 NetworkReplyUpdated = 185,
25692 GrabKeyboard = 188,
25693 UngrabKeyboard = 189,
25694 CocoaRequestModal = 190,
25695 MacGLClearDrawable = 191,
25701 inline Type type() const { return static_cast<Type>(t); }
25702 inline bool spontaneous() const { return spont; }
25703 inline void setAccepted(bool accepted) { m_accept = accepted; }
25704 inline bool isAccepted() const { return m_accept; }
25705 inline void accept() { m_accept = true; }
25706 inline void ignore() { m_accept = false; }
25707 static int registerEventType(int hint = -1);
25714 ushort m_accept : 1;
25715 ushort reserved : 13;
25716 friend class QCoreApplication;
25717 friend class QCoreApplicationPrivate;
25718 friend class QThreadData;
25719 friend class QApplication;
25720 friend class QApplicationPrivate;
25721 friend class Q3AccelManager;
25722 friend class QShortcutMap;
25723 friend class QETWidget;
25725 class __attribute__((visibility("default"))) QTimerEvent : public QEvent
25728 QTimerEvent( int timerId );
25730 int timerId() const { return id; }
25735 class __attribute__((visibility("default"))) QChildEvent : public QEvent
25738 QChildEvent( Type type, QObject *child );
25740 QObject *child() const { return c; }
25741 bool added() const { return type() == ChildAdded; }
25742 bool polished() const { return type() == ChildPolished; }
25743 bool removed() const { return type() == ChildRemoved; }
25747 class __attribute__((visibility("default"))) QDynamicPropertyChangeEvent : public QEvent
25750 QDynamicPropertyChangeEvent(const QByteArray &name);
25751 ~QDynamicPropertyChangeEvent();
25752 inline QByteArray propertyName() const { return n; }
25756 typedef QtValidLicenseForCoreModule QtCoreModule;
25757 class __attribute__((visibility("default"))) QMetaType {
25760 Void = 0, Bool = 1, Int = 2, UInt = 3, LongLong = 4, ULongLong = 5,
25761 Double = 6, QChar = 7, QVariantMap = 8, QVariantList = 9,
25762 QString = 10, QStringList = 11, QByteArray = 12,
25763 QBitArray = 13, QDate = 14, QTime = 15, QDateTime = 16, QUrl = 17,
25764 QLocale = 18, QRect = 19, QRectF = 20, QSize = 21, QSizeF = 22,
25765 QLine = 23, QLineF = 24, QPoint = 25, QPointF = 26, QRegExp = 27,
25766 QVariantHash = 28, LastCoreType = 28 ,
25767 FirstGuiType = 63 ,
25768 QFont = 64, QPixmap = 65, QBrush = 66, QColor = 67, QPalette = 68,
25769 QIcon = 69, QImage = 70, QPolygon = 71, QRegion = 72, QBitmap = 73,
25770 QCursor = 74, QSizePolicy = 75, QKeySequence = 76, QPen = 77,
25771 QTextLength = 78, QTextFormat = 79, QMatrix = 80, QTransform = 81,
25773 FirstCoreExtType = 128 ,
25774 VoidStar = 128, Long = 129, Short = 130, Char = 131, ULong = 132,
25775 UShort = 133, UChar = 134, Float = 135, QObjectStar = 136, QWidgetStar = 137,
25776 LastCoreExtType = 137 ,
25779 typedef void (*Destructor)(void *);
25780 typedef void *(*Constructor)(const void *);
25781 typedef void (*SaveOperator)(QDataStream &, const void *);
25782 typedef void (*LoadOperator)(QDataStream &, void *);
25783 static void registerStreamOperators(const char *typeName, SaveOperator saveOp,
25784 LoadOperator loadOp);
25785 static int registerType(const char *typeName, Destructor destructor,
25786 Constructor constructor);
25787 static int type(const char *typeName);
25788 static const char *typeName(int type);
25789 static bool isRegistered(int type);
25790 static void *construct(int type, const void *copy = 0);
25791 static void destroy(int type, void *data);
25792 static void unregisterType(const char *typeName);
25793 static bool save(QDataStream &stream, int type, const void *data);
25794 static bool load(QDataStream &stream, int type, void *data);
25796 template <typename T>
25797 void qMetaTypeDeleteHelper(T *t)
25801 template <typename T>
25802 void *qMetaTypeConstructHelper(const T *t)
25806 return new T(*static_cast<const T*>(t));
25808 template <typename T>
25809 void qMetaTypeSaveHelper(QDataStream &stream, const T *t)
25813 template <typename T>
25814 void qMetaTypeLoadHelper(QDataStream &stream, T *t)
25818 template <typename T>
25819 int qRegisterMetaType(const char *typeName
25823 typedef void*(*ConstructPtr)(const T*);
25824 ConstructPtr cptr = qMetaTypeConstructHelper<T>;
25825 typedef void(*DeletePtr)(T*);
25826 DeletePtr dptr = qMetaTypeDeleteHelper<T>;
25827 return QMetaType::registerType(typeName, reinterpret_cast<QMetaType::Destructor>(dptr),
25828 reinterpret_cast<QMetaType::Constructor>(cptr));
25830 template <typename T>
25831 void qRegisterMetaTypeStreamOperators(const char *typeName
25835 typedef void(*SavePtr)(QDataStream &, const T *);
25836 typedef void(*LoadPtr)(QDataStream &, T *);
25837 SavePtr sptr = qMetaTypeSaveHelper<T>;
25838 LoadPtr lptr = qMetaTypeLoadHelper<T>;
25839 qRegisterMetaType<T>(typeName);
25840 QMetaType::registerStreamOperators(typeName, reinterpret_cast<QMetaType::SaveOperator>(sptr),
25841 reinterpret_cast<QMetaType::LoadOperator>(lptr));
25843 template <typename T>
25846 enum { Defined = 0 };
25848 template <typename T>
25849 struct QMetaTypeId2
25851 enum { Defined = QMetaTypeId<T>::Defined };
25852 static inline int qt_metatype_id() { return QMetaTypeId<T>::qt_metatype_id(); }
25854 template <typename T>
25855 inline int qMetaTypeId(
25859 return QMetaTypeId2<T>::qt_metatype_id();
25861 template <typename T>
25862 inline int qRegisterMetaType(
25866 return qMetaTypeId(dummy);
25901 class QKeySequence;
25907 template<> struct QMetaTypeId2<QString> { enum { Defined = 1, MetaType = QMetaType::QString }; static inline int qt_metatype_id() { return QMetaType::QString; } };
25908 template<> struct QMetaTypeId2<int> { enum { Defined = 1, MetaType = QMetaType::Int }; static inline int qt_metatype_id() { return QMetaType::Int; } };
25909 template<> struct QMetaTypeId2<uint> { enum { Defined = 1, MetaType = QMetaType::UInt }; static inline int qt_metatype_id() { return QMetaType::UInt; } };
25910 template<> struct QMetaTypeId2<bool> { enum { Defined = 1, MetaType = QMetaType::Bool }; static inline int qt_metatype_id() { return QMetaType::Bool; } };
25911 template<> struct QMetaTypeId2<double> { enum { Defined = 1, MetaType = QMetaType::Double }; static inline int qt_metatype_id() { return QMetaType::Double; } };
25912 template<> struct QMetaTypeId2<QByteArray> { enum { Defined = 1, MetaType = QMetaType::QByteArray }; static inline int qt_metatype_id() { return QMetaType::QByteArray; } };
25913 template<> struct QMetaTypeId2<QChar> { enum { Defined = 1, MetaType = QMetaType::QChar }; static inline int qt_metatype_id() { return QMetaType::QChar; } };
25914 template<> struct QMetaTypeId2<long> { enum { Defined = 1, MetaType = QMetaType::Long }; static inline int qt_metatype_id() { return QMetaType::Long; } };
25915 template<> struct QMetaTypeId2<short> { enum { Defined = 1, MetaType = QMetaType::Short }; static inline int qt_metatype_id() { return QMetaType::Short; } };
25916 template<> struct QMetaTypeId2<char> { enum { Defined = 1, MetaType = QMetaType::Char }; static inline int qt_metatype_id() { return QMetaType::Char; } };
25917 template<> struct QMetaTypeId2<ulong> { enum { Defined = 1, MetaType = QMetaType::ULong }; static inline int qt_metatype_id() { return QMetaType::ULong; } };
25918 template<> struct QMetaTypeId2<ushort> { enum { Defined = 1, MetaType = QMetaType::UShort }; static inline int qt_metatype_id() { return QMetaType::UShort; } };
25919 template<> struct QMetaTypeId2<uchar> { enum { Defined = 1, MetaType = QMetaType::UChar }; static inline int qt_metatype_id() { return QMetaType::UChar; } };
25920 template<> struct QMetaTypeId2<float> { enum { Defined = 1, MetaType = QMetaType::Float }; static inline int qt_metatype_id() { return QMetaType::Float; } };
25921 template<> struct QMetaTypeId2<QObject *> { enum { Defined = 1, MetaType = QMetaType::QObjectStar }; static inline int qt_metatype_id() { return QMetaType::QObjectStar; } };
25922 template<> struct QMetaTypeId2<QWidget *> { enum { Defined = 1, MetaType = QMetaType::QWidgetStar }; static inline int qt_metatype_id() { return QMetaType::QWidgetStar; } };
25923 template<> struct QMetaTypeId2<void *> { enum { Defined = 1, MetaType = QMetaType::VoidStar }; static inline int qt_metatype_id() { return QMetaType::VoidStar; } };
25924 template<> struct QMetaTypeId2<qlonglong> { enum { Defined = 1, MetaType = QMetaType::LongLong }; static inline int qt_metatype_id() { return QMetaType::LongLong; } };
25925 template<> struct QMetaTypeId2<qulonglong> { enum { Defined = 1, MetaType = QMetaType::ULongLong }; static inline int qt_metatype_id() { return QMetaType::ULongLong; } };
25926 template<> struct QMetaTypeId2<QStringList> { enum { Defined = 1, MetaType = QMetaType::QStringList }; static inline int qt_metatype_id() { return QMetaType::QStringList; } };
25927 template<> struct QMetaTypeId2<QBitArray> { enum { Defined = 1, MetaType = QMetaType::QBitArray }; static inline int qt_metatype_id() { return QMetaType::QBitArray; } };
25928 template<> struct QMetaTypeId2<QDate> { enum { Defined = 1, MetaType = QMetaType::QDate }; static inline int qt_metatype_id() { return QMetaType::QDate; } };
25929 template<> struct QMetaTypeId2<QTime> { enum { Defined = 1, MetaType = QMetaType::QTime }; static inline int qt_metatype_id() { return QMetaType::QTime; } };
25930 template<> struct QMetaTypeId2<QDateTime> { enum { Defined = 1, MetaType = QMetaType::QDateTime }; static inline int qt_metatype_id() { return QMetaType::QDateTime; } };
25931 template<> struct QMetaTypeId2<QUrl> { enum { Defined = 1, MetaType = QMetaType::QUrl }; static inline int qt_metatype_id() { return QMetaType::QUrl; } };
25932 template<> struct QMetaTypeId2<QLocale> { enum { Defined = 1, MetaType = QMetaType::QLocale }; static inline int qt_metatype_id() { return QMetaType::QLocale; } };
25933 template<> struct QMetaTypeId2<QRect> { enum { Defined = 1, MetaType = QMetaType::QRect }; static inline int qt_metatype_id() { return QMetaType::QRect; } };
25934 template<> struct QMetaTypeId2<QRectF> { enum { Defined = 1, MetaType = QMetaType::QRectF }; static inline int qt_metatype_id() { return QMetaType::QRectF; } };
25935 template<> struct QMetaTypeId2<QSize> { enum { Defined = 1, MetaType = QMetaType::QSize }; static inline int qt_metatype_id() { return QMetaType::QSize; } };
25936 template<> struct QMetaTypeId2<QSizeF> { enum { Defined = 1, MetaType = QMetaType::QSizeF }; static inline int qt_metatype_id() { return QMetaType::QSizeF; } };
25937 template<> struct QMetaTypeId2<QLine> { enum { Defined = 1, MetaType = QMetaType::QLine }; static inline int qt_metatype_id() { return QMetaType::QLine; } };
25938 template<> struct QMetaTypeId2<QLineF> { enum { Defined = 1, MetaType = QMetaType::QLineF }; static inline int qt_metatype_id() { return QMetaType::QLineF; } };
25939 template<> struct QMetaTypeId2<QPoint> { enum { Defined = 1, MetaType = QMetaType::QPoint }; static inline int qt_metatype_id() { return QMetaType::QPoint; } };
25940 template<> struct QMetaTypeId2<QPointF> { enum { Defined = 1, MetaType = QMetaType::QPointF }; static inline int qt_metatype_id() { return QMetaType::QPointF; } };
25941 template<> struct QMetaTypeId2<QRegExp> { enum { Defined = 1, MetaType = QMetaType::QRegExp }; static inline int qt_metatype_id() { return QMetaType::QRegExp; } };
25942 template<> struct QMetaTypeId2<QFont> { enum { Defined = 1, MetaType = QMetaType::QFont }; static inline int qt_metatype_id() { return QMetaType::QFont; } };
25943 template<> struct QMetaTypeId2<QPixmap> { enum { Defined = 1, MetaType = QMetaType::QPixmap }; static inline int qt_metatype_id() { return QMetaType::QPixmap; } };
25944 template<> struct QMetaTypeId2<QBrush> { enum { Defined = 1, MetaType = QMetaType::QBrush }; static inline int qt_metatype_id() { return QMetaType::QBrush; } };
25945 template<> struct QMetaTypeId2<QColor> { enum { Defined = 1, MetaType = QMetaType::QColor }; static inline int qt_metatype_id() { return QMetaType::QColor; } };
25946 template<> struct QMetaTypeId2<QPalette> { enum { Defined = 1, MetaType = QMetaType::QPalette }; static inline int qt_metatype_id() { return QMetaType::QPalette; } };
25947 template<> struct QMetaTypeId2<QIcon> { enum { Defined = 1, MetaType = QMetaType::QIcon }; static inline int qt_metatype_id() { return QMetaType::QIcon; } };
25948 template<> struct QMetaTypeId2<QImage> { enum { Defined = 1, MetaType = QMetaType::QImage }; static inline int qt_metatype_id() { return QMetaType::QImage; } };
25949 template<> struct QMetaTypeId2<QPolygon> { enum { Defined = 1, MetaType = QMetaType::QPolygon }; static inline int qt_metatype_id() { return QMetaType::QPolygon; } };
25950 template<> struct QMetaTypeId2<QRegion> { enum { Defined = 1, MetaType = QMetaType::QRegion }; static inline int qt_metatype_id() { return QMetaType::QRegion; } };
25951 template<> struct QMetaTypeId2<QBitmap> { enum { Defined = 1, MetaType = QMetaType::QBitmap }; static inline int qt_metatype_id() { return QMetaType::QBitmap; } };
25952 template<> struct QMetaTypeId2<QCursor> { enum { Defined = 1, MetaType = QMetaType::QCursor }; static inline int qt_metatype_id() { return QMetaType::QCursor; } };
25953 template<> struct QMetaTypeId2<QSizePolicy> { enum { Defined = 1, MetaType = QMetaType::QSizePolicy }; static inline int qt_metatype_id() { return QMetaType::QSizePolicy; } };
25954 template<> struct QMetaTypeId2<QKeySequence> { enum { Defined = 1, MetaType = QMetaType::QKeySequence }; static inline int qt_metatype_id() { return QMetaType::QKeySequence; } };
25955 template<> struct QMetaTypeId2<QPen> { enum { Defined = 1, MetaType = QMetaType::QPen }; static inline int qt_metatype_id() { return QMetaType::QPen; } };
25956 template<> struct QMetaTypeId2<QTextLength> { enum { Defined = 1, MetaType = QMetaType::QTextLength }; static inline int qt_metatype_id() { return QMetaType::QTextLength; } };
25957 template<> struct QMetaTypeId2<QTextFormat> { enum { Defined = 1, MetaType = QMetaType::QTextFormat }; static inline int qt_metatype_id() { return QMetaType::QTextFormat; } };
25958 template<> struct QMetaTypeId2<QMatrix> { enum { Defined = 1, MetaType = QMetaType::QMatrix }; static inline int qt_metatype_id() { return QMetaType::QMatrix; } };
25959 template<> struct QMetaTypeId2<QTransform> { enum { Defined = 1, MetaType = QMetaType::QTransform }; static inline int qt_metatype_id() { return QMetaType::QTransform; } };
25960 typedef QtValidLicenseForCoreModule QtCoreModule;
25983 class QVariantComparisonHelper;
25984 template <typename T>
25985 inline QVariant qVariantFromValue(const T &);
25986 template <typename T>
25987 inline void qVariantSetValue(QVariant &, const T &);
25988 template<typename T>
25989 inline T qVariantValue(const QVariant &);
25990 template<typename T>
25991 inline bool qVariantCanConvert(const QVariant &);
25992 class __attribute__((visibility("default"))) QVariant
26025 LastCoreType = Hash,
26044 LastGuiType = Transform,
26046 LastType = 0xffffffff
26050 QVariant(Type type);
26051 QVariant(int typeOrUserType, const void *copy);
26052 QVariant(const QVariant &other);
26053 QVariant(QDataStream &s);
26056 QVariant(qlonglong ll);
26057 QVariant(qulonglong ull);
26059 QVariant(double d);
26060 __attribute__ ((__deprecated__)) QVariant(const char *str);
26061 QVariant(const QByteArray &bytearray);
26062 QVariant(const QBitArray &bitarray);
26063 QVariant(const QString &string);
26064 QVariant(const QLatin1String &string);
26065 QVariant(const QStringList &stringlist);
26066 QVariant(const QChar &qchar);
26067 QVariant(const QDate &date);
26068 QVariant(const QTime &time);
26069 QVariant(const QDateTime &datetime);
26070 QVariant(const QList<QVariant> &list);
26071 QVariant(const QMap<QString,QVariant> &map);
26072 QVariant(const QHash<QString,QVariant> &hash);
26073 QVariant(const QSize &size);
26074 QVariant(const QSizeF &size);
26075 QVariant(const QPoint &pt);
26076 QVariant(const QPointF &pt);
26077 QVariant(const QLine &line);
26078 QVariant(const QLineF &line);
26079 QVariant(const QRect &rect);
26080 QVariant(const QRectF &rect);
26081 QVariant(const QUrl &url);
26082 QVariant(const QLocale &locale);
26083 QVariant(const QRegExp ®Exp);
26084 QVariant(Qt::GlobalColor color);
26085 QVariant& operator=(const QVariant &other);
26087 int userType() const;
26088 const char *typeName() const;
26089 bool canConvert(Type t) const;
26090 bool convert(Type t);
26091 inline bool isValid() const;
26092 bool isNull() const;
26095 inline bool isDetached() const;
26096 int toInt(bool *ok = 0) const;
26097 uint toUInt(bool *ok = 0) const;
26098 qlonglong toLongLong(bool *ok = 0) const;
26099 qulonglong toULongLong(bool *ok = 0) const;
26100 bool toBool() const;
26101 double toDouble(bool *ok = 0) const;
26102 QByteArray toByteArray() const;
26103 QBitArray toBitArray() const;
26104 QString toString() const;
26105 QStringList toStringList() const;
26106 QChar toChar() const;
26107 QDate toDate() const;
26108 QTime toTime() const;
26109 QDateTime toDateTime() const;
26110 QList<QVariant> toList() const;
26111 QMap<QString, QVariant> toMap() const;
26112 QHash<QString, QVariant> toHash() const;
26113 QPoint toPoint() const;
26114 QPointF toPointF() const;
26115 QRect toRect() const;
26116 QSize toSize() const;
26117 QSizeF toSizeF() const;
26118 QLine toLine() const;
26119 QLineF toLineF() const;
26120 QRectF toRectF() const;
26121 QUrl toUrl() const;
26122 QLocale toLocale() const;
26123 QRegExp toRegExp() const;
26124 void load(QDataStream &ds);
26125 void save(QDataStream &ds) const;
26126 static const char *typeToName(Type type);
26127 static Type nameToType(const char *name);
26129 const void *constData() const;
26130 inline const void *data() const { return constData(); }
26131 template<typename T>
26132 inline void setValue(const T &value);
26133 template<typename T>
26134 inline T value() const
26135 { return qVariantValue<T>(*this); }
26136 template<typename T>
26137 static inline QVariant fromValue(const T &value)
26138 { return qVariantFromValue(value); }
26139 template<typename T>
26140 bool canConvert() const
26141 { return qVariantCanConvert<T>(*this); }
26143 struct PrivateShared
26145 inline PrivateShared(void *v) : ptr(v), ref(1) { }
26151 inline Private(): type(Invalid), is_shared(false), is_null(true) { data.ptr = 0; }
26152 inline Private(const Private &other)
26153 : data(other.data), type(other.type),
26154 is_shared(other.is_shared), is_null(other.is_null)
26166 PrivateShared *shared;
26169 uint is_shared : 1;
26173 typedef void (*f_construct)(Private *, const void *);
26174 typedef void (*f_clear)(Private *);
26175 typedef bool (*f_null)(const Private *);
26176 typedef void (*f_load)(Private *, QDataStream &);
26177 typedef void (*f_save)(const Private *, QDataStream &);
26178 typedef bool (*f_compare)(const Private *, const Private *);
26179 typedef bool (*f_convert)(const QVariant::Private *d, Type t, void *, bool *);
26180 typedef bool (*f_canConvert)(const QVariant::Private *d, Type t);
26181 typedef void (*f_debugStream)(QDebug, const QVariant &);
26183 f_construct construct;
26190 f_canConvert canConvert;
26191 f_debugStream debugStream;
26193 inline bool operator==(const QVariant &v) const
26195 inline bool operator!=(const QVariant &v) const
26196 { return !cmp(v); }
26198 friend inline bool qvariant_cast_helper(const QVariant &, QVariant::Type, void *);
26199 friend int qRegisterGuiVariant();
26200 friend int qUnregisterGuiVariant();
26201 friend inline bool operator==(const QVariant &, const QVariantComparisonHelper &);
26202 friend __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QVariant &);
26204 static const Handler *handler;
26205 void create(int type, const void *copy);
26206 bool cmp(const QVariant &other) const;
26208 inline QVariant(void *) { qt_noop(); }
26209 inline QVariant(bool, int) { qt_noop(); }
26211 typedef Private DataPtr;
26212 inline DataPtr &data_ptr() { return d; }
26214 typedef QList<QVariant> QVariantList;
26215 typedef QMap<QString, QVariant> QVariantMap;
26216 typedef QHash<QString, QVariant> QVariantHash;
26217 inline bool qvariant_cast_helper(const QVariant &v, QVariant::Type tp, void *ptr)
26218 { return QVariant::handler->convert(&v.d, tp, ptr, 0); }
26219 template <typename T>
26220 inline QVariant qVariantFromValue(const T &t)
26222 return QVariant(qMetaTypeId<T>(reinterpret_cast<T *>(0)), &t);
26225 inline QVariant qVariantFromValue(const QVariant &t) { return t; }
26226 template <typename T>
26227 inline void qVariantSetValue(QVariant &v, const T &t)
26229 v = QVariant(qMetaTypeId<T>(reinterpret_cast<T *>(0)), &t);
26231 inline QVariant::QVariant() {}
26232 inline bool QVariant::isValid() const { return d.type != Invalid; }
26233 template<typename T>
26234 inline void QVariant::setValue(const T &avalue)
26235 { qVariantSetValue(*this, avalue); }
26236 __attribute__((visibility("default"))) QDataStream& operator>> (QDataStream& s, QVariant& p);
26237 __attribute__((visibility("default"))) QDataStream& operator<< (QDataStream& s, const QVariant& p);
26238 __attribute__((visibility("default"))) QDataStream& operator>> (QDataStream& s, QVariant::Type& p);
26239 __attribute__((visibility("default"))) QDataStream& operator<< (QDataStream& s, const QVariant::Type p);
26240 inline bool QVariant::isDetached() const
26241 { return !d.is_shared || d.data.shared->ref == 1; }
26242 class QVariantComparisonHelper
26245 inline QVariantComparisonHelper(const QVariant &var)
26248 friend inline bool operator==(const QVariant &, const QVariantComparisonHelper &);
26251 inline bool operator==(const QVariant &v1, const QVariantComparisonHelper &v2)
26253 return v1.cmp(*v2.v);
26255 inline bool operator!=(const QVariant &v1, const QVariantComparisonHelper &v2)
26257 return !operator==(v1, v2);
26259 template<typename T> T qvariant_cast(const QVariant &v)
26261 const int vid = qMetaTypeId<T>(static_cast<T *>(0));
26262 if (vid == v.userType())
26263 return *reinterpret_cast<const T *>(v.constData());
26264 if (vid < int(QMetaType::User)) {
26266 if (qvariant_cast_helper(v, QVariant::Type(vid), &t))
26271 template<typename T>
26272 inline T qVariantValue(const QVariant &variant)
26273 { return qvariant_cast<T>(variant); }
26274 template<typename T>
26275 inline bool qVariantCanConvert(const QVariant &variant)
26277 return variant.canConvert(static_cast<QVariant::Type>(
26278 qMetaTypeId<T>(static_cast<T *>(0))));
26280 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; }
26281 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"; } };
26282 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QVariant &);
26283 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QVariant::Type);
26284 template<> struct QMetaTypeId2<QVariantList> { enum { Defined = 1, MetaType = QMetaType::QVariantList }; static inline int qt_metatype_id() { return QMetaType::QVariantList; } };
26285 template<> struct QMetaTypeId2<QVariantMap> { enum { Defined = 1, MetaType = QMetaType::QVariantMap }; static inline int qt_metatype_id() { return QMetaType::QVariantMap; } };
26286 template<> struct QMetaTypeId2<QVariantHash> { enum { Defined = 1, MetaType = QMetaType::QVariantHash }; static inline int qt_metatype_id() { return QMetaType::QVariantHash; } };
26287 typedef QtValidLicenseForCoreModule QtCoreModule;
26289 class QMimeDataPrivate;
26290 class __attribute__((visibility("default"))) QMimeData : public QObject
26292 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:
26296 QList<QUrl> urls() const;
26297 void setUrls(const QList<QUrl> &urls);
26298 bool hasUrls() const;
26299 QString text() const;
26300 void setText(const QString &text);
26301 bool hasText() const;
26302 QString html() const;
26303 void setHtml(const QString &html);
26304 bool hasHtml() const;
26305 QVariant imageData() const;
26306 void setImageData(const QVariant &image);
26307 bool hasImage() const;
26308 QVariant colorData() const;
26309 void setColorData(const QVariant &color);
26310 bool hasColor() const;
26311 QByteArray data(const QString &mimetype) const;
26312 void setData(const QString &mimetype, const QByteArray &data);
26313 void removeFormat(const QString &mimetype);
26314 virtual bool hasFormat(const QString &mimetype) const;
26315 virtual QStringList formats() const;
26318 virtual QVariant retrieveData(const QString &mimetype,
26319 QVariant::Type preferredType) const;
26321 QMimeData(const QMimeData &); QMimeData &operator=(const QMimeData &);
26322 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;
26324 typedef QtValidLicenseForGuiModule QtGuiModule;
26325 class __attribute__((visibility("default"))) QMimeSource
26328 virtual ~QMimeSource();
26329 virtual const char* format(int n = 0) const = 0;
26330 virtual bool provides(const char*) const;
26331 virtual QByteArray encodedData(const char*) const = 0;
26333 typedef QtValidLicenseForGuiModule QtGuiModule;
26335 class QDragPrivate;
26339 class QDragManager;
26340 class __attribute__((visibility("default"))) QDrag : public QObject
26342 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:
26343 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;
26345 explicit QDrag(QWidget *dragSource);
26347 void setMimeData(QMimeData *data);
26348 QMimeData *mimeData() const;
26349 void setPixmap(const QPixmap &);
26350 QPixmap pixmap() const;
26351 void setHotSpot(const QPoint &hotspot);
26352 QPoint hotSpot() const;
26353 QWidget *source() const;
26354 QWidget *target() const;
26355 Qt::DropAction start(Qt::DropActions supportedActions = Qt::CopyAction);
26356 Qt::DropAction exec(Qt::DropActions supportedActions = Qt::MoveAction);
26357 Qt::DropAction exec(Qt::DropActions supportedActions, Qt::DropAction defaultAction);
26358 void setDragCursor(const QPixmap &cursor, Qt::DropAction action);
26360 void actionChanged(Qt::DropAction action);
26361 void targetChanged(QWidget *newTarget);
26363 friend class QDragManager;
26364 QDrag(const QDrag &); QDrag &operator=(const QDrag &);
26366 typedef QtValidLicenseForGuiModule QtGuiModule;
26368 class __attribute__((visibility("default"))) QInputEvent : public QEvent
26371 QInputEvent(Type type, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
26373 inline Qt::KeyboardModifiers modifiers() const { return modState; }
26375 Qt::KeyboardModifiers modState;
26377 class __attribute__((visibility("default"))) QMouseEvent : public QInputEvent
26380 QMouseEvent(Type type, const QPoint &pos, Qt::MouseButton button,
26381 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
26382 QMouseEvent(Type type, const QPoint &pos, const QPoint &globalPos,
26383 Qt::MouseButton button, Qt::MouseButtons buttons,
26384 Qt::KeyboardModifiers modifiers);
26386 inline const QPoint &pos() const { return p; }
26387 inline const QPoint &globalPos() const { return g; }
26388 inline int x() const { return p.x(); }
26389 inline int y() const { return p.y(); }
26390 inline int globalX() const { return g.x(); }
26391 inline int globalY() const { return g.y(); }
26392 inline Qt::MouseButton button() const { return b; }
26393 inline Qt::MouseButtons buttons() const { return mouseState; }
26394 static QMouseEvent *createExtendedMouseEvent(Type type, const QPointF &pos,
26395 const QPoint &globalPos, Qt::MouseButton button,
26396 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
26397 inline bool hasExtendedInfo() const { return reinterpret_cast<const QMouseEvent *>(d) == this; }
26398 QPointF posF() const;
26402 Qt::MouseButtons mouseState;
26404 class __attribute__((visibility("default"))) QHoverEvent : public QEvent
26407 QHoverEvent(Type type, const QPoint &pos, const QPoint &oldPos);
26409 inline const QPoint &pos() const { return p; }
26410 inline const QPoint &oldPos() const { return op; }
26414 class __attribute__((visibility("default"))) QWheelEvent : public QInputEvent
26417 QWheelEvent(const QPoint &pos, int delta,
26418 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
26419 Qt::Orientation orient = Qt::Vertical);
26420 QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta,
26421 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
26422 Qt::Orientation orient = Qt::Vertical);
26424 inline int delta() const { return d; }
26425 inline const QPoint &pos() const { return p; }
26426 inline const QPoint &globalPos() const { return g; }
26427 inline int x() const { return p.x(); }
26428 inline int y() const { return p.y(); }
26429 inline int globalX() const { return g.x(); }
26430 inline int globalY() const { return g.y(); }
26431 inline Qt::MouseButtons buttons() const { return mouseState; }
26432 Qt::Orientation orientation() const { return o; }
26437 Qt::MouseButtons mouseState;
26440 class __attribute__((visibility("default"))) QTabletEvent : public QInputEvent
26443 enum TabletDevice { NoDevice, Puck, Stylus, Airbrush, FourDMouse,
26444 XFreeEraser , RotationStylus };
26445 enum PointerType { UnknownPointer, Pen, Cursor, Eraser };
26446 QTabletEvent(Type t, const QPoint &pos, const QPoint &globalPos, const QPointF &hiResGlobalPos,
26447 int device, int pointerType, qreal pressure, int xTilt, int yTilt,
26448 qreal tangentialPressure, qreal rotation, int z,
26449 Qt::KeyboardModifiers keyState, qint64 uniqueID);
26451 inline const QPoint &pos() const { return mPos; }
26452 inline const QPoint &globalPos() const { return mGPos; }
26453 inline const QPointF &hiResGlobalPos() const { return mHiResGlobalPos; }
26454 inline int x() const { return mPos.x(); }
26455 inline int y() const { return mPos.y(); }
26456 inline int globalX() const { return mGPos.x(); }
26457 inline int globalY() const { return mGPos.y(); }
26458 inline qreal hiResGlobalX() const { return mHiResGlobalPos.x(); }
26459 inline qreal hiResGlobalY() const { return mHiResGlobalPos.y(); }
26460 inline TabletDevice device() const { return TabletDevice(mDev); }
26461 inline PointerType pointerType() const { return PointerType(mPointerType); }
26462 inline qint64 uniqueId() const { return mUnique; }
26463 inline qreal pressure() const { return mPress; }
26464 inline int z() const { return mZ; }
26465 inline qreal tangentialPressure() const { return mTangential; }
26466 inline qreal rotation() const { return mRot; }
26467 inline int xTilt() const { return mXT; }
26468 inline int yTilt() const { return mYT; }
26470 QPoint mPos, mGPos;
26471 QPointF mHiResGlobalPos;
26472 int mDev, mPointerType, mXT, mYT, mZ;
26473 qreal mPress, mTangential, mRot;
26477 class __attribute__((visibility("default"))) QKeyEvent : public QInputEvent
26480 QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(),
26481 bool autorep = false, ushort count = 1);
26483 int key() const { return k; }
26484 bool matches(QKeySequence::StandardKey key) const;
26485 Qt::KeyboardModifiers modifiers() const;
26486 inline QString text() const { return txt; }
26487 inline bool isAutoRepeat() const { return autor; }
26488 inline int count() const { return int(c); }
26489 static QKeyEvent *createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
26490 quint32 nativeScanCode, quint32 nativeVirtualKey,
26491 quint32 nativeModifiers,
26492 const QString& text = QString(), bool autorep = false,
26494 inline bool hasExtendedInfo() const { return reinterpret_cast<const QKeyEvent*>(d) == this; }
26495 quint32 nativeScanCode() const;
26496 quint32 nativeVirtualKey() const;
26497 quint32 nativeModifiers() const;
26504 class __attribute__((visibility("default"))) QFocusEvent : public QEvent
26507 QFocusEvent(Type type, Qt::FocusReason reason=Qt::OtherFocusReason);
26509 inline bool gotFocus() const { return type() == FocusIn; }
26510 inline bool lostFocus() const { return type() == FocusOut; }
26511 Qt::FocusReason reason();
26512 Qt::FocusReason reason() const;
26514 Qt::FocusReason m_reason;
26516 class __attribute__((visibility("default"))) QPaintEvent : public QEvent
26519 QPaintEvent(const QRegion& paintRegion);
26520 QPaintEvent(const QRect &paintRect);
26522 inline const QRect &rect() const { return m_rect; }
26523 inline const QRegion ®ion() const { return m_region; }
26525 friend class QApplication;
26526 friend class QCoreApplication;
26531 class QUpdateLaterEvent : public QEvent
26534 QUpdateLaterEvent(const QRegion& paintRegion);
26535 ~QUpdateLaterEvent();
26536 inline const QRegion ®ion() const { return m_region; }
26540 class __attribute__((visibility("default"))) QMoveEvent : public QEvent
26543 QMoveEvent(const QPoint &pos, const QPoint &oldPos);
26545 inline const QPoint &pos() const { return p; }
26546 inline const QPoint &oldPos() const { return oldp;}
26549 friend class QApplication;
26550 friend class QCoreApplication;
26552 class __attribute__((visibility("default"))) QResizeEvent : public QEvent
26555 QResizeEvent(const QSize &size, const QSize &oldSize);
26557 inline const QSize &size() const { return s; }
26558 inline const QSize &oldSize()const { return olds;}
26561 friend class QApplication;
26562 friend class QCoreApplication;
26564 class __attribute__((visibility("default"))) QCloseEvent : public QEvent
26570 class __attribute__((visibility("default"))) QIconDragEvent : public QEvent
26576 class __attribute__((visibility("default"))) QShowEvent : public QEvent
26582 class __attribute__((visibility("default"))) QHideEvent : public QEvent
26588 class __attribute__((visibility("default"))) QContextMenuEvent : public QInputEvent
26591 enum Reason { Mouse, Keyboard, Other };
26592 QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos,
26593 Qt::KeyboardModifiers modifiers);
26594 QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos);
26595 QContextMenuEvent(Reason reason, const QPoint &pos);
26596 ~QContextMenuEvent();
26597 inline int x() const { return p.x(); }
26598 inline int y() const { return p.y(); }
26599 inline int globalX() const { return gp.x(); }
26600 inline int globalY() const { return gp.y(); }
26601 inline const QPoint& pos() const { return p; }
26602 inline const QPoint& globalPos() const { return gp; }
26603 inline Reason reason() const { return Reason(reas); }
26609 class __attribute__((visibility("default"))) QInputMethodEvent : public QEvent
26612 enum AttributeType {
26620 Attribute(AttributeType t, int s, int l, QVariant val) : type(t), start(s), length(l), value(val) {}
26621 AttributeType type;
26626 QInputMethodEvent();
26627 QInputMethodEvent(const QString &preeditText, const QList<Attribute> &attributes);
26628 void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0);
26629 inline const QList<Attribute> &attributes() const { return attrs; }
26630 inline const QString &preeditString() const { return preedit; }
26631 inline const QString &commitString() const { return commit; }
26632 inline int replacementStart() const { return replace_from; }
26633 inline int replacementLength() const { return replace_length; }
26634 QInputMethodEvent(const QInputMethodEvent &other);
26637 QList<Attribute> attrs;
26640 int replace_length;
26643 class __attribute__((visibility("default"))) QDropEvent : public QEvent
26644 , public QMimeSource
26647 QDropEvent(const QPoint& pos, Qt::DropActions actions, const QMimeData *data,
26648 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = Drop);
26650 inline const QPoint &pos() const { return p; }
26651 inline Qt::MouseButtons mouseButtons() const { return mouseState; }
26652 inline Qt::KeyboardModifiers keyboardModifiers() const { return modState; }
26653 inline Qt::DropActions possibleActions() const { return act; }
26654 inline Qt::DropAction proposedAction() const { return default_action; }
26655 inline void acceptProposedAction() { drop_action = default_action; accept(); }
26656 inline Qt::DropAction dropAction() const { return drop_action; }
26657 void setDropAction(Qt::DropAction action);
26658 QWidget* source() const;
26659 inline const QMimeData *mimeData() const { return mdata; }
26660 const char* format(int n = 0) const;
26661 QByteArray encodedData(const char*) const;
26662 bool provides(const char*) const;
26664 friend class QApplication;
26666 Qt::MouseButtons mouseState;
26667 Qt::KeyboardModifiers modState;
26668 Qt::DropActions act;
26669 Qt::DropAction drop_action;
26670 Qt::DropAction default_action;
26671 const QMimeData *mdata;
26672 mutable QList<QByteArray> fmts;
26674 class __attribute__((visibility("default"))) QDragMoveEvent : public QDropEvent
26677 QDragMoveEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
26678 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove);
26680 inline QRect answerRect() const { return rect; }
26681 inline void accept() { QDropEvent::accept(); }
26682 inline void ignore() { QDropEvent::ignore(); }
26683 inline void accept(const QRect & r) { accept(); rect = r; }
26684 inline void ignore(const QRect & r) { ignore(); rect = r; }
26686 friend class QApplication;
26689 class __attribute__((visibility("default"))) QDragEnterEvent : public QDragMoveEvent
26692 QDragEnterEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
26693 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
26694 ~QDragEnterEvent();
26696 class __attribute__((visibility("default"))) QDragResponseEvent : public QEvent
26699 QDragResponseEvent(bool accepted);
26700 ~QDragResponseEvent();
26701 inline bool dragAccepted() const { return a; }
26705 class __attribute__((visibility("default"))) QDragLeaveEvent : public QEvent
26709 ~QDragLeaveEvent();
26711 class __attribute__((visibility("default"))) QHelpEvent : public QEvent
26714 QHelpEvent(Type type, const QPoint &pos, const QPoint &globalPos);
26716 inline int x() const { return p.x(); }
26717 inline int y() const { return p.y(); }
26718 inline int globalX() const { return gp.x(); }
26719 inline int globalY() const { return gp.y(); }
26720 inline const QPoint& pos() const { return p; }
26721 inline const QPoint& globalPos() const { return gp; }
26726 class __attribute__((visibility("default"))) QStatusTipEvent : public QEvent
26729 QStatusTipEvent(const QString &tip);
26730 ~QStatusTipEvent();
26731 inline QString tip() const { return s; }
26735 class __attribute__((visibility("default"))) QWhatsThisClickedEvent : public QEvent
26738 QWhatsThisClickedEvent(const QString &href);
26739 ~QWhatsThisClickedEvent();
26740 inline QString href() const { return s; }
26744 class __attribute__((visibility("default"))) QActionEvent : public QEvent
26746 QAction *act, *bef;
26748 QActionEvent(int type, QAction *action, QAction *before = 0);
26750 inline QAction *action() const { return act; }
26751 inline QAction *before() const { return bef; }
26753 class __attribute__((visibility("default"))) QFileOpenEvent : public QEvent
26756 QFileOpenEvent(const QString &file);
26758 inline QString file() const { return f; }
26762 class __attribute__((visibility("default"))) QToolBarChangeEvent : public QEvent
26765 QToolBarChangeEvent(bool t);
26766 ~QToolBarChangeEvent();
26767 inline bool toggle() const { return tog; }
26771 class __attribute__((visibility("default"))) QShortcutEvent : public QEvent
26774 QShortcutEvent(const QKeySequence &key, int id, bool ambiguous = false);
26776 inline const QKeySequence &key() { return sequence; }
26777 inline const QKeySequence &key() const { return sequence; }
26778 inline int shortcutId() { return sid; }
26779 inline int shortcutId() const { return sid; }
26780 inline bool isAmbiguous() { return ambig; }
26781 inline bool isAmbiguous() const { return ambig; }
26783 QKeySequence sequence;
26787 class __attribute__((visibility("default"))) QClipboardEvent : public QEvent
26790 QClipboardEvent(QEventPrivate *data);
26791 ~QClipboardEvent();
26792 QEventPrivate *data() { return d; };
26794 class __attribute__((visibility("default"))) QWindowStateChangeEvent: public QEvent
26797 QWindowStateChangeEvent(Qt::WindowStates aOldState);
26798 QWindowStateChangeEvent(Qt::WindowStates aOldState, bool isOverride);
26799 ~QWindowStateChangeEvent();
26800 inline Qt::WindowStates oldState() const { return ostate; }
26801 bool isOverride() const;
26803 Qt::WindowStates ostate;
26805 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QEvent *);
26806 inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key){return (e ? e->matches(key) : false);}
26807 inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e){return (e ? e->matches(key) : false);}
26808 typedef struct FT_FaceRec_* FT_Face;
26809 typedef QtValidLicenseForGuiModule QtGuiModule;
26810 class QFontPrivate;
26813 class Q3TextFormatCollection;
26814 class __attribute__((visibility("default"))) QFont
26816 public: static const QMetaObject staticMetaObject; private:
26819 Helvetica, SansSerif = Helvetica,
26820 Times, Serif = Times,
26821 Courier, TypeWriter = Courier,
26822 OldEnglish, Decorative = OldEnglish,
26826 enum StyleStrategy {
26827 PreferDefault = 0x0001,
26828 PreferBitmap = 0x0002,
26829 PreferDevice = 0x0004,
26830 PreferOutline = 0x0008,
26831 ForceOutline = 0x0010,
26832 PreferMatch = 0x0020,
26833 PreferQuality = 0x0040,
26834 PreferAntialias = 0x0080,
26835 NoAntialias = 0x0100,
26836 OpenGLCompatible = 0x0200,
26837 NoFontMerging = 0x8000
26852 UltraCondensed = 50,
26853 ExtraCondensed = 62,
26855 SemiCondensed = 87,
26857 SemiExpanded = 112,
26859 ExtraExpanded = 150,
26860 UltraExpanded = 200
26862 enum Capitalization {
26873 enum ResolveProperties {
26874 FamilyResolved = 0x0001,
26875 SizeResolved = 0x0002,
26876 StyleHintResolved = 0x0004,
26877 StyleStrategyResolved = 0x0008,
26878 WeightResolved = 0x0010,
26879 StyleResolved = 0x0020,
26880 UnderlineResolved = 0x0040,
26881 OverlineResolved = 0x0080,
26882 StrikeOutResolved = 0x0100,
26883 FixedPitchResolved = 0x0200,
26884 StretchResolved = 0x0400,
26885 KerningResolved = 0x0800,
26886 CapitalizationResolved = 0x1000,
26887 LetterSpacingResolved = 0x2000,
26888 WordSpacingResolved = 0x4000,
26889 AllPropertiesResolved = 0x7fff
26892 QFont(const QString &family, int pointSize = -1, int weight = -1, bool italic = false);
26893 QFont(const QFont &, QPaintDevice *pd);
26894 QFont(const QFont &);
26896 QString family() const;
26897 void setFamily(const QString &);
26898 int pointSize() const;
26899 void setPointSize(int);
26900 qreal pointSizeF() const;
26901 void setPointSizeF(qreal);
26902 int pixelSize() const;
26903 void setPixelSize(int);
26904 int weight() const;
26905 void setWeight(int);
26906 inline bool bold() const;
26907 inline void setBold(bool);
26908 void setStyle(Style style);
26909 Style style() const;
26910 inline bool italic() const;
26911 inline void setItalic(bool b);
26912 bool underline() const;
26913 void setUnderline(bool);
26914 bool overline() const;
26915 void setOverline(bool);
26916 bool strikeOut() const;
26917 void setStrikeOut(bool);
26918 bool fixedPitch() const;
26919 void setFixedPitch(bool);
26920 bool kerning() const;
26921 void setKerning(bool);
26922 StyleHint styleHint() const;
26923 StyleStrategy styleStrategy() const;
26924 void setStyleHint(StyleHint, StyleStrategy = PreferDefault);
26925 void setStyleStrategy(StyleStrategy s);
26926 int stretch() const;
26927 void setStretch(int);
26928 qreal letterSpacing() const;
26929 SpacingType letterSpacingType() const;
26930 void setLetterSpacing(SpacingType type, qreal spacing);
26931 qreal wordSpacing() const;
26932 void setWordSpacing(qreal spacing);
26933 void setCapitalization(Capitalization);
26934 Capitalization capitalization() const;
26935 bool rawMode() const;
26936 void setRawMode(bool);
26937 bool exactMatch() const;
26938 QFont &operator=(const QFont &);
26939 bool operator==(const QFont &) const;
26940 bool operator!=(const QFont &) const;
26941 bool operator<(const QFont &) const;
26942 operator QVariant() const;
26943 bool isCopyOf(const QFont &) const;
26944 Qt::HANDLE handle() const;
26945 FT_Face freetypeFace() const;
26946 void setRawName(const QString &);
26947 QString rawName() const;
26948 QString key() const;
26949 QString toString() const;
26950 bool fromString(const QString &);
26951 static QString substitute(const QString &);
26952 static QStringList substitutes(const QString &);
26953 static QStringList substitutions();
26954 static void insertSubstitution(const QString&, const QString &);
26955 static void insertSubstitutions(const QString&, const QStringList &);
26956 static void removeSubstitution(const QString &);
26957 static void initialize();
26958 static void cleanup();
26959 QString defaultFamily() const;
26960 QString lastResortFamily() const;
26961 QString lastResortFont() const;
26962 QFont resolve(const QFont &) const;
26963 inline uint resolve() const { return resolve_mask; }
26964 inline void resolve(uint mask) { resolve_mask = mask; }
26966 QFont(QFontPrivate *);
26968 friend class QFontPrivate;
26969 friend class QFontDialogPrivate;
26970 friend class QFontMetrics;
26971 friend class QFontMetricsF;
26972 friend class QFontInfo;
26973 friend class QPainter;
26974 friend class QPSPrintEngineFont;
26975 friend class QApplication;
26976 friend class QWidget;
26977 friend class QWidgetPrivate;
26978 friend class Q3TextFormatCollection;
26979 friend class QTextLayout;
26980 friend class QTextEngine;
26981 friend class QStackTextEngine;
26982 friend class QTextLine;
26983 friend struct QScriptLine;
26984 friend class QGLContext;
26985 friend class QWin32PaintEngine;
26986 friend class QAlphaPaintEngine;
26987 friend class QPainterPath;
26988 friend class QTextItemInt;
26989 friend class QPicturePaintEngine;
26990 friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QFont &);
26991 friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QFont &);
26995 inline bool QFont::bold() const
26996 { return weight() > Normal; }
26997 inline void QFont::setBold(bool enable)
26998 { setWeight(enable ? Bold : Normal); }
26999 inline bool QFont::italic() const
27001 return (style() != StyleNormal);
27003 inline void QFont::setItalic(bool b) {
27004 setStyle(b ? StyleItalic : StyleNormal);
27006 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QFont &);
27007 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QFont &);
27008 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QFont &);
27009 typedef QtValidLicenseForCoreModule QtCoreModule;
27010 template <class T> class QSharedDataPointer;
27011 class __attribute__((visibility("default"))) QSharedData
27014 mutable QAtomicInt ref;
27015 inline QSharedData() : ref(0) { }
27016 inline QSharedData(const QSharedData &) : ref(0) { }
27018 QSharedData &operator=(const QSharedData &);
27020 template <class T> class QSharedDataPointer
27023 inline void detach() { if (d && d->ref != 1) detach_helper(); }
27024 inline T &operator*() { detach(); return *d; }
27025 inline const T &operator*() const { return *d; }
27026 inline T *operator->() { detach(); return d; }
27027 inline const T *operator->() const { return d; }
27028 inline operator T *() { detach(); return d; }
27029 inline operator const T *() const { return d; }
27030 inline T *data() { detach(); return d; }
27031 inline const T *data() const { return d; }
27032 inline const T *constData() const { return d; }
27033 inline bool operator==(const QSharedDataPointer<T> &other) const { return d == other.d; }
27034 inline bool operator!=(const QSharedDataPointer<T> &other) const { return d != other.d; }
27035 inline QSharedDataPointer() { d = 0; }
27036 inline ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; }
27037 explicit QSharedDataPointer(T *data);
27038 inline QSharedDataPointer(const QSharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
27039 inline QSharedDataPointer<T> & operator=(const QSharedDataPointer<T> &o) {
27043 if (d && !d->ref.deref())
27049 inline QSharedDataPointer &operator=(T *o) {
27053 if (d && !d->ref.deref())
27059 inline bool operator!() const { return !d; }
27063 void detach_helper();
27066 template <class T> class QExplicitlySharedDataPointer
27070 inline T &operator*() const { return *d; }
27071 inline T *operator->() { return d; }
27072 inline T *operator->() const { return d; }
27073 inline T *data() const { return d; }
27074 inline const T *constData() const { return d; }
27075 inline void detach() { if (d && d->ref != 1) detach_helper(); }
27076 inline void reset()
27078 if(d && !d->ref.deref())
27082 inline operator bool () const { return d != 0; }
27083 inline bool operator==(const QExplicitlySharedDataPointer<T> &other) const { return d == other.d; }
27084 inline bool operator!=(const QExplicitlySharedDataPointer<T> &other) const { return d != other.d; }
27085 inline bool operator==(const T *ptr) const { return d == ptr; }
27086 inline bool operator!=(const T *ptr) const { return d != ptr; }
27087 inline QExplicitlySharedDataPointer() { d = 0; }
27088 inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; }
27089 explicit QExplicitlySharedDataPointer(T *data);
27090 inline QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
27092 inline QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer<X> &o) : d(static_cast<T *>(o.data()))
27097 inline QExplicitlySharedDataPointer<T> & operator=(const QExplicitlySharedDataPointer<T> &o) {
27101 if (d && !d->ref.deref())
27107 inline QExplicitlySharedDataPointer &operator=(T *o) {
27111 if (d && !d->ref.deref())
27117 inline bool operator!() const { return !d; }
27121 void detach_helper();
27125 inline QSharedDataPointer<T>::QSharedDataPointer(T *adata) : d(adata)
27126 { if (d) d->ref.ref(); }
27128 inline T *QSharedDataPointer<T>::clone()
27133 void QSharedDataPointer<T>::detach_helper()
27137 if (!d->ref.deref())
27142 inline T *QExplicitlySharedDataPointer<T>::clone()
27147 void QExplicitlySharedDataPointer<T>::detach_helper()
27151 if (!d->ref.deref())
27156 inline QExplicitlySharedDataPointer<T>::QExplicitlySharedDataPointer(T *adata) : d(adata)
27157 { if (d) d->ref.ref(); }
27158 typedef QtValidLicenseForGuiModule QtGuiModule;
27163 class __attribute__((visibility("default"))) QPolygon : public QVector<QPoint>
27166 inline QPolygon() {}
27167 inline ~QPolygon() {}
27168 inline QPolygon(int size);
27169 inline QPolygon(const QPolygon &a) : QVector<QPoint>(a) {}
27170 inline QPolygon(const QVector<QPoint> &v) : QVector<QPoint>(v) {}
27171 QPolygon(const QRect &r, bool closed=false);
27172 QPolygon(int nPoints, const int *points);
27173 operator QVariant() const;
27174 void translate(int dx, int dy);
27175 void translate(const QPoint &offset);
27176 QRect boundingRect() const;
27177 void point(int i, int *x, int *y) const;
27178 QPoint point(int i) const;
27179 void setPoint(int index, int x, int y);
27180 void setPoint(int index, const QPoint &p);
27181 void setPoints(int nPoints, const int *points);
27182 void setPoints(int nPoints, int firstx, int firsty, ...);
27183 void putPoints(int index, int nPoints, const int *points);
27184 void putPoints(int index, int nPoints, int firstx, int firsty, ...);
27185 void putPoints(int index, int nPoints, const QPolygon & from, int fromIndex=0);
27186 bool containsPoint(const QPoint &pt, Qt::FillRule fillRule) const;
27187 QPolygon united(const QPolygon &r) const;
27188 QPolygon intersected(const QPolygon &r) const;
27189 QPolygon subtracted(const QPolygon &r) const;
27191 inline QPolygon::QPolygon(int asize) : QVector<QPoint>(asize) {}
27192 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QPolygon &);
27193 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &stream, const QPolygon &polygon);
27194 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &stream, QPolygon &polygon);
27195 inline void QPolygon::setPoint(int index, const QPoint &pt)
27196 { (*this)[index] = pt; }
27197 inline void QPolygon::setPoint(int index, int x, int y)
27198 { (*this)[index] = QPoint(x, y); }
27199 inline QPoint QPolygon::point(int index) const
27200 { return at(index); }
27201 inline void QPolygon::translate(const QPoint &offset)
27202 { translate(offset.x(), offset.y()); }
27204 class __attribute__((visibility("default"))) QPolygonF : public QVector<QPointF>
27207 inline QPolygonF() {}
27208 inline ~QPolygonF() {}
27209 inline QPolygonF(int size);
27210 inline QPolygonF(const QPolygonF &a) : QVector<QPointF>(a) {}
27211 inline QPolygonF(const QVector<QPointF> &v) : QVector<QPointF>(v) {}
27212 QPolygonF(const QRectF &r);
27213 QPolygonF(const QPolygon &a);
27214 inline void translate(qreal dx, qreal dy);
27215 void translate(const QPointF &offset);
27216 QPolygon toPolygon() const;
27217 bool isClosed() const { return !isEmpty() && first() == last(); }
27218 QRectF boundingRect() const;
27219 bool containsPoint(const QPointF &pt, Qt::FillRule fillRule) const;
27220 QPolygonF united(const QPolygonF &r) const;
27221 QPolygonF intersected(const QPolygonF &r) const;
27222 QPolygonF subtracted(const QPolygonF &r) const;
27224 inline QPolygonF::QPolygonF(int asize) : QVector<QPointF>(asize) {}
27225 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QPolygonF &);
27226 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &stream, const QPolygonF &array);
27227 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &stream, QPolygonF &array);
27228 inline void QPolygonF::translate(qreal dx, qreal dy)
27229 { translate(QPointF(dx, dy)); }
27230 typedef QtValidLicenseForCoreModule QtCoreModule;
27231 class __attribute__((visibility("default"))) QLine
27235 inline QLine(const QPoint &pt1, const QPoint &pt2);
27236 inline QLine(int x1, int y1, int x2, int y2);
27237 inline bool isNull() const;
27238 inline QPoint p1() const;
27239 inline QPoint p2() const;
27240 inline int x1() const;
27241 inline int y1() const;
27242 inline int x2() const;
27243 inline int y2() const;
27244 inline int dx() const;
27245 inline int dy() const;
27246 inline void translate(const QPoint &p);
27247 inline void translate(int dx, int dy);
27248 inline QLine translated(const QPoint &p) const;
27249 inline QLine translated(int dx, int dy) const;
27250 inline void setP1(const QPoint &p1);
27251 inline void setP2(const QPoint &p2);
27252 inline void setPoints(const QPoint &p1, const QPoint &p2);
27253 inline void setLine(int x1, int y1, int x2, int y2);
27254 inline bool operator==(const QLine &d) const;
27255 inline bool operator!=(const QLine &d) const { return !(*this == d); }
27259 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"; } };
27260 inline QLine::QLine() { }
27261 inline QLine::QLine(const QPoint &pt1_, const QPoint &pt2_) : pt1(pt1_), pt2(pt2_) { }
27262 inline QLine::QLine(int x1pos, int y1pos, int x2pos, int y2pos) : pt1(QPoint(x1pos, y1pos)), pt2(QPoint(x2pos, y2pos)) { }
27263 inline bool QLine::isNull() const
27267 inline int QLine::x1() const
27271 inline int QLine::y1() const
27275 inline int QLine::x2() const
27279 inline int QLine::y2() const
27283 inline QPoint QLine::p1() const
27287 inline QPoint QLine::p2() const
27291 inline int QLine::dx() const
27293 return pt2.x() - pt1.x();
27295 inline int QLine::dy() const
27297 return pt2.y() - pt1.y();
27299 inline void QLine::translate(const QPoint &point)
27304 inline void QLine::translate(int adx, int ady)
27306 this->translate(QPoint(adx, ady));
27308 inline QLine QLine::translated(const QPoint &p) const
27310 return QLine(pt1 + p, pt2 + p);
27312 inline QLine QLine::translated(int adx, int ady) const
27314 return translated(QPoint(adx, ady));
27316 inline void QLine::setP1(const QPoint &aP1)
27320 inline void QLine::setP2(const QPoint &aP2)
27324 inline void QLine::setPoints(const QPoint &aP1, const QPoint &aP2)
27329 inline void QLine::setLine(int aX1, int aY1, int aX2, int aY2)
27331 pt1 = QPoint(aX1, aY1);
27332 pt2 = QPoint(aX2, aY2);
27334 inline bool QLine::operator==(const QLine &d) const
27336 return pt1 == d.pt1 && pt2 == d.pt2;
27338 __attribute__((visibility("default"))) QDebug operator<<(QDebug d, const QLine &p);
27339 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QLine &);
27340 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QLine &);
27341 class __attribute__((visibility("default"))) QLineF {
27343 enum IntersectType { NoIntersection, BoundedIntersection, UnboundedIntersection };
27345 inline QLineF(const QPointF &pt1, const QPointF &pt2);
27346 inline QLineF(qreal x1, qreal y1, qreal x2, qreal y2);
27347 inline QLineF(const QLine &line) : pt1(line.p1()), pt2(line.p2()) { }
27348 static QLineF fromPolar(qreal length, qreal angle);
27349 bool isNull() const;
27350 inline QPointF p1() const;
27351 inline QPointF p2() const;
27352 inline qreal x1() const;
27353 inline qreal y1() const;
27354 inline qreal x2() const;
27355 inline qreal y2() const;
27356 inline qreal dx() const;
27357 inline qreal dy() const;
27358 qreal length() const;
27359 void setLength(qreal len);
27360 qreal angle() const;
27361 void setAngle(qreal angle);
27362 qreal angleTo(const QLineF &l) const;
27363 QLineF unitVector() const;
27364 QLineF normalVector() const;
27365 IntersectType intersect(const QLineF &l, QPointF *intersectionPoint) const;
27366 qreal angle(const QLineF &l) const;
27367 QPointF pointAt(qreal t) const;
27368 inline void translate(const QPointF &p);
27369 inline void translate(qreal dx, qreal dy);
27370 inline QLineF translated(const QPointF &p) const;
27371 inline QLineF translated(qreal dx, qreal dy) const;
27372 inline void setP1(const QPointF &p1);
27373 inline void setP2(const QPointF &p2);
27374 inline void setPoints(const QPointF &p1, const QPointF &p2);
27375 inline void setLine(qreal x1, qreal y1, qreal x2, qreal y2);
27376 inline bool operator==(const QLineF &d) const;
27377 inline bool operator!=(const QLineF &d) const { return !(*this == d); }
27378 QLine toLine() const;
27382 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"; } };
27383 inline QLineF::QLineF()
27386 inline QLineF::QLineF(const QPointF &apt1, const QPointF &apt2)
27387 : pt1(apt1), pt2(apt2)
27390 inline QLineF::QLineF(qreal x1pos, qreal y1pos, qreal x2pos, qreal y2pos)
27391 : pt1(x1pos, y1pos), pt2(x2pos, y2pos)
27394 inline qreal QLineF::x1() const
27398 inline qreal QLineF::y1() const
27402 inline qreal QLineF::x2() const
27406 inline qreal QLineF::y2() const
27410 inline QPointF QLineF::p1() const
27414 inline QPointF QLineF::p2() const
27418 inline qreal QLineF::dx() const
27420 return pt2.x() - pt1.x();
27422 inline qreal QLineF::dy() const
27424 return pt2.y() - pt1.y();
27426 inline QLineF QLineF::normalVector() const
27428 return QLineF(p1(), p1() + QPointF(dy(), -dx()));
27430 inline void QLineF::translate(const QPointF &point)
27435 inline void QLineF::translate(qreal adx, qreal ady)
27437 this->translate(QPointF(adx, ady));
27439 inline QLineF QLineF::translated(const QPointF &p) const
27441 return QLineF(pt1 + p, pt2 + p);
27443 inline QLineF QLineF::translated(qreal adx, qreal ady) const
27445 return translated(QPointF(adx, ady));
27447 inline void QLineF::setLength(qreal len)
27451 QLineF v = unitVector();
27452 pt2 = QPointF(pt1.x() + v.dx() * len, pt1.y() + v.dy() * len);
27454 inline QPointF QLineF::pointAt(qreal t) const
27456 qreal vx = pt2.x() - pt1.x();
27457 qreal vy = pt2.y() - pt1.y();
27458 return QPointF(pt1.x() + vx * t, pt1.y() + vy * t);
27460 inline QLine QLineF::toLine() const
27462 return QLine(pt1.toPoint(), pt2.toPoint());
27464 inline void QLineF::setP1(const QPointF &aP1)
27468 inline void QLineF::setP2(const QPointF &aP2)
27472 inline void QLineF::setPoints(const QPointF &aP1, const QPointF &aP2)
27477 inline void QLineF::setLine(qreal aX1, qreal aY1, qreal aX2, qreal aY2)
27479 pt1 = QPointF(aX1, aY1);
27480 pt2 = QPointF(aX2, aY2);
27482 inline bool QLineF::operator==(const QLineF &d) const
27484 return pt1 == d.pt1 && pt2 == d.pt2;
27486 __attribute__((visibility("default"))) QDebug operator<<(QDebug d, const QLineF &p);
27487 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QLineF &);
27488 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QLineF &);
27489 typedef QtValidLicenseForGuiModule QtGuiModule;
27490 class QPainterPath;
27492 class __attribute__((visibility("default"))) QMatrix
27496 QMatrix(qreal m11, qreal m12, qreal m21, qreal m22,
27497 qreal dx, qreal dy);
27498 QMatrix(const QMatrix &matrix);
27499 void setMatrix(qreal m11, qreal m12, qreal m21, qreal m22,
27500 qreal dx, qreal dy);
27501 qreal m11() const { return _m11; }
27502 qreal m12() const { return _m12; }
27503 qreal m21() const { return _m21; }
27504 qreal m22() const { return _m22; }
27505 qreal dx() const { return _dx; }
27506 qreal dy() const { return _dy; }
27507 void map(int x, int y, int *tx, int *ty) const;
27508 void map(qreal x, qreal y, qreal *tx, qreal *ty) const;
27509 QRect mapRect(const QRect &) const;
27510 QRectF mapRect(const QRectF &) const;
27511 QPoint map(const QPoint &p) const;
27512 QPointF map(const QPointF&p) const;
27513 QLine map(const QLine &l) const;
27514 QLineF map(const QLineF &l) const;
27515 QPolygonF map(const QPolygonF &a) const;
27516 QPolygon map(const QPolygon &a) const;
27517 QRegion map(const QRegion &r) const;
27518 QPainterPath map(const QPainterPath &p) const;
27519 QPolygon mapToPolygon(const QRect &r) const;
27521 inline bool isIdentity() const;
27522 QMatrix &translate(qreal dx, qreal dy);
27523 QMatrix &scale(qreal sx, qreal sy);
27524 QMatrix &shear(qreal sh, qreal sv);
27525 QMatrix &rotate(qreal a);
27526 bool isInvertible() const { return !qFuzzyCompare(_m11*_m22 - _m12*_m21 + 1, 1); }
27527 qreal det() const { return _m11*_m22 - _m12*_m21; }
27528 QMatrix inverted(bool *invertible = 0) const;
27529 bool operator==(const QMatrix &) const;
27530 bool operator!=(const QMatrix &) const;
27531 QMatrix &operator*=(const QMatrix &);
27532 QMatrix operator*(const QMatrix &o) const;
27533 QMatrix &operator=(const QMatrix &);
27534 operator QVariant() const;
27536 friend class QTransform;
27541 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"; } };
27542 __attribute__((visibility("default"))) inline QPoint operator*(const QPoint &p, const QMatrix &m)
27543 { return m.map(p); }
27544 __attribute__((visibility("default"))) inline QPointF operator*(const QPointF &p, const QMatrix &m)
27545 { return m.map(p); }
27546 __attribute__((visibility("default"))) inline QLineF operator*(const QLineF &l, const QMatrix &m)
27547 { return m.map(l); }
27548 __attribute__((visibility("default"))) inline QLine operator*(const QLine &l, const QMatrix &m)
27549 { return m.map(l); }
27550 __attribute__((visibility("default"))) inline QPolygon operator *(const QPolygon &a, const QMatrix &m)
27551 { return m.map(a); }
27552 __attribute__((visibility("default"))) inline QPolygonF operator *(const QPolygonF &a, const QMatrix &m)
27553 { return m.map(a); }
27554 __attribute__((visibility("default"))) inline QRegion operator *(const QRegion &r, const QMatrix &m)
27555 { return m.map(r); }
27556 __attribute__((visibility("default"))) QPainterPath operator *(const QPainterPath &p, const QMatrix &m);
27557 inline bool QMatrix::isIdentity() const
27559 return qFuzzyCompare(_m11, 1) && qFuzzyCompare(_m22, 1) && qFuzzyCompare(_m12 + 1, 1)
27560 && qFuzzyCompare(_m21 + 1, 1) && qFuzzyCompare(_dx + 1, 1) && qFuzzyCompare(_dy + 1, 1);
27562 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QMatrix &);
27563 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QMatrix &);
27564 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QMatrix &);
27565 typedef QtValidLicenseForGuiModule QtGuiModule;
27567 class QPainterPathPrivate;
27568 class QPainterPathData;
27569 class QPainterPathStrokerPrivate;
27573 class __attribute__((visibility("default"))) QPainterPath
27587 bool isMoveTo() const { return type == MoveToElement; }
27588 bool isLineTo() const { return type == LineToElement; }
27589 bool isCurveTo() const { return type == CurveToElement; }
27590 operator QPointF () const { return QPointF(x, y); }
27591 bool operator==(const Element &e) const { return qFuzzyCompare(x, e.x)
27592 && qFuzzyCompare(y, e.y) && type == e.type; }
27593 inline bool operator!=(const Element &e) const { return !operator==(e); }
27596 explicit QPainterPath(const QPointF &startPoint);
27597 QPainterPath(const QPainterPath &other);
27598 QPainterPath &operator=(const QPainterPath &other);
27600 void closeSubpath();
27601 void moveTo(const QPointF &p);
27602 inline void moveTo(qreal x, qreal y);
27603 void lineTo(const QPointF &p);
27604 inline void lineTo(qreal x, qreal y);
27605 void arcMoveTo(const QRectF &rect, qreal angle);
27606 inline void arcMoveTo(qreal x, qreal y, qreal w, qreal h, qreal angle);
27607 void arcTo(const QRectF &rect, qreal startAngle, qreal arcLength);
27608 inline void arcTo(qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal arcLength);
27609 void cubicTo(const QPointF &ctrlPt1, const QPointF &ctrlPt2, const QPointF &endPt);
27610 inline void cubicTo(qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y,
27611 qreal endPtx, qreal endPty);
27612 void quadTo(const QPointF &ctrlPt, const QPointF &endPt);
27613 inline void quadTo(qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty);
27614 QPointF currentPosition() const;
27615 void addRect(const QRectF &rect);
27616 inline void addRect(qreal x, qreal y, qreal w, qreal h);
27617 void addEllipse(const QRectF &rect);
27618 inline void addEllipse(qreal x, qreal y, qreal w, qreal h);
27619 inline void addEllipse(const QPointF ¢er, qreal rx, qreal ry);
27620 void addPolygon(const QPolygonF &polygon);
27621 void addText(const QPointF &point, const QFont &f, const QString &text);
27622 inline void addText(qreal x, qreal y, const QFont &f, const QString &text);
27623 void addPath(const QPainterPath &path);
27624 void addRegion(const QRegion ®ion);
27625 void addRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius,
27626 Qt::SizeMode mode = Qt::AbsoluteSize);
27627 inline void addRoundedRect(qreal x, qreal y, qreal w, qreal h,
27628 qreal xRadius, qreal yRadius,
27629 Qt::SizeMode mode = Qt::AbsoluteSize);
27630 void addRoundRect(const QRectF &rect, int xRnd, int yRnd);
27631 inline void addRoundRect(qreal x, qreal y, qreal w, qreal h,
27632 int xRnd, int yRnd);
27633 inline void addRoundRect(const QRectF &rect, int roundness);
27634 inline void addRoundRect(qreal x, qreal y, qreal w, qreal h,
27636 void connectPath(const QPainterPath &path);
27637 bool contains(const QPointF &pt) const;
27638 bool contains(const QRectF &rect) const;
27639 bool intersects(const QRectF &rect) const;
27640 QRectF boundingRect() const;
27641 QRectF controlPointRect() const;
27642 Qt::FillRule fillRule() const;
27643 void setFillRule(Qt::FillRule fillRule);
27644 inline bool isEmpty() const;
27645 QPainterPath toReversed() const;
27646 QList<QPolygonF> toSubpathPolygons(const QMatrix &matrix = QMatrix()) const;
27647 QList<QPolygonF> toFillPolygons(const QMatrix &matrix = QMatrix()) const;
27648 QPolygonF toFillPolygon(const QMatrix &matrix = QMatrix()) const;
27649 QList<QPolygonF> toSubpathPolygons(const QTransform &matrix) const;
27650 QList<QPolygonF> toFillPolygons(const QTransform &matrix) const;
27651 QPolygonF toFillPolygon(const QTransform &matrix) const;
27652 inline int elementCount() const;
27653 inline const QPainterPath::Element &elementAt(int i) const;
27654 inline void setElementPositionAt(int i, qreal x, qreal y);
27655 qreal length() const;
27656 qreal percentAtLength(qreal t) const;
27657 QPointF pointAtPercent(qreal t) const;
27658 qreal angleAtPercent(qreal t) const;
27659 qreal slopeAtPercent(qreal t) const;
27660 bool intersects(const QPainterPath &p) const;
27661 bool contains(const QPainterPath &p) const;
27662 QPainterPath united(const QPainterPath &r) const;
27663 QPainterPath intersected(const QPainterPath &r) const;
27664 QPainterPath subtracted(const QPainterPath &r) const;
27665 QPainterPath subtractedInverted(const QPainterPath &r) const;
27666 QPainterPath simplified() const;
27667 bool operator==(const QPainterPath &other) const;
27668 bool operator!=(const QPainterPath &other) const;
27669 QPainterPath operator&(const QPainterPath &other) const;
27670 QPainterPath operator|(const QPainterPath &other) const;
27671 QPainterPath operator+(const QPainterPath &other) const;
27672 QPainterPath operator-(const QPainterPath &other) const;
27673 QPainterPath &operator&=(const QPainterPath &other);
27674 QPainterPath &operator|=(const QPainterPath &other);
27675 QPainterPath &operator+=(const QPainterPath &other);
27676 QPainterPath &operator-=(const QPainterPath &other);
27678 QPainterPathPrivate *d_ptr;
27679 inline void ensureData() { if (!d_ptr) ensureData_helper(); }
27680 void ensureData_helper();
27681 inline void detach();
27682 void detach_helper();
27683 void setDirty(bool);
27684 void computeBoundingRect() const;
27685 void computeControlPointRect() const;
27686 QPainterPathData *d_func() const { return reinterpret_cast<QPainterPathData *>(d_ptr); }
27687 friend class QPainterPathData;
27688 friend class QPainterPathStroker;
27689 friend class QPainterPathStrokerPrivate;
27690 friend class QMatrix;
27691 friend class QTransform;
27692 friend __attribute__((visibility("default"))) const QVectorPath &qtVectorPathForPath(const QPainterPath &);
27693 friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPainterPath &);
27694 friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPainterPath &);
27696 class QPainterPathPrivate
27699 friend class QPainterPath;
27700 friend class QPainterPathData;
27701 friend class QPainterPathStroker;
27702 friend class QPainterPathStrokerPrivate;
27703 friend class QMatrix;
27704 friend class QTransform;
27705 friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPainterPath &);
27706 friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPainterPath &);
27709 QVector<QPainterPath::Element> elements;
27711 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"; } };
27712 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPainterPath &);
27713 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPainterPath &);
27714 class __attribute__((visibility("default"))) QPainterPathStroker
27716 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;
27718 QPainterPathStroker();
27719 ~QPainterPathStroker();
27720 void setWidth(qreal width);
27721 qreal width() const;
27722 void setCapStyle(Qt::PenCapStyle style);
27723 Qt::PenCapStyle capStyle() const;
27724 void setJoinStyle(Qt::PenJoinStyle style);
27725 Qt::PenJoinStyle joinStyle() const;
27726 void setMiterLimit(qreal length);
27727 qreal miterLimit() const;
27728 void setCurveThreshold(qreal threshold);
27729 qreal curveThreshold() const;
27730 void setDashPattern(Qt::PenStyle);
27731 void setDashPattern(const QVector<qreal> &dashPattern);
27732 QVector<qreal> dashPattern() const;
27733 void setDashOffset(qreal offset);
27734 qreal dashOffset() const;
27735 QPainterPath createStroke(const QPainterPath &path) const;
27737 friend class QX11PaintEngine;
27738 QPainterPathStrokerPrivate *d_ptr;
27740 inline void QPainterPath::moveTo(qreal x, qreal y)
27742 moveTo(QPointF(x, y));
27744 inline void QPainterPath::lineTo(qreal x, qreal y)
27746 lineTo(QPointF(x, y));
27748 inline void QPainterPath::arcTo(qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal arcLenght)
27750 arcTo(QRectF(x, y, w, h), startAngle, arcLenght);
27752 inline void QPainterPath::arcMoveTo(qreal x, qreal y, qreal w, qreal h, qreal angle)
27754 arcMoveTo(QRectF(x, y, w, h), angle);
27756 inline void QPainterPath::cubicTo(qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y,
27757 qreal endPtx, qreal endPty)
27759 cubicTo(QPointF(ctrlPt1x, ctrlPt1y), QPointF(ctrlPt2x, ctrlPt2y),
27760 QPointF(endPtx, endPty));
27762 inline void QPainterPath::quadTo(qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty)
27764 quadTo(QPointF(ctrlPtx, ctrlPty), QPointF(endPtx, endPty));
27766 inline void QPainterPath::addEllipse(qreal x, qreal y, qreal w, qreal h)
27768 addEllipse(QRectF(x, y, w, h));
27770 inline void QPainterPath::addEllipse(const QPointF ¢er, qreal rx, qreal ry)
27772 addEllipse(QRectF(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
27774 inline void QPainterPath::addRect(qreal x, qreal y, qreal w, qreal h)
27776 addRect(QRectF(x, y, w, h));
27778 inline void QPainterPath::addRoundedRect(qreal x, qreal y, qreal w, qreal h,
27779 qreal xRadius, qreal yRadius,
27782 addRoundedRect(QRectF(x, y, w, h), xRadius, yRadius, mode);
27784 inline void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h,
27785 int xRnd, int yRnd)
27787 addRoundRect(QRectF(x, y, w, h), xRnd, yRnd);
27789 inline void QPainterPath::addRoundRect(const QRectF &rect,
27792 int xRnd = roundness;
27793 int yRnd = roundness;
27794 if (rect.width() > rect.height())
27795 xRnd = int(roundness * rect.height()/rect.width());
27797 yRnd = int(roundness * rect.width()/rect.height());
27798 addRoundRect(rect, xRnd, yRnd);
27800 inline void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h,
27803 addRoundRect(QRectF(x, y, w, h), roundness);
27805 inline void QPainterPath::addText(qreal x, qreal y, const QFont &f, const QString &text)
27807 addText(QPointF(x, y), f, text);
27809 inline bool QPainterPath::isEmpty() const
27811 return !d_ptr || (d_ptr->elements.size() == 1 && d_ptr->elements.first().type == MoveToElement);
27813 inline int QPainterPath::elementCount() const
27815 return d_ptr ? d_ptr->elements.size() : 0;
27817 inline const QPainterPath::Element &QPainterPath::elementAt(int i) const
27821 return d_ptr->elements.at(i);
27823 inline void QPainterPath::setElementPositionAt(int i, qreal x, qreal y)
27828 QPainterPath::Element &e = d_ptr->elements[i];
27832 inline void QPainterPath::detach()
27834 if (d_ptr->ref != 1)
27838 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QPainterPath &);
27839 typedef QtValidLicenseForGuiModule QtGuiModule;
27841 class __attribute__((visibility("default"))) QTransform
27844 enum TransformationType {
27846 TxTranslate = 0x01,
27853 QTransform(qreal h11, qreal h12, qreal h13,
27854 qreal h21, qreal h22, qreal h23,
27855 qreal h31, qreal h32, qreal h33 = 1.0);
27856 QTransform(qreal h11, qreal h12, qreal h21,
27857 qreal h22, qreal dx, qreal dy);
27858 explicit QTransform(const QMatrix &mtx);
27859 bool isAffine() const;
27860 bool isIdentity() const;
27861 bool isInvertible() const;
27862 bool isScaling() const;
27863 bool isRotating() const;
27864 bool isTranslating() const;
27865 TransformationType type() const;
27866 inline qreal determinant() const;
27879 void setMatrix(qreal m11, qreal m12, qreal m13,
27880 qreal m21, qreal m22, qreal m23,
27881 qreal m31, qreal m32, qreal m33);
27882 QTransform inverted(bool *invertible = 0) const;
27883 QTransform adjoint() const;
27884 QTransform transposed() const;
27885 QTransform &translate(qreal dx, qreal dy);
27886 QTransform &scale(qreal sx, qreal sy);
27887 QTransform &shear(qreal sh, qreal sv);
27888 QTransform &rotate(qreal a, Qt::Axis axis = Qt::ZAxis);
27889 QTransform &rotateRadians(qreal a, Qt::Axis axis = Qt::ZAxis);
27890 static bool squareToQuad(const QPolygonF &square, QTransform &result);
27891 static bool quadToSquare(const QPolygonF &quad, QTransform &result);
27892 static bool quadToQuad(const QPolygonF &one,
27893 const QPolygonF &two,
27894 QTransform &result);
27895 bool operator==(const QTransform &) const;
27896 bool operator!=(const QTransform &) const;
27897 QTransform &operator*=(const QTransform &);
27898 QTransform operator*(const QTransform &o) const;
27899 QTransform &operator=(const QTransform &);
27900 operator QVariant() const;
27902 QPoint map(const QPoint &p) const;
27903 QPointF map(const QPointF &p) const;
27904 QLine map(const QLine &l) const;
27905 QLineF map(const QLineF &l) const;
27906 QPolygonF map(const QPolygonF &a) const;
27907 QPolygon map(const QPolygon &a) const;
27908 QRegion map(const QRegion &r) const;
27909 QPainterPath map(const QPainterPath &p) const;
27910 QPolygon mapToPolygon(const QRect &r) const;
27911 QRect mapRect(const QRect &) const;
27912 QRectF mapRect(const QRectF &) const;
27913 void map(int x, int y, int *tx, int *ty) const;
27914 void map(qreal x, qreal y, qreal *tx, qreal *ty) const;
27915 const QMatrix &toAffine() const;
27916 QTransform &operator*=(qreal div);
27917 QTransform &operator/=(qreal div);
27918 QTransform &operator+=(qreal div);
27919 QTransform &operator-=(qreal div);
27920 static QTransform fromTranslate(qreal dx, qreal dy);
27921 static QTransform fromScale(qreal dx, qreal dy);
27927 mutable uint m_type : 5;
27928 mutable uint m_dirty : 5;
27932 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"; } };
27933 inline bool QTransform::isAffine() const
27935 return type() < TxProject;
27937 inline bool QTransform::isIdentity() const
27939 return type() == TxNone;
27941 inline bool QTransform::isInvertible() const
27943 return !qFuzzyCompare(determinant() + 1, 1);
27945 inline bool QTransform::isScaling() const
27947 return type() >= TxScale;
27949 inline bool QTransform::isRotating() const
27951 return type() >= TxRotate;
27953 inline bool QTransform::isTranslating() const
27955 return type() >= TxTranslate;
27957 inline qreal QTransform::determinant() const
27959 return affine._m11*(m_33*affine._m22-affine._dy*m_23) -
27960 affine._m21*(m_33*affine._m12-affine._dy*m_13)+affine._dx*(m_23*affine._m12-affine._m22*m_13);
27962 inline qreal QTransform::det() const
27964 return determinant();
27966 inline qreal QTransform::m11() const
27968 return affine._m11;
27970 inline qreal QTransform::m12() const
27972 return affine._m12;
27974 inline qreal QTransform::m13() const
27978 inline qreal QTransform::m21() const
27980 return affine._m21;
27982 inline qreal QTransform::m22() const
27984 return affine._m22;
27986 inline qreal QTransform::m23() const
27990 inline qreal QTransform::m31() const
27994 inline qreal QTransform::m32() const
27998 inline qreal QTransform::m33() const
28002 inline qreal QTransform::dx() const
28006 inline qreal QTransform::dy() const
28010 inline QTransform &QTransform::operator*=(qreal num)
28014 affine._m11 *= num;
28015 affine._m12 *= num;
28017 affine._m21 *= num;
28018 affine._m22 *= num;
28023 m_dirty |= TxScale;
28026 inline QTransform &QTransform::operator/=(qreal div)
28031 return operator*=(div);
28033 inline QTransform &QTransform::operator+=(qreal num)
28037 affine._m11 += num;
28038 affine._m12 += num;
28040 affine._m21 += num;
28041 affine._m22 += num;
28046 m_dirty |= TxProject;
28049 inline QTransform &QTransform::operator-=(qreal num)
28053 affine._m11 -= num;
28054 affine._m12 -= num;
28056 affine._m21 -= num;
28057 affine._m22 -= num;
28062 m_dirty |= TxProject;
28065 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QTransform &);
28066 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QTransform &);
28067 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QTransform &);
28068 __attribute__((visibility("default"))) inline QPoint operator*(const QPoint &p, const QTransform &m)
28069 { return m.map(p); }
28070 __attribute__((visibility("default"))) inline QPointF operator*(const QPointF &p, const QTransform &m)
28071 { return m.map(p); }
28072 __attribute__((visibility("default"))) inline QLineF operator*(const QLineF &l, const QTransform &m)
28073 { return m.map(l); }
28074 __attribute__((visibility("default"))) inline QLine operator*(const QLine &l, const QTransform &m)
28075 { return m.map(l); }
28076 __attribute__((visibility("default"))) inline QPolygon operator *(const QPolygon &a, const QTransform &m)
28077 { return m.map(a); }
28078 __attribute__((visibility("default"))) inline QPolygonF operator *(const QPolygonF &a, const QTransform &m)
28079 { return m.map(a); }
28080 __attribute__((visibility("default"))) inline QRegion operator *(const QRegion &r, const QTransform &m)
28081 { return m.map(r); }
28082 __attribute__((visibility("default"))) inline QPainterPath operator *(const QPainterPath &p, const QTransform &m)
28083 { return m.map(p); }
28084 __attribute__((visibility("default"))) inline QTransform operator *(const QTransform &a, qreal n)
28085 { QTransform t(a); t *= n; return t; }
28086 __attribute__((visibility("default"))) inline QTransform operator /(const QTransform &a, qreal n)
28087 { QTransform t(a); t /= n; return t; }
28088 __attribute__((visibility("default"))) inline QTransform operator +(const QTransform &a, qreal n)
28089 { QTransform t(a); t += n; return t; }
28090 __attribute__((visibility("default"))) inline QTransform operator -(const QTransform &a, qreal n)
28091 { QTransform t(a); t -= n; return t; }
28092 typedef QtValidLicenseForGuiModule QtGuiModule;
28094 class QPaintEngine;
28095 class __attribute__((visibility("default"))) QPaintDevice
28098 enum PaintDeviceMetric {
28110 virtual ~QPaintDevice();
28111 virtual int devType() const;
28112 bool paintingActive() const;
28113 virtual QPaintEngine *paintEngine() const = 0;
28114 static QWSDisplay *qwsDisplay();
28115 int width() const { return metric(PdmWidth); }
28116 int height() const { return metric(PdmHeight); }
28117 int widthMM() const { return metric(PdmWidthMM); }
28118 int heightMM() const { return metric(PdmHeightMM); }
28119 int logicalDpiX() const { return metric(PdmDpiX); }
28120 int logicalDpiY() const { return metric(PdmDpiY); }
28121 int physicalDpiX() const { return metric(PdmPhysicalDpiX); }
28122 int physicalDpiY() const { return metric(PdmPhysicalDpiY); }
28123 int numColors() const { return metric(PdmNumColors); }
28124 int depth() const { return metric(PdmDepth); }
28127 virtual int metric(PaintDeviceMetric metric) const;
28130 QPaintDevice(const QPaintDevice &); QPaintDevice &operator=(const QPaintDevice &);
28131 friend class QPainter;
28132 friend class QFontEngineMac;
28133 friend class QX11PaintEngine;
28135 inline int QPaintDevice::devType() const
28136 { return QInternal::UnknownDevice; }
28137 inline bool QPaintDevice::paintingActive() const
28138 { return painters != 0; }
28139 typedef QtValidLicenseForGuiModule QtGuiModule;
28145 template <class T> class QList;
28146 template <class T> class QVector;
28148 class QImageDataMisc;
28149 class __attribute__((visibility("default"))) QImageTextKeyLang {
28151 QImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { }
28152 QImageTextKeyLang() { }
28155 bool operator< (const QImageTextKeyLang& other) const
28156 { return key < other.key || (key==other.key && lang < other.lang); }
28157 bool operator== (const QImageTextKeyLang& other) const
28158 { return key==other.key && lang==other.lang; }
28159 inline bool operator!= (const QImageTextKeyLang &other) const
28160 { return !operator==(other); }
28162 class __attribute__((visibility("default"))) QImage : public QPaintDevice
28165 enum InvertMode { InvertRgb, InvertRgba };
28173 Format_ARGB32_Premultiplied,
28175 Format_ARGB8565_Premultiplied,
28177 Format_ARGB6666_Premultiplied,
28179 Format_ARGB8555_Premultiplied,
28182 Format_ARGB4444_Premultiplied,
28186 QImage(const QSize &size, Format format);
28187 QImage(int width, int height, Format format);
28188 QImage(uchar *data, int width, int height, Format format);
28189 QImage(const uchar *data, int width, int height, Format format);
28190 QImage(uchar *data, int width, int height, int bytesPerLine, Format format);
28191 QImage(const uchar *data, int width, int height, int bytesPerLine, Format format);
28192 explicit QImage(const char * const xpm[]);
28193 explicit QImage(const QString &fileName, const char *format = 0);
28194 explicit QImage(const char *fileName, const char *format = 0);
28195 QImage(const QImage &);
28197 QImage &operator=(const QImage &);
28198 bool isNull() const;
28199 int devType() const;
28200 bool operator==(const QImage &) const;
28201 bool operator!=(const QImage &) const;
28202 operator QVariant() const;
28204 bool isDetached() const;
28205 QImage copy(const QRect &rect = QRect()) const;
28206 inline QImage copy(int x, int y, int w, int h) const
28207 { return copy(QRect(x, y, w, h)); }
28208 Format format() const;
28209 QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const __attribute__ ((warn_unused_result));
28210 QImage convertToFormat(Format f, const QVector<QRgb> &colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor) const __attribute__ ((warn_unused_result));
28212 int height() const;
28213 QSize size() const;
28214 QRect rect() const;
28216 int numColors() const;
28217 QRgb color(int i) const;
28218 void setColor(int i, QRgb c);
28219 void setNumColors(int);
28220 bool allGray() const;
28221 bool isGrayscale() const;
28223 const uchar *bits() const;
28224 int numBytes() const;
28225 uchar *scanLine(int);
28226 const uchar *scanLine(int) const;
28227 int bytesPerLine() const;
28228 bool valid(int x, int y) const;
28229 bool valid(const QPoint &pt) const;
28230 int pixelIndex(int x, int y) const;
28231 int pixelIndex(const QPoint &pt) const;
28232 QRgb pixel(int x, int y) const;
28233 QRgb pixel(const QPoint &pt) const;
28234 void setPixel(int x, int y, uint index_or_rgb);
28235 void setPixel(const QPoint &pt, uint index_or_rgb);
28236 QVector<QRgb> colorTable() const;
28237 void setColorTable(const QVector<QRgb> colors);
28238 void fill(uint pixel);
28239 bool hasAlphaChannel() const;
28240 void setAlphaChannel(const QImage &alphaChannel);
28241 QImage alphaChannel() const;
28242 QImage createAlphaMask(Qt::ImageConversionFlags flags = Qt::AutoColor) const;
28243 QImage createHeuristicMask(bool clipTight = true) const;
28244 QImage createMaskFromColor(QRgb color, Qt::MaskMode mode = Qt::MaskInColor) const;
28245 inline QImage scaled(int w, int h, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
28246 Qt::TransformationMode mode = Qt::FastTransformation) const
28247 { return scaled(QSize(w, h), aspectMode, mode); }
28248 QImage scaled(const QSize &s, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
28249 Qt::TransformationMode mode = Qt::FastTransformation) const;
28250 QImage scaledToWidth(int w, Qt::TransformationMode mode = Qt::FastTransformation) const;
28251 QImage scaledToHeight(int h, Qt::TransformationMode mode = Qt::FastTransformation) const;
28252 QImage transformed(const QMatrix &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const;
28253 static QMatrix trueMatrix(const QMatrix &, int w, int h);
28254 QImage transformed(const QTransform &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const;
28255 static QTransform trueMatrix(const QTransform &, int w, int h);
28256 QImage mirrored(bool horizontally = false, bool vertically = true) const;
28257 QImage rgbSwapped() const;
28258 void invertPixels(InvertMode = InvertRgb);
28259 bool load(QIODevice *device, const char* format);
28260 bool load(const QString &fileName, const char* format=0);
28261 bool loadFromData(const uchar *buf, int len, const char *format = 0);
28262 inline bool loadFromData(const QByteArray &data, const char* aformat=0)
28263 { return loadFromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), aformat); }
28264 bool save(const QString &fileName, const char* format=0, int quality=-1) const;
28265 bool save(QIODevice *device, const char* format=0, int quality=-1) const;
28266 static QImage fromData(const uchar *data, int size, const char *format = 0);
28267 inline static QImage fromData(const QByteArray &data, const char *format = 0)
28268 { return fromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), format); }
28269 int serialNumber() const;
28270 qint64 cacheKey() const;
28271 QPaintEngine *paintEngine() const;
28272 int dotsPerMeterX() const;
28273 int dotsPerMeterY() const;
28274 void setDotsPerMeterX(int);
28275 void setDotsPerMeterY(int);
28276 QPoint offset() const;
28277 void setOffset(const QPoint&);
28278 QStringList textKeys() const;
28279 QString text(const QString &key = QString()) const;
28280 void setText(const QString &key, const QString &value);
28281 QString text(const char* key, const char* lang=0) const;
28282 QList<QImageTextKeyLang> textList() const;
28283 QStringList textLanguages() const;
28284 QString text(const QImageTextKeyLang&) const;
28285 void setText(const char* key, const char* lang, const QString&);
28287 virtual int metric(PaintDeviceMetric metric) const;
28289 friend class QWSOnScreenSurface;
28291 friend class QRasterPixmapData;
28292 friend class QDetachedPixmap;
28293 friend __attribute__((visibility("default"))) qint64 qt_image_id(const QImage &image);
28294 friend const QVector<QRgb> *qt_image_colortable(const QImage &image);
28296 typedef QImageData * DataPtr;
28297 inline DataPtr &data_ptr() { return d; }
28299 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; }
28300 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"; } };
28301 __attribute__((visibility("default"))) inline bool QImage::valid(const QPoint &pt) const { return valid(pt.x(), pt.y()); }
28302 __attribute__((visibility("default"))) inline int QImage::pixelIndex(const QPoint &pt) const { return pixelIndex(pt.x(), pt.y());}
28303 __attribute__((visibility("default"))) inline QRgb QImage::pixel(const QPoint &pt) const { return pixel(pt.x(), pt.y()); }
28304 __attribute__((visibility("default"))) inline void QImage::setPixel(const QPoint &pt, uint index_or_rgb) { setPixel(pt.x(), pt.y(), index_or_rgb); }
28305 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QImage &);
28306 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QImage &);
28307 typedef QtValidLicenseForGuiModule QtGuiModule;
28308 class QImageWriter;
28313 class __attribute__((visibility("default"))) QPixmap : public QPaintDevice
28317 explicit QPixmap(QPixmapData *data);
28318 QPixmap(int w, int h);
28319 QPixmap(const QSize &);
28320 QPixmap(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
28321 QPixmap(const char * const xpm[]);
28322 QPixmap(const QPixmap &);
28324 QPixmap &operator=(const QPixmap &);
28325 operator QVariant() const;
28326 bool isNull() const;
28327 int devType() const;
28329 int height() const;
28330 QSize size() const;
28331 QRect rect() const;
28333 static int defaultDepth();
28334 void fill(const QColor &fillColor = Qt::white);
28335 void fill(const QWidget *widget, const QPoint &ofs);
28336 inline void fill(const QWidget *widget, int xofs, int yofs) { fill(widget, QPoint(xofs, yofs)); }
28337 QBitmap mask() const;
28338 void setMask(const QBitmap &);
28339 QPixmap alphaChannel() const;
28340 void setAlphaChannel(const QPixmap &);
28341 bool hasAlpha() const;
28342 bool hasAlphaChannel() const;
28343 QBitmap createHeuristicMask(bool clipTight = true) const;
28344 QBitmap createMaskFromColor(const QColor &maskColor) const;
28345 QBitmap createMaskFromColor(const QColor &maskColor, Qt::MaskMode mode) const;
28346 static QPixmap grabWindow(WId, int x=0, int y=0, int w=-1, int h=-1);
28347 static QPixmap grabWidget(QWidget *widget, const QRect &rect);
28348 static inline QPixmap grabWidget(QWidget *widget, int x=0, int y=0, int w=-1, int h=-1)
28349 { return grabWidget(widget, QRect(x, y, w, h)); }
28350 inline QPixmap scaled(int w, int h, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
28351 Qt::TransformationMode mode = Qt::FastTransformation) const
28352 { return scaled(QSize(w, h), aspectMode, mode); }
28353 QPixmap scaled(const QSize &s, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
28354 Qt::TransformationMode mode = Qt::FastTransformation) const;
28355 QPixmap scaledToWidth(int w, Qt::TransformationMode mode = Qt::FastTransformation) const;
28356 QPixmap scaledToHeight(int h, Qt::TransformationMode mode = Qt::FastTransformation) const;
28357 QPixmap transformed(const QMatrix &, Qt::TransformationMode mode = Qt::FastTransformation) const;
28358 static QMatrix trueMatrix(const QMatrix &m, int w, int h);
28359 QPixmap transformed(const QTransform &, Qt::TransformationMode mode = Qt::FastTransformation) const;
28360 static QTransform trueMatrix(const QTransform &m, int w, int h);
28361 QImage toImage() const;
28362 static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
28363 bool load(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
28364 bool loadFromData(const uchar *buf, uint len, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
28365 inline bool loadFromData(const QByteArray &data, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
28366 bool save(const QString& fileName, const char* format = 0, int quality = -1) const;
28367 bool save(QIODevice* device, const char* format = 0, int quality = -1) const;
28368 inline QPixmap copy(int x, int y, int width, int height) const;
28369 QPixmap copy(const QRect &rect = QRect()) const;
28370 int serialNumber() const;
28371 qint64 cacheKey() const;
28372 bool isDetached() const;
28374 bool isQBitmap() const;
28375 const uchar *qwsBits() const;
28376 int qwsBytesPerLine() const;
28377 QRgb *clut() const;
28378 int numCols() const;
28379 Qt::HANDLE handle() const;
28380 QPaintEngine *paintEngine() const;
28381 inline bool operator!() const { return isNull(); }
28383 int metric(PaintDeviceMetric) const;
28386 bool doImageIO(QImageWriter *io, int quality) const;
28387 enum Type { PixmapType, BitmapType };
28388 QPixmap(const QSize &s, Type);
28389 void init(int, int, Type = PixmapType);
28390 QPixmap(const QSize &s, int type);
28391 void init(int, int, int);
28393 friend class QPixmapData;
28394 friend class QX11PixmapData;
28395 friend class QMacPixmapData;
28396 friend class QBitmap;
28397 friend class QPaintDevice;
28398 friend class QPainter;
28399 friend class QGLWidget;
28400 friend class QX11PaintEngine;
28401 friend class QCoreGraphicsPaintEngine;
28402 friend class QWidgetPrivate;
28403 friend class QRasterPaintEngine;
28404 friend class QRasterBuffer;
28405 friend class QDirect3DPaintEngine;
28406 friend class QDirect3DPaintEnginePrivate;
28407 friend class QDetachedPixmap;
28408 friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPixmap &);
28409 friend __attribute__((visibility("default"))) qint64 qt_pixmap_id(const QPixmap &pixmap);
28411 QPixmapData* pixmapData() const;
28413 typedef QPixmapData * DataPtr;
28414 inline DataPtr &data_ptr() { return data; }
28416 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; }
28417 inline QPixmap QPixmap::copy(int ax, int ay, int awidth, int aheight) const
28419 return copy(QRect(ax, ay, awidth, aheight));
28421 inline bool QPixmap::loadFromData(const QByteArray &buf, const char *format,
28422 Qt::ImageConversionFlags flags)
28424 return loadFromData(reinterpret_cast<const uchar *>(buf.constData()), buf.size(), format, flags);
28426 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPixmap &);
28427 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPixmap &);
28428 typedef QtValidLicenseForGuiModule QtGuiModule;
28433 class __attribute__((visibility("default"))) QBrush
28437 QBrush(Qt::BrushStyle bs);
28438 QBrush(const QColor &color, Qt::BrushStyle bs=Qt::SolidPattern);
28439 QBrush(Qt::GlobalColor color, Qt::BrushStyle bs=Qt::SolidPattern);
28440 QBrush(const QColor &color, const QPixmap &pixmap);
28441 QBrush(Qt::GlobalColor color, const QPixmap &pixmap);
28442 QBrush(const QPixmap &pixmap);
28443 QBrush(const QImage &image);
28444 QBrush(const QBrush &brush);
28445 QBrush(const QGradient &gradient);
28447 QBrush &operator=(const QBrush &brush);
28448 operator QVariant() const;
28449 inline Qt::BrushStyle style() const;
28450 void setStyle(Qt::BrushStyle);
28451 inline const QMatrix &matrix() const;
28452 void setMatrix(const QMatrix &mat);
28453 inline QTransform transform() const;
28454 void setTransform(const QTransform &);
28455 QPixmap texture() const;
28456 void setTexture(const QPixmap &pixmap);
28457 QImage textureImage() const;
28458 void setTextureImage(const QImage &image);
28459 inline const QColor &color() const;
28460 void setColor(const QColor &color);
28461 inline void setColor(Qt::GlobalColor color);
28462 const QGradient *gradient() const;
28463 bool isOpaque() const;
28464 bool operator==(const QBrush &b) const;
28465 inline bool operator!=(const QBrush &b) const { return !(operator==(b)); }
28467 friend class QRasterPaintEngine;
28468 friend class QRasterPaintEnginePrivate;
28469 friend struct QSpanData;
28470 friend class QPainter;
28471 friend bool qHasPixmapTexture(const QBrush& brush);
28472 void detach(Qt::BrushStyle newStyle);
28473 void init(const QColor &color, Qt::BrushStyle bs);
28475 void cleanUp(QBrushData *x);
28477 inline bool isDetached() const;
28478 typedef QBrushData * DataPtr;
28479 inline DataPtr &data_ptr() { return d; }
28481 inline void QBrush::setColor(Qt::GlobalColor acolor)
28482 { setColor(QColor(acolor)); }
28483 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"; } };
28484 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; }
28485 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QBrush &);
28486 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QBrush &);
28487 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QBrush &);
28491 Qt::BrushStyle style;
28493 QTransform transform;
28495 inline Qt::BrushStyle QBrush::style() const { return d->style; }
28496 inline const QColor &QBrush::color() const { return d->color; }
28497 inline const QMatrix &QBrush::matrix() const { return d->transform.toAffine(); }
28498 inline QTransform QBrush::transform() const { return d->transform; }
28499 inline bool QBrush::isDetached() const { return d->ref == 1; }
28500 class QGradientPrivate;
28501 typedef QPair<qreal, QColor> QGradientStop;
28502 typedef QVector<QGradientStop> QGradientStops;
28503 class __attribute__((visibility("default"))) QGradient
28505 public: static const QMetaObject staticMetaObject; private:
28518 enum CoordinateMode {
28520 StretchToDeviceMode,
28523 enum InterpolationMode {
28524 ColorInterpolation,
28525 ComponentInterpolation
28528 Type type() const { return m_type; }
28529 inline void setSpread(Spread spread);
28530 Spread spread() const { return m_spread; }
28531 void setColorAt(qreal pos, const QColor &color);
28532 void setStops(const QGradientStops &stops);
28533 QGradientStops stops() const;
28534 CoordinateMode coordinateMode() const;
28535 void setCoordinateMode(CoordinateMode mode);
28536 InterpolationMode interpolationMode() const;
28537 void setInterpolationMode(InterpolationMode mode);
28538 bool operator==(const QGradient &gradient) const;
28539 inline bool operator!=(const QGradient &other) const
28540 { return !operator==(other); }
28541 bool operator==(const QGradient &gradient);
28543 friend class QLinearGradient;
28544 friend class QRadialGradient;
28545 friend class QConicalGradient;
28548 QGradientStops m_stops;
28551 qreal x1, y1, x2, y2;
28554 qreal cx, cy, fx, fy, radius;
28557 qreal cx, cy, angle;
28562 inline void QGradient::setSpread(Spread aspread)
28563 { m_spread = aspread; }
28564 class __attribute__((visibility("default"))) QLinearGradient : public QGradient
28568 QLinearGradient(const QPointF &start, const QPointF &finalStop);
28569 QLinearGradient(qreal xStart, qreal yStart, qreal xFinalStop, qreal yFinalStop);
28570 QPointF start() const;
28571 void setStart(const QPointF &start);
28572 inline void setStart(qreal x, qreal y) { setStart(QPointF(x, y)); }
28573 QPointF finalStop() const;
28574 void setFinalStop(const QPointF &stop);
28575 inline void setFinalStop(qreal x, qreal y) { setFinalStop(QPointF(x, y)); }
28577 class __attribute__((visibility("default"))) QRadialGradient : public QGradient
28581 QRadialGradient(const QPointF ¢er, qreal radius, const QPointF &focalPoint);
28582 QRadialGradient(qreal cx, qreal cy, qreal radius, qreal fx, qreal fy);
28583 QRadialGradient(const QPointF ¢er, qreal radius);
28584 QRadialGradient(qreal cx, qreal cy, qreal radius);
28585 QPointF center() const;
28586 void setCenter(const QPointF ¢er);
28587 inline void setCenter(qreal x, qreal y) { setCenter(QPointF(x, y)); }
28588 QPointF focalPoint() const;
28589 void setFocalPoint(const QPointF &focalPoint);
28590 inline void setFocalPoint(qreal x, qreal y) { setFocalPoint(QPointF(x, y)); }
28591 qreal radius() const;
28592 void setRadius(qreal radius);
28594 class __attribute__((visibility("default"))) QConicalGradient : public QGradient
28597 QConicalGradient();
28598 QConicalGradient(const QPointF ¢er, qreal startAngle);
28599 QConicalGradient(qreal cx, qreal cy, qreal startAngle);
28600 QPointF center() const;
28601 void setCenter(const QPointF ¢er);
28602 inline void setCenter(qreal x, qreal y) { setCenter(QPointF(x, y)); }
28603 qreal angle() const;
28604 void setAngle(qreal angle);
28606 typedef QtValidLicenseForGuiModule QtGuiModule;
28611 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPen &);
28612 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPen &);
28613 class __attribute__((visibility("default"))) QPen
28617 QPen(Qt::PenStyle);
28618 QPen(const QColor &color);
28619 QPen(const QBrush &brush, qreal width, Qt::PenStyle s = Qt::SolidLine,
28620 Qt::PenCapStyle c = Qt::SquareCap, Qt::PenJoinStyle j = Qt::BevelJoin);
28621 QPen(const QPen &pen);
28623 QPen &operator=(const QPen &pen);
28624 Qt::PenStyle style() const;
28625 void setStyle(Qt::PenStyle);
28626 QVector<qreal> dashPattern() const;
28627 void setDashPattern(const QVector<qreal> &pattern);
28628 qreal dashOffset() const;
28629 void setDashOffset(qreal doffset);
28630 qreal miterLimit() const;
28631 void setMiterLimit(qreal limit);
28632 qreal widthF() const;
28633 void setWidthF(qreal width);
28635 void setWidth(int width);
28636 QColor color() const;
28637 void setColor(const QColor &color);
28638 QBrush brush() const;
28639 void setBrush(const QBrush &brush);
28640 bool isSolid() const;
28641 Qt::PenCapStyle capStyle() const;
28642 void setCapStyle(Qt::PenCapStyle pcs);
28643 Qt::PenJoinStyle joinStyle() const;
28644 void setJoinStyle(Qt::PenJoinStyle pcs);
28645 bool isCosmetic() const;
28646 void setCosmetic(bool cosmetic);
28647 bool operator==(const QPen &p) const;
28648 inline bool operator!=(const QPen &p) const { return !(operator==(p)); }
28649 operator QVariant() const;
28652 friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QPen &);
28653 friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QPen &);
28655 class QPenPrivate *d;
28657 typedef QPenPrivate * DataPtr;
28658 inline DataPtr &data_ptr() { return d; }
28660 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"; } };
28661 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; }
28662 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QPen &);
28663 typedef QtValidLicenseForGuiModule QtGuiModule;
28664 template <typename T> class QList;
28665 struct QTextOptionPrivate;
28666 class __attribute__((visibility("default"))) QTextOption
28675 struct __attribute__((visibility("default"))) Tab {
28676 inline Tab() : position(80), type(QTextOption::LeftTab) { }
28677 inline bool operator==(const Tab &other) const {
28678 return type == other.type
28679 && qFuzzyCompare(position, other.position)
28680 && delimiter == other.delimiter;
28682 inline bool operator!=(const Tab &other) const {
28683 return !operator==(other);
28690 QTextOption(Qt::Alignment alignment);
28692 QTextOption(const QTextOption &o);
28693 QTextOption &operator=(const QTextOption &o);
28694 inline void setAlignment(Qt::Alignment alignment);
28695 inline Qt::Alignment alignment() const { return Qt::Alignment(align); }
28696 inline void setTextDirection(Qt::LayoutDirection aDirection) { this->direction = aDirection; }
28697 inline Qt::LayoutDirection textDirection() const { return Qt::LayoutDirection(direction); }
28703 WrapAtWordBoundaryOrAnywhere
28705 inline void setWrapMode(WrapMode wrap) { wordWrap = wrap; }
28706 inline WrapMode wrapMode() const { return static_cast<WrapMode>(wordWrap); }
28708 ShowTabsAndSpaces = 0x1,
28709 ShowLineAndParagraphSeparators = 0x2,
28710 AddSpaceForLineAndParagraphSeparators = 0x4,
28711 SuppressColors = 0x8,
28712 IncludeTrailingSpaces = 0x80000000
28714 typedef QFlags<Flag> Flags;
28715 inline void setFlags(Flags flags);
28716 inline Flags flags() const { return Flags(f); }
28717 inline void setTabStop(qreal tabStop);
28718 inline qreal tabStop() const { return tab; }
28719 void setTabArray(QList<qreal> tabStops);
28720 QList<qreal> tabArray() const;
28721 void setTabs(QList<Tab> tabStops);
28722 QList<Tab> tabs() const;
28723 void setUseDesignMetrics(bool b) { design = b; }
28724 bool useDesignMetrics() const { return design; }
28729 uint direction : 1;
28733 QTextOptionPrivate *d;
28735 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); }
28736 inline void QTextOption::setAlignment(Qt::Alignment aalignment)
28737 { align = aalignment; }
28738 inline void QTextOption::setFlags(Flags aflags)
28740 inline void QTextOption::setTabStop(qreal atabStop)
28741 { tab = atabStop; }
28742 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; } };
28743 typedef QtValidLicenseForGuiModule QtGuiModule;
28747 class QTextFormatCollection;
28748 class QTextFormatPrivate;
28749 class QTextBlockFormat;
28750 class QTextCharFormat;
28751 class QTextListFormat;
28752 class QTextTableFormat;
28753 class QTextFrameFormat;
28754 class QTextImageFormat;
28755 class QTextTableCellFormat;
28759 class QTextDocument;
28761 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QTextLength &);
28762 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QTextLength &);
28763 class __attribute__((visibility("default"))) QTextLength
28766 enum Type { VariableLength = 0, FixedLength, PercentageLength };
28767 inline QTextLength() : lengthType(VariableLength), fixedValueOrPercentage(0) {}
28768 inline explicit QTextLength(Type type, qreal value);
28769 inline Type type() const { return lengthType; }
28770 inline qreal value(qreal maximumLength) const
28772 switch (lengthType) {
28773 case FixedLength: return fixedValueOrPercentage;
28774 case VariableLength: return maximumLength;
28775 case PercentageLength: return fixedValueOrPercentage * maximumLength / qreal(100);
28779 inline qreal rawValue() const { return fixedValueOrPercentage; }
28780 inline bool operator==(const QTextLength &other) const
28781 { return lengthType == other.lengthType
28782 && qFuzzyCompare(fixedValueOrPercentage, other.fixedValueOrPercentage); }
28783 inline bool operator!=(const QTextLength &other) const
28784 { return lengthType != other.lengthType
28785 || !qFuzzyCompare(fixedValueOrPercentage, other.fixedValueOrPercentage); }
28786 operator QVariant() const;
28789 qreal fixedValueOrPercentage;
28790 friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QTextLength &);
28791 friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QTextLength &);
28793 inline QTextLength::QTextLength(Type atype, qreal avalue)
28794 : lengthType(atype), fixedValueOrPercentage(avalue) {}
28795 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QTextFormat &);
28796 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QTextFormat &);
28797 class __attribute__((visibility("default"))) QTextFormat
28799 public: static const QMetaObject staticMetaObject; private:
28802 InvalidFormat = -1,
28813 LayoutDirection = 0x0801,
28814 OutlinePen = 0x810,
28815 BackgroundBrush = 0x820,
28816 ForegroundBrush = 0x821,
28817 BackgroundImageUrl = 0x823,
28818 BlockAlignment = 0x1010,
28819 BlockTopMargin = 0x1030,
28820 BlockBottomMargin = 0x1031,
28821 BlockLeftMargin = 0x1032,
28822 BlockRightMargin = 0x1033,
28823 TextIndent = 0x1034,
28824 TabPositions = 0x1035,
28825 BlockIndent = 0x1040,
28826 BlockNonBreakableLines = 0x1050,
28827 BlockTrailingHorizontalRulerWidth = 0x1060,
28828 FirstFontProperty = 0x1FE0,
28829 FontCapitalization = FirstFontProperty,
28830 FontLetterSpacing = 0x1FE1,
28831 FontWordSpacing = 0x1FE2,
28832 FontStyleHint = 0x1FE3,
28833 FontStyleStrategy = 0x1FE4,
28834 FontKerning = 0x1FE5,
28835 FontFamily = 0x2000,
28836 FontPointSize = 0x2001,
28837 FontSizeAdjustment = 0x2002,
28838 FontSizeIncrement = FontSizeAdjustment,
28839 FontWeight = 0x2003,
28840 FontItalic = 0x2004,
28841 FontUnderline = 0x2005,
28842 FontOverline = 0x2006,
28843 FontStrikeOut = 0x2007,
28844 FontFixedPitch = 0x2008,
28845 FontPixelSize = 0x2009,
28846 LastFontProperty = FontPixelSize,
28847 TextUnderlineColor = 0x2010,
28848 TextVerticalAlignment = 0x2021,
28849 TextOutline = 0x2022,
28850 TextUnderlineStyle = 0x2023,
28851 TextToolTip = 0x2024,
28853 AnchorHref = 0x2031,
28854 AnchorName = 0x2032,
28855 ObjectType = 0x2f00,
28856 ListStyle = 0x3000,
28857 ListIndent = 0x3001,
28858 FrameBorder = 0x4000,
28859 FrameMargin = 0x4001,
28860 FramePadding = 0x4002,
28861 FrameWidth = 0x4003,
28862 FrameHeight = 0x4004,
28863 FrameTopMargin = 0x4005,
28864 FrameBottomMargin = 0x4006,
28865 FrameLeftMargin = 0x4007,
28866 FrameRightMargin = 0x4008,
28867 FrameBorderBrush = 0x4009,
28868 FrameBorderStyle = 0x4010,
28869 TableColumns = 0x4100,
28870 TableColumnWidthConstraints = 0x4101,
28871 TableCellSpacing = 0x4102,
28872 TableCellPadding = 0x4103,
28873 TableHeaderRowCount = 0x4104,
28874 TableCellRowSpan = 0x4810,
28875 TableCellColumnSpan = 0x4811,
28876 TableCellTopPadding = 0x4812,
28877 TableCellBottomPadding = 0x4813,
28878 TableCellLeftPadding = 0x4814,
28879 TableCellRightPadding = 0x4815,
28880 ImageName = 0x5000,
28881 ImageWidth = 0x5010,
28882 ImageHeight = 0x5011,
28883 FullWidthSelection = 0x06000,
28884 PageBreakPolicy = 0x7000,
28885 UserProperty = 0x100000
28892 UserObject = 0x1000
28894 enum PageBreakFlag {
28895 PageBreak_Auto = 0,
28896 PageBreak_AlwaysBefore = 0x001,
28897 PageBreak_AlwaysAfter = 0x010
28899 typedef QFlags<PageBreakFlag> PageBreakFlags;
28901 explicit QTextFormat(int type);
28902 QTextFormat(const QTextFormat &rhs);
28903 QTextFormat &operator=(const QTextFormat &rhs);
28905 void merge(const QTextFormat &other);
28906 inline bool isValid() const { return type() != InvalidFormat; }
28908 int objectIndex() const;
28909 void setObjectIndex(int object);
28910 QVariant property(int propertyId) const;
28911 void setProperty(int propertyId, const QVariant &value);
28912 void clearProperty(int propertyId);
28913 bool hasProperty(int propertyId) const;
28914 bool boolProperty(int propertyId) const;
28915 int intProperty(int propertyId) const;
28916 qreal doubleProperty(int propertyId) const;
28917 QString stringProperty(int propertyId) const;
28918 QColor colorProperty(int propertyId) const;
28919 QPen penProperty(int propertyId) const;
28920 QBrush brushProperty(int propertyId) const;
28921 QTextLength lengthProperty(int propertyId) const;
28922 QVector<QTextLength> lengthVectorProperty(int propertyId) const;
28923 void setProperty(int propertyId, const QVector<QTextLength> &lengths);
28924 QMap<int, QVariant> properties() const;
28925 int propertyCount() const;
28926 inline void setObjectType(int type);
28927 inline int objectType() const
28928 { return intProperty(ObjectType); }
28929 inline bool isCharFormat() const { return type() == CharFormat; }
28930 inline bool isBlockFormat() const { return type() == BlockFormat; }
28931 inline bool isListFormat() const { return type() == ListFormat; }
28932 inline bool isFrameFormat() const { return type() == FrameFormat; }
28933 inline bool isImageFormat() const { return type() == CharFormat && objectType() == ImageObject; }
28934 inline bool isTableFormat() const { return type() == FrameFormat && objectType() == TableObject; }
28935 inline bool isTableCellFormat() const { return type() == CharFormat && objectType() == TableCellObject; }
28936 QTextBlockFormat toBlockFormat() const;
28937 QTextCharFormat toCharFormat() const;
28938 QTextListFormat toListFormat() const;
28939 QTextTableFormat toTableFormat() const;
28940 QTextFrameFormat toFrameFormat() const;
28941 QTextImageFormat toImageFormat() const;
28942 QTextTableCellFormat toTableCellFormat() const;
28943 bool operator==(const QTextFormat &rhs) const;
28944 inline bool operator!=(const QTextFormat &rhs) const { return !operator==(rhs); }
28945 operator QVariant() const;
28946 inline void setLayoutDirection(Qt::LayoutDirection direction)
28947 { setProperty(QTextFormat::LayoutDirection, direction); }
28948 inline Qt::LayoutDirection layoutDirection() const
28949 { return Qt::LayoutDirection(intProperty(QTextFormat::LayoutDirection)); }
28950 inline void setBackground(const QBrush &brush)
28951 { setProperty(BackgroundBrush, brush); }
28952 inline QBrush background() const
28953 { return brushProperty(BackgroundBrush); }
28954 inline void clearBackground()
28955 { clearProperty(BackgroundBrush); }
28956 inline void setForeground(const QBrush &brush)
28957 { setProperty(ForegroundBrush, brush); }
28958 inline QBrush foreground() const
28959 { return brushProperty(ForegroundBrush); }
28960 inline void clearForeground()
28961 { clearProperty(ForegroundBrush); }
28963 QSharedDataPointer<QTextFormatPrivate> d;
28964 qint32 format_type;
28965 friend class QTextFormatCollection;
28966 friend class QTextCharFormat;
28967 friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QTextFormat &);
28968 friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QTextFormat &);
28970 inline void QTextFormat::setObjectType(int atype)
28971 { setProperty(ObjectType, atype); }
28972 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); }
28973 class __attribute__((visibility("default"))) QTextCharFormat : public QTextFormat
28976 enum VerticalAlignment {
28984 enum UnderlineStyle {
28992 SpellCheckUnderline
28995 bool isValid() const { return isCharFormat(); }
28996 void setFont(const QFont &font);
28997 QFont font() const;
28998 inline void setFontFamily(const QString &family)
28999 { setProperty(FontFamily, family); }
29000 inline QString fontFamily() const
29001 { return stringProperty(FontFamily); }
29002 inline void setFontPointSize(qreal size)
29003 { setProperty(FontPointSize, size); }
29004 inline qreal fontPointSize() const
29005 { return doubleProperty(FontPointSize); }
29006 inline void setFontWeight(int weight)
29007 { if (weight == QFont::Normal) weight = 0; setProperty(FontWeight, weight); }
29008 inline int fontWeight() const
29009 { int weight = intProperty(FontWeight); if (weight == 0) weight = QFont::Normal; return weight; }
29010 inline void setFontItalic(bool italic)
29011 { setProperty(FontItalic, italic); }
29012 inline bool fontItalic() const
29013 { return boolProperty(FontItalic); }
29014 inline void setFontCapitalization(QFont::Capitalization capitalization)
29015 { setProperty(FontCapitalization, capitalization); }
29016 inline QFont::Capitalization fontCapitalization() const
29017 { return static_cast<QFont::Capitalization>(intProperty(FontCapitalization)); }
29018 inline void setFontLetterSpacing(qreal spacing)
29019 { setProperty(FontLetterSpacing, spacing); }
29020 inline qreal fontLetterSpacing() const
29021 { return doubleProperty(FontLetterSpacing); }
29022 inline void setFontWordSpacing(qreal spacing)
29023 { setProperty(FontWordSpacing, spacing); }
29024 inline qreal fontWordSpacing() const
29025 { return doubleProperty(FontWordSpacing); }
29026 inline void setFontUnderline(bool underline)
29027 { setProperty(TextUnderlineStyle, underline ? SingleUnderline : NoUnderline); }
29028 bool fontUnderline() const;
29029 inline void setFontOverline(bool overline)
29030 { setProperty(FontOverline, overline); }
29031 inline bool fontOverline() const
29032 { return boolProperty(FontOverline); }
29033 inline void setFontStrikeOut(bool strikeOut)
29034 { setProperty(FontStrikeOut, strikeOut); }
29035 inline bool fontStrikeOut() const
29036 { return boolProperty(FontStrikeOut); }
29037 inline void setUnderlineColor(const QColor &color)
29038 { setProperty(TextUnderlineColor, color); }
29039 inline QColor underlineColor() const
29040 { return colorProperty(TextUnderlineColor); }
29041 inline void setFontFixedPitch(bool fixedPitch)
29042 { setProperty(FontFixedPitch, fixedPitch); }
29043 inline bool fontFixedPitch() const
29044 { return boolProperty(FontFixedPitch); }
29045 inline void setFontStyleHint(QFont::StyleHint hint, QFont::StyleStrategy strategy = QFont::PreferDefault)
29046 { setProperty(FontStyleHint, hint); setProperty(FontStyleStrategy, strategy); }
29047 inline void setFontStyleStrategy(QFont::StyleStrategy strategy)
29048 { setProperty(FontStyleStrategy, strategy); }
29049 QFont::StyleHint fontStyleHint() const
29050 { return static_cast<QFont::StyleHint>(intProperty(FontStyleHint)); }
29051 QFont::StyleStrategy fontStyleStrategy() const
29052 { return static_cast<QFont::StyleStrategy>(intProperty(FontStyleStrategy)); }
29053 inline void setFontKerning(bool enable)
29054 { setProperty(FontKerning, enable); }
29055 inline bool fontKerning() const
29056 { return boolProperty(FontKerning); }
29057 void setUnderlineStyle(UnderlineStyle style);
29058 inline UnderlineStyle underlineStyle() const
29059 { return static_cast<UnderlineStyle>(intProperty(TextUnderlineStyle)); }
29060 inline void setVerticalAlignment(VerticalAlignment alignment)
29061 { setProperty(TextVerticalAlignment, alignment); }
29062 inline VerticalAlignment verticalAlignment() const
29063 { return static_cast<VerticalAlignment>(intProperty(TextVerticalAlignment)); }
29064 inline void setTextOutline(const QPen &pen)
29065 { setProperty(TextOutline, pen); }
29066 inline QPen textOutline() const
29067 { return penProperty(TextOutline); }
29068 inline void setToolTip(const QString &tip)
29069 { setProperty(TextToolTip, tip); }
29070 inline QString toolTip() const
29071 { return stringProperty(TextToolTip); }
29072 inline void setAnchor(bool anchor)
29073 { setProperty(IsAnchor, anchor); }
29074 inline bool isAnchor() const
29075 { return boolProperty(IsAnchor); }
29076 inline void setAnchorHref(const QString &value)
29077 { setProperty(AnchorHref, value); }
29078 inline QString anchorHref() const
29079 { return stringProperty(AnchorHref); }
29080 inline void setAnchorName(const QString &name)
29081 { setAnchorNames(QStringList(name)); }
29082 QString anchorName() const;
29083 inline void setAnchorNames(const QStringList &names)
29084 { setProperty(AnchorName, names); }
29085 QStringList anchorNames() const;
29086 inline void setTableCellRowSpan(int tableCellRowSpan);
29087 inline int tableCellRowSpan() const
29088 { int s = intProperty(TableCellRowSpan); if (s == 0) s = 1; return s; }
29089 inline void setTableCellColumnSpan(int tableCellColumnSpan);
29090 inline int tableCellColumnSpan() const
29091 { int s = intProperty(TableCellColumnSpan); if (s == 0) s = 1; return s; }
29093 explicit QTextCharFormat(const QTextFormat &fmt);
29094 friend class QTextFormat;
29096 inline void QTextCharFormat::setTableCellRowSpan(int _tableCellRowSpan)
29098 if (_tableCellRowSpan <= 1)
29099 clearProperty(TableCellRowSpan);
29101 setProperty(TableCellRowSpan, _tableCellRowSpan);
29103 inline void QTextCharFormat::setTableCellColumnSpan(int _tableCellColumnSpan)
29105 if (_tableCellColumnSpan <= 1)
29106 clearProperty(TableCellColumnSpan);
29108 setProperty(TableCellColumnSpan, _tableCellColumnSpan);
29110 class __attribute__((visibility("default"))) QTextBlockFormat : public QTextFormat
29113 QTextBlockFormat();
29114 bool isValid() const { return isBlockFormat(); }
29115 inline void setAlignment(Qt::Alignment alignment);
29116 inline Qt::Alignment alignment() const
29117 { int a = intProperty(BlockAlignment); if (a == 0) a = Qt::AlignLeft; return QFlag(a); }
29118 inline void setTopMargin(qreal margin)
29119 { setProperty(BlockTopMargin, margin); }
29120 inline qreal topMargin() const
29121 { return doubleProperty(BlockTopMargin); }
29122 inline void setBottomMargin(qreal margin)
29123 { setProperty(BlockBottomMargin, margin); }
29124 inline qreal bottomMargin() const
29125 { return doubleProperty(BlockBottomMargin); }
29126 inline void setLeftMargin(qreal margin)
29127 { setProperty(BlockLeftMargin, margin); }
29128 inline qreal leftMargin() const
29129 { return doubleProperty(BlockLeftMargin); }
29130 inline void setRightMargin(qreal margin)
29131 { setProperty(BlockRightMargin, margin); }
29132 inline qreal rightMargin() const
29133 { return doubleProperty(BlockRightMargin); }
29134 inline void setTextIndent(qreal aindent)
29135 { setProperty(TextIndent, aindent); }
29136 inline qreal textIndent() const
29137 { return doubleProperty(TextIndent); }
29138 inline void setIndent(int indent);
29139 inline int indent() const
29140 { return intProperty(BlockIndent); }
29141 inline void setNonBreakableLines(bool b)
29142 { setProperty(BlockNonBreakableLines, b); }
29143 inline bool nonBreakableLines() const
29144 { return boolProperty(BlockNonBreakableLines); }
29145 inline void setPageBreakPolicy(PageBreakFlags flags)
29146 { setProperty(PageBreakPolicy, int(flags)); }
29147 inline PageBreakFlags pageBreakPolicy() const
29148 { return PageBreakFlags(intProperty(PageBreakPolicy)); }
29149 void setTabPositions(const QList<QTextOption::Tab> &tabs);
29150 QList<QTextOption::Tab> tabPositions() const;
29152 explicit QTextBlockFormat(const QTextFormat &fmt);
29153 friend class QTextFormat;
29155 inline void QTextBlockFormat::setAlignment(Qt::Alignment aalignment)
29156 { setProperty(BlockAlignment, int(aalignment)); }
29157 inline void QTextBlockFormat::setIndent(int aindent)
29158 { setProperty(BlockIndent, aindent); }
29159 class __attribute__((visibility("default"))) QTextListFormat : public QTextFormat
29163 bool isValid() const { return isListFormat(); }
29169 ListLowerAlpha = -5,
29170 ListUpperAlpha = -6,
29171 ListStyleUndefined = 0
29173 inline void setStyle(Style style);
29174 inline Style style() const
29175 { return static_cast<Style>(intProperty(ListStyle)); }
29176 inline void setIndent(int indent);
29177 inline int indent() const
29178 { return intProperty(ListIndent); }
29180 explicit QTextListFormat(const QTextFormat &fmt);
29181 friend class QTextFormat;
29183 inline void QTextListFormat::setStyle(Style astyle)
29184 { setProperty(ListStyle, astyle); }
29185 inline void QTextListFormat::setIndent(int aindent)
29186 { setProperty(ListIndent, aindent); }
29187 class __attribute__((visibility("default"))) QTextImageFormat : public QTextCharFormat
29190 QTextImageFormat();
29191 bool isValid() const { return isImageFormat(); }
29192 inline void setName(const QString &name);
29193 inline QString name() const
29194 { return stringProperty(ImageName); }
29195 inline void setWidth(qreal width);
29196 inline qreal width() const
29197 { return doubleProperty(ImageWidth); }
29198 inline void setHeight(qreal height);
29199 inline qreal height() const
29200 { return doubleProperty(ImageHeight); }
29202 explicit QTextImageFormat(const QTextFormat &format);
29203 friend class QTextFormat;
29205 inline void QTextImageFormat::setName(const QString &aname)
29206 { setProperty(ImageName, aname); }
29207 inline void QTextImageFormat::setWidth(qreal awidth)
29208 { setProperty(ImageWidth, awidth); }
29209 inline void QTextImageFormat::setHeight(qreal aheight)
29210 { setProperty(ImageHeight, aheight); }
29211 class __attribute__((visibility("default"))) QTextFrameFormat : public QTextFormat
29214 QTextFrameFormat();
29215 bool isValid() const { return isFrameFormat(); }
29223 BorderStyle_Dotted,
29224 BorderStyle_Dashed,
29226 BorderStyle_Double,
29227 BorderStyle_DotDash,
29228 BorderStyle_DotDotDash,
29229 BorderStyle_Groove,
29234 inline void setPosition(Position f)
29235 { setProperty(CssFloat, f); }
29236 inline Position position() const
29237 { return static_cast<Position>(intProperty(CssFloat)); }
29238 inline void setBorder(qreal border);
29239 inline qreal border() const
29240 { return doubleProperty(FrameBorder); }
29241 inline void setBorderBrush(const QBrush &brush)
29242 { setProperty(FrameBorderBrush, brush); }
29243 inline QBrush borderBrush() const
29244 { return brushProperty(FrameBorderBrush); }
29245 inline void setBorderStyle(BorderStyle style)
29246 { setProperty(FrameBorderStyle, style); }
29247 inline BorderStyle borderStyle() const
29248 { return static_cast<BorderStyle>(intProperty(FrameBorderStyle)); }
29249 void setMargin(qreal margin);
29250 inline qreal margin() const
29251 { return doubleProperty(FrameMargin); }
29252 inline void setTopMargin(qreal margin);
29253 qreal topMargin() const;
29254 inline void setBottomMargin(qreal margin);
29255 qreal bottomMargin() const;
29256 inline void setLeftMargin(qreal margin);
29257 qreal leftMargin() const;
29258 inline void setRightMargin(qreal margin);
29259 qreal rightMargin() const;
29260 inline void setPadding(qreal padding);
29261 inline qreal padding() const
29262 { return doubleProperty(FramePadding); }
29263 inline void setWidth(qreal width);
29264 inline void setWidth(const QTextLength &length)
29265 { setProperty(FrameWidth, length); }
29266 inline QTextLength width() const
29267 { return lengthProperty(FrameWidth); }
29268 inline void setHeight(qreal height);
29269 inline void setHeight(const QTextLength &height);
29270 inline QTextLength height() const
29271 { return lengthProperty(FrameHeight); }
29272 inline void setPageBreakPolicy(PageBreakFlags flags)
29273 { setProperty(PageBreakPolicy, int(flags)); }
29274 inline PageBreakFlags pageBreakPolicy() const
29275 { return PageBreakFlags(intProperty(PageBreakPolicy)); }
29277 explicit QTextFrameFormat(const QTextFormat &fmt);
29278 friend class QTextFormat;
29280 inline void QTextFrameFormat::setBorder(qreal aborder)
29281 { setProperty(FrameBorder, aborder); }
29282 inline void QTextFrameFormat::setPadding(qreal apadding)
29283 { setProperty(FramePadding, apadding); }
29284 inline void QTextFrameFormat::setWidth(qreal awidth)
29285 { setProperty(FrameWidth, QTextLength(QTextLength::FixedLength, awidth)); }
29286 inline void QTextFrameFormat::setHeight(qreal aheight)
29287 { setProperty(FrameHeight, QTextLength(QTextLength::FixedLength, aheight)); }
29288 inline void QTextFrameFormat::setHeight(const QTextLength &aheight)
29289 { setProperty(FrameHeight, aheight); }
29290 inline void QTextFrameFormat::setTopMargin(qreal amargin)
29291 { setProperty(FrameTopMargin, amargin); }
29292 inline void QTextFrameFormat::setBottomMargin(qreal amargin)
29293 { setProperty(FrameBottomMargin, amargin); }
29294 inline void QTextFrameFormat::setLeftMargin(qreal amargin)
29295 { setProperty(FrameLeftMargin, amargin); }
29296 inline void QTextFrameFormat::setRightMargin(qreal amargin)
29297 { setProperty(FrameRightMargin, amargin); }
29298 class __attribute__((visibility("default"))) QTextTableFormat : public QTextFrameFormat
29301 QTextTableFormat();
29302 inline bool isValid() const { return isTableFormat(); }
29303 inline int columns() const
29304 { int cols = intProperty(TableColumns); if (cols == 0) cols = 1; return cols; }
29305 inline void setColumns(int columns);
29306 inline void setColumnWidthConstraints(const QVector<QTextLength> &constraints)
29307 { setProperty(TableColumnWidthConstraints, constraints); }
29308 inline QVector<QTextLength> columnWidthConstraints() const
29309 { return lengthVectorProperty(TableColumnWidthConstraints); }
29310 inline void clearColumnWidthConstraints()
29311 { clearProperty(TableColumnWidthConstraints); }
29312 inline qreal cellSpacing() const
29313 { return doubleProperty(TableCellSpacing); }
29314 inline void setCellSpacing(qreal spacing)
29315 { setProperty(TableCellSpacing, spacing); }
29316 inline qreal cellPadding() const
29317 { return doubleProperty(TableCellPadding); }
29318 inline void setCellPadding(qreal padding);
29319 inline void setAlignment(Qt::Alignment alignment);
29320 inline Qt::Alignment alignment() const
29321 { return QFlag(intProperty(BlockAlignment)); }
29322 inline void setHeaderRowCount(int count)
29323 { setProperty(TableHeaderRowCount, count); }
29324 inline int headerRowCount() const
29325 { return intProperty(TableHeaderRowCount); }
29327 explicit QTextTableFormat(const QTextFormat &fmt);
29328 friend class QTextFormat;
29330 inline void QTextTableFormat::setColumns(int acolumns)
29334 setProperty(TableColumns, acolumns);
29336 inline void QTextTableFormat::setCellPadding(qreal apadding)
29337 { setProperty(TableCellPadding, apadding); }
29338 inline void QTextTableFormat::setAlignment(Qt::Alignment aalignment)
29339 { setProperty(BlockAlignment, int(aalignment)); }
29340 class __attribute__((visibility("default"))) QTextTableCellFormat : public QTextCharFormat
29343 QTextTableCellFormat();
29344 inline bool isValid() const { return isTableCellFormat(); }
29345 inline void setTopPadding(qreal padding);
29346 inline qreal topPadding() const;
29347 inline void setBottomPadding(qreal padding);
29348 inline qreal bottomPadding() const;
29349 inline void setLeftPadding(qreal padding);
29350 inline qreal leftPadding() const;
29351 inline void setRightPadding(qreal padding);
29352 inline qreal rightPadding() const;
29353 inline void setPadding(qreal padding);
29355 explicit QTextTableCellFormat(const QTextFormat &fmt);
29356 friend class QTextFormat;
29358 inline void QTextTableCellFormat::setTopPadding(qreal padding)
29360 setProperty(TableCellTopPadding, padding);
29362 inline qreal QTextTableCellFormat::topPadding() const
29364 return doubleProperty(TableCellTopPadding);
29366 inline void QTextTableCellFormat::setBottomPadding(qreal padding)
29368 setProperty(TableCellBottomPadding, padding);
29370 inline qreal QTextTableCellFormat::bottomPadding() const
29372 return doubleProperty(TableCellBottomPadding);
29374 inline void QTextTableCellFormat::setLeftPadding(qreal padding)
29376 setProperty(TableCellLeftPadding, padding);
29378 inline qreal QTextTableCellFormat::leftPadding() const
29380 return doubleProperty(TableCellLeftPadding);
29382 inline void QTextTableCellFormat::setRightPadding(qreal padding)
29384 setProperty(TableCellRightPadding, padding);
29386 inline qreal QTextTableCellFormat::rightPadding() const
29388 return doubleProperty(TableCellRightPadding);
29390 inline void QTextTableCellFormat::setPadding(qreal padding)
29392 setTopPadding(padding);
29393 setBottomPadding(padding);
29394 setLeftPadding(padding);
29395 setRightPadding(padding);
29397 typedef QtValidLicenseForGuiModule QtGuiModule;
29405 class __attribute__((visibility("default"))) QTextInlineObject
29408 QTextInlineObject(int i, QTextEngine *e) : itm(i), eng(e) {}
29409 inline QTextInlineObject() : itm(0), eng(0) {}
29410 inline bool isValid() const { return eng; }
29411 QRectF rect() const;
29412 qreal width() const;
29413 qreal ascent() const;
29414 qreal descent() const;
29415 qreal height() const;
29416 Qt::LayoutDirection textDirection() const;
29417 void setWidth(qreal w);
29418 void setAscent(qreal a);
29419 void setDescent(qreal d);
29420 int textPosition() const;
29421 int formatIndex() const;
29422 QTextFormat format() const;
29424 friend class QTextLayout;
29428 class QPaintDevice;
29433 class __attribute__((visibility("default"))) QTextLayout
29437 QTextLayout(const QString& text);
29438 QTextLayout(const QString& text, const QFont &font, QPaintDevice *paintdevice = 0);
29439 QTextLayout(const QTextBlock &b);
29441 void setFont(const QFont &f);
29442 QFont font() const;
29443 void setText(const QString& string);
29444 QString text() const;
29445 void setTextOption(const QTextOption &option);
29446 QTextOption textOption() const;
29447 void setPreeditArea(int position, const QString &text);
29448 int preeditAreaPosition() const;
29449 QString preeditAreaText() const;
29450 struct FormatRange {
29453 QTextCharFormat format;
29455 void setAdditionalFormats(const QList<FormatRange> &overrides);
29456 QList<FormatRange> additionalFormats() const;
29457 void clearAdditionalFormats();
29458 void setCacheEnabled(bool enable);
29459 bool cacheEnabled() const;
29460 void beginLayout();
29462 void clearLayout();
29463 QTextLine createLine();
29464 int lineCount() const;
29465 QTextLine lineAt(int i) const;
29466 QTextLine lineForTextPosition(int pos) const;
29471 bool isValidCursorPosition(int pos) const;
29472 int nextCursorPosition(int oldPos, CursorMode mode = SkipCharacters) const;
29473 int previousCursorPosition(int oldPos, CursorMode mode = SkipCharacters) const;
29474 void draw(QPainter *p, const QPointF &pos, const QVector<FormatRange> &selections = QVector<FormatRange>(),
29475 const QRectF &clip = QRectF()) const;
29476 void drawCursor(QPainter *p, const QPointF &pos, int cursorPosition) const;
29477 void drawCursor(QPainter *p, const QPointF &pos, int cursorPosition, int width) const;
29478 QPointF position() const;
29479 void setPosition(const QPointF &p);
29480 QRectF boundingRect() const;
29481 qreal minimumWidth() const;
29482 qreal maximumWidth() const;
29483 QTextEngine *engine() const { return d; }
29484 void setFlags(int flags);
29486 QTextLayout(QTextEngine *e) : d(e) {}
29487 QTextLayout(const QTextLayout &); QTextLayout &operator=(const QTextLayout &);
29488 friend class QPainter;
29489 friend class QPSPrinter;
29490 friend class QGraphicsSimpleTextItemPrivate;
29491 friend class QGraphicsSimpleTextItem;
29492 friend void qt_format_text(const QFont &font, const QRectF &_r, int tf, const QTextOption *, const QString& str,
29493 QRectF *brect, int tabstops, int* tabarray, int tabarraylen,
29494 QPainter *painter);
29497 class __attribute__((visibility("default"))) QTextLine
29500 inline QTextLine() : i(0), eng(0) {}
29501 inline bool isValid() const { return eng; }
29502 QRectF rect() const;
29505 qreal width() const;
29506 qreal ascent() const;
29507 qreal descent() const;
29508 qreal height() const;
29509 qreal naturalTextWidth() const;
29510 QRectF naturalTextRect() const;
29515 enum CursorPosition {
29516 CursorBetweenCharacters,
29519 qreal cursorToX(int *cursorPos, Edge edge = Leading) const;
29520 inline qreal cursorToX(int cursorPos, Edge edge = Leading) const { return cursorToX(&cursorPos, edge); }
29521 int xToCursor(qreal x, CursorPosition = CursorBetweenCharacters) const;
29522 void setLineWidth(qreal width);
29523 void setNumColumns(int columns);
29524 void setNumColumns(int columns, qreal alignmentWidth);
29525 void setPosition(const QPointF &pos);
29526 QPointF position() const;
29527 int textStart() const;
29528 int textLength() const;
29529 int lineNumber() const { return i; }
29530 void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection = 0) const;
29532 QTextLine(int line, QTextEngine *e) : i(line), eng(e) {}
29533 void layout_helper(int numGlyphs);
29534 friend class QTextLayout;
29538 class __attribute__((visibility("default"))) QTextFormatCollection
29541 QTextFormatCollection() {}
29542 ~QTextFormatCollection();
29543 QTextFormatCollection(const QTextFormatCollection &rhs);
29544 QTextFormatCollection &operator=(const QTextFormatCollection &rhs);
29545 QTextFormat objectFormat(int objectIndex) const;
29546 void setObjectFormat(int objectIndex, const QTextFormat &format);
29547 int objectFormatIndex(int objectIndex) const;
29548 void setObjectFormatIndex(int objectIndex, int formatIndex);
29549 int createObjectIndex(const QTextFormat &f);
29550 int indexForFormat(const QTextFormat &f);
29551 bool hasFormatCached(const QTextFormat &format) const;
29552 QTextFormat format(int idx) const;
29553 inline QTextBlockFormat blockFormat(int index) const
29554 { return format(index).toBlockFormat(); }
29555 inline QTextCharFormat charFormat(int index) const
29556 { return format(index).toCharFormat(); }
29557 inline QTextListFormat listFormat(int index) const
29558 { return format(index).toListFormat(); }
29559 inline QTextTableFormat tableFormat(int index) const
29560 { return format(index).toTableFormat(); }
29561 inline QTextImageFormat imageFormat(int index) const
29562 { return format(index).toImageFormat(); }
29563 inline int numFormats() const { return formats.count(); }
29564 typedef QVector<QTextFormat> FormatVector;
29565 FormatVector formats;
29566 QVector<qint32> objFormats;
29568 inline QFont defaultFont() const { return defaultFnt; }
29569 void setDefaultFont(const QFont &f);
29573 namespace QUnicodeTables {
29574 struct Properties {
29575 ushort category : 8;
29576 ushort line_break_class : 8;
29577 ushort direction : 8;
29578 ushort combiningClass :8;
29579 ushort joining : 2;
29580 signed short digitValue : 6;
29581 ushort unicodeVersion : 4;
29582 ushort lowerCaseSpecial : 1;
29583 ushort upperCaseSpecial : 1;
29584 ushort titleCaseSpecial : 1;
29585 ushort caseFoldSpecial : 1;
29586 signed short mirrorDiff : 16;
29587 signed short lowerCaseDiff : 16;
29588 signed short upperCaseDiff : 16;
29589 signed short titleCaseDiff : 16;
29590 signed short caseFoldDiff : 16;
29591 ushort graphemeBreak : 8;
29592 ushort wordBreak : 8;
29593 ushort sentenceBreak : 8;
29595 __attribute__((visibility("default"))) const Properties* properties(uint ucs4);
29596 __attribute__((visibility("default"))) const Properties* properties(ushort ucs2);
29626 ScriptCount = Inherited,
29630 CanadianAboriginal = Common,
29631 Mongolian = Common,
29637 OldItalic = Common,
29654 NewTaiLue = Common,
29655 Glagolitic = Common,
29657 SylotiNagri = Common,
29658 OldPersian = Common,
29659 Kharoshthi = Common,
29661 Cuneiform = Common,
29662 Phoenician = Common,
29666 enum { ScriptSentinel = 32 };
29667 enum LineBreakClass {
29668 LineBreak_OP, LineBreak_CL, LineBreak_QU, LineBreak_GL, LineBreak_NS,
29669 LineBreak_EX, LineBreak_SY, LineBreak_IS, LineBreak_PR, LineBreak_PO,
29670 LineBreak_NU, LineBreak_AL, LineBreak_ID, LineBreak_IN, LineBreak_HY,
29671 LineBreak_BA, LineBreak_BB, LineBreak_B2, LineBreak_ZW, LineBreak_CM,
29672 LineBreak_WJ, LineBreak_H2, LineBreak_H3, LineBreak_JL, LineBreak_JV,
29673 LineBreak_JT, LineBreak_SA, LineBreak_SG,
29674 LineBreak_SP, LineBreak_CR, LineBreak_LF, LineBreak_BK
29676 __attribute__((visibility("default"))) QUnicodeTables::LineBreakClass lineBreakClass(uint ucs4);
29677 inline int lineBreakClass(const QChar &ch) {
29678 return QUnicodeTables::lineBreakClass(ch.unicode());
29680 __attribute__((visibility("default"))) int script(uint ucs4);
29681 __attribute__((visibility("default"))) inline int script(const QChar &ch) {
29682 return script(ch.unicode());
29684 enum GraphemeBreak {
29685 GraphemeBreakOther,
29688 GraphemeBreakControl,
29689 GraphemeBreakExtend,
29701 WordBreakMidLetter,
29704 WordBreakExtendNumLet
29706 enum SentenceBreak {
29707 SentenceBreakOther,
29709 SentenceBreakFormat,
29711 SentenceBreakLower,
29712 SentenceBreakUpper,
29713 SentenceBreakOLetter,
29714 SentenceBreakNumeric,
29715 SentenceBreakATerm,
29716 SentenceBreakSTerm,
29720 typedef QtValidLicenseForGuiModule QtGuiModule;
29722 template <class T> class QList;
29725 class QFontDatabasePrivate;
29726 class __attribute__((visibility("default"))) QFontDatabase
29728 public: static const QMetaObject staticMetaObject; private:
29730 enum WritingSystem {
29757 TraditionalChinese,
29765 WritingSystemsCount
29767 static QList<int> standardSizes();
29769 QList<WritingSystem> writingSystems() const;
29770 QList<WritingSystem> writingSystems(const QString &family) const;
29771 QStringList families(WritingSystem writingSystem = Any) const;
29772 QStringList styles(const QString &family) const;
29773 QList<int> pointSizes(const QString &family, const QString &style = QString());
29774 QList<int> smoothSizes(const QString &family, const QString &style);
29775 QString styleString(const QFont &font);
29776 QString styleString(const QFontInfo &fontInfo);
29777 QFont font(const QString &family, const QString &style, int pointSize) const;
29778 bool isBitmapScalable(const QString &family, const QString &style = QString()) const;
29779 bool isSmoothlyScalable(const QString &family, const QString &style = QString()) const;
29780 bool isScalable(const QString &family, const QString &style = QString()) const;
29781 bool isFixedPitch(const QString &family, const QString &style = QString()) const;
29782 bool italic(const QString &family, const QString &style) const;
29783 bool bold(const QString &family, const QString &style) const;
29784 int weight(const QString &family, const QString &style) const;
29785 static QString writingSystemName(WritingSystem writingSystem);
29786 static QString writingSystemSample(WritingSystem writingSystem);
29787 static int addApplicationFont(const QString &fileName);
29788 static int addApplicationFontFromData(const QByteArray &fontData);
29789 static QStringList applicationFontFamilies(int id);
29790 static bool removeApplicationFont(int id);
29791 static bool removeAllApplicationFonts();
29792 static bool supportsThreadedFontRendering();
29794 static void createDatabase();
29795 static void parseFontName(const QString &name, QString &foundry, QString &family);
29796 static QFontEngine *findFont(int script, const QFontPrivate *fp, const QFontDef &request);
29797 static void load(const QFontPrivate *d, int script);
29798 friend struct QFontDef;
29799 friend class QFontPrivate;
29800 friend class QFontDialog;
29801 friend class QFontDialogPrivate;
29802 friend class QFontEngineMultiXLFD;
29803 friend class QFontEngineMultiQWS;
29804 QFontDatabasePrivate *d;
29808 QFixed() : val(0) {}
29809 QFixed(int i) : val(i<<6) {}
29810 QFixed(long i) : val(i<<6) {}
29811 QFixed &operator=(int i) { val = (i<<6); return *this; }
29812 QFixed &operator=(long i) { val = (i<<6); return *this; }
29813 static QFixed fromReal(qreal r) { QFixed f; f.val = (int)(r*qreal(64)); return f; }
29814 static QFixed fromFixed(int fixed) { QFixed f; f.val = fixed; return f; }
29815 inline int value() const { return val; }
29816 inline void setValue(int value) { val = value; }
29817 inline int toInt() const { return (((val)+32) & -64)>>6; }
29818 inline qreal toReal() const { return ((qreal)val)/(qreal)64; }
29819 inline int truncate() const { return val>>6; }
29820 inline QFixed round() const { QFixed f; f.val = ((val)+32) & -64; return f; }
29821 inline QFixed floor() const { QFixed f; f.val = (val) & -64; return f; }
29822 inline QFixed ceil() const { QFixed f; f.val = (val+63) & -64; return f; }
29823 inline QFixed operator+(int i) const { QFixed f; f.val = (val + (i<<6)); return f; }
29824 inline QFixed operator+(uint i) const { QFixed f; f.val = (val + (i<<6)); return f; }
29825 inline QFixed operator+(const QFixed &other) const { QFixed f; f.val = (val + other.val); return f; }
29826 inline QFixed &operator+=(int i) { val += (i<<6); return *this; }
29827 inline QFixed &operator+=(uint i) { val += (i<<6); return *this; }
29828 inline QFixed &operator+=(const QFixed &other) { val += other.val; return *this; }
29829 inline QFixed operator-(int i) const { QFixed f; f.val = (val - (i<<6)); return f; }
29830 inline QFixed operator-(uint i) const { QFixed f; f.val = (val - (i<<6)); return f; }
29831 inline QFixed operator-(const QFixed &other) const { QFixed f; f.val = (val - other.val); return f; }
29832 inline QFixed &operator-=(int i) { val -= (i<<6); return *this; }
29833 inline QFixed &operator-=(uint i) { val -= (i<<6); return *this; }
29834 inline QFixed &operator-=(const QFixed &other) { val -= other.val; return *this; }
29835 inline QFixed operator-() const { QFixed f; f.val = -val; return f; }
29836 inline bool operator==(const QFixed &other) const { return val == other.val; }
29837 inline bool operator!=(const QFixed &other) const { return val != other.val; }
29838 inline bool operator<(const QFixed &other) const { return val < other.val; }
29839 inline bool operator>(const QFixed &other) const { return val > other.val; }
29840 inline bool operator<=(const QFixed &other) const { return val <= other.val; }
29841 inline bool operator>=(const QFixed &other) const { return val >= other.val; }
29842 inline bool operator!() const { return !val; }
29843 inline QFixed &operator/=(int x) { val /= x; return *this; }
29844 inline QFixed &operator/=(const QFixed &o) {
29851 if (a < 0) { a = -a; neg = true; }
29852 if (b < 0) { b = -b; neg = !neg; }
29853 int res = (int)(((a << 6) + (b >> 1)) / b);
29854 val = (neg ? -res : res);
29858 inline QFixed operator/(int d) const { QFixed f; f.val = val/d; return f; }
29859 inline QFixed operator/(QFixed b) const { QFixed f = *this; return (f /= b); }
29860 inline QFixed operator>>(int d) const { QFixed f = *this; f.val >>= d; return f; }
29861 inline QFixed &operator*=(int i) { val *= i; return *this; }
29862 inline QFixed &operator*=(uint i) { val *= i; return *this; }
29863 inline QFixed &operator*=(const QFixed &o) {
29867 if (a < 0) { a = -a; neg = true; }
29868 if (b < 0) { b = -b; neg = !neg; }
29869 int res = (int)((a * b + 0x20L) >> 6);
29870 val = neg ? -res : res;
29873 inline QFixed operator*(int i) const { QFixed f = *this; return (f *= i); }
29874 inline QFixed operator*(uint i) const { QFixed f = *this; return (f *= i); }
29875 inline QFixed operator*(const QFixed &o) const { QFixed f = *this; return (f *= o); }
29877 QFixed(qreal i) : val((int)(i*qreal(64))) {}
29878 QFixed &operator=(qreal i) { val = (int)(i*qreal(64)); return *this; }
29879 inline QFixed operator+(qreal i) const { QFixed f; f.val = (val + (int)(i*qreal(64))); return f; }
29880 inline QFixed &operator+=(qreal i) { val += (int)(i*64); return *this; }
29881 inline QFixed operator-(qreal i) const { QFixed f; f.val = (val - (int)(i*qreal(64))); return f; }
29882 inline QFixed &operator-=(qreal i) { val -= (int)(i*64); return *this; }
29883 inline QFixed &operator/=(qreal r) { val = (int)(val/r); return *this; }
29884 inline QFixed operator/(qreal d) const { QFixed f; f.val = (int)(val/d); return f; }
29885 inline QFixed &operator*=(qreal d) { val = (int) (val*d); return *this; }
29886 inline QFixed operator*(qreal d) const { QFixed f = *this; return (f *= d); }
29889 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"; } };
29890 inline int qRound(const QFixed &f) { return f.toInt(); }
29891 inline int qFloor(const QFixed &f) { return f.floor().truncate(); }
29892 inline QFixed operator*(int i, const QFixed &d) { return d*i; }
29893 inline QFixed operator+(int i, const QFixed &d) { return d+i; }
29894 inline QFixed operator-(int i, const QFixed &d) { return -(d-i); }
29895 inline QFixed operator*(uint i, const QFixed &d) { return d*i; }
29896 inline QFixed operator+(uint i, const QFixed &d) { return d+i; }
29897 inline QFixed operator-(uint i, const QFixed &d) { return -(d-i); }
29898 inline bool operator==(const QFixed &f, int i) { return f.value() == (i<<6); }
29899 inline bool operator==(int i, const QFixed &f) { return f.value() == (i<<6); }
29900 inline bool operator!=(const QFixed &f, int i) { return f.value() != (i<<6); }
29901 inline bool operator!=(int i, const QFixed &f) { return f.value() != (i<<6); }
29902 inline bool operator<=(const QFixed &f, int i) { return f.value() <= (i<<6); }
29903 inline bool operator<=(int i, const QFixed &f) { return (i<<6) <= f.value(); }
29904 inline bool operator>=(const QFixed &f, int i) { return f.value() >= (i<<6); }
29905 inline bool operator>=(int i, const QFixed &f) { return (i<<6) >= f.value(); }
29906 inline bool operator<(const QFixed &f, int i) { return f.value() < (i<<6); }
29907 inline bool operator<(int i, const QFixed &f) { return (i<<6) < f.value(); }
29908 inline bool operator>(const QFixed &f, int i) { return f.value() > (i<<6); }
29909 inline bool operator>(int i, const QFixed &f) { return (i<<6) > f.value(); }
29910 inline QDebug &operator<<(QDebug &dbg, const QFixed &f)
29911 { return dbg << f.toReal(); }
29912 struct QFixedPoint {
29915 inline QFixedPoint() {}
29916 inline QFixedPoint(const QFixed &_x, const QFixed &_y) : x(_x), y(_y) {}
29917 QPointF toPointF() const { return QPointF(x.toReal(), y.toReal()); }
29918 static QFixedPoint fromPointF(const QPointF &p) {
29919 return QFixedPoint(QFixed::fromReal(p.x()), QFixed::fromReal(p.y()));
29922 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"; } };
29923 inline QFixedPoint operator-(const QFixedPoint &p1, const QFixedPoint &p2)
29924 { return QFixedPoint(p1.x - p2.x, p1.y - p2.y); }
29925 inline QFixedPoint operator+(const QFixedPoint &p1, const QFixedPoint &p2)
29926 { return QFixedPoint(p1.x + p2.x, p1.y + p2.y); }
29927 struct QFixedSize {
29930 QSizeF toSizeF() const { return QSizeF(width.toReal(), height.toReal()); }
29931 static QFixedSize fromSizeF(const QSizeF &s) {
29933 size.width = QFixed::fromReal(s.width());
29934 size.height = QFixed::fromReal(s.height());
29938 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"; } };
29944 : pointSize(-1.0), pixelSize(-1),
29945 styleStrategy(QFont::PreferDefault), styleHint(QFont::AnyStyle),
29946 weight(50), fixedPitch(false), style(QFont::StyleNormal), stretch(100),
29953 uint styleStrategy : 16;
29954 uint styleHint : 8;
29956 uint fixedPitch : 1;
29959 uint ignorePitch : 1;
29960 uint fixedPitchComputed : 1;
29962 bool exactMatch(const QFontDef &other) const;
29963 bool operator==(const QFontDef &other) const
29965 return pixelSize == other.pixelSize
29966 && weight == other.weight
29967 && style == other.style
29968 && stretch == other.stretch
29969 && styleHint == other.styleHint
29970 && styleStrategy == other.styleStrategy
29971 && ignorePitch == other.ignorePitch && fixedPitch == other.fixedPitch
29972 && family == other.family
29975 inline bool operator<(const QFontDef &other) const
29977 if (pixelSize != other.pixelSize) return pixelSize < other.pixelSize;
29978 if (weight != other.weight) return weight < other.weight;
29979 if (style != other.style) return style < other.style;
29980 if (stretch != other.stretch) return stretch < other.stretch;
29981 if (styleHint != other.styleHint) return styleHint < other.styleHint;
29982 if (styleStrategy != other.styleStrategy) return styleStrategy < other.styleStrategy;
29983 if (family != other.family) return family < other.family;
29984 if (ignorePitch != other.ignorePitch) return ignorePitch < other.ignorePitch;
29985 if (fixedPitch != other.fixedPitch) return fixedPitch < other.fixedPitch;
29989 class QFontEngineData
29993 ~QFontEngineData();
29995 QFontCache *fontCache;
29996 QFontEngine *engines[QUnicodeTables::ScriptCount];
29998 class __attribute__((visibility("default"))) QFontPrivate
30002 QFontPrivate(const QFontPrivate &other);
30004 QFontEngine *engineForScript(int script) const;
30005 void alterCharForCapitalization(QChar &c) const;
30008 mutable QFontEngineData *engineData;
30012 uint underline : 1;
30014 uint strikeOut : 1;
30017 bool letterSpacingIsAbsolute : 1;
30018 QFixed letterSpacing;
30019 QFixed wordSpacing;
30020 mutable QFontPrivate *scFont;
30021 QFont smallCapsFont() const { return QFont(smallCapsFontPrivate()); }
30022 QFontPrivate *smallCapsFontPrivate() const;
30023 void resolve(uint mask, const QFontPrivate *other);
30025 QFontPrivate &operator=(const QFontPrivate &) { return *this; }
30027 class QFontCache : public QObject
30029 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:
30031 static QFontCache *instance();
30032 static void cleanup();
30036 void removeEngineForFont(const QByteArray &fontName);
30038 Key() : script(0), screen(0) { }
30039 Key(const QFontDef &d, int c, int s = 0)
30040 : def(d), script(c), screen(s) { }
30044 inline bool operator<(const Key &other) const
30046 if (script != other.script) return script < other.script;
30047 if (screen != other.screen) return screen < other.screen;
30048 return def < other.def;
30050 inline bool operator==(const Key &other) const
30051 { return def == other.def && script == other.script && screen == other.screen; }
30053 typedef QMap<Key,QFontEngineData*> EngineDataCache;
30054 EngineDataCache engineDataCache;
30055 QFontEngineData *findEngineData(const Key &key) const;
30056 void insertEngineData(const Key &key, QFontEngineData *engineData);
30058 Engine() : data(0), timestamp(0), hits(0) { }
30059 Engine(QFontEngine *d) : data(d), timestamp(0), hits(0) { }
30064 typedef QMap<Key,Engine> EngineCache;
30065 EngineCache engineCache;
30066 QFontEngine *findEngine(const Key &key);
30067 void insertEngine(const Key &key, QFontEngine *engine);
30068 void cleanupPrinterFonts();
30070 void increaseCost(uint cost);
30071 void decreaseCost(uint cost);
30072 void timerEvent(QTimerEvent *event);
30073 static const uint min_cost;
30074 uint total_cost, max_cost;
30075 uint current_timestamp;
30079 typedef QtValidLicenseForGuiModule QtGuiModule;
30088 __attribute__((visibility("default"))) void qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2,
30089 const QPalette &pal, bool sunken = true,
30090 int lineWidth = 1, int midLineWidth = 0);
30091 __attribute__((visibility("default"))) void qDrawShadeLine(QPainter *p, const QPoint &p1, const QPoint &p2,
30092 const QPalette &pal, bool sunken = true,
30093 int lineWidth = 1, int midLineWidth = 0);
30094 __attribute__((visibility("default"))) void qDrawShadeRect(QPainter *p, int x, int y, int w, int h,
30095 const QPalette &pal, bool sunken = false,
30096 int lineWidth = 1, int midLineWidth = 0,
30097 const QBrush *fill = 0);
30098 __attribute__((visibility("default"))) void qDrawShadeRect(QPainter *p, const QRect &r,
30099 const QPalette &pal, bool sunken = false,
30100 int lineWidth = 1, int midLineWidth = 0,
30101 const QBrush *fill = 0);
30102 __attribute__((visibility("default"))) void qDrawShadePanel(QPainter *p, int x, int y, int w, int h,
30103 const QPalette &pal, bool sunken = false,
30104 int lineWidth = 1, const QBrush *fill = 0);
30105 __attribute__((visibility("default"))) void qDrawShadePanel(QPainter *p, const QRect &r,
30106 const QPalette &pal, bool sunken = false,
30107 int lineWidth = 1, const QBrush *fill = 0);
30108 __attribute__((visibility("default"))) void qDrawWinButton(QPainter *p, int x, int y, int w, int h,
30109 const QPalette &pal, bool sunken = false,
30110 const QBrush *fill = 0);
30111 __attribute__((visibility("default"))) void qDrawWinButton(QPainter *p, const QRect &r,
30112 const QPalette &pal, bool sunken = false,
30113 const QBrush *fill = 0);
30114 __attribute__((visibility("default"))) void qDrawWinPanel(QPainter *p, int x, int y, int w, int h,
30115 const QPalette &pal, bool sunken = false,
30116 const QBrush *fill = 0);
30117 __attribute__((visibility("default"))) void qDrawWinPanel(QPainter *p, const QRect &r,
30118 const QPalette &pal, bool sunken = false,
30119 const QBrush *fill = 0);
30120 __attribute__((visibility("default"))) void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &,
30121 int lineWidth = 1, const QBrush *fill = 0);
30122 __attribute__((visibility("default"))) void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &,
30123 int lineWidth = 1, const QBrush *fill = 0);
30124 typedef QtValidLicenseForGuiModule QtGuiModule;
30125 class __attribute__((visibility("default"))) QFontInfo
30128 QFontInfo(const QFont &);
30129 QFontInfo(const QFontInfo &);
30131 QFontInfo &operator=(const QFontInfo &);
30132 QString family() const;
30133 int pixelSize() const;
30134 int pointSize() const;
30135 qreal pointSizeF() const;
30136 bool italic() const;
30137 QFont::Style style() const;
30138 int weight() const;
30139 inline bool bold() const { return weight() > QFont::Normal; }
30140 bool underline() const;
30141 bool overline() const;
30142 bool strikeOut() const;
30143 bool fixedPitch() const;
30144 QFont::StyleHint styleHint() const;
30145 bool rawMode() const;
30146 bool exactMatch() const;
30150 typedef QtValidLicenseForGuiModule QtGuiModule;
30154 class __attribute__((visibility("default"))) QFontMetrics
30157 QFontMetrics(const QFont &);
30158 QFontMetrics(const QFont &, QPaintDevice *pd);
30159 QFontMetrics(const QFontMetrics &);
30161 QFontMetrics &operator=(const QFontMetrics &);
30162 int ascent() const;
30163 int descent() const;
30164 int height() const;
30165 int leading() const;
30166 int lineSpacing() const;
30167 int minLeftBearing() const;
30168 int minRightBearing() const;
30169 int maxWidth() const;
30170 int xHeight() const;
30171 int averageCharWidth() const;
30172 bool inFont(QChar) const;
30173 int leftBearing(QChar) const;
30174 int rightBearing(QChar) const;
30175 int width(const QString &, int len = -1) const;
30176 int width(QChar) const;
30177 int charWidth(const QString &str, int pos) const;
30178 QRect boundingRect(QChar) const;
30179 QRect boundingRect(const QString &text) const;
30180 QRect boundingRect(const QRect &r, int flags, const QString &text, int tabstops=0, int *tabarray=0) const;
30181 inline QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text,
30182 int tabstops=0, int *tabarray=0) const
30183 { return boundingRect(QRect(x, y, w, h), flags, text, tabstops, tabarray); }
30184 QSize size(int flags, const QString& str, int tabstops=0, int *tabarray=0) const;
30185 QRect tightBoundingRect(const QString &text) const;
30186 QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags = 0) const;
30187 int underlinePos() const;
30188 int overlinePos() const;
30189 int strikeOutPos() const;
30190 int lineWidth() const;
30191 bool operator==(const QFontMetrics &other);
30192 bool operator==(const QFontMetrics &other) const;
30193 inline bool operator !=(const QFontMetrics &other) { return !operator==(other); }
30194 inline bool operator !=(const QFontMetrics &other) const { return !operator==(other); }
30196 friend class QFontMetricsF;
30197 friend class QStackTextEngine;
30200 class __attribute__((visibility("default"))) QFontMetricsF
30203 QFontMetricsF(const QFont &);
30204 QFontMetricsF(const QFont &, QPaintDevice *pd);
30205 QFontMetricsF(const QFontMetrics &);
30206 QFontMetricsF(const QFontMetricsF &);
30208 QFontMetricsF &operator=(const QFontMetricsF &);
30209 QFontMetricsF &operator=(const QFontMetrics &);
30210 qreal ascent() const;
30211 qreal descent() const;
30212 qreal height() const;
30213 qreal leading() const;
30214 qreal lineSpacing() const;
30215 qreal minLeftBearing() const;
30216 qreal minRightBearing() const;
30217 qreal maxWidth() const;
30218 qreal xHeight() const;
30219 qreal averageCharWidth() const;
30220 bool inFont(QChar) const;
30221 qreal leftBearing(QChar) const;
30222 qreal rightBearing(QChar) const;
30223 qreal width(const QString &string) const;
30224 qreal width(QChar) const;
30225 QRectF boundingRect(const QString &string) const;
30226 QRectF boundingRect(QChar) const;
30227 QRectF boundingRect(const QRectF &r, int flags, const QString& string, int tabstops=0, int *tabarray=0) const;
30228 QSizeF size(int flags, const QString& str, int tabstops=0, int *tabarray=0) const;
30229 QRectF tightBoundingRect(const QString &text) const;
30230 QString elidedText(const QString &text, Qt::TextElideMode mode, qreal width, int flags = 0) const;
30231 qreal underlinePos() const;
30232 qreal overlinePos() const;
30233 qreal strikeOutPos() const;
30234 qreal lineWidth() const;
30235 bool operator==(const QFontMetricsF &other);
30236 bool operator==(const QFontMetricsF &other) const;
30237 inline bool operator !=(const QFontMetricsF &other) { return !operator==(other); }
30238 inline bool operator !=(const QFontMetricsF &other) const { return !operator==(other); }
30242 typedef QtValidLicenseForGuiModule QtGuiModule;
30245 class QFontMetrics;
30246 class QPaintDevice;
30247 class QPainterPath;
30248 class QPainterPrivate;
30254 class __attribute__((visibility("default"))) QPainter
30256 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;
30257 public: static const QMetaObject staticMetaObject; private:
30260 Antialiasing = 0x01,
30261 TextAntialiasing = 0x02,
30262 SmoothPixmapTransform = 0x04,
30263 HighQualityAntialiasing = 0x08,
30264 NonCosmeticDefaultPen = 0x10
30266 typedef QFlags<RenderHint> RenderHints;
30268 explicit QPainter(QPaintDevice *);
30270 QPaintDevice *device() const;
30271 bool begin(QPaintDevice *);
30273 bool isActive() const;
30274 void initFrom(const QWidget *widget);
30275 enum CompositionMode {
30276 CompositionMode_SourceOver,
30277 CompositionMode_DestinationOver,
30278 CompositionMode_Clear,
30279 CompositionMode_Source,
30280 CompositionMode_Destination,
30281 CompositionMode_SourceIn,
30282 CompositionMode_DestinationIn,
30283 CompositionMode_SourceOut,
30284 CompositionMode_DestinationOut,
30285 CompositionMode_SourceAtop,
30286 CompositionMode_DestinationAtop,
30287 CompositionMode_Xor,
30288 CompositionMode_Plus,
30289 CompositionMode_Multiply,
30290 CompositionMode_Screen,
30291 CompositionMode_Overlay,
30292 CompositionMode_Darken,
30293 CompositionMode_Lighten,
30294 CompositionMode_ColorDodge,
30295 CompositionMode_ColorBurn,
30296 CompositionMode_HardLight,
30297 CompositionMode_SoftLight,
30298 CompositionMode_Difference,
30299 CompositionMode_Exclusion,
30300 RasterOp_SourceOrDestination,
30301 RasterOp_SourceAndDestination,
30302 RasterOp_SourceXorDestination,
30303 RasterOp_NotSourceAndNotDestination,
30304 RasterOp_NotSourceOrNotDestination,
30305 RasterOp_NotSourceXorDestination,
30306 RasterOp_NotSource,
30307 RasterOp_NotSourceAndDestination,
30308 RasterOp_SourceAndNotDestination
30310 void setCompositionMode(CompositionMode mode);
30311 CompositionMode compositionMode() const;
30312 const QFont &font() const;
30313 void setFont(const QFont &f);
30314 QFontMetrics fontMetrics() const;
30315 QFontInfo fontInfo() const;
30316 void setPen(const QColor &color);
30317 void setPen(const QPen &pen);
30318 void setPen(Qt::PenStyle style);
30319 const QPen &pen() const;
30320 void setBrush(const QBrush &brush);
30321 void setBrush(Qt::BrushStyle style);
30322 const QBrush &brush() const;
30323 void setBackgroundMode(Qt::BGMode mode);
30324 Qt::BGMode backgroundMode() const;
30325 QPoint brushOrigin() const;
30326 inline void setBrushOrigin(int x, int y);
30327 inline void setBrushOrigin(const QPoint &);
30328 void setBrushOrigin(const QPointF &);
30329 void setBackground(const QBrush &bg);
30330 const QBrush &background() const;
30331 qreal opacity() const;
30332 void setOpacity(qreal opacity);
30333 QRegion clipRegion() const;
30334 QPainterPath clipPath() const;
30335 void setClipRect(const QRectF &, Qt::ClipOperation op = Qt::ReplaceClip);
30336 void setClipRect(const QRect &, Qt::ClipOperation op = Qt::ReplaceClip);
30337 inline void setClipRect(int x, int y, int w, int h, Qt::ClipOperation op = Qt::ReplaceClip);
30338 void setClipRegion(const QRegion &, Qt::ClipOperation op = Qt::ReplaceClip);
30339 void setClipPath(const QPainterPath &path, Qt::ClipOperation op = Qt::ReplaceClip);
30340 void setClipping(bool enable);
30341 bool hasClipping() const;
30344 void setMatrix(const QMatrix &matrix, bool combine = false);
30345 const QMatrix &matrix() const;
30346 const QMatrix &deviceMatrix() const;
30347 void resetMatrix();
30348 void setTransform(const QTransform &transform, bool combine = false);
30349 const QTransform &transform() const;
30350 const QTransform &deviceTransform() const;
30351 void resetTransform();
30352 void setWorldMatrix(const QMatrix &matrix, bool combine = false);
30353 const QMatrix &worldMatrix() const;
30354 void setWorldTransform(const QTransform &matrix, bool combine = false);
30355 const QTransform &worldTransform() const;
30356 QMatrix combinedMatrix() const;
30357 QTransform combinedTransform() const;
30358 void setMatrixEnabled(bool enabled);
30359 bool matrixEnabled() const;
30360 void setWorldMatrixEnabled(bool enabled);
30361 bool worldMatrixEnabled() const;
30362 void scale(qreal sx, qreal sy);
30363 void shear(qreal sh, qreal sv);
30364 void rotate(qreal a);
30365 void translate(const QPointF &offset);
30366 inline void translate(const QPoint &offset);
30367 inline void translate(qreal dx, qreal dy);
30368 QRect window() const;
30369 void setWindow(const QRect &window);
30370 inline void setWindow(int x, int y, int w, int h);
30371 QRect viewport() const;
30372 void setViewport(const QRect &viewport);
30373 inline void setViewport(int x, int y, int w, int h);
30374 void setViewTransformEnabled(bool enable);
30375 bool viewTransformEnabled() const;
30376 void strokePath(const QPainterPath &path, const QPen &pen);
30377 void fillPath(const QPainterPath &path, const QBrush &brush);
30378 void drawPath(const QPainterPath &path);
30379 inline void drawPoint(const QPointF &pt);
30380 inline void drawPoint(const QPoint &p);
30381 inline void drawPoint(int x, int y);
30382 void drawPoints(const QPointF *points, int pointCount);
30383 inline void drawPoints(const QPolygonF &points);
30384 void drawPoints(const QPoint *points, int pointCount);
30385 inline void drawPoints(const QPolygon &points);
30386 inline void drawLine(const QLineF &line);
30387 inline void drawLine(const QLine &line);
30388 inline void drawLine(int x1, int y1, int x2, int y2);
30389 inline void drawLine(const QPoint &p1, const QPoint &p2);
30390 inline void drawLine(const QPointF &p1, const QPointF &p2);
30391 void drawLines(const QLineF *lines, int lineCount);
30392 inline void drawLines(const QVector<QLineF> &lines);
30393 void drawLines(const QPointF *pointPairs, int lineCount);
30394 inline void drawLines(const QVector<QPointF> &pointPairs);
30395 void drawLines(const QLine *lines, int lineCount);
30396 inline void drawLines(const QVector<QLine> &lines);
30397 void drawLines(const QPoint *pointPairs, int lineCount);
30398 inline void drawLines(const QVector<QPoint> &pointPairs);
30399 inline void drawRect(const QRectF &rect);
30400 inline void drawRect(int x1, int y1, int w, int h);
30401 inline void drawRect(const QRect &rect);
30402 void drawRects(const QRectF *rects, int rectCount);
30403 inline void drawRects(const QVector<QRectF> &rectangles);
30404 void drawRects(const QRect *rects, int rectCount);
30405 inline void drawRects(const QVector<QRect> &rectangles);
30406 void drawEllipse(const QRectF &r);
30407 void drawEllipse(const QRect &r);
30408 inline void drawEllipse(int x, int y, int w, int h);
30409 inline void drawEllipse(const QPointF ¢er, qreal rx, qreal ry);
30410 inline void drawEllipse(const QPoint ¢er, int rx, int ry);
30411 void drawPolyline(const QPointF *points, int pointCount);
30412 inline void drawPolyline(const QPolygonF &polyline);
30413 void drawPolyline(const QPoint *points, int pointCount);
30414 inline void drawPolyline(const QPolygon &polygon);
30415 void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule = Qt::OddEvenFill);
30416 inline void drawPolygon(const QPolygonF &polygon, Qt::FillRule fillRule = Qt::OddEvenFill);
30417 void drawPolygon(const QPoint *points, int pointCount, Qt::FillRule fillRule = Qt::OddEvenFill);
30418 inline void drawPolygon(const QPolygon &polygon, Qt::FillRule fillRule = Qt::OddEvenFill);
30419 void drawConvexPolygon(const QPointF *points, int pointCount);
30420 inline void drawConvexPolygon(const QPolygonF &polygon);
30421 void drawConvexPolygon(const QPoint *points, int pointCount);
30422 inline void drawConvexPolygon(const QPolygon &polygon);
30423 void drawArc(const QRectF &rect, int a, int alen);
30424 inline void drawArc(const QRect &, int a, int alen);
30425 inline void drawArc(int x, int y, int w, int h, int a, int alen);
30426 void drawPie(const QRectF &rect, int a, int alen);
30427 inline void drawPie(int x, int y, int w, int h, int a, int alen);
30428 inline void drawPie(const QRect &, int a, int alen);
30429 void drawChord(const QRectF &rect, int a, int alen);
30430 inline void drawChord(int x, int y, int w, int h, int a, int alen);
30431 inline void drawChord(const QRect &, int a, int alen);
30432 void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius,
30433 Qt::SizeMode mode = Qt::AbsoluteSize);
30434 inline void drawRoundedRect(int x, int y, int w, int h, qreal xRadius, qreal yRadius,
30435 Qt::SizeMode mode = Qt::AbsoluteSize);
30436 inline void drawRoundedRect(const QRect &rect, qreal xRadius, qreal yRadius,
30437 Qt::SizeMode mode = Qt::AbsoluteSize);
30438 void drawRoundRect(const QRectF &r, int xround = 25, int yround = 25);
30439 inline void drawRoundRect(int x, int y, int w, int h, int = 25, int = 25);
30440 inline void drawRoundRect(const QRect &r, int xround = 25, int yround = 25);
30441 void drawTiledPixmap(const QRectF &rect, const QPixmap &pm, const QPointF &offset = QPointF());
30442 inline void drawTiledPixmap(int x, int y, int w, int h, const QPixmap &, int sx=0, int sy=0);
30443 inline void drawTiledPixmap(const QRect &, const QPixmap &, const QPoint & = QPoint());
30444 void drawPicture(const QPointF &p, const QPicture &picture);
30445 inline void drawPicture(int x, int y, const QPicture &picture);
30446 inline void drawPicture(const QPoint &p, const QPicture &picture);
30447 void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect);
30448 inline void drawPixmap(const QRect &targetRect, const QPixmap &pixmap, const QRect &sourceRect);
30449 inline void drawPixmap(int x, int y, int w, int h, const QPixmap &pm,
30450 int sx, int sy, int sw, int sh);
30451 inline void drawPixmap(int x, int y, const QPixmap &pm,
30452 int sx, int sy, int sw, int sh);
30453 inline void drawPixmap(const QPointF &p, const QPixmap &pm, const QRectF &sr);
30454 inline void drawPixmap(const QPoint &p, const QPixmap &pm, const QRect &sr);
30455 void drawPixmap(const QPointF &p, const QPixmap &pm);
30456 inline void drawPixmap(const QPoint &p, const QPixmap &pm);
30457 inline void drawPixmap(int x, int y, const QPixmap &pm);
30458 inline void drawPixmap(const QRect &r, const QPixmap &pm);
30459 inline void drawPixmap(int x, int y, int w, int h, const QPixmap &pm);
30460 void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect,
30461 Qt::ImageConversionFlags flags = Qt::AutoColor);
30462 inline void drawImage(const QRect &targetRect, const QImage &image, const QRect &sourceRect,
30463 Qt::ImageConversionFlags flags = Qt::AutoColor);
30464 inline void drawImage(const QPointF &p, const QImage &image, const QRectF &sr,
30465 Qt::ImageConversionFlags flags = Qt::AutoColor);
30466 inline void drawImage(const QPoint &p, const QImage &image, const QRect &sr,
30467 Qt::ImageConversionFlags flags = Qt::AutoColor);
30468 inline void drawImage(const QRectF &r, const QImage &image);
30469 inline void drawImage(const QRect &r, const QImage &image);
30470 void drawImage(const QPointF &p, const QImage &image);
30471 inline void drawImage(const QPoint &p, const QImage &image);
30472 inline void drawImage(int x, int y, const QImage &image, int sx = 0, int sy = 0,
30473 int sw = -1, int sh = -1, Qt::ImageConversionFlags flags = Qt::AutoColor);
30474 void setLayoutDirection(Qt::LayoutDirection direction);
30475 Qt::LayoutDirection layoutDirection() const;
30476 void drawText(const QPointF &p, const QString &s);
30477 inline void drawText(const QPoint &p, const QString &s);
30478 inline void drawText(int x, int y, const QString &s);
30479 void drawText(const QPointF &p, const QString &str, int tf, int justificationPadding);
30480 void drawText(const QRectF &r, int flags, const QString &text, QRectF *br=0);
30481 void drawText(const QRect &r, int flags, const QString &text, QRect *br=0);
30482 inline void drawText(int x, int y, int w, int h, int flags, const QString &text, QRect *br=0);
30483 void drawText(const QRectF &r, const QString &text, const QTextOption &o = QTextOption());
30484 QRectF boundingRect(const QRectF &rect, int flags, const QString &text);
30485 QRect boundingRect(const QRect &rect, int flags, const QString &text);
30486 inline QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text);
30487 QRectF boundingRect(const QRectF &rect, const QString &text, const QTextOption &o = QTextOption());
30488 void drawTextItem(const QPointF &p, const QTextItem &ti);
30489 inline void drawTextItem(int x, int y, const QTextItem &ti);
30490 inline void drawTextItem(const QPoint &p, const QTextItem &ti);
30491 void fillRect(const QRectF &, const QBrush &);
30492 inline void fillRect(int x, int y, int w, int h, const QBrush &);
30493 void fillRect(const QRect &, const QBrush &);
30494 void fillRect(const QRectF &, const QColor &color);
30495 inline void fillRect(int x, int y, int w, int h, const QColor &color);
30496 void fillRect(const QRect &, const QColor &color);
30497 inline void fillRect(int x, int y, int w, int h, Qt::GlobalColor c);
30498 inline void fillRect(const QRect &r, Qt::GlobalColor c);
30499 inline void fillRect(const QRectF &r, Qt::GlobalColor c);
30500 inline void fillRect(int x, int y, int w, int h, Qt::BrushStyle style);
30501 inline void fillRect(const QRect &r, Qt::BrushStyle style);
30502 inline void fillRect(const QRectF &r, Qt::BrushStyle style);
30503 void eraseRect(const QRectF &);
30504 inline void eraseRect(int x, int y, int w, int h);
30505 inline void eraseRect(const QRect &);
30506 void setRenderHint(RenderHint hint, bool on = true);
30507 void setRenderHints(RenderHints hints, bool on = true);
30508 RenderHints renderHints() const;
30509 inline bool testRenderHint(RenderHint hint) const { return renderHints() & hint; }
30510 QPaintEngine *paintEngine() const;
30511 static void setRedirected(const QPaintDevice *device, QPaintDevice *replacement,
30512 const QPoint& offset = QPoint());
30513 static QPaintDevice *redirected(const QPaintDevice *device, QPoint *offset = 0);
30514 static void restoreRedirected(const QPaintDevice *device);
30516 QPainter(const QPainter &); QPainter &operator=(const QPainter &);
30517 friend class Q3Painter;
30518 QPainterPrivate *d_ptr;
30519 friend class QFontEngine;
30520 friend class QFontEngineBox;
30521 friend class QFontEngineFT;
30522 friend class QFontEngineMac;
30523 friend class QFontEngineWin;
30524 friend class QFontEngineXLFD;
30525 friend class QWSManager;
30526 friend class QPaintEngine;
30527 friend class QOpenGLPaintEngine;
30528 friend class QX11PaintEngine;
30529 friend class QX11PaintEnginePrivate;
30530 friend class QWin32PaintEngine;
30531 friend class QWin32PaintEnginePrivate;
30532 friend class QRasterPaintEngine;
30533 friend class QAlphaPaintEngine;
30534 friend class QPreviewPaintEngine;
30536 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); }
30537 inline void QPainter::drawLine(const QLineF &l)
30541 inline void QPainter::drawLine(const QLine &line)
30543 drawLines(&line, 1);
30545 inline void QPainter::drawLine(int x1, int y1, int x2, int y2)
30547 QLine l(x1, y1, x2, y2);
30550 inline void QPainter::drawLine(const QPoint &p1, const QPoint &p2)
30555 inline void QPainter::drawLine(const QPointF &p1, const QPointF &p2)
30557 drawLine(QLineF(p1, p2));
30559 inline void QPainter::drawLines(const QVector<QLineF> &lines)
30561 drawLines(lines.constData(), lines.size());
30563 inline void QPainter::drawLines(const QVector<QLine> &lines)
30565 drawLines(lines.constData(), lines.size());
30567 inline void QPainter::drawLines(const QVector<QPointF> &pointPairs)
30569 drawLines(pointPairs.constData(), pointPairs.size() / 2);
30571 inline void QPainter::drawLines(const QVector<QPoint> &pointPairs)
30573 drawLines(pointPairs.constData(), pointPairs.size() / 2);
30575 inline void QPainter::drawPolyline(const QPolygonF &polyline)
30577 drawPolyline(polyline.constData(), polyline.size());
30579 inline void QPainter::drawPolyline(const QPolygon &polyline)
30581 drawPolyline(polyline.constData(), polyline.size());
30583 inline void QPainter::drawPolygon(const QPolygonF &polygon, Qt::FillRule fillRule)
30585 drawPolygon(polygon.constData(), polygon.size(), fillRule);
30587 inline void QPainter::drawPolygon(const QPolygon &polygon, Qt::FillRule fillRule)
30589 drawPolygon(polygon.constData(), polygon.size(), fillRule);
30591 inline void QPainter::drawConvexPolygon(const QPolygonF &poly)
30593 drawConvexPolygon(poly.constData(), poly.size());
30595 inline void QPainter::drawConvexPolygon(const QPolygon &poly)
30597 drawConvexPolygon(poly.constData(), poly.size());
30599 inline void QPainter::drawRect(const QRectF &rect)
30601 drawRects(&rect, 1);
30603 inline void QPainter::drawRect(int x, int y, int w, int h)
30605 QRect r(x, y, w, h);
30608 inline void QPainter::drawRect(const QRect &r)
30612 inline void QPainter::drawRects(const QVector<QRectF> &rects)
30614 drawRects(rects.constData(), rects.size());
30616 inline void QPainter::drawRects(const QVector<QRect> &rects)
30618 drawRects(rects.constData(), rects.size());
30620 inline void QPainter::drawPoint(const QPointF &p)
30624 inline void QPainter::drawPoint(int x, int y)
30629 inline void QPainter::drawPoint(const QPoint &p)
30633 inline void QPainter::drawPoints(const QPolygonF &points)
30635 drawPoints(points.constData(), points.size());
30637 inline void QPainter::drawPoints(const QPolygon &points)
30639 drawPoints(points.constData(), points.size());
30641 inline void QPainter::drawRoundRect(int x, int y, int w, int h, int xRnd, int yRnd)
30643 drawRoundRect(QRectF(x, y, w, h), xRnd, yRnd);
30645 inline void QPainter::drawRoundRect(const QRect &rect, int xRnd, int yRnd)
30647 drawRoundRect(QRectF(rect), xRnd, yRnd);
30649 inline void QPainter::drawRoundedRect(int x, int y, int w, int h, qreal xRadius, qreal yRadius,
30652 drawRoundedRect(QRectF(x, y, w, h), xRadius, yRadius, mode);
30654 inline void QPainter::drawRoundedRect(const QRect &rect, qreal xRadius, qreal yRadius,
30657 drawRoundedRect(QRectF(rect), xRadius, yRadius, mode);
30659 inline void QPainter::drawEllipse(int x, int y, int w, int h)
30661 drawEllipse(QRect(x, y, w, h));
30663 inline void QPainter::drawEllipse(const QPointF ¢er, qreal rx, qreal ry)
30665 drawEllipse(QRectF(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
30667 inline void QPainter::drawEllipse(const QPoint ¢er, int rx, int ry)
30669 drawEllipse(QRect(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
30671 inline void QPainter::drawArc(const QRect &r, int a, int alen)
30673 drawArc(QRectF(r), a, alen);
30675 inline void QPainter::drawArc(int x, int y, int w, int h, int a, int alen)
30677 drawArc(QRectF(x, y, w, h), a, alen);
30679 inline void QPainter::drawPie(const QRect &rect, int a, int alen)
30681 drawPie(QRectF(rect), a, alen);
30683 inline void QPainter::drawPie(int x, int y, int w, int h, int a, int alen)
30685 drawPie(QRectF(x, y, w, h), a, alen);
30687 inline void QPainter::drawChord(const QRect &rect, int a, int alen)
30689 drawChord(QRectF(rect), a, alen);
30691 inline void QPainter::drawChord(int x, int y, int w, int h, int a, int alen)
30693 drawChord(QRectF(x, y, w, h), a, alen);
30695 inline void QPainter::setClipRect(int x, int y, int w, int h, Qt::ClipOperation op)
30697 setClipRect(QRect(x, y, w, h), op);
30699 inline void QPainter::eraseRect(const QRect &rect)
30701 eraseRect(QRectF(rect));
30703 inline void QPainter::eraseRect(int x, int y, int w, int h)
30705 eraseRect(QRectF(x, y, w, h));
30707 inline void QPainter::fillRect(int x, int y, int w, int h, const QBrush &b)
30709 fillRect(QRect(x, y, w, h), b);
30711 inline void QPainter::fillRect(int x, int y, int w, int h, const QColor &b)
30713 fillRect(QRect(x, y, w, h), b);
30715 inline void QPainter::fillRect(int x, int y, int w, int h, Qt::GlobalColor c)
30717 fillRect(QRect(x, y, w, h), QColor(c));
30719 inline void QPainter::fillRect(const QRect &r, Qt::GlobalColor c)
30721 fillRect(r, QColor(c));
30723 inline void QPainter::fillRect(const QRectF &r, Qt::GlobalColor c)
30725 fillRect(r, QColor(c));
30727 inline void QPainter::fillRect(int x, int y, int w, int h, Qt::BrushStyle style)
30729 fillRect(QRectF(x, y, w, h), QBrush(style));
30731 inline void QPainter::fillRect(const QRect &r, Qt::BrushStyle style)
30733 fillRect(QRectF(r), QBrush(style));
30735 inline void QPainter::fillRect(const QRectF &r, Qt::BrushStyle style)
30737 fillRect(r, QBrush(style));
30739 inline void QPainter::setBrushOrigin(int x, int y)
30741 setBrushOrigin(QPoint(x, y));
30743 inline void QPainter::setBrushOrigin(const QPoint &p)
30745 setBrushOrigin(QPointF(p));
30747 inline void QPainter::drawTiledPixmap(const QRect &rect, const QPixmap &pm, const QPoint &offset)
30749 drawTiledPixmap(QRectF(rect), pm, QPointF(offset));
30751 inline void QPainter::drawTiledPixmap(int x, int y, int w, int h, const QPixmap &pm, int sx, int sy)
30753 drawTiledPixmap(QRectF(x, y, w, h), pm, QPointF(sx, sy));
30755 inline void QPainter::drawPixmap(const QRect &targetRect, const QPixmap &pixmap, const QRect &sourceRect)
30757 drawPixmap(QRectF(targetRect), pixmap, QRectF(sourceRect));
30759 inline void QPainter::drawPixmap(const QPoint &p, const QPixmap &pm)
30761 drawPixmap(QPointF(p), pm);
30763 inline void QPainter::drawPixmap(const QRect &r, const QPixmap &pm)
30765 drawPixmap(QRectF(r), pm, QRectF());
30767 inline void QPainter::drawPixmap(int x, int y, const QPixmap &pm)
30769 drawPixmap(QPointF(x, y), pm);
30771 inline void QPainter::drawPixmap(int x, int y, int w, int h, const QPixmap &pm)
30773 drawPixmap(QRectF(x, y, w, h), pm, QRectF());
30775 inline void QPainter::drawPixmap(int x, int y, int w, int h, const QPixmap &pm,
30776 int sx, int sy, int sw, int sh)
30778 drawPixmap(QRectF(x, y, w, h), pm, QRectF(sx, sy, sw, sh));
30780 inline void QPainter::drawPixmap(int x, int y, const QPixmap &pm,
30781 int sx, int sy, int sw, int sh)
30783 drawPixmap(QRectF(x, y, -1, -1), pm, QRectF(sx, sy, sw, sh));
30785 inline void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm, const QRectF &sr)
30787 drawPixmap(QRectF(p.x(), p.y(), -1, -1), pm, sr);
30789 inline void QPainter::drawPixmap(const QPoint &p, const QPixmap &pm, const QRect &sr)
30791 drawPixmap(QRectF(p.x(), p.y(), -1, -1), pm, sr);
30793 inline void QPainter::drawTextItem(int x, int y, const QTextItem &ti)
30795 drawTextItem(QPointF(x, y), ti);
30797 inline void QPainter::drawImage(const QRect &targetRect, const QImage &image, const QRect &sourceRect,
30798 Qt::ImageConversionFlags flags)
30800 drawImage(QRectF(targetRect), image, QRectF(sourceRect), flags);
30802 inline void QPainter::drawImage(const QPointF &p, const QImage &image, const QRectF &sr,
30803 Qt::ImageConversionFlags flags)
30805 drawImage(QRectF(p.x(), p.y(), -1, -1), image, sr, flags);
30807 inline void QPainter::drawImage(const QPoint &p, const QImage &image, const QRect &sr,
30808 Qt::ImageConversionFlags flags)
30810 drawImage(QRect(p.x(), p.y(), -1, -1), image, sr, flags);
30812 inline void QPainter::drawImage(const QRectF &r, const QImage &image)
30814 drawImage(r, image, QRect(0, 0, image.width(), image.height()));
30816 inline void QPainter::drawImage(const QRect &r, const QImage &image)
30818 drawImage(r, image, QRectF(0, 0, image.width(), image.height()));
30820 inline void QPainter::drawImage(const QPoint &p, const QImage &image)
30822 drawImage(QPointF(p), image);
30824 inline void QPainter::drawImage(int x, int y, const QImage &image, int sx, int sy, int sw, int sh,
30825 Qt::ImageConversionFlags flags)
30827 if (sx == 0 && sy == 0 && sw == -1 && sh == -1 && flags == Qt::AutoColor)
30828 drawImage(QPointF(x, y), image);
30830 drawImage(QRectF(x, y, -1, -1), image, QRectF(sx, sy, sw, sh), flags);
30832 inline void QPainter::drawTextItem(const QPoint &p, const QTextItem &ti)
30834 drawTextItem(QPointF(p), ti);
30836 inline void QPainter::drawText(const QPoint &p, const QString &s)
30838 drawText(QPointF(p), s);
30840 inline void QPainter::drawText(int x, int y, int w, int h, int flags, const QString &str, QRect *br)
30842 drawText(QRect(x, y, w, h), flags, str, br);
30844 inline void QPainter::drawText(int x, int y, const QString &s)
30846 drawText(QPointF(x, y), s);
30848 inline QRect QPainter::boundingRect(int x, int y, int w, int h, int flags, const QString &text)
30850 return boundingRect(QRect(x, y, w, h), flags, text);
30852 inline void QPainter::translate(qreal dx, qreal dy)
30854 translate(QPointF(dx, dy));
30856 inline void QPainter::translate(const QPoint &offset)
30858 translate(offset.x(), offset.y());
30860 inline void QPainter::setViewport(int x, int y, int w, int h)
30862 setViewport(QRect(x, y, w, h));
30864 inline void QPainter::setWindow(int x, int y, int w, int h)
30866 setWindow(QRect(x, y, w, h));
30868 inline void QPainter::drawPicture(int x, int y, const QPicture &p)
30870 drawPicture(QPoint(x, y), p);
30872 inline void QPainter::drawPicture(const QPoint &pt, const QPicture &p)
30874 drawPicture(QPointF(pt), p);
30876 typedef QtValidLicenseForGuiModule QtGuiModule;
30879 class QPaintDevice;
30880 class QPaintEnginePrivate;
30881 class QPainterPath;
30885 struct QGlyphLayout;
30886 class QTextItemInt;
30887 class QPaintEngineState;
30888 class __attribute__((visibility("default"))) QTextItem {
30897 typedef QFlags<RenderFlag> RenderFlags;
30898 qreal descent() const;
30899 qreal ascent() const;
30900 qreal width() const;
30901 RenderFlags renderFlags() const;
30902 QString text() const;
30903 QFont font() const;
30905 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"; } };
30906 class __attribute__((visibility("default"))) QPaintEngine
30908 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;
30910 enum PaintEngineFeature {
30911 PrimitiveTransform = 0x00000001,
30912 PatternTransform = 0x00000002,
30913 PixmapTransform = 0x00000004,
30914 PatternBrush = 0x00000008,
30915 LinearGradientFill = 0x00000010,
30916 RadialGradientFill = 0x00000020,
30917 ConicalGradientFill = 0x00000040,
30918 AlphaBlend = 0x00000080,
30919 PorterDuff = 0x00000100,
30920 PainterPaths = 0x00000200,
30921 Antialiasing = 0x00000400,
30922 BrushStroke = 0x00000800,
30923 ConstantOpacity = 0x00001000,
30924 MaskedBrush = 0x00002000,
30925 PerspectiveTransform = 0x00004000,
30926 BlendModes = 0x00008000,
30927 ObjectBoundingModeGradients = 0x00010000,
30928 RasterOpModes = 0x00020000,
30929 PaintOutsidePaintEvent = 0x20000000,
30930 AllFeatures = 0xffffffff
30932 typedef QFlags<PaintEngineFeature> PaintEngineFeatures;
30935 DirtyBrush = 0x0002,
30936 DirtyBrushOrigin = 0x0004,
30937 DirtyFont = 0x0008,
30938 DirtyBackground = 0x0010,
30939 DirtyBackgroundMode = 0x0020,
30940 DirtyTransform = 0x0040,
30941 DirtyClipRegion = 0x0080,
30942 DirtyClipPath = 0x0100,
30943 DirtyHints = 0x0200,
30944 DirtyCompositionMode = 0x0400,
30945 DirtyClipEnabled = 0x0800,
30946 DirtyOpacity = 0x1000,
30949 typedef QFlags<DirtyFlag> DirtyFlags;
30950 enum PolygonDrawMode {
30956 explicit QPaintEngine(PaintEngineFeatures features=0);
30957 virtual ~QPaintEngine();
30958 bool isActive() const { return active; }
30959 void setActive(bool newState) { active = newState; }
30960 virtual bool begin(QPaintDevice *pdev) = 0;
30961 virtual bool end() = 0;
30962 virtual void updateState(const QPaintEngineState &state) = 0;
30963 virtual void drawRects(const QRect *rects, int rectCount);
30964 virtual void drawRects(const QRectF *rects, int rectCount);
30965 virtual void drawLines(const QLine *lines, int lineCount);
30966 virtual void drawLines(const QLineF *lines, int lineCount);
30967 virtual void drawEllipse(const QRectF &r);
30968 virtual void drawEllipse(const QRect &r);
30969 virtual void drawPath(const QPainterPath &path);
30970 virtual void drawPoints(const QPointF *points, int pointCount);
30971 virtual void drawPoints(const QPoint *points, int pointCount);
30972 virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
30973 virtual void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode);
30974 virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) = 0;
30975 virtual void drawTextItem(const QPointF &p, const QTextItem &textItem);
30976 virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
30977 virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
30978 Qt::ImageConversionFlags flags = Qt::AutoColor);
30979 void setPaintDevice(QPaintDevice *device);
30980 QPaintDevice *paintDevice() const;
30981 void setSystemClip(const QRegion &baseClip);
30982 QRegion systemClip() const;
30983 void setSystemRect(const QRect &rect);
30984 QRect systemRect() const;
30985 virtual QPoint coordinateOffset() const;
30989 QuickDraw, CoreGraphics, MacPrinter,
31002 virtual Type type() const = 0;
31003 inline void fix_neg_rect(int *x, int *y, int *w, int *h);
31004 inline bool testDirty(DirtyFlags df);
31005 inline void setDirty(DirtyFlags df);
31006 inline void clearDirty(DirtyFlags df);
31007 bool hasFeature(PaintEngineFeatures feature) const { return (gccaps & feature) != 0; }
31008 QPainter *painter() const;
31010 inline bool isExtended() const { return extended; }
31012 QPaintEngine(QPaintEnginePrivate &data, PaintEngineFeatures devcaps=0);
31013 QPaintEngineState *state;
31014 PaintEngineFeatures gccaps;
31016 uint selfDestruct : 1;
31018 QPaintEnginePrivate *d_ptr;
31020 void setAutoDestruct(bool autoDestr) { selfDestruct = autoDestr; }
31021 bool autoDestruct() const { return selfDestruct; }
31022 QPaintEngine(const QPaintEngine &); QPaintEngine &operator=(const QPaintEngine &);
31023 friend class QFontEngineBox;
31024 friend class QFontEngineMac;
31025 friend class QFontEngineWin;
31026 friend class QFontEngineQPF1;
31027 friend class QFontEngineQPF;
31028 friend class QPSPrintEngine;
31029 friend class QMacPrintEngine;
31030 friend class QMacPrintEnginePrivate;
31031 friend class QtopiaPrintEngine;
31032 friend class QtopiaPrintEnginePrivate;
31033 friend class QProxyFontEngine;
31034 friend class QPainter;
31035 friend class QPainterPrivate;
31036 friend class QWidget;
31037 friend class QWidgetPrivate;
31038 friend class QWin32PaintEngine;
31039 friend class QWin32PaintEnginePrivate;
31040 friend class QMacCGContext;
31041 friend class QPreviewPaintEngine;
31043 class __attribute__((visibility("default"))) QPaintEngineState
31046 QPaintEngine::DirtyFlags state() const { return dirtyFlags; }
31048 QBrush brush() const;
31049 QPointF brushOrigin() const;
31050 QBrush backgroundBrush() const;
31051 Qt::BGMode backgroundMode() const;
31052 QFont font() const;
31053 QMatrix matrix() const;
31054 QTransform transform() const;
31055 Qt::ClipOperation clipOperation() const;
31056 QRegion clipRegion() const;
31057 QPainterPath clipPath() const;
31058 bool isClipEnabled() const;
31059 QPainter::RenderHints renderHints() const;
31060 QPainter::CompositionMode compositionMode() const;
31061 qreal opacity() const;
31062 QPainter *painter() const;
31063 bool brushNeedsResolving() const;
31064 bool penNeedsResolving() const;
31066 friend class QPaintEngine;
31067 friend class QRasterPaintEngine;
31068 friend class QWidget;
31069 friend class QPainter;
31070 friend class QPainterPrivate;
31071 friend class QMacPrintEnginePrivate;
31072 QPaintEngine::DirtyFlags dirtyFlags;
31074 inline void QPaintEngine::fix_neg_rect(int *x, int *y, int *w, int *h)
31085 inline bool QPaintEngine::testDirty(DirtyFlags df) {
31087 return ((state->dirtyFlags & df) != 0);
31089 inline void QPaintEngine::setDirty(DirtyFlags df) {
31091 state->dirtyFlags |= df;
31093 inline void QPaintEngine::clearDirty(DirtyFlags df)
31096 state->dirtyFlags &= ~static_cast<uint>(df);
31098 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); }
31099 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); }
31100 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); }
31101 typedef QtValidLicenseForGuiModule QtGuiModule;
31102 class QTextObjectPrivate;
31103 class QTextDocument;
31104 class QTextDocumentPrivate;
31107 class QTextFragment;
31110 class __attribute__((visibility("default"))) QTextObject : public QObject
31112 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:
31114 explicit QTextObject(QTextDocument *doc);
31116 void setFormat(const QTextFormat &format);
31118 QTextFormat format() const;
31119 int formatIndex() const;
31120 QTextDocument *document() const;
31121 int objectIndex() const;
31122 QTextDocumentPrivate *docHandle() const;
31124 QTextObject(QTextObjectPrivate &p, QTextDocument *doc);
31126 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;
31127 QTextObject(const QTextObject &); QTextObject &operator=(const QTextObject &);
31128 friend class QTextDocumentPrivate;
31130 class QTextBlockGroupPrivate;
31131 class __attribute__((visibility("default"))) QTextBlockGroup : public QTextObject
31133 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:
31135 explicit QTextBlockGroup(QTextDocument *doc);
31136 ~QTextBlockGroup();
31137 virtual void blockInserted(const QTextBlock &block);
31138 virtual void blockRemoved(const QTextBlock &block);
31139 virtual void blockFormatChanged(const QTextBlock &block);
31140 QList<QTextBlock> blockList() const;
31142 QTextBlockGroup(QTextBlockGroupPrivate &p, QTextDocument *doc);
31144 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;
31145 QTextBlockGroup(const QTextBlockGroup &); QTextBlockGroup &operator=(const QTextBlockGroup &);
31146 friend class QTextDocumentPrivate;
31148 class __attribute__((visibility("default"))) QTextFrameLayoutData {
31150 virtual ~QTextFrameLayoutData();
31152 class QTextFramePrivate;
31153 class __attribute__((visibility("default"))) QTextFrame : public QTextObject
31155 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:
31157 explicit QTextFrame(QTextDocument *doc);
31159 inline void setFrameFormat(const QTextFrameFormat &format);
31160 QTextFrameFormat frameFormat() const { return QTextObject::format().toFrameFormat(); }
31161 QTextCursor firstCursorPosition() const;
31162 QTextCursor lastCursorPosition() const;
31163 int firstPosition() const;
31164 int lastPosition() const;
31165 QTextFrameLayoutData *layoutData() const;
31166 void setLayoutData(QTextFrameLayoutData *data);
31167 QList<QTextFrame *> childFrames() const;
31168 QTextFrame *parentFrame() const;
31169 class __attribute__((visibility("default"))) iterator {
31175 friend class QTextFrame;
31176 friend class QTextTableCell;
31177 friend class QTextDocumentLayoutPrivate;
31178 iterator(QTextFrame *frame, int block, int begin, int end);
31181 iterator(const iterator &o);
31182 iterator &operator=(const iterator &o);
31183 QTextFrame *parentFrame() const { return f; }
31184 QTextFrame *currentFrame() const;
31185 QTextBlock currentBlock() const;
31186 bool atEnd() const { return !cf && cb == e; }
31187 inline bool operator==(const iterator &o) const { return f == o.f && cf == o.cf && cb == o.cb; }
31188 inline bool operator!=(const iterator &o) const { return f != o.f || cf != o.cf || cb != o.cb; }
31189 iterator &operator++();
31190 inline iterator operator++(int) { iterator tmp = *this; operator++(); return tmp; }
31191 iterator &operator--();
31192 inline iterator operator--(int) { iterator tmp = *this; operator--(); return tmp; }
31194 friend class iterator;
31195 typedef iterator Iterator;
31196 iterator begin() const;
31197 iterator end() const;
31199 QTextFrame(QTextFramePrivate &p, QTextDocument *doc);
31201 friend class QTextDocumentPrivate;
31202 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;
31203 QTextFrame(const QTextFrame &); QTextFrame &operator=(const QTextFrame &);
31205 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"; } };
31206 inline void QTextFrame::setFrameFormat(const QTextFrameFormat &aformat)
31207 { QTextObject::setFormat(aformat); }
31208 class __attribute__((visibility("default"))) QTextBlockUserData {
31210 virtual ~QTextBlockUserData();
31212 class __attribute__((visibility("default"))) QTextBlock
31214 friend class QSyntaxHighlighter;
31216 inline QTextBlock(QTextDocumentPrivate *priv, int b) : p(priv), n(b) {}
31217 inline QTextBlock() : p(0), n(0) {}
31218 inline QTextBlock(const QTextBlock &o) : p(o.p), n(o.n) {}
31219 inline QTextBlock &operator=(const QTextBlock &o) { p = o.p; n = o.n; return *this; }
31220 inline bool isValid() const { return p != 0 && n != 0; }
31221 inline bool operator==(const QTextBlock &o) const { return p == o.p && n == o.n; }
31222 inline bool operator!=(const QTextBlock &o) const { return p != o.p || n != o.n; }
31223 inline bool operator<(const QTextBlock &o) const { return position() < o.position(); }
31224 int position() const;
31225 int length() const;
31226 bool contains(int position) const;
31227 QTextLayout *layout() const;
31228 void clearLayout();
31229 QTextBlockFormat blockFormat() const;
31230 int blockFormatIndex() const;
31231 QTextCharFormat charFormat() const;
31232 int charFormatIndex() const;
31233 QString text() const;
31234 const QTextDocument *document() const;
31235 QTextList *textList() const;
31236 QTextBlockUserData *userData() const;
31237 void setUserData(QTextBlockUserData *data);
31238 int userState() const;
31239 void setUserState(int state);
31240 int revision() const;
31241 void setRevision(int rev);
31242 bool isVisible() const;
31243 void setVisible(bool visible);
31244 int blockNumber() const;
31245 int firstLineNumber() const;
31246 void setLineCount(int count);
31247 int lineCount() const;
31248 class __attribute__((visibility("default"))) iterator {
31249 const QTextDocumentPrivate *p;
31253 friend class QTextBlock;
31254 iterator(const QTextDocumentPrivate *priv, int begin, int end, int f) : p(priv), b(begin), e(end), n(f) {}
31256 iterator() : p(0), b(0), e(0), n(0) {}
31257 iterator(const iterator &o) : p(o.p), b(o.b), e(o.e), n(o.n) {}
31258 QTextFragment fragment() const;
31259 bool atEnd() const { return n == e; }
31260 inline bool operator==(const iterator &o) const { return p == o.p && n == o.n; }
31261 inline bool operator!=(const iterator &o) const { return p != o.p || n != o.n; }
31262 iterator &operator++();
31263 inline iterator operator++(int) { iterator tmp = *this; operator++(); return tmp; }
31264 iterator &operator--();
31265 inline iterator operator--(int) { iterator tmp = *this; operator--(); return tmp; }
31267 typedef iterator Iterator;
31268 iterator begin() const;
31269 iterator end() const;
31270 QTextBlock next() const;
31271 QTextBlock previous() const;
31272 inline QTextDocumentPrivate *docHandle() const { return p; }
31273 inline int fragmentIndex() const { return n; }
31275 QTextDocumentPrivate *p;
31277 friend class QTextDocumentPrivate;
31278 friend class QTextLayout;
31280 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"; } };
31281 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"; } };
31282 class __attribute__((visibility("default"))) QTextFragment
31285 inline QTextFragment(const QTextDocumentPrivate *priv, int f, int fe) : p(priv), n(f), ne(fe) {}
31286 inline QTextFragment() : p(0), n(0), ne(0) {}
31287 inline QTextFragment(const QTextFragment &o) : p(o.p), n(o.n), ne(o.ne) {}
31288 inline QTextFragment &operator=(const QTextFragment &o) { p = o.p; n = o.n; ne = o.ne; return *this; }
31289 inline bool isValid() const { return p && n; }
31290 inline bool operator==(const QTextFragment &o) const { return p == o.p && n == o.n; }
31291 inline bool operator!=(const QTextFragment &o) const { return p != o.p || n != o.n; }
31292 inline bool operator<(const QTextFragment &o) const { return position() < o.position(); }
31293 int position() const;
31294 int length() const;
31295 bool contains(int position) const;
31296 QTextCharFormat charFormat() const;
31297 int charFormatIndex() const;
31298 QString text() const;
31300 const QTextDocumentPrivate *p;
31304 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"; } };
31305 typedef QtValidLicenseForCoreModule QtCoreModule;
31311 inline QPointer() : o(0) {}
31312 inline QPointer(T *p) : o(p)
31313 { QMetaObject::addGuard(&o); }
31314 inline QPointer(const QPointer<T> &p) : o(p.o)
31315 { QMetaObject::addGuard(&o); }
31317 { QMetaObject::removeGuard(&o); }
31318 inline QPointer<T> &operator=(const QPointer<T> &p)
31319 { if (this != &p) QMetaObject::changeGuard(&o, p.o); return *this; }
31320 inline QPointer<T> &operator=(T* p)
31321 { if (o != p) QMetaObject::changeGuard(&o, p); return *this; }
31322 inline bool isNull() const
31324 inline T* operator->() const
31325 { return static_cast<T*>(const_cast<QObject*>(o)); }
31326 inline T& operator*() const
31327 { return *static_cast<T*>(const_cast<QObject*>(o)); }
31328 inline operator T*() const
31329 { return static_cast<T*>(const_cast<QObject*>(o)); }
31330 inline T* data() const
31331 { return static_cast<T*>(const_cast<QObject*>(o)); }
31334 inline bool operator==(const T *o, const QPointer<T> &p)
31335 { return o == p.operator->(); }
31337 inline bool operator==(const QPointer<T> &p, const T *o)
31338 { return p.operator->() == o; }
31340 inline bool operator==(T *o, const QPointer<T> &p)
31341 { return o == p.operator->(); }
31343 inline bool operator==(const QPointer<T> &p, T *o)
31344 { return p.operator->() == o; }
31346 inline bool operator==(const QPointer<T> &p1, const QPointer<T> &p2)
31347 { return p1.operator->() == p2.operator->(); }
31349 inline bool operator!=(const T *o, const QPointer<T> &p)
31350 { return o != p.operator->(); }
31352 inline bool operator!= (const QPointer<T> &p, const T *o)
31353 { return p.operator->() != o; }
31355 inline bool operator!=(T *o, const QPointer<T> &p)
31356 { return o != p.operator->(); }
31358 inline bool operator!= (const QPointer<T> &p, T *o)
31359 { return p.operator->() != o; }
31361 inline bool operator!= (const QPointer<T> &p1, const QPointer<T> &p2)
31362 { return p1.operator->() != p2.operator->() ; }
31363 typedef QtValidLicenseForCoreModule QtCoreModule;
31364 struct QReadWriteLockPrivate;
31365 class __attribute__((visibility("default"))) QReadWriteLock
31368 enum RecursionMode { NonRecursive, Recursive };
31370 QReadWriteLock(RecursionMode recursionMode);
31372 void lockForRead();
31373 bool tryLockForRead();
31374 bool tryLockForRead(int timeout);
31375 void lockForWrite();
31376 bool tryLockForWrite();
31377 bool tryLockForWrite(int timeout);
31380 QReadWriteLock(const QReadWriteLock &); QReadWriteLock &operator=(const QReadWriteLock &);
31381 QReadWriteLockPrivate *d;
31382 friend class QWaitCondition;
31384 class __attribute__((visibility("default"))) QReadLocker
31387 inline QReadLocker(QReadWriteLock *readWriteLock);
31388 inline ~QReadLocker()
31390 inline void unlock()
31393 if ((q_val & quintptr(1u)) == quintptr(1u)) {
31394 q_val &= ~quintptr(1u);
31399 inline void relock()
31402 if ((q_val & quintptr(1u)) == quintptr(0u)) {
31403 q_lock->lockForRead();
31404 q_val |= quintptr(1u);
31408 inline QReadWriteLock *readWriteLock() const
31409 { return reinterpret_cast<QReadWriteLock *>(q_val & ~quintptr(1u)); }
31411 QReadLocker(const QReadLocker &); QReadLocker &operator=(const QReadLocker &);
31413 QReadWriteLock *q_lock;
31417 inline QReadLocker::QReadLocker(QReadWriteLock *areadWriteLock)
31418 : q_lock(areadWriteLock)
31423 class __attribute__((visibility("default"))) QWriteLocker
31426 inline QWriteLocker(QReadWriteLock *readWriteLock);
31427 inline ~QWriteLocker()
31429 inline void unlock()
31432 if ((q_val & quintptr(1u)) == quintptr(1u)) {
31433 q_val &= ~quintptr(1u);
31438 inline void relock()
31441 if ((q_val & quintptr(1u)) == quintptr(0u)) {
31442 q_lock->lockForWrite();
31443 q_val |= quintptr(1u);
31447 inline QReadWriteLock *readWriteLock() const
31448 { return reinterpret_cast<QReadWriteLock *>(q_val & ~quintptr(1u)); }
31450 QWriteLocker(const QWriteLocker &); QWriteLocker &operator=(const QWriteLocker &);
31452 QReadWriteLock *q_lock;
31456 inline QWriteLocker::QWriteLocker(QReadWriteLock *areadWriteLock)
31457 : q_lock(areadWriteLock)
31464 class QObjectConnectionListVector;
31465 struct QSignalSpyCallbackSet
31467 typedef void (*BeginCallback)(QObject *caller, int method_index, void **argv);
31468 typedef void (*EndCallback)(QObject *caller, int method_index);
31469 BeginCallback signal_begin_callback,
31470 slot_begin_callback;
31471 EndCallback signal_end_callback,
31474 void __attribute__((visibility("default"))) qt_register_signal_spy_callbacks(const QSignalSpyCallbackSet &callback_set);
31475 extern QSignalSpyCallbackSet __attribute__((visibility("default"))) qt_signal_spy_callback_set;
31476 inline QObjectData::~QObjectData() {}
31477 enum { QObjectPrivateVersion = 0x040501 };
31478 class __attribute__((visibility("default"))) QObjectPrivate : public QObjectData
31480 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;
31482 QObjectPrivate(int version = QObjectPrivateVersion);
31483 virtual ~QObjectPrivate();
31484 QList<QObject *> unused;
31485 QThreadData *threadData;
31486 void moveToThread_helper();
31487 void setThreadData_helper(QThreadData *currentData, QThreadData *targetData);
31488 void _q_reregisterTimers(void *pointer);
31495 Sender *currentSender;
31496 QObject *currentChildBeingDeleted;
31497 bool isSender(const QObject *receiver, const char *signal) const;
31498 QObjectList receiverList(const char *signal) const;
31499 QObjectList senderList() const;
31500 QList<QPointer<QObject> > eventFilters;
31501 void setParent_helper(QObject *);
31502 void deleteChildren();
31503 static void clearGuards(QObject *);
31506 QVector<QObjectUserData *> userData;
31507 QList<QByteArray> propertyNames;
31508 QList<QVariant> propertyValues;
31510 ExtraData *extraData;
31511 mutable quint32 connectedSignals;
31512 QString objectName;
31517 uint connectionType : 3;
31518 QBasicAtomicPointer<int> argumentTypes;
31520 typedef QList<Connection> ConnectionList;
31521 QObjectConnectionListVector *connectionLists;
31522 void addConnection(int signal, Connection *c);
31523 void removeReceiver(int signal, QObject *receiver);
31524 void cleanConnectionLists();
31525 QList<Sender> senders;
31526 void refSender(QObject *sender, int signal);
31527 void derefSender(QObject *sender, int signal);
31528 void removeSender(QObject *sender, int signal);
31529 static Sender *setCurrentSender(QObject *receiver,
31531 static void resetCurrentSender(QObject *receiver,
31532 Sender *currentSender,
31533 Sender *previousSender);
31534 static int *setDeleteWatch(QObjectPrivate *d, int *newWatch);
31535 static void resetDeleteWatch(QObjectPrivate *d, int *oldWatch, int deleteWatch);
31537 static QObjectPrivate *get(QObject *o) {
31538 return o->d_func();
31541 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"; } };
31542 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"; } };
31544 class __attribute__((visibility("default"))) QMetaCallEvent : public QEvent
31547 QMetaCallEvent(int id, const QObject *sender, int signalId,
31548 int nargs = 0, int *types = 0, void **args = 0, QSemaphore *semaphore = 0);
31550 inline int id() const { return id_; }
31551 inline const QObject *sender() const { return sender_; }
31552 inline int signalId() const { return signalId_; }
31553 inline void **args() const { return args_; }
31554 virtual int placeMetaCall(QObject *object);
31557 const QObject *sender_;
31562 QSemaphore *semaphore_;
31564 class __attribute__((visibility("default"))) QBoolBlocker
31567 inline QBoolBlocker(bool &b, bool value=true):block(b), reset(b){block = value;}
31568 inline ~QBoolBlocker(){block = reset; }
31573 void __attribute__((visibility("default"))) qDeleteInEventHandler(QObject *o);
31574 int __attribute__((visibility("default"))) qAllocMore(int alloc, int extra);
31575 template <int N = 1>
31583 quint32 size_left_array[N];
31584 quint32 size_array[N];
31585 enum {size_array_max = N };
31587 template <class Fragment>
31588 class QFragmentMapData
31590 enum Color { Red, Black };
31592 QFragmentMapData();
31593 ~QFragmentMapData();
31601 quint32 node_count;
31604 enum {fragmentSize = sizeof(Fragment) };
31605 int length(uint field = 0) const;
31606 inline Fragment *fragment(uint index) {
31607 return (fragments + index);
31609 inline const Fragment *fragment(uint index) const {
31610 return (fragments + index);
31612 inline Fragment &F(uint index) { return fragments[index] ; }
31613 inline const Fragment &F(uint index) const { return fragments[index] ; }
31614 inline bool isRoot(uint index) const {
31615 return !fragment(index)->parent;
31617 inline uint position(uint node, uint field = 0) const {
31619 const Fragment *f = fragment(node);
31620 uint offset = f->size_left_array[field];
31621 while (f->parent) {
31622 uint p = f->parent;
31624 if (f->right == node)
31625 offset += f->size_left_array[field] + f->size_array[field];
31630 inline uint sizeRight(uint node, uint field = 0) const {
31633 const Fragment *f = fragment(node);
31636 f = fragment(node);
31637 sr += f->size_left_array[field] + f->size_array[field];
31642 inline uint sizeLeft(uint node, uint field = 0) const {
31644 return fragment(node)->size_left_array[field];
31646 inline uint size(uint node, uint field = 0) const {
31648 return fragment(node)->size_array[field];
31650 inline void setSize(uint node, int new_size, uint field = 0) {
31652 Fragment *f = fragment(node);
31653 int diff = new_size - f->size_array[field];
31654 f->size_array[field] = new_size;
31655 while (f->parent) {
31656 uint p = f->parent;
31658 if (f->left == node)
31659 f->size_left_array[field] += diff;
31663 uint findNode(int k, uint field = 0) const;
31664 uint insert_single(int key, uint length);
31665 uint erase_single(uint f);
31666 uint minimum(uint n) const {
31667 while (n && fragment(n)->left)
31668 n = fragment(n)->left;
31671 uint maximum(uint n) const {
31672 while (n && fragment(n)->right)
31673 n = fragment(n)->right;
31676 uint next(uint n) const;
31677 uint previous(uint n) const;
31678 inline uint root() const {
31682 inline void setRoot(uint new_root) {
31684 head->root = new_root;
31688 Fragment *fragments;
31691 void rotateLeft(uint x);
31692 void rotateRight(uint x);
31693 void rebalance(uint x);
31694 void removeAndRebalance(uint z);
31695 uint createFragment();
31696 void freeFragment(uint f);
31698 template <class Fragment>
31699 QFragmentMapData<Fragment>::QFragmentMapData()
31703 template <class Fragment>
31704 void QFragmentMapData<Fragment>::init()
31706 fragments = (Fragment *)malloc(64*fragmentSize);
31707 head->tag = (((quint32)'p') << 24) | (((quint32)'m') << 16) | (((quint32)'a') << 8) | 'p';
31709 head->freelist = 1;
31710 head->node_count = 0;
31711 head->allocated = 64;
31712 F(head->freelist).right = 0;
31714 template <class Fragment>
31715 QFragmentMapData<Fragment>::~QFragmentMapData()
31719 template <class Fragment>
31720 uint QFragmentMapData<Fragment>::createFragment()
31723 uint freePos = head->freelist;
31724 if (freePos == head->allocated) {
31725 uint needed = qAllocMore((freePos+1)*fragmentSize, 0);
31727 fragments = (Fragment *)realloc(fragments, needed);
31728 head->allocated = needed/fragmentSize;
31729 F(freePos).right = 0;
31731 uint nextPos = F(freePos).right;
31733 nextPos = freePos+1;
31734 if (nextPos < head->allocated)
31735 F(nextPos).right = 0;
31737 head->freelist = nextPos;
31738 ++head->node_count;
31741 template <class Fragment>
31742 void QFragmentMapData<Fragment>::freeFragment(uint i)
31744 F(i).right = head->freelist;
31745 head->freelist = i;
31746 --head->node_count;
31748 template <class Fragment>
31749 uint QFragmentMapData<Fragment>::next(uint n) const {
31756 uint y = F(n).parent;
31757 while (F(n).parent && n == F(y).right) {
31765 template <class Fragment>
31766 uint QFragmentMapData<Fragment>::previous(uint n) const {
31768 return maximum(root());
31774 uint y = F(n).parent;
31775 while (F(n).parent && n == F(y).left) {
31783 template <class Fragment>
31784 void QFragmentMapData<Fragment>::rotateLeft(uint x)
31786 uint p = F(x).parent;
31787 uint y = F(x).right;
31789 F(x).right = F(y).left;
31791 F(F(y).left).parent = x;
31801 else if (x == F(p).left)
31806 for (uint field = 0; field < Fragment::size_array_max; ++field)
31807 F(y).size_left_array[field] += F(x).size_left_array[field] + F(x).size_array[field];
31809 template <class Fragment>
31810 void QFragmentMapData<Fragment>::rotateRight(uint x)
31812 uint y = F(x).left;
31813 uint p = F(x).parent;
31815 F(x).left = F(y).right;
31817 F(F(y).right).parent = x;
31827 else if (x == F(p).right)
31832 for (uint field = 0; field < Fragment::size_array_max; ++field)
31833 F(x).size_left_array[field] -= F(y).size_left_array[field] + F(y).size_array[field];
31835 template <class Fragment>
31836 void QFragmentMapData<Fragment>::rebalance(uint x)
31839 while (F(x).parent && F(F(x).parent).color == Red) {
31840 uint p = F(x).parent;
31841 uint pp = F(p).parent;
31843 if (p == F(pp).left) {
31844 uint y = F(pp).right;
31845 if (y && F(y).color == Red) {
31846 F(p).color = Black;
31847 F(y).color = Black;
31851 if (x == F(p).right) {
31857 F(p).color = Black;
31864 uint y = F(pp).left;
31865 if (y && F(y).color == Red) {
31866 F(p).color = Black;
31867 F(y).color = Black;
31871 if (x == F(p).left) {
31877 F(p).color = Black;
31885 F(root()).color = Black;
31887 template <class Fragment>
31888 uint QFragmentMapData<Fragment>::erase_single(uint z)
31890 uint w = previous(z);
31896 } else if (!F(y).right) {
31905 F(F(z).left).parent = y;
31906 F(y).left = F(z).left;
31907 for (uint field = 0; field < Fragment::size_array_max; ++field)
31908 F(y).size_left_array[field] = F(z).size_left_array[field];
31909 if (y != F(z).right) {
31914 F(y).right = F(z).right;
31915 F(F(z).right).parent = y;
31918 for (uint field = 0; field < Fragment::size_array_max; ++field)
31919 F(n).size_left_array[field] -= F(y).size_array[field];
31925 uint zp = F(z).parent;
31929 } else if (F(zp).left == z) {
31931 for (uint field = 0; field < Fragment::size_array_max; ++field)
31932 F(zp).size_left_array[field] -= F(z).size_array[field];
31937 uint c = F(y).color;
31938 F(y).color = F(z).color;
31948 } else if (F(p).left == z) {
31950 for (uint field = 0; field < Fragment::size_array_max; ++field)
31951 F(p).size_left_array[field] -= F(z).size_array[field];
31957 while (F(n).parent) {
31958 uint p = F(n).parent;
31959 if (F(p).left == n) {
31960 for (uint field = 0; field < Fragment::size_array_max; ++field)
31961 F(p).size_left_array[field] -= F(z).size_array[field];
31966 if (F(y).color != Red) {
31967 while (F(x).parent && (x == 0 || F(x).color == Black)) {
31968 if (x == F(p).left) {
31969 uint w = F(p).right;
31970 if (F(w).color == Red) {
31971 F(w).color = Black;
31976 if ((F(w).left == 0 || F(F(w).left).color == Black) &&
31977 (F(w).right == 0 || F(F(w).right).color == Black)) {
31982 if (F(w).right == 0 || F(F(w).right).color == Black) {
31984 F(F(w).left).color = Black;
31986 rotateRight(F(p).right);
31989 F(w).color = F(p).color;
31990 F(p).color = Black;
31992 F(F(w).right).color = Black;
31997 uint w = F(p).left;
31998 if (F(w).color == Red) {
31999 F(w).color = Black;
32004 if ((F(w).right == 0 || F(F(w).right).color == Black) &&
32005 (F(w).left == 0 || F(F(w).left).color == Black)) {
32010 if (F(w).left == 0 || F(F(w).left).color == Black) {
32012 F(F(w).right).color = Black;
32014 rotateLeft(F(p).left);
32017 F(w).color = F(p).color;
32018 F(p).color = Black;
32020 F(F(w).left).color = Black;
32027 F(x).color = Black;
32031 template <class Fragment>
32032 uint QFragmentMapData<Fragment>::findNode(int k, uint field) const
32038 if (sizeLeft(x, field) <= s) {
32039 if (s < sizeLeft(x, field) + size(x, field))
32041 s -= sizeLeft(x, field) + size(x, field);
32049 template <class Fragment>
32050 uint QFragmentMapData<Fragment>::insert_single(int key, uint length)
32053 uint z = createFragment();
32056 F(z).size_array[0] = length;
32057 for (uint field = 1; field < Fragment::size_array_max; ++field)
32058 F(z).size_array[field] = 1;
32059 for (uint field = 0; field < Fragment::size_array_max; ++field)
32060 F(z).size_left_array[field] = 0;
32065 bool right = false;
32068 if (s <= F(x).size_left_array[0]) {
32072 s -= F(x).size_left_array[0] + F(x).size_array[0];
32080 } else if (!right) {
32082 for (uint field = 0; field < Fragment::size_array_max; ++field)
32083 F(y).size_left_array[field] = F(z).size_array[field];
32087 while (y && F(y).parent) {
32088 uint p = F(y).parent;
32089 if (F(p).left == y) {
32090 for (uint field = 0; field < Fragment::size_array_max; ++field)
32091 F(p).size_left_array[field] += F(z).size_array[field];
32098 template <class Fragment>
32099 int QFragmentMapData<Fragment>::length(uint field) const {
32100 uint root = this->root();
32101 return root ? sizeLeft(root, field) + size(root, field) + sizeRight(root, field) : 0;
32103 template <class Fragment>
32112 Iterator() : pt(0), n(0) {}
32113 Iterator(QFragmentMap *p, int node) : pt(p), n(node) {}
32114 Iterator(const Iterator& it) : pt(it.pt), n(it.n) {}
32115 inline bool atEnd() const { return !n; }
32116 bool operator==(const Iterator& it) const { return pt == it.pt && n == it.n; }
32117 bool operator!=(const Iterator& it) const { return pt != it.pt || n != it.n; }
32118 bool operator<(const Iterator &it) const { return position() < it.position(); }
32119 Fragment *operator*() { qt_noop(); return pt->fragment(n); }
32120 const Fragment *operator*() const { qt_noop(); return pt->fragment(n); }
32121 Fragment *operator->() { qt_noop(); return pt->fragment(n); }
32122 const Fragment *operator->() const { qt_noop(); return pt->fragment(n); }
32123 int position() const { qt_noop(); return pt->data.position(n); }
32124 const Fragment *value() const { qt_noop(); return pt->fragment(n); }
32125 Fragment *value() { qt_noop(); return pt->fragment(n); }
32126 Iterator& operator++() {
32127 n = pt->data.next(n);
32130 Iterator& operator--() {
32131 n = pt->data.previous(n);
32135 class ConstIterator
32138 const QFragmentMap *pt;
32140 ConstIterator() : pt(0), n(0) {}
32141 ConstIterator(const QFragmentMap *p, int node) : pt(p), n(node) {}
32142 ConstIterator(const ConstIterator& it) : pt(it.pt), n(it.n) {}
32143 ConstIterator(const Iterator& it) : pt(it.pt), n(it.n) {}
32144 inline bool atEnd() const { return !n; }
32145 bool operator==(const ConstIterator& it) const { return pt == it.pt && n == it.n; }
32146 bool operator!=(const ConstIterator& it) const { return pt != it.pt || n != it.n; }
32147 bool operator<(const ConstIterator &it) const { return position() < it.position(); }
32148 const Fragment *operator*() const { qt_noop(); return pt->fragment(n); }
32149 const Fragment *operator->() const { qt_noop(); return pt->fragment(n); }
32150 int position() const { qt_noop(); return pt->data.position(n); }
32151 int size() const { qt_noop(); return pt->data.size(n); }
32152 const Fragment *value() const { qt_noop(); return pt->fragment(n); }
32153 ConstIterator& operator++() {
32154 n = pt->data.next(n);
32157 ConstIterator& operator--() {
32158 n = pt->data.previous(n);
32165 for (Iterator it = begin(); !it.atEnd(); ++it)
32166 it.value()->free();
32168 inline void clear() {
32169 for (Iterator it = begin(); !it.atEnd(); ++it)
32170 it.value()->free();
32174 inline Iterator begin() { return Iterator(this, data.minimum(data.root())); }
32175 inline Iterator end() { return Iterator(this, 0); }
32176 inline ConstIterator begin() const { return ConstIterator(this, data.minimum(data.root())); }
32177 inline ConstIterator end() const { return ConstIterator(this, 0); }
32178 inline ConstIterator last() const { return ConstIterator(this, data.maximum(data.root())); }
32179 inline bool isEmpty() const { return data.head->node_count == 0; }
32180 inline int numNodes() const { return data.head->node_count; }
32181 int length(uint field = 0) const { return data.length(field); }
32182 Iterator find(int k, uint field = 0) { return Iterator(this, data.findNode(k, field)); }
32183 ConstIterator find(int k, uint field = 0) const { return ConstIterator(this, data.findNode(k, field)); }
32184 uint findNode(int k, uint field = 0) const { return data.findNode(k, field); }
32185 uint insert_single(int key, uint length)
32187 uint f = data.insert_single(key, length);
32189 Fragment *frag = fragment(f);
32191 frag->initialize();
32195 uint erase_single(uint f)
32198 Fragment *frag = fragment(f);
32202 return data.erase_single(f);
32204 inline Fragment *fragment(uint index) {
32206 return data.fragment(index);
32208 inline const Fragment *fragment(uint index) const {
32210 return data.fragment(index);
32212 inline uint position(uint node, uint field = 0) const { return data.position(node, field); }
32213 inline uint next(uint n) const { return data.next(n); }
32214 inline uint previous(uint n) const { return data.previous(n); }
32215 inline uint size(uint node, uint field = 0) const { return data.size(node, field); }
32216 inline void setSize(uint node, int new_size, uint field = 0)
32217 { data.setSize(node, new_size, field);
32218 if (node != 0 && field == 0) {
32219 Fragment *frag = fragment(node);
32221 frag->invalidate();
32224 inline int firstNode() const { return data.minimum(data.root()); }
32226 friend class Iterator;
32227 friend class ConstIterator;
32228 QFragmentMapData<Fragment> data;
32229 QFragmentMap(const QFragmentMap& m);
32230 QFragmentMap& operator= (const QFragmentMap& m);
32232 typedef QtValidLicenseForGuiModule QtGuiModule;
32233 class QTextFormatCollection;
32234 class QTextListFormat;
32238 class QAbstractTextDocumentLayout;
32250 template<typename T> class QVector;
32253 enum HitTestAccuracy { ExactHit, FuzzyHit };
32254 enum WhiteSpaceMode {
32258 WhiteSpaceModeUndefined = -1
32260 __attribute__((visibility("default"))) bool mightBeRichText(const QString&);
32261 __attribute__((visibility("default"))) QString escape(const QString& plain);
32262 __attribute__((visibility("default"))) QString convertFromPlainText(const QString &plain, WhiteSpaceMode mode = WhiteSpacePre);
32263 __attribute__((visibility("default"))) QTextCodec *codecForHtml(const QByteArray &ba);
32265 class __attribute__((visibility("default"))) QAbstractUndoItem
32268 virtual ~QAbstractUndoItem() = 0;
32269 virtual void undo() = 0;
32270 virtual void redo() = 0;
32272 inline QAbstractUndoItem::~QAbstractUndoItem()
32275 class QTextDocumentPrivate;
32276 class __attribute__((visibility("default"))) QTextDocument : public QObject
32278 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:
32280 explicit QTextDocument(QObject *parent = 0);
32281 explicit QTextDocument(const QString &text, QObject *parent = 0);
32283 QTextDocument *clone(QObject *parent = 0) const;
32284 bool isEmpty() const;
32285 virtual void clear();
32286 void setUndoRedoEnabled(bool enable);
32287 bool isUndoRedoEnabled() const;
32288 bool isUndoAvailable() const;
32289 bool isRedoAvailable() const;
32290 int revision() const;
32291 void setDocumentLayout(QAbstractTextDocumentLayout *layout);
32292 QAbstractTextDocumentLayout *documentLayout() const;
32293 enum MetaInformation {
32297 void setMetaInformation(MetaInformation info, const QString &);
32298 QString metaInformation(MetaInformation info) const;
32299 QString toHtml(const QByteArray &encoding = QByteArray()) const;
32300 void setHtml(const QString &html);
32301 QString toPlainText() const;
32302 void setPlainText(const QString &text);
32303 QChar characterAt(int pos) const;
32306 FindBackward = 0x00001,
32307 FindCaseSensitively = 0x00002,
32308 FindWholeWords = 0x00004
32310 typedef QFlags<FindFlag> FindFlags;
32311 QTextCursor find(const QString &subString, int from = 0, FindFlags options = 0) const;
32312 QTextCursor find(const QString &subString, const QTextCursor &from, FindFlags options = 0) const;
32313 QTextCursor find(const QRegExp &expr, int from = 0, FindFlags options = 0) const;
32314 QTextCursor find(const QRegExp &expr, const QTextCursor &from, FindFlags options = 0) const;
32315 QTextFrame *frameAt(int pos) const;
32316 QTextFrame *rootFrame() const;
32317 QTextObject *object(int objectIndex) const;
32318 QTextObject *objectForFormat(const QTextFormat &) const;
32319 QTextBlock findBlock(int pos) const;
32320 QTextBlock findBlockByNumber(int blockNumber) const;
32321 QTextBlock findBlockByLineNumber(int blockNumber) const;
32322 QTextBlock begin() const;
32323 QTextBlock end() const;
32324 QTextBlock firstBlock() const;
32325 QTextBlock lastBlock() const;
32326 void setPageSize(const QSizeF &size);
32327 QSizeF pageSize() const;
32328 void setDefaultFont(const QFont &font);
32329 QFont defaultFont() const;
32330 int pageCount() const;
32331 bool isModified() const;
32332 void print(QPrinter *printer) const;
32333 enum ResourceType {
32336 StyleSheetResource = 3,
32339 QVariant resource(int type, const QUrl &name) const;
32340 void addResource(int type, const QUrl &name, const QVariant &resource);
32341 QVector<QTextFormat> allFormats() const;
32342 void markContentsDirty(int from, int length);
32343 void setUseDesignMetrics(bool b);
32344 bool useDesignMetrics() const;
32345 void drawContents(QPainter *painter, const QRectF &rect = QRectF());
32346 void setTextWidth(qreal width);
32347 qreal textWidth() const;
32348 qreal idealWidth() const;
32349 qreal indentWidth() const;
32350 void setIndentWidth(qreal width);
32351 qreal documentMargin() const;
32352 void setDocumentMargin(qreal margin);
32354 QSizeF size() const;
32355 int blockCount() const;
32356 int lineCount() const;
32357 int characterCount() const;
32358 void setDefaultStyleSheet(const QString &sheet);
32359 QString defaultStyleSheet() const;
32360 void undo(QTextCursor *cursor);
32361 void redo(QTextCursor *cursor);
32362 int maximumBlockCount() const;
32363 void setMaximumBlockCount(int maximum);
32364 QTextOption defaultTextOption() const;
32365 void setDefaultTextOption(const QTextOption &option);
32367 void contentsChange(int from, int charsRemoves, int charsAdded);
32368 void contentsChanged();
32369 void undoAvailable(bool);
32370 void redoAvailable(bool);
32371 void undoCommandAdded();
32372 void modificationChanged(bool m);
32373 void cursorPositionChanged(const QTextCursor &cursor);
32374 void blockCountChanged(int newBlockCount);
32375 void documentLayoutChanged();
32379 void appendUndoItem(QAbstractUndoItem *);
32380 void setModified(bool m = true);
32382 virtual QTextObject *createObject(const QTextFormat &f);
32383 virtual QVariant loadResource(int type, const QUrl &name);
32384 QTextDocument(QTextDocumentPrivate &dd, QObject *parent);
32386 QTextDocumentPrivate *docHandle() const;
32388 QTextDocument(const QTextDocument &); QTextDocument &operator=(const QTextDocument &);
32389 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;
32390 friend class QTextObjectPrivate;
32392 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); }
32393 typedef QtValidLicenseForCoreModule QtCoreModule;
32396 class __attribute__((visibility("default"))) QUrl
32403 enum FormattingOption {
32405 RemoveScheme = 0x1,
32406 RemovePassword = 0x2,
32407 RemoveUserInfo = RemovePassword | 0x4,
32409 RemoveAuthority = RemoveUserInfo | RemovePort | 0x10,
32411 RemoveQuery = 0x40,
32412 RemoveFragment = 0x80,
32413 StripTrailingSlash = 0x10000
32415 typedef QFlags<FormattingOption> FormattingOptions;
32417 QUrl(const QString &url);
32418 QUrl(const QString &url, ParsingMode mode);
32419 QUrl(const QUrl ©);
32420 QUrl &operator =(const QUrl ©);
32421 QUrl &operator =(const QString &url);
32423 void setUrl(const QString &url);
32424 void setUrl(const QString &url, ParsingMode mode);
32425 void setEncodedUrl(const QByteArray &url);
32426 void setEncodedUrl(const QByteArray &url, ParsingMode mode);
32427 bool isValid() const;
32428 bool isEmpty() const;
32430 void setScheme(const QString &scheme);
32431 QString scheme() const;
32432 void setAuthority(const QString &authority);
32433 QString authority() const;
32434 void setUserInfo(const QString &userInfo);
32435 QString userInfo() const;
32436 void setUserName(const QString &userName);
32437 QString userName() const;
32438 void setEncodedUserName(const QByteArray &userName);
32439 QByteArray encodedUserName() const;
32440 void setPassword(const QString &password);
32441 QString password() const;
32442 void setEncodedPassword(const QByteArray &password);
32443 QByteArray encodedPassword() const;
32444 void setHost(const QString &host);
32445 QString host() const;
32446 void setEncodedHost(const QByteArray &host);
32447 QByteArray encodedHost() const;
32448 void setPort(int port);
32450 int port(int defaultPort) const;
32451 void setPath(const QString &path);
32452 QString path() const;
32453 void setEncodedPath(const QByteArray &path);
32454 QByteArray encodedPath() const;
32455 bool hasQuery() const;
32456 void setEncodedQuery(const QByteArray &query);
32457 QByteArray encodedQuery() const;
32458 void setQueryDelimiters(char valueDelimiter, char pairDelimiter);
32459 char queryValueDelimiter() const;
32460 char queryPairDelimiter() const;
32461 void setQueryItems(const QList<QPair<QString, QString> > &query);
32462 void addQueryItem(const QString &key, const QString &value);
32463 QList<QPair<QString, QString> > queryItems() const;
32464 bool hasQueryItem(const QString &key) const;
32465 QString queryItemValue(const QString &key) const;
32466 QStringList allQueryItemValues(const QString &key) const;
32467 void removeQueryItem(const QString &key);
32468 void removeAllQueryItems(const QString &key);
32469 void setEncodedQueryItems(const QList<QPair<QByteArray, QByteArray> > &query);
32470 void addEncodedQueryItem(const QByteArray &key, const QByteArray &value);
32471 QList<QPair<QByteArray, QByteArray> > encodedQueryItems() const;
32472 bool hasEncodedQueryItem(const QByteArray &key) const;
32473 QByteArray encodedQueryItemValue(const QByteArray &key) const;
32474 QList<QByteArray> allEncodedQueryItemValues(const QByteArray &key) const;
32475 void removeEncodedQueryItem(const QByteArray &key);
32476 void removeAllEncodedQueryItems(const QByteArray &key);
32477 void setFragment(const QString &fragment);
32478 QString fragment() const;
32479 void setEncodedFragment(const QByteArray &fragment);
32480 QByteArray encodedFragment() const;
32481 bool hasFragment() const;
32482 QUrl resolved(const QUrl &relative) const;
32483 bool isRelative() const;
32484 bool isParentOf(const QUrl &url) const;
32485 static QUrl fromLocalFile(const QString &localfile);
32486 QString toLocalFile() const;
32487 QString toString(FormattingOptions options = None) const;
32488 QByteArray toEncoded(FormattingOptions options = None) const;
32489 static QUrl fromEncoded(const QByteArray &url);
32490 static QUrl fromEncoded(const QByteArray &url, ParsingMode mode);
32492 bool isDetached() const;
32493 bool operator <(const QUrl &url) const;
32494 bool operator ==(const QUrl &url) const;
32495 bool operator !=(const QUrl &url) const;
32496 static QString fromPercentEncoding(const QByteArray &);
32497 static QByteArray toPercentEncoding(const QString &,
32498 const QByteArray &exclude = QByteArray(),
32499 const QByteArray &include = QByteArray());
32500 static QString fromPunycode(const QByteArray &);
32501 static QByteArray toPunycode(const QString &);
32502 static QString fromAce(const QByteArray &);
32503 static QByteArray toAce(const QString &);
32504 static QStringList idnWhitelist();
32505 static void setIdnWhitelist(const QStringList &);
32506 QString errorString() const;
32511 typedef QUrlPrivate * DataPtr;
32512 inline DataPtr &data_ptr() { return d; }
32514 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"; } };
32515 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; }
32516 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); }
32517 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QUrl &);
32518 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QUrl &);
32519 __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QUrl &);
32520 typedef QtValidLicenseForGuiModule QtGuiModule;
32521 class QPalettePrivate;
32523 class __attribute__((visibility("default"))) QPalette
32525 public: static const QMetaObject staticMetaObject; private:
32528 QPalette(const QColor &button);
32529 QPalette(Qt::GlobalColor button);
32530 QPalette(const QColor &button, const QColor &window);
32531 QPalette(const QBrush &windowText, const QBrush &button, const QBrush &light,
32532 const QBrush &dark, const QBrush &mid, const QBrush &text,
32533 const QBrush &bright_text, const QBrush &base, const QBrush &window);
32534 QPalette(const QColor &windowText, const QColor &window, const QColor &light,
32535 const QColor &dark, const QColor &mid, const QColor &text, const QColor &base);
32536 QPalette(const QPalette &palette);
32538 QPalette &operator=(const QPalette &palette);
32539 operator QVariant() const;
32540 enum ColorGroup { Active, Disabled, Inactive, NColorGroups, Current, All, Normal = Active };
32541 enum ColorRole { WindowText, Button, Light, Midlight, Dark, Mid,
32542 Text, BrightText, ButtonText, Base, Window, Shadow,
32543 Highlight, HighlightedText,
32547 ToolTipBase, ToolTipText,
32548 NColorRoles = ToolTipText + 1,
32549 Foreground = WindowText, Background = Window
32551 inline ColorGroup currentColorGroup() const { return static_cast<ColorGroup>(current_group); }
32552 inline void setCurrentColorGroup(ColorGroup cg) { current_group = cg; }
32553 inline const QColor &color(ColorGroup cg, ColorRole cr) const
32554 { return brush(cg, cr).color(); }
32555 const QBrush &brush(ColorGroup cg, ColorRole cr) const;
32556 inline void setColor(ColorGroup cg, ColorRole cr, const QColor &color);
32557 inline void setColor(ColorRole cr, const QColor &color);
32558 inline void setBrush(ColorRole cr, const QBrush &brush);
32559 bool isBrushSet(ColorGroup cg, ColorRole cr) const;
32560 void setBrush(ColorGroup cg, ColorRole cr, const QBrush &brush);
32561 void setColorGroup(ColorGroup cr, const QBrush &windowText, const QBrush &button,
32562 const QBrush &light, const QBrush &dark, const QBrush &mid,
32563 const QBrush &text, const QBrush &bright_text, const QBrush &base,
32564 const QBrush &window);
32565 bool isEqual(ColorGroup cr1, ColorGroup cr2) const;
32566 inline const QColor &color(ColorRole cr) const { return color(Current, cr); }
32567 inline const QBrush &brush(ColorRole cr) const { return brush(Current, cr); }
32568 inline const QBrush &foreground() const { return brush(WindowText); }
32569 inline const QBrush &windowText() const { return brush(WindowText); }
32570 inline const QBrush &button() const { return brush(Button); }
32571 inline const QBrush &light() const { return brush(Light); }
32572 inline const QBrush &dark() const { return brush(Dark); }
32573 inline const QBrush &mid() const { return brush(Mid); }
32574 inline const QBrush &text() const { return brush(Text); }
32575 inline const QBrush &base() const { return brush(Base); }
32576 inline const QBrush &alternateBase() const { return brush(AlternateBase); }
32577 inline const QBrush &toolTipBase() const { return brush(ToolTipBase); }
32578 inline const QBrush &toolTipText() const { return brush(ToolTipText); }
32579 inline const QBrush &background() const { return brush(Window); }
32580 inline const QBrush &window() const { return brush(Window); }
32581 inline const QBrush &midlight() const { return brush(Midlight); }
32582 inline const QBrush &brightText() const { return brush(BrightText); }
32583 inline const QBrush &buttonText() const { return brush(ButtonText); }
32584 inline const QBrush &shadow() const { return brush(Shadow); }
32585 inline const QBrush &highlight() const { return brush(Highlight); }
32586 inline const QBrush &highlightedText() const { return brush(HighlightedText); }
32587 inline const QBrush &link() const { return brush(Link); }
32588 inline const QBrush &linkVisited() const { return brush(LinkVisited); }
32589 bool operator==(const QPalette &p) const;
32590 inline bool operator!=(const QPalette &p) const { return !(operator==(p)); }
32591 bool isCopyOf(const QPalette &p) const;
32592 int serialNumber() const;
32593 qint64 cacheKey() const;
32594 QPalette resolve(const QPalette &) const;
32595 inline uint resolve() const { return resolve_mask; }
32596 inline void resolve(uint mask) { resolve_mask = mask; }
32598 void setColorGroup(ColorGroup cr, const QBrush &windowText, const QBrush &button,
32599 const QBrush &light, const QBrush &dark, const QBrush &mid,
32600 const QBrush &text, const QBrush &bright_text,
32601 const QBrush &base, const QBrush &alternate_base,
32602 const QBrush &window, const QBrush &midlight,
32603 const QBrush &button_text, const QBrush &shadow,
32604 const QBrush &highlight, const QBrush &highlighted_text,
32605 const QBrush &link, const QBrush &link_visited);
32606 void setColorGroup(ColorGroup cr, const QBrush &windowText, const QBrush &button,
32607 const QBrush &light, const QBrush &dark, const QBrush &mid,
32608 const QBrush &text, const QBrush &bright_text,
32609 const QBrush &base, const QBrush &alternate_base,
32610 const QBrush &window, const QBrush &midlight,
32611 const QBrush &button_text, const QBrush &shadow,
32612 const QBrush &highlight, const QBrush &highlighted_text,
32613 const QBrush &link, const QBrush &link_visited,
32614 const QBrush &toolTipBase, const QBrush &toolTipText);
32617 QPalettePrivate *d;
32618 uint current_group : 4;
32619 uint resolve_mask : 28;
32620 friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &s, const QPalette &p);
32622 inline void QPalette::setColor(ColorGroup acg, ColorRole acr,
32623 const QColor &acolor)
32624 { setBrush(acg, acr, QBrush(acolor)); }
32625 inline void QPalette::setColor(ColorRole acr, const QColor &acolor)
32626 { setColor(All, acr, acolor); }
32627 inline void QPalette::setBrush(ColorRole acr, const QBrush &abrush)
32628 { setBrush(All, acr, abrush); }
32629 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &ds, const QPalette &p);
32630 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &ds, QPalette &p);
32631 typedef QtValidLicenseForGuiModule QtGuiModule;
32632 class QIconPrivate;
32634 class QIconEngineV2;
32635 class __attribute__((visibility("default"))) QIcon
32638 enum Mode { Normal, Disabled, Active, Selected };
32639 enum State { On, Off };
32641 QIcon(const QPixmap &pixmap);
32642 QIcon(const QIcon &other);
32643 explicit QIcon(const QString &fileName);
32644 explicit QIcon(QIconEngine *engine);
32645 explicit QIcon(QIconEngineV2 *engine);
32647 QIcon &operator=(const QIcon &other);
32648 operator QVariant() const;
32649 QPixmap pixmap(const QSize &size, Mode mode = Normal, State state = Off) const;
32650 inline QPixmap pixmap(int w, int h, Mode mode = Normal, State state = Off) const
32651 { return pixmap(QSize(w, h), mode, state); }
32652 inline QPixmap pixmap(int extent, Mode mode = Normal, State state = Off) const
32653 { return pixmap(QSize(extent, extent), mode, state); }
32654 QSize actualSize(const QSize &size, Mode mode = Normal, State state = Off) const;
32655 void paint(QPainter *painter, const QRect &rect, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off) const;
32656 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
32657 { paint(painter, QRect(x, y, w, h), alignment, mode, state); }
32658 bool isNull() const;
32659 bool isDetached() const;
32661 int serialNumber() const;
32662 qint64 cacheKey() const;
32663 void addPixmap(const QPixmap &pixmap, Mode mode = Normal, State state = Off);
32664 void addFile(const QString &fileName, const QSize &size = QSize(), Mode mode = Normal, State state = Off);
32665 QList<QSize> availableSizes(Mode mode = Normal, State state = Off) const;
32668 friend __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QIcon &);
32669 friend __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QIcon &);
32671 typedef QIconPrivate * DataPtr;
32672 inline DataPtr &data_ptr() { return d; }
32674 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; }
32675 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"; } };
32676 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QIcon &);
32677 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QIcon &);
32702 TextUnderlineStyle,
32705 QtSelectionForeground,
32706 QtSelectionBackground,
32719 QtAlternateBackground,
32735 BorderTopLeftRadius,
32736 BorderTopRightRadius,
32737 BorderBottomLeftRadius,
32738 BorderBottomRightRadius,
32744 BackgroundPosition,
32745 BackgroundAttachment,
32775 OutlineTopLeftRadius,
32776 OutlineTopRightRadius,
32777 OutlineBottomLeftRadius,
32778 OutlineBottomRightRadius,
32833 Value_FirstColorRole,
32834 Value_WindowText = Value_FirstColorRole,
32847 Value_HighlightedText,
32850 Value_AlternateBase,
32851 Value_LastColorRole = Value_AlternateBase,
32860 BorderStyle_Unknown,
32862 BorderStyle_Dotted,
32863 BorderStyle_Dashed,
32865 BorderStyle_Double,
32866 BorderStyle_DotDash,
32867 BorderStyle_DotDotDash,
32868 BorderStyle_Groove,
32871 BorderStyle_Outset,
32872 BorderStyle_Native,
32873 NumKnownBorderStyles
32911 enum PositionMode {
32912 PositionMode_Unknown,
32913 PositionMode_Static,
32914 PositionMode_Relative,
32915 PositionMode_Absolute,
32916 PositionMode_Fixed,
32917 NumKnownPositionModes
32920 Attachment_Unknown,
32923 NumKnownAttachments
32925 enum StyleFeature {
32926 StyleFeature_None = 0,
32927 StyleFeature_BackgroundColor = 1,
32928 StyleFeature_BackgroundGradient = 2,
32929 NumKnownStyleFeatures = 4
32931 struct __attribute__((visibility("default"))) Value
32947 inline Value() : type(Unknown) { }
32950 QString toString() const;
32953 ColorData() : type(Invalid) {}
32954 ColorData(const QColor &col) : color(col) , type(Color) {}
32955 ColorData(QPalette::ColorRole r) : role(r) , type(Role) {}
32957 QPalette::ColorRole role;
32958 enum { Invalid, Color, Role} type;
32961 BrushData() : type(Invalid) {}
32962 BrushData(const QBrush &br) : brush(br) , type(Brush) {}
32963 BrushData(QPalette::ColorRole r) : role(r) , type(Role) {}
32965 QPalette::ColorRole role;
32966 enum { Invalid, Brush, Role, DependsOnThePalette } type;
32968 struct BackgroundData {
32972 Qt::Alignment alignment;
32974 struct LengthData {
32976 enum { None, Px, Ex, Em } unit;
32978 struct BorderData {
32983 struct __attribute__((visibility("default"))) Declaration
32985 struct DeclarationData : public QSharedData
32987 inline DeclarationData() : propertyId(UnknownProperty), important(false) {}
32989 Property propertyId;
32990 QVector<Value> values;
32994 QExplicitlySharedDataPointer<DeclarationData> d;
32995 inline Declaration() : d(new DeclarationData()) {}
32996 inline bool isEmpty() const { return d->property.isEmpty() && d->propertyId == UnknownProperty; }
32997 QColor colorValue(const QPalette & = QPalette()) const;
32998 void colorValues(QColor *c, const QPalette & = QPalette()) const;
32999 QBrush brushValue(const QPalette & = QPalette()) const;
33000 void brushValues(QBrush *c, const QPalette & = QPalette()) const;
33001 BorderStyle styleValue() const;
33002 void styleValues(BorderStyle *s) const;
33003 Origin originValue() const;
33004 Repeat repeatValue() const;
33005 Qt::Alignment alignmentValue() const;
33006 PositionMode positionValue() const;
33007 Attachment attachmentValue() const;
33008 int styleFeaturesValue() const;
33009 bool intValue(int *i, const char *unit = 0) const;
33010 bool realValue(qreal *r, const char *unit = 0) const;
33011 QSize sizeValue() const;
33012 QRect rectValue() const;
33013 QString uriValue() const;
33014 QIcon iconValue() const;
33015 void borderImageValue(QString *image, int *cuts, TileMode *h, TileMode *v) const;
33017 const quint64 PseudoClass_Unknown = static_cast<unsigned long long>(0x0000000000000000ULL);
33018 const quint64 PseudoClass_Enabled = static_cast<unsigned long long>(0x0000000000000001ULL);
33019 const quint64 PseudoClass_Disabled = static_cast<unsigned long long>(0x0000000000000002ULL);
33020 const quint64 PseudoClass_Pressed = static_cast<unsigned long long>(0x0000000000000004ULL);
33021 const quint64 PseudoClass_Focus = static_cast<unsigned long long>(0x0000000000000008ULL);
33022 const quint64 PseudoClass_Hover = static_cast<unsigned long long>(0x0000000000000010ULL);
33023 const quint64 PseudoClass_Checked = static_cast<unsigned long long>(0x0000000000000020ULL);
33024 const quint64 PseudoClass_Unchecked = static_cast<unsigned long long>(0x0000000000000040ULL);
33025 const quint64 PseudoClass_Indeterminate = static_cast<unsigned long long>(0x0000000000000080ULL);
33026 const quint64 PseudoClass_Unspecified = static_cast<unsigned long long>(0x0000000000000100ULL);
33027 const quint64 PseudoClass_Selected = static_cast<unsigned long long>(0x0000000000000200ULL);
33028 const quint64 PseudoClass_Horizontal = static_cast<unsigned long long>(0x0000000000000400ULL);
33029 const quint64 PseudoClass_Vertical = static_cast<unsigned long long>(0x0000000000000800ULL);
33030 const quint64 PseudoClass_Window = static_cast<unsigned long long>(0x0000000000001000ULL);
33031 const quint64 PseudoClass_Children = static_cast<unsigned long long>(0x0000000000002000ULL);
33032 const quint64 PseudoClass_Sibling = static_cast<unsigned long long>(0x0000000000004000ULL);
33033 const quint64 PseudoClass_Default = static_cast<unsigned long long>(0x0000000000008000ULL);
33034 const quint64 PseudoClass_First = static_cast<unsigned long long>(0x0000000000010000ULL);
33035 const quint64 PseudoClass_Last = static_cast<unsigned long long>(0x0000000000020000ULL);
33036 const quint64 PseudoClass_Middle = static_cast<unsigned long long>(0x0000000000040000ULL);
33037 const quint64 PseudoClass_OnlyOne = static_cast<unsigned long long>(0x0000000000080000ULL);
33038 const quint64 PseudoClass_PreviousSelected = static_cast<unsigned long long>(0x0000000000100000ULL);
33039 const quint64 PseudoClass_NextSelected = static_cast<unsigned long long>(0x0000000000200000ULL);
33040 const quint64 PseudoClass_Flat = static_cast<unsigned long long>(0x0000000000400000ULL);
33041 const quint64 PseudoClass_Left = static_cast<unsigned long long>(0x0000000000800000ULL);
33042 const quint64 PseudoClass_Right = static_cast<unsigned long long>(0x0000000001000000ULL);
33043 const quint64 PseudoClass_Top = static_cast<unsigned long long>(0x0000000002000000ULL);
33044 const quint64 PseudoClass_Bottom = static_cast<unsigned long long>(0x0000000004000000ULL);
33045 const quint64 PseudoClass_Exclusive = static_cast<unsigned long long>(0x0000000008000000ULL);
33046 const quint64 PseudoClass_NonExclusive = static_cast<unsigned long long>(0x0000000010000000ULL);
33047 const quint64 PseudoClass_Frameless = static_cast<unsigned long long>(0x0000000020000000ULL);
33048 const quint64 PseudoClass_ReadOnly = static_cast<unsigned long long>(0x0000000040000000ULL);
33049 const quint64 PseudoClass_Active = static_cast<unsigned long long>(0x0000000080000000ULL);
33050 const quint64 PseudoClass_Closable = static_cast<unsigned long long>(0x0000000100000000ULL);
33051 const quint64 PseudoClass_Movable = static_cast<unsigned long long>(0x0000000200000000ULL);
33052 const quint64 PseudoClass_Floatable = static_cast<unsigned long long>(0x0000000400000000ULL);
33053 const quint64 PseudoClass_Minimized = static_cast<unsigned long long>(0x0000000800000000ULL);
33054 const quint64 PseudoClass_Maximized = static_cast<unsigned long long>(0x0000001000000000ULL);
33055 const quint64 PseudoClass_On = static_cast<unsigned long long>(0x0000002000000000ULL);
33056 const quint64 PseudoClass_Off = static_cast<unsigned long long>(0x0000004000000000ULL);
33057 const quint64 PseudoClass_Editable = static_cast<unsigned long long>(0x0000008000000000ULL);
33058 const quint64 PseudoClass_Item = static_cast<unsigned long long>(0x0000010000000000ULL);
33059 const quint64 PseudoClass_Closed = static_cast<unsigned long long>(0x0000020000000000ULL);
33060 const quint64 PseudoClass_Open = static_cast<unsigned long long>(0x0000040000000000ULL);
33061 const quint64 PseudoClass_EditFocus = static_cast<unsigned long long>(0x0000080000000000ULL);
33062 const quint64 PseudoClass_Alternate = static_cast<unsigned long long>(0x0000100000000000ULL);
33063 const quint64 PseudoClass_Any = static_cast<unsigned long long>(0x0000ffffffffffffULL);
33064 const int NumPseudos = 46;
33065 struct __attribute__((visibility("default"))) Pseudo
33067 Pseudo() : negated(false) { }
33073 struct __attribute__((visibility("default"))) AttributeSelector
33075 enum ValueMatchType {
33081 inline AttributeSelector() : valueMatchCriterium(NoMatch) {}
33084 ValueMatchType valueMatchCriterium;
33086 struct __attribute__((visibility("default"))) BasicSelector
33088 inline BasicSelector() : relationToNext(NoRelation) {}
33091 MatchNextSelectorIfAncestor,
33092 MatchNextSelectorIfParent,
33093 MatchNextSelectorIfPreceeds
33095 QString elementName;
33097 QVector<Pseudo> pseudos;
33098 QVector<AttributeSelector> attributeSelectors;
33099 Relation relationToNext;
33101 struct __attribute__((visibility("default"))) Selector
33103 QVector<BasicSelector> basicSelectors;
33104 int specificity() const;
33105 quint64 pseudoClass(quint64 *negated = 0) const;
33106 QString pseudoElement() const;
33112 struct __attribute__((visibility("default"))) ValueExtractor
33114 ValueExtractor(const QVector<Declaration> &declarations, const QPalette & = QPalette());
33115 bool extractFont(QFont *font, int *fontSizeAdjustment);
33116 bool extractBackground(QBrush *, QString *, Repeat *, Qt::Alignment *, QCss::Origin *, QCss::Attachment *,
33118 bool extractGeometry(int *w, int *h, int *minw, int *minh, int *maxw, int *maxh);
33119 bool extractPosition(int *l, int *t, int *r, int *b, QCss::Origin *, Qt::Alignment *,
33120 QCss::PositionMode *, Qt::Alignment *);
33121 bool extractBox(int *margins, int *paddings, int *spacing = 0);
33122 bool extractBorder(int *borders, QBrush *colors, BorderStyle *Styles, QSize *radii);
33123 bool extractOutline(int *borders, QBrush *colors, BorderStyle *Styles, QSize *radii, int *offsets);
33124 bool extractPalette(QBrush *fg, QBrush *sfg, QBrush *sbg, QBrush *abg);
33125 int extractStyleFeatures();
33126 bool extractImage(QIcon *icon, Qt::Alignment *a, QSize *size);
33127 int lengthValue(const Declaration &decl);
33129 void extractFont();
33130 void borderValue(const Declaration &decl, int *width, QCss::BorderStyle *style, QBrush *color);
33131 LengthData lengthValue(const Value& v);
33132 void lengthValues(const Declaration &decl, int *m);
33133 QSize sizeValue(const Declaration &decl);
33134 void sizeValues(const Declaration &decl, QSize *radii);
33135 QVector<Declaration> declarations;
33141 struct __attribute__((visibility("default"))) StyleRule
33143 StyleRule() : order(0) { }
33144 QVector<Selector> selectors;
33145 QVector<Declaration> declarations;
33148 struct __attribute__((visibility("default"))) MediaRule
33151 QVector<StyleRule> styleRules;
33153 struct __attribute__((visibility("default"))) PageRule
33156 QVector<Declaration> declarations;
33158 struct __attribute__((visibility("default"))) ImportRule
33163 enum StyleSheetOrigin {
33164 StyleSheetOrigin_Unspecified,
33165 StyleSheetOrigin_UserAgent,
33166 StyleSheetOrigin_User,
33167 StyleSheetOrigin_Author,
33168 StyleSheetOrigin_Inline
33170 struct __attribute__((visibility("default"))) StyleSheet
33172 StyleSheet() : origin(StyleSheetOrigin_Unspecified), depth(0) { }
33173 QVector<StyleRule> styleRules;
33174 QVector<MediaRule> mediaRules;
33175 QVector<PageRule> pageRules;
33176 QVector<ImportRule> importRules;
33177 StyleSheetOrigin origin;
33179 QMultiHash<QString, StyleRule> nameIndex;
33180 QMultiHash<QString, StyleRule> idIndex;
33181 void buildIndexes(Qt::CaseSensitivity nameCaseSensitivity = Qt::CaseSensitive);
33183 class __attribute__((visibility("default"))) StyleSelector
33186 StyleSelector() : nameCaseSensitivity(Qt::CaseSensitive) {}
33187 virtual ~StyleSelector();
33192 QVector<StyleRule> styleRulesForNode(NodePtr node);
33193 QVector<Declaration> declarationsForNode(NodePtr node, const char *extraPseudo = 0);
33194 virtual bool nodeNameEquals(NodePtr node, const QString& nodeName) const;
33195 virtual QString attribute(NodePtr node, const QString &name) const = 0;
33196 virtual bool hasAttributes(NodePtr node) const = 0;
33197 virtual QStringList nodeIds(NodePtr node) const;
33198 virtual QStringList nodeNames(NodePtr node) const = 0;
33199 virtual bool isNullNode(NodePtr node) const = 0;
33200 virtual NodePtr parentNode(NodePtr node) const = 0;
33201 virtual NodePtr previousSiblingNode(NodePtr node) const = 0;
33202 virtual NodePtr duplicateNode(NodePtr node) const = 0;
33203 virtual void freeNode(NodePtr node) const = 0;
33204 QVector<StyleSheet> styleSheets;
33206 Qt::CaseSensitivity nameCaseSensitivity;
33208 void matchRule(NodePtr node, const StyleRule &rules, StyleSheetOrigin origin,
33209 int depth, QMap<uint, StyleRule> *weightedRules);
33210 bool selectorMatches(const Selector &rule, NodePtr node);
33211 bool basicSelectorMatches(const BasicSelector &rule, NodePtr node);
33248 struct __attribute__((visibility("default"))) Symbol
33250 inline Symbol() : start(0), len(-1) {}
33254 QString lexem() const;
33259 static QString preprocess(const QString &input, bool *hasEscapeSequences = 0);
33260 static void scan(const QString &preprocessedInput, QVector<Symbol> *symbols);
33261 static const char *tokenName(TokenType t);
33263 class __attribute__((visibility("default"))) Parser
33267 Parser(const QString &css, bool file = false);
33268 void init(const QString &css, bool file = false);
33269 bool parse(StyleSheet *styleSheet, Qt::CaseSensitivity nameCaseSensitivity = Qt::CaseSensitive);
33270 Symbol errorSymbol();
33271 bool parseImport(ImportRule *importRule);
33272 bool parseMedia(MediaRule *mediaRule);
33273 bool parseMedium(QStringList *media);
33274 bool parsePage(PageRule *pageRule);
33275 bool parsePseudoPage(QString *selector);
33276 bool parseNextOperator(Value *value);
33277 bool parseCombinator(BasicSelector::Relation *relation);
33278 bool parseProperty(Declaration *decl);
33279 bool parseRuleset(StyleRule *styleRule);
33280 bool parseSelector(Selector *sel);
33281 bool parseSimpleSelector(BasicSelector *basicSel);
33282 bool parseClass(QString *name);
33283 bool parseElementName(QString *name);
33284 bool parseAttrib(AttributeSelector *attr);
33285 bool parsePseudo(Pseudo *pseudo);
33286 bool parseNextDeclaration(Declaration *declaration);
33287 bool parsePrio(Declaration *declaration);
33288 bool parseExpr(QVector<Value> *values);
33289 bool parseTerm(Value *value);
33290 bool parseFunction(QString *name, QString *args);
33291 bool parseHexColor(QColor *col);
33292 bool testAndParseUri(QString *uri);
33293 inline bool testRuleset() { return testSelector(); }
33294 inline bool testSelector() { return testSimpleSelector(); }
33295 inline bool parseNextSelector(Selector *sel) { if (!testSelector()) return recordError(); return parseSelector(sel); }
33296 bool testSimpleSelector();
33297 inline bool parseNextSimpleSelector(BasicSelector *basicSel) { if (!testSimpleSelector()) return recordError(); return parseSimpleSelector(basicSel); }
33298 inline bool testElementName() { return test(IDENT) || test(STAR); }
33299 inline bool testClass() { return test(DOT); }
33300 inline bool testAttrib() { return test(LBRACKET); }
33301 inline bool testPseudo() { return test(COLON); }
33302 inline bool testMedium() { return test(IDENT); }
33303 inline bool parseNextMedium(QStringList *media) { if (!testMedium()) return recordError(); return parseMedium(media); }
33304 inline bool testPseudoPage() { return test(COLON); }
33305 inline bool testImport() { return testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("import")); }
33306 inline bool testMedia() { return testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("media")); }
33307 inline bool testPage() { return testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("page")); }
33308 inline bool testCombinator() { return test(PLUS) || test(GREATER) || test(S); }
33309 inline bool testProperty() { return test(IDENT); }
33311 inline bool testExpr() { return testTerm(); }
33312 inline bool parseNextExpr(QVector<Value> *values) { if (!testExpr()) return recordError(); return parseExpr(values); }
33314 inline bool testHexColor() { return test(HASH); }
33315 inline bool testFunction() { return test(FUNCTION); }
33316 inline bool parseNextFunction(QString *name, QString *args) { if (!testFunction()) return recordError(); return parseFunction(name, args); }
33317 inline bool lookupElementName() const { return lookup() == IDENT || lookup() == STAR; }
33318 inline void skipSpace() { while (test(S)) {}; }
33319 inline bool hasNext() const { return index < symbols.count(); }
33320 inline TokenType next() { return symbols.at(index++).token; }
33321 bool next(TokenType t);
33322 bool test(TokenType t);
33323 inline void prev() { index--; }
33324 inline const Symbol &symbol() const { return symbols.at(index - 1); }
33325 inline QString lexem() const { return symbol().lexem(); }
33326 QString unquotedLexem() const;
33327 QString lexemUntil(TokenType t);
33328 bool until(TokenType target, TokenType target2 = NONE);
33329 inline TokenType lookup() const {
33330 return (index - 1) < symbols.count() ? symbols.at(index - 1).token : NONE;
33332 bool testTokenAndEndsWith(TokenType t, const QLatin1String &str);
33333 inline bool recordError() { errorIndex = index; return false; }
33334 QVector<Symbol> symbols;
33337 bool hasEscapeSequences;
33338 QString sourcePath;
33341 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; } };
33342 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; } };
33343 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; } };
33344 class QTextFormatCollection;
33346 class QTextBlockFormat;
33347 class QTextCursorPrivate;
33348 class QAbstractTextDocumentLayout;
33349 class QTextDocument;
33351 class QTextFragmentData : public QFragment<>
33354 inline void initialize() {}
33355 inline void invalidate() const {}
33356 inline void free() {}
33357 int stringPosition;
33360 class QTextBlockData : public QFragment<3>
33363 inline void initialize()
33364 { layout = 0; userData = 0; userState = -1; revision = 0; hidden = 0; }
33365 void invalidate() const;
33367 { delete layout; layout = 0; delete userData; userData = 0; }
33368 mutable int format;
33369 mutable QTextLayout *layout;
33370 mutable QTextBlockUserData *userData;
33371 mutable int userState;
33372 mutable int revision : 31;
33373 mutable uint hidden : 1;
33375 class QAbstractUndoItem;
33376 class QTextUndoCommand
33382 CharFormatChanged = 2,
33383 BlockFormatChanged = 3,
33388 GroupFormatChange = 8,
33404 QAbstractUndoItem *custom;
33408 bool tryMerge(const QTextUndoCommand &other);
33410 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"; } };
33411 class QTextDocumentPrivate : public QObjectPrivate
33413 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;
33415 typedef QFragmentMap<QTextFragmentData> FragmentMap;
33416 typedef FragmentMap::ConstIterator FragmentIterator;
33417 typedef QFragmentMap<QTextBlockData> BlockMap;
33418 QTextDocumentPrivate();
33419 ~QTextDocumentPrivate();
33422 void setLayout(QAbstractTextDocumentLayout *layout);
33423 void insert(int pos, const QString &text, int format);
33424 void insert(int pos, int strPos, int strLength, int format);
33425 int insertBlock(int pos, int blockFormat, int charFormat, QTextUndoCommand::Operation = QTextUndoCommand::MoveCursor);
33426 int insertBlock(const QChar &blockSeparator, int pos, int blockFormat, int charFormat,
33427 QTextUndoCommand::Operation op = QTextUndoCommand::MoveCursor);
33428 void move(int from, int to, int length, QTextUndoCommand::Operation = QTextUndoCommand::MoveCursor);
33429 void remove(int pos, int length, QTextUndoCommand::Operation = QTextUndoCommand::MoveCursor);
33430 void aboutToRemoveCell(int cursorFrom, int cursorEnd);
33431 QTextFrame *insertFrame(int start, int end, const QTextFrameFormat &format);
33432 void removeFrame(QTextFrame *frame);
33433 enum FormatChangeMode { MergeFormat, SetFormat, SetFormatAndPreserveObjectIndices };
33434 void setCharFormat(int pos, int length, const QTextCharFormat &newFormat, FormatChangeMode mode = SetFormat);
33435 void setBlockFormat(const QTextBlock &from, const QTextBlock &to,
33436 const QTextBlockFormat &newFormat, FormatChangeMode mode = SetFormat);
33437 void emitUndoAvailable(bool available);
33438 void emitRedoAvailable(bool available);
33439 int undoRedo(bool undo);
33440 inline void undo() { undoRedo(true); }
33441 inline void redo() { undoRedo(false); }
33442 void appendUndoItem(QAbstractUndoItem *);
33443 inline void beginEditBlock() { editBlock++; }
33444 void joinPreviousEditBlock();
33445 void endEditBlock();
33446 inline bool isInEditBlock() const { return editBlock; }
33447 void enableUndoRedo(bool enable);
33448 inline bool isUndoRedoEnabled() const { return undoEnabled; }
33449 inline bool isUndoAvailable() const { return undoEnabled && undoState > 0; }
33450 inline bool isRedoAvailable() const { return undoEnabled && undoState < undoStack.size(); }
33451 inline QString buffer() const { return text; }
33452 QString plainText() const;
33453 inline int length() const { return fragments.length(); }
33454 inline QTextFormatCollection *formatCollection() { return &formats; }
33455 inline const QTextFormatCollection *formatCollection() const { return &formats; }
33456 inline QAbstractTextDocumentLayout *layout() const { return lout; }
33457 inline FragmentIterator find(int pos) const { return fragments.find(pos); }
33458 inline FragmentIterator begin() const { return fragments.begin(); }
33459 inline FragmentIterator end() const { return fragments.end(); }
33460 inline QTextBlock blocksBegin() const { return QTextBlock(const_cast<QTextDocumentPrivate *>(this), blocks.firstNode()); }
33461 inline QTextBlock blocksEnd() const { return QTextBlock(const_cast<QTextDocumentPrivate *>(this), 0); }
33462 inline QTextBlock blocksFind(int pos) const { return QTextBlock(const_cast<QTextDocumentPrivate *>(this), blocks.findNode(pos)); }
33463 int blockCharFormatIndex(int node) const;
33464 inline int numBlocks() const { return blocks.numNodes(); }
33465 const BlockMap &blockMap() const { return blocks; }
33466 const FragmentMap &fragmentMap() const { return fragments; }
33467 BlockMap &blockMap() { return blocks; }
33468 FragmentMap &fragmentMap() { return fragments; }
33469 static const QTextBlockData *block(const QTextBlock &it) { return it.p->blocks.fragment(it.n); }
33470 int nextCursorPosition(int position, QTextLayout::CursorMode mode) const;
33471 int previousCursorPosition(int position, QTextLayout::CursorMode mode) const;
33472 void changeObjectFormat(QTextObject *group, int format);
33473 void setModified(bool m);
33474 inline bool isModified() const { return modified; }
33475 inline QFont defaultFont() const { return formats.defaultFont(); }
33476 inline void setDefaultFont(const QFont &f) { formats.setDefaultFont(f); }
33478 bool split(int pos);
33479 bool unite(uint f);
33480 void truncateUndoStack();
33481 void insert_string(int pos, uint strPos, uint length, int format, QTextUndoCommand::Operation op);
33482 int insert_block(int pos, uint strPos, int format, int blockformat, QTextUndoCommand::Operation op, int command);
33483 int remove_string(int pos, uint length, QTextUndoCommand::Operation op);
33484 int remove_block(int pos, int *blockformat, int command, QTextUndoCommand::Operation op);
33485 void insert_frame(QTextFrame *f);
33486 void scan_frames(int pos, int charsRemoved, int charsAdded);
33487 static void clearFrame(QTextFrame *f);
33488 void adjustDocumentChangesAndCursors(int from, int addedOrRemoved, QTextUndoCommand::Operation op);
33489 bool wasUndoAvailable;
33490 bool wasRedoAvailable;
33492 void documentChange(int from, int length);
33493 inline void addCursor(QTextCursorPrivate *c) { cursors.append(c); }
33494 inline void removeCursor(QTextCursorPrivate *c) { cursors.removeAll(c); changedCursors.removeAll(c); }
33495 QTextFrame *frameAt(int pos) const;
33496 QTextFrame *rootFrame() const;
33497 QTextObject *objectForIndex(int objectIndex) const;
33498 QTextObject *objectForFormat(int formatIndex) const;
33499 QTextObject *objectForFormat(const QTextFormat &f) const;
33500 QTextObject *createObject(const QTextFormat &newFormat, int objectIndex = -1);
33501 void deleteObject(QTextObject *object);
33502 QTextDocument *document() { return q_func(); }
33503 const QTextDocument *document() const { return q_func(); }
33504 bool ensureMaximumBlockCount();
33506 QTextDocumentPrivate(const QTextDocumentPrivate& m);
33507 QTextDocumentPrivate& operator= (const QTextDocumentPrivate& m);
33508 void appendUndoItem(const QTextUndoCommand &c);
33509 void contentsChanged();
33510 void compressPieceTable();
33512 uint unreachableCharacterCount;
33513 QVector<QTextUndoCommand> undoStack;
33520 int docChangeOldLength;
33521 int docChangeLength;
33523 QTextFormatCollection formats;
33524 mutable QTextFrame *rtFrame;
33525 QAbstractTextDocumentLayout *lout;
33526 FragmentMap fragments;
33528 int initialBlockCharFormatIndex;
33529 QList<QTextCursorPrivate*> cursors;
33530 QList<QTextCursorPrivate*> changedCursors;
33531 QMap<int, QTextObject *> objects;
33532 QMap<QUrl, QVariant> resources;
33533 QMap<QUrl, QVariant> cachedResources;
33534 QString defaultStyleSheet;
33535 int lastBlockCount;
33537 QTextOption defaultTextOption;
33538 QCss::StyleSheet parsedDefaultStyleSheet;
33539 int maximumBlockCount;
33540 bool needsEnsureMaximumBlockCount;
33541 bool inContentsChange;
33546 qreal documentMargin;
33547 void mergeCachedResources(const QTextDocumentPrivate *priv);
33548 friend class QTextHtmlExporter;
33549 friend class QTextCursor;
33552 class QTextHtmlExporter
33555 QTextHtmlExporter(const QTextDocument *_doc);
33557 ExportEntireDocument,
33560 QString toHtml(const QByteArray &encoding, ExportMode mode = ExportEntireDocument);
33562 enum StyleMode { EmitStyleTag, OmitStyleTag };
33563 enum FrameType { TextFrame, TableFrame, RootFrame };
33564 void emitFrame(QTextFrame::Iterator frameIt);
33565 void emitTextFrame(const QTextFrame *frame);
33566 void emitBlock(const QTextBlock &block);
33567 void emitTable(const QTextTable *table);
33568 void emitFragment(const QTextFragment &fragment);
33569 void emitBlockAttributes(const QTextBlock &block);
33570 bool emitCharFormatStyle(const QTextCharFormat &format);
33571 void emitTextLength(const char *attribute, const QTextLength &length);
33572 void emitAlignment(Qt::Alignment alignment);
33573 void emitFloatStyle(QTextFrameFormat::Position pos, StyleMode mode = EmitStyleTag);
33574 void emitMargins(const QString &top, const QString &bottom, const QString &left, const QString &right);
33575 void emitAttribute(const char *attribute, const QString &value);
33576 void emitFrameStyle(const QTextFrameFormat &format, FrameType frameType);
33577 void emitBorderStyle(QTextFrameFormat::BorderStyle style);
33578 void emitPageBreakPolicy(QTextFormat::PageBreakFlags policy);
33579 void emitFontFamily(const QString &family);
33580 void emitBackgroundAttribute(const QTextFormat &format);
33581 QString findUrlForImage(const QTextDocument *doc, qint64 cacheKey, bool isPixmap);
33583 QTextCharFormat defaultCharFormat;
33584 const QTextDocument *doc;
33585 bool fragmentMarkers;
33588 typedef char hb_int8;
33589 typedef unsigned char hb_uint8;
33590 typedef short hb_int16;
33591 typedef unsigned short hb_uint16;
33592 typedef int hb_int32;
33593 typedef unsigned int hb_uint32;
33594 typedef hb_uint8 HB_Bool;
33595 typedef hb_uint8 HB_Byte;
33596 typedef hb_uint16 HB_UShort;
33597 typedef hb_uint32 HB_UInt;
33598 typedef hb_int8 HB_Char;
33599 typedef hb_int16 HB_Short;
33600 typedef hb_int32 HB_Int;
33601 typedef hb_uint16 HB_UChar16;
33602 typedef hb_uint32 HB_UChar32;
33603 typedef hb_uint32 HB_Glyph;
33604 typedef hb_int32 HB_Fixed;
33605 typedef hb_int32 HB_16Dot16;
33606 typedef void * HB_Pointer;
33607 typedef hb_uint32 HB_Tag;
33609 HB_Err_Ok = 0x0000,
33610 HB_Err_Not_Covered = 0xFFFF,
33611 HB_Err_Invalid_Argument = 0x1A66,
33612 HB_Err_Invalid_SubTable_Format = 0x157F,
33613 HB_Err_Invalid_SubTable = 0x1570,
33614 HB_Err_Read_Error = 0x6EAD,
33615 HB_Err_Out_Of_Memory = 0xDEAD
33621 typedef struct HB_Font_ *HB_Font;
33622 typedef struct HB_StreamRec_ *HB_Stream;
33623 typedef struct HB_FaceRec_ *HB_Face;
33628 HB_UShort LookupOrderOffset;
33629 HB_UShort ReqFeatureIndex;
33630 HB_UShort FeatureCount;
33631 HB_UShort* FeatureIndex;
33633 typedef struct HB_LangSys_ HB_LangSys;
33634 struct HB_LangSysRecord_
33636 HB_UInt LangSysTag;
33637 HB_LangSys LangSys;
33639 typedef struct HB_LangSysRecord_ HB_LangSysRecord;
33640 struct HB_ScriptTable_
33642 HB_LangSys DefaultLangSys;
33643 HB_UShort LangSysCount;
33644 HB_LangSysRecord* LangSysRecord;
33646 typedef struct HB_ScriptTable_ HB_ScriptTable;
33647 struct HB_ScriptRecord_
33650 HB_ScriptTable Script;
33652 typedef struct HB_ScriptRecord_ HB_ScriptRecord;
33653 struct HB_ScriptList_
33655 HB_UShort ScriptCount;
33656 HB_ScriptRecord* ScriptRecord;
33658 typedef struct HB_ScriptList_ HB_ScriptList;
33661 HB_UShort FeatureParams;
33662 HB_UShort LookupListCount;
33663 HB_UShort* LookupListIndex;
33665 typedef struct HB_Feature_ HB_Feature;
33666 struct HB_FeatureRecord_
33668 HB_UInt FeatureTag;
33669 HB_Feature Feature;
33671 typedef struct HB_FeatureRecord_ HB_FeatureRecord;
33672 struct HB_FeatureList_
33674 HB_UShort FeatureCount;
33675 HB_FeatureRecord* FeatureRecord;
33676 HB_UShort* ApplyOrder;
33677 HB_UShort ApplyCount;
33679 typedef struct HB_FeatureList_ HB_FeatureList;
33680 typedef struct HB_SubTable_ HB_SubTable;
33683 HB_UShort LookupType;
33684 HB_UShort LookupFlag;
33685 HB_UShort SubTableCount;
33686 HB_SubTable* SubTable;
33688 typedef struct HB_Lookup_ HB_Lookup;
33689 struct HB_LookupList_
33691 HB_UShort LookupCount;
33693 HB_UInt* Properties;
33695 typedef struct HB_LookupList_ HB_LookupList;
33696 struct HB_CoverageFormat1_
33698 HB_UShort GlyphCount;
33699 HB_UShort* GlyphArray;
33701 typedef struct HB_CoverageFormat1_ HB_CoverageFormat1;
33702 struct HB_RangeRecord_
33706 HB_UShort StartCoverageIndex;
33708 typedef struct HB_RangeRecord_ HB_RangeRecord;
33709 struct HB_CoverageFormat2_
33711 HB_UShort RangeCount;
33712 HB_RangeRecord* RangeRecord;
33714 typedef struct HB_CoverageFormat2_ HB_CoverageFormat2;
33715 struct HB_Coverage_
33717 HB_UShort CoverageFormat;
33720 HB_CoverageFormat1 cf1;
33721 HB_CoverageFormat2 cf2;
33724 typedef struct HB_Coverage_ HB_Coverage;
33725 struct HB_ClassDefFormat1_
33727 HB_UShort StartGlyph;
33728 HB_UShort GlyphCount;
33729 HB_UShort* ClassValueArray;
33731 typedef struct HB_ClassDefFormat1_ HB_ClassDefFormat1;
33732 struct HB_ClassRangeRecord_
33738 typedef struct HB_ClassRangeRecord_ HB_ClassRangeRecord;
33739 struct HB_ClassDefFormat2_
33741 HB_UShort ClassRangeCount;
33742 HB_ClassRangeRecord* ClassRangeRecord;
33744 typedef struct HB_ClassDefFormat2_ HB_ClassDefFormat2;
33745 struct HB_ClassDefinition_
33748 HB_UShort ClassFormat;
33751 HB_ClassDefFormat1 cd1;
33752 HB_ClassDefFormat2 cd2;
33755 typedef struct HB_ClassDefinition_ HB_ClassDefinition;
33758 HB_UShort StartSize;
33760 HB_UShort DeltaFormat;
33761 HB_UShort* DeltaValue;
33763 typedef struct HB_Device_ HB_Device;
33769 typedef enum HB_Type_ HB_Type;
33772 typedef struct HB_StreamRec_
33781 typedef struct HB_AttachPoint_ HB_AttachPoint;
33782 struct HB_AttachList_
33785 HB_Coverage Coverage;
33786 HB_UShort GlyphCount;
33787 HB_AttachPoint* AttachPoint;
33789 typedef struct HB_AttachList_ HB_AttachList;
33790 typedef struct HB_LigGlyph_ HB_LigGlyph;
33791 struct HB_LigCaretList_
33794 HB_Coverage Coverage;
33795 HB_UShort LigGlyphCount;
33796 HB_LigGlyph* LigGlyph;
33798 typedef struct HB_LigCaretList_ HB_LigCaretList;
33799 struct HB_GDEFHeader_
33802 HB_16Dot16 Version;
33803 HB_ClassDefinition GlyphClassDef;
33804 HB_AttachList AttachList;
33805 HB_LigCaretList LigCaretList;
33806 HB_UInt MarkAttachClassDef_offset;
33807 HB_ClassDefinition MarkAttachClassDef;
33808 HB_UShort LastGlyph;
33809 HB_UShort** NewGlyphClasses;
33811 typedef struct HB_GDEFHeader_ HB_GDEFHeader;
33812 typedef struct HB_GDEFHeader_* HB_GDEF;
33813 HB_Error HB_New_GDEF_Table( HB_GDEFHeader** retptr );
33814 HB_Error HB_Load_GDEF_Table( HB_Stream stream,
33815 HB_GDEFHeader** gdef );
33816 HB_Error HB_Done_GDEF_Table ( HB_GDEFHeader* gdef );
33817 HB_Error HB_GDEF_Get_Glyph_Property( HB_GDEFHeader* gdef,
33819 HB_UShort* property );
33820 HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
33821 HB_UShort num_glyphs,
33822 HB_UShort glyph_count,
33823 HB_UShort* glyph_array,
33824 HB_UShort* class_array );
33827 typedef struct HB_GlyphItemRec_ {
33829 HB_UInt properties;
33831 HB_UShort component;
33833 HB_UShort gproperties;
33834 } HB_GlyphItemRec, *HB_GlyphItem;
33835 typedef struct HB_PositionRec_ {
33838 HB_Fixed x_advance;
33839 HB_Fixed y_advance;
33841 HB_Bool new_advance;
33842 HB_Short cursive_chain;
33843 } HB_PositionRec, *HB_Position;
33844 typedef struct HB_BufferRec_{
33847 HB_UInt out_length;
33850 HB_Bool separate_out;
33851 HB_GlyphItem in_string;
33852 HB_GlyphItem out_string;
33853 HB_GlyphItem alt_string;
33854 HB_Position positions;
33855 HB_UShort max_ligID;
33856 } HB_BufferRec, *HB_Buffer;
33858 hb_buffer_new( HB_Buffer *buffer );
33860 hb_buffer_free( HB_Buffer buffer );
33862 hb_buffer_clear( HB_Buffer buffer );
33864 hb_buffer_add_glyph( HB_Buffer buffer,
33865 HB_UInt glyph_index,
33866 HB_UInt properties,
33870 typedef HB_Error (*HB_MMFunction)(HB_Font font,
33871 HB_UShort metric_id,
33872 HB_Fixed* metric_value,
33874 struct HB_GPOSHeader_
33876 HB_16Dot16 Version;
33877 HB_ScriptList ScriptList;
33878 HB_FeatureList FeatureList;
33879 HB_LookupList LookupList;
33880 HB_GDEFHeader* gdef;
33881 HB_MMFunction mmfunc;
33884 typedef struct HB_GPOSHeader_ HB_GPOSHeader;
33885 typedef HB_GPOSHeader* HB_GPOS;
33886 HB_Error HB_Load_GPOS_Table( HB_Stream stream,
33887 HB_GPOSHeader** gpos,
33888 HB_GDEFHeader* gdef,
33889 HB_Stream gdefStream );
33890 HB_Error HB_Done_GPOS_Table( HB_GPOSHeader* gpos );
33891 HB_Error HB_GPOS_Select_Script( HB_GPOSHeader* gpos,
33892 HB_UInt script_tag,
33893 HB_UShort* script_index );
33894 HB_Error HB_GPOS_Select_Language( HB_GPOSHeader* gpos,
33895 HB_UInt language_tag,
33896 HB_UShort script_index,
33897 HB_UShort* language_index,
33898 HB_UShort* req_feature_index );
33899 HB_Error HB_GPOS_Select_Feature( HB_GPOSHeader* gpos,
33900 HB_UInt feature_tag,
33901 HB_UShort script_index,
33902 HB_UShort language_index,
33903 HB_UShort* feature_index );
33904 HB_Error HB_GPOS_Query_Scripts( HB_GPOSHeader* gpos,
33905 HB_UInt** script_tag_list );
33906 HB_Error HB_GPOS_Query_Languages( HB_GPOSHeader* gpos,
33907 HB_UShort script_index,
33908 HB_UInt** language_tag_list );
33909 HB_Error HB_GPOS_Query_Features( HB_GPOSHeader* gpos,
33910 HB_UShort script_index,
33911 HB_UShort language_index,
33912 HB_UInt** feature_tag_list );
33913 HB_Error HB_GPOS_Add_Feature( HB_GPOSHeader* gpos,
33914 HB_UShort feature_index,
33915 HB_UInt property );
33916 HB_Error HB_GPOS_Clear_Features( HB_GPOSHeader* gpos );
33917 HB_Error HB_GPOS_Register_MM_Function( HB_GPOSHeader* gpos,
33918 HB_MMFunction mmfunc,
33920 HB_Error HB_GPOS_Apply_String( HB_Font font,
33921 HB_GPOSHeader* gpos,
33922 HB_UShort load_flags,
33928 typedef HB_UShort (*HB_AltFunction)(HB_UInt pos,
33930 HB_UShort num_alternates,
33931 HB_UShort* alternates,
33933 struct HB_GSUBHeader_
33936 HB_16Dot16 Version;
33937 HB_ScriptList ScriptList;
33938 HB_FeatureList FeatureList;
33939 HB_LookupList LookupList;
33940 HB_GDEFHeader* gdef;
33941 HB_AltFunction altfunc;
33944 typedef struct HB_GSUBHeader_ HB_GSUBHeader;
33945 typedef HB_GSUBHeader* HB_GSUB;
33946 HB_Error HB_Load_GSUB_Table( HB_Stream stream,
33947 HB_GSUBHeader** gsub,
33948 HB_GDEFHeader* gdef,
33949 HB_Stream gdefStream );
33950 HB_Error HB_Done_GSUB_Table( HB_GSUBHeader* gsub );
33951 HB_Error HB_GSUB_Select_Script( HB_GSUBHeader* gsub,
33952 HB_UInt script_tag,
33953 HB_UShort* script_index );
33954 HB_Error HB_GSUB_Select_Language( HB_GSUBHeader* gsub,
33955 HB_UInt language_tag,
33956 HB_UShort script_index,
33957 HB_UShort* language_index,
33958 HB_UShort* req_feature_index );
33959 HB_Error HB_GSUB_Select_Feature( HB_GSUBHeader* gsub,
33960 HB_UInt feature_tag,
33961 HB_UShort script_index,
33962 HB_UShort language_index,
33963 HB_UShort* feature_index );
33964 HB_Error HB_GSUB_Query_Scripts( HB_GSUBHeader* gsub,
33965 HB_UInt** script_tag_list );
33966 HB_Error HB_GSUB_Query_Languages( HB_GSUBHeader* gsub,
33967 HB_UShort script_index,
33968 HB_UInt** language_tag_list );
33969 HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub,
33970 HB_UShort script_index,
33971 HB_UShort language_index,
33972 HB_UInt** feature_tag_list );
33973 HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub,
33974 HB_UShort feature_index,
33975 HB_UInt property );
33976 HB_Error HB_GSUB_Clear_Features( HB_GSUBHeader* gsub );
33977 HB_Error HB_GSUB_Register_Alternate_Function( HB_GSUBHeader* gsub,
33978 HB_AltFunction altfunc,
33980 HB_Error HB_GSUB_Apply_String( HB_GSUBHeader* gsub,
33981 HB_Buffer buffer );
33985 HB_LineBreak_OP, HB_LineBreak_CL, HB_LineBreak_QU, HB_LineBreak_GL, HB_LineBreak_NS,
33986 HB_LineBreak_EX, HB_LineBreak_SY, HB_LineBreak_IS, HB_LineBreak_PR, HB_LineBreak_PO,
33987 HB_LineBreak_NU, HB_LineBreak_AL, HB_LineBreak_ID, HB_LineBreak_IN, HB_LineBreak_HY,
33988 HB_LineBreak_BA, HB_LineBreak_BB, HB_LineBreak_B2, HB_LineBreak_ZW, HB_LineBreak_CM,
33989 HB_LineBreak_WJ, HB_LineBreak_H2, HB_LineBreak_H3, HB_LineBreak_JL, HB_LineBreak_JV,
33990 HB_LineBreak_JT, HB_LineBreak_SA, HB_LineBreak_SG,
33991 HB_LineBreak_SP, HB_LineBreak_CR, HB_LineBreak_LF, HB_LineBreak_BK
33992 } HB_LineBreakClass;
33996 HB_Mark_NonSpacing,
33997 HB_Mark_SpacingCombining,
33999 HB_Number_DecimalDigit,
34002 HB_Separator_Space,
34004 HB_Separator_Paragraph,
34007 HB_Other_Surrogate,
34008 HB_Other_PrivateUse,
34009 HB_Other_NotAssigned,
34010 HB_Letter_Uppercase,
34011 HB_Letter_Lowercase,
34012 HB_Letter_Titlecase,
34013 HB_Letter_Modifier,
34015 HB_Punctuation_Connector,
34016 HB_Punctuation_Dash,
34017 HB_Punctuation_Open,
34018 HB_Punctuation_Close,
34019 HB_Punctuation_InitialQuote,
34020 HB_Punctuation_FinalQuote,
34021 HB_Punctuation_Other,
34023 HB_Symbol_Currency,
34024 HB_Symbol_Modifier,
34032 HB_Grapheme_Control,
34033 HB_Grapheme_Extend,
34039 } HB_GraphemeClass;
34049 HB_Word_ExtendNumLet
34055 HB_Sentence_Format,
34059 HB_Sentence_OLetter,
34060 HB_Sentence_Numeric,
34064 } HB_SentenceClass;
34065 HB_GraphemeClass HB_GetGraphemeClass(HB_UChar32 ch);
34066 HB_WordClass HB_GetWordClass(HB_UChar32 ch);
34067 HB_SentenceClass HB_GetSentenceClass(HB_UChar32 ch);
34068 HB_LineBreakClass HB_GetLineBreakClass(HB_UChar32 ch);
34069 void HB_GetGraphemeAndLineBreakClass(HB_UChar32 ch, HB_GraphemeClass *grapheme, HB_LineBreakClass *lineBreak);
34070 void HB_GetUnicodeCharProperties(HB_UChar32 ch, HB_CharCategory *category, int *combiningClass);
34071 HB_CharCategory HB_GetUnicodeCharCategory(HB_UChar32 ch);
34072 int HB_GetUnicodeCharCombiningClass(HB_UChar32 ch);
34073 HB_UChar16 HB_GetMirroredChar(HB_UChar16 ch);
34074 void *HB_Library_Resolve(const char *library, const char *symbol);
34075 void *HB_TextCodecForMib(int mib);
34076 char *HB_TextCodec_ConvertFromUnicode(void *codec, const HB_UChar16 *unicode, hb_uint32 length, hb_uint32 *outputLength);
34077 void HB_TextCodec_FreeResult(char *);
34081 _hb_alloc( size_t size,
34082 HB_Error *perror_ );
34084 _hb_realloc( HB_Pointer block,
34086 HB_Error *perror_ );
34088 _hb_free( HB_Pointer block );
34090 _hb_err (HB_Error code);
34094 _hb_close_stream( HB_Stream stream );
34096 _hb_stream_pos( HB_Stream stream );
34098 _hb_stream_seek( HB_Stream stream,
34101 _hb_stream_frame_enter( HB_Stream stream,
34104 _hb_stream_frame_exit( HB_Stream stream );
34110 HB_Script_Cyrillic,
34111 HB_Script_Armenian,
34116 HB_Script_Devanagari,
34118 HB_Script_Gurmukhi,
34119 HB_Script_Gujarati,
34124 HB_Script_Malayalam,
34130 HB_Script_Georgian,
34135 HB_Script_Inherited,
34136 HB_ScriptCount = HB_Script_Inherited
34143 hb_uint8 bidiLevel;
34150 } HB_LineBreakType;
34152 unsigned lineBreakType :2;
34153 unsigned whiteSpace :1;
34154 unsigned charStop :1;
34155 unsigned wordBoundary :1;
34156 unsigned sentenceBoundary :1;
34157 unsigned unused :2;
34158 } HB_CharAttributes;
34159 void HB_GetCharAttributes(const HB_UChar16 *string, hb_uint32 stringLength,
34160 const HB_ScriptItem *items, hb_uint32 numItems,
34161 HB_CharAttributes *attributes);
34162 void HB_GetWordBoundaries(const HB_UChar16 *string, hb_uint32 stringLength,
34163 const HB_ScriptItem *items, hb_uint32 numItems,
34164 HB_CharAttributes *attributes);
34165 void HB_GetSentenceBoundaries(const HB_UChar16 *string, hb_uint32 stringLength,
34166 const HB_ScriptItem *items, hb_uint32 numItems,
34167 HB_CharAttributes *attributes);
34169 HB_LeftToRight = 0,
34171 } HB_StringToGlyphsFlags;
34173 HB_ShaperFlag_Default = 0,
34174 HB_ShaperFlag_NoKerning = 1,
34175 HB_ShaperFlag_UseDesignMetrics = 2
34178 HB_NoJustification= 0,
34179 HB_Arabic_Space = 1,
34182 HB_Arabic_Normal = 7,
34184 HB_Arabic_BaRa = 9,
34185 HB_Arabic_Alef = 10,
34186 HB_Arabic_HaaDal = 11,
34187 HB_Arabic_Seen = 12,
34188 HB_Arabic_Kashida = 13
34189 } HB_JustificationClass;
34191 unsigned justification :4;
34192 unsigned clusterStart :1;
34194 unsigned zeroWidth :1;
34195 unsigned dontPrint :1;
34196 unsigned combiningClass :8;
34197 } HB_GlyphAttributes;
34198 typedef struct HB_FaceRec_ {
34199 HB_Bool isSymbolFont;
34203 HB_Bool supported_scripts[HB_ScriptCount];
34205 HB_Script current_script;
34207 HB_Bool has_opentype_kerning;
34208 HB_Bool glyphs_substituted;
34209 HB_GlyphAttributes *tmpAttributes;
34210 unsigned int *tmpLogClusters;
34214 typedef HB_Error (*HB_GetFontTableFunc)(void *font, HB_Tag tag, HB_Byte *buffer, HB_UInt *length);
34215 HB_Face HB_NewFace(void *font, HB_GetFontTableFunc tableFunc);
34216 void HB_FreeFace(HB_Face face);
34219 HB_Fixed width, height;
34220 HB_Fixed xOffset, yOffset;
34226 HB_Bool (*convertStringToGlyphIndices)(HB_Font font, const HB_UChar16 *string, hb_uint32 length, HB_Glyph *glyphs, hb_uint32 *numGlyphs, HB_Bool rightToLeft);
34227 void (*getGlyphAdvances)(HB_Font font, const HB_Glyph *glyphs, hb_uint32 numGlyphs, HB_Fixed *advances, int flags );
34228 HB_Bool (*canRender)(HB_Font font, const HB_UChar16 *string, hb_uint32 length);
34229 HB_Error (*getPointInOutline)(HB_Font font, HB_Glyph glyph, int flags , hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints);
34230 void (*getGlyphMetrics)(HB_Font font, HB_Glyph glyph, HB_GlyphMetrics *metrics);
34231 HB_Fixed (*getFontMetric)(HB_Font font, HB_FontMetric metric);
34233 typedef struct HB_Font_ {
34234 const HB_FontClass *klass;
34235 HB_UShort x_ppem, y_ppem;
34236 HB_16Dot16 x_scale, y_scale;
34240 const HB_UChar16 *string;
34241 hb_uint32 stringLength;
34242 HB_ScriptItem item;
34246 HB_Bool glyphIndicesPresent;
34247 hb_uint32 initialGlyphCount;
34248 hb_uint32 num_glyphs;
34250 HB_GlyphAttributes *attributes;
34251 HB_Fixed *advances;
34252 HB_FixedPoint *offsets;
34253 unsigned short *log_clusters;
34254 HB_Bool kerning_applied;
34256 HB_Bool HB_ShapeItem(HB_ShaperItem *item);
34258 __attribute__((visibility("default"))) void qGetCharAttributes(const HB_UChar16 *string, hb_uint32 stringLength,
34259 const HB_ScriptItem *items, hb_uint32 numItems,
34260 HB_CharAttributes *attributes);
34261 __attribute__((visibility("default"))) HB_Bool qShapeItem(HB_ShaperItem *item);
34262 __attribute__((visibility("default"))) HB_Face qHBNewFace(void *font, HB_GetFontTableFunc tableFunc);
34263 __attribute__((visibility("default"))) void qHBFreeFace(HB_Face);
34264 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"; } };
34265 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"; } };
34266 class QFontPrivate;
34270 class QAbstractTextDocumentLayout;
34271 struct glyph_metrics_t
34273 inline glyph_metrics_t()
34274 : x(100000), y(100000) {}
34275 inline glyph_metrics_t(QFixed _x, QFixed _y, QFixed _width, QFixed _height, QFixed _xoff, QFixed _yoff)
34289 glyph_metrics_t transformed(const QTransform &xform) const;
34291 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"; } };
34292 struct QScriptAnalysis
34299 LineOrParagraphSeparator = 4,
34301 SpaceTabOrObject = Space,
34306 unsigned short script : 8;
34307 unsigned short bidiLevel : 6;
34308 unsigned short flags : 3;
34309 inline bool operator == (const QScriptAnalysis &other) const {
34310 return script == other.script && bidiLevel == other.bidiLevel && flags == other.flags;
34313 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"; } };
34314 struct QGlyphJustification
34316 inline QGlyphJustification()
34317 : type(0), nKashidas(0), space_18d6(0)
34319 enum JustificationType {
34325 uint nKashidas : 6;
34326 uint space_18d6 : 24;
34328 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"; } };
34329 struct QGlyphLayoutInstance
34331 QFixedPoint offset;
34332 QFixedPoint advance;
34334 QGlyphJustification justification;
34335 HB_GlyphAttributes attributes;
34337 struct QGlyphLayout
34339 QFixedPoint *offsets;
34341 QFixed *advances_x;
34342 QFixed *advances_y;
34343 QGlyphJustification *justifications;
34344 HB_GlyphAttributes *attributes;
34346 inline QGlyphLayout() : numGlyphs(0) {}
34347 inline explicit QGlyphLayout(char *address, int totalGlyphs)
34349 offsets = reinterpret_cast<QFixedPoint *>(address);
34350 int offset = totalGlyphs * sizeof(HB_FixedPoint);
34351 glyphs = reinterpret_cast<HB_Glyph *>(address + offset);
34352 offset += totalGlyphs * sizeof(HB_Glyph);
34353 advances_x = reinterpret_cast<QFixed *>(address + offset);
34354 offset += totalGlyphs * sizeof(QFixed);
34355 advances_y = reinterpret_cast<QFixed *>(address + offset);
34356 offset += totalGlyphs * sizeof(QFixed);
34357 justifications = reinterpret_cast<QGlyphJustification *>(address + offset);
34358 offset += totalGlyphs * sizeof(QGlyphJustification);
34359 attributes = reinterpret_cast<HB_GlyphAttributes *>(address + offset);
34360 numGlyphs = totalGlyphs;
34362 inline QGlyphLayout mid(int position, int n = -1) const {
34363 QGlyphLayout copy = *this;
34364 copy.glyphs += position;
34365 copy.advances_x += position;
34366 copy.advances_y += position;
34367 copy.offsets += position;
34368 copy.justifications += position;
34369 copy.attributes += position;
34371 copy.numGlyphs -= position;
34373 copy.numGlyphs = n;
34376 static inline int spaceNeededForGlyphLayout(int totalGlyphs) {
34377 return totalGlyphs * (sizeof(HB_Glyph) + sizeof(HB_GlyphAttributes)
34378 + sizeof(QFixed) + sizeof(QFixed) + sizeof(QFixedPoint)
34379 + sizeof(QGlyphJustification));
34381 inline QFixed effectiveAdvance(int item) const
34382 { return (advances_x[item] + QFixed::fromFixed(justifications[item].space_18d6)) * !attributes[item].dontPrint; }
34383 inline QGlyphLayoutInstance instance(int position) const {
34384 QGlyphLayoutInstance g;
34385 g.offset.x = offsets[position].x;
34386 g.offset.y = offsets[position].y;
34387 g.glyph = glyphs[position];
34388 g.advance.x = advances_x[position];
34389 g.advance.y = advances_y[position];
34390 g.justification = justifications[position];
34391 g.attributes = attributes[position];
34394 inline void setInstance(int position, const QGlyphLayoutInstance &g) {
34395 offsets[position].x = g.offset.x;
34396 offsets[position].y = g.offset.y;
34397 glyphs[position] = g.glyph;
34398 advances_x[position] = g.advance.x;
34399 advances_y[position] = g.advance.y;
34400 justifications[position] = g.justification;
34401 attributes[position] = g.attributes;
34403 inline void clear(int first = 0, int last = -1) {
34406 if (first == 0 && last == numGlyphs
34407 && reinterpret_cast<char *>(offsets + numGlyphs) == reinterpret_cast<char *>(glyphs)) {
34408 memset(offsets, 0, spaceNeededForGlyphLayout(numGlyphs));
34410 const int num = last - first;
34411 memset(offsets + first, 0, num * sizeof(QFixedPoint));
34412 memset(glyphs + first, 0, num * sizeof(HB_Glyph));
34413 memset(advances_x + first, 0, num * sizeof(QFixed));
34414 memset(advances_y + first, 0, num * sizeof(QFixed));
34415 memset(justifications + first, 0, num * sizeof(QGlyphJustification));
34416 memset(attributes + first, 0, num * sizeof(HB_GlyphAttributes));
34419 inline char *data() {
34420 return reinterpret_cast<char *>(offsets);
34422 void grow(char *address, int totalGlyphs);
34424 class QVarLengthGlyphLayoutArray : private QVarLengthArray<void *>, public QGlyphLayout
34427 typedef QVarLengthArray<void *> Array;
34429 QVarLengthGlyphLayoutArray(int totalGlyphs)
34430 : Array(spaceNeededForGlyphLayout(totalGlyphs) / sizeof(void *) + 1)
34431 , QGlyphLayout(reinterpret_cast<char *>(Array::data()), totalGlyphs)
34433 memset(Array::data(), 0, Array::size() * sizeof(void *));
34435 void resize(int totalGlyphs)
34437 Array::resize(spaceNeededForGlyphLayout(totalGlyphs) / sizeof(void *) + 1);
34438 *((QGlyphLayout *)this) = QGlyphLayout(reinterpret_cast<char *>(Array::data()), totalGlyphs);
34439 memset(Array::data(), 0, Array::size() * sizeof(void *));
34442 template <int N> struct QGlyphLayoutArray : public QGlyphLayout
34445 QGlyphLayoutArray()
34446 : QGlyphLayout(reinterpret_cast<char *>(buffer), N)
34448 memset(buffer, 0, sizeof(buffer));
34451 void *buffer[(N * (sizeof(HB_Glyph) + sizeof(HB_GlyphAttributes)
34452 + sizeof(QFixed) + sizeof(QFixed) + sizeof(QFixedPoint)
34453 + sizeof(QGlyphJustification)))
34454 / sizeof(void *) + 1];
34456 struct QScriptItem;
34457 class QTextItemInt : public QTextItem
34460 inline QTextItemInt()
34461 : justified(false), underlineStyle(QTextCharFormat::NoUnderline), num_chars(0), chars(0),
34462 logClusters(0), f(0), fontEngine(0)
34464 QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat());
34465 QTextItemInt midItem(QFontEngine *fontEngine, int firstGlyphIndex, int numGlyphs) const;
34471 QTextCharFormat::UnderlineStyle underlineStyle;
34472 const QTextCharFormat charFormat;
34474 const QChar *chars;
34475 const unsigned short *logClusters;
34477 QGlyphLayout glyphs;
34478 QFontEngine *fontEngine;
34480 inline bool qIsControlChar(ushort uc)
34482 return uc >= 0x200b && uc <= 0x206f
34484 || (uc >= 0x2028 && uc <= 0x202f )
34489 inline QScriptItem()
34491 num_glyphs(0), descent(-1), ascent(-1), width(-1),
34492 glyph_data_offset(0) {}
34493 inline QScriptItem(int p, const QScriptAnalysis &a)
34494 : position(p), analysis(a),
34495 num_glyphs(0), descent(-1), ascent(-1), width(-1),
34496 glyph_data_offset(0) {}
34498 QScriptAnalysis analysis;
34499 unsigned short num_glyphs;
34503 int glyph_data_offset;
34504 QFixed height() const { return ascent + descent + 1; }
34506 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"; } };
34507 typedef QVector<QScriptItem> QScriptItemArray;
34511 : from(0), length(0),
34512 justified(0), gridfitted(0),
34513 hasTrailingSpaces(0) {}
34521 signed int length : 29;
34522 mutable uint justified : 1;
34523 mutable uint gridfitted : 1;
34524 uint hasTrailingSpaces : 1;
34525 QFixed height() const { return ascent + descent + 1; }
34526 void setDefaultHeight(QTextEngine *eng);
34527 void operator+=(const QScriptLine &other);
34529 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"; } };
34530 inline void QScriptLine::operator+=(const QScriptLine &other)
34532 descent = qMax(descent, other.descent);
34533 ascent = qMax(ascent, other.ascent);
34534 textWidth += other.textWidth;
34535 length += other.length;
34537 typedef QVector<QScriptLine> QScriptLineArray;
34538 class QFontPrivate;
34539 class QTextFormatCollection;
34540 class __attribute__((visibility("default"))) QTextEngine {
34542 struct LayoutData {
34543 LayoutData(const QString &str, void **stack_memory, int mem_size);
34546 mutable QScriptItemArray items;
34548 int available_glyphs;
34550 unsigned short *logClustersPtr;
34551 QGlyphLayout glyphLayout;
34555 uint memory_on_stack : 1;
34556 bool haveCharAttributes;
34558 void reallocate(int totalGlyphs);
34560 QTextEngine(LayoutData *data);
34562 QTextEngine(const QString &str, const QFont &f);
34568 RightToLeft = 0x0001,
34569 DesignMetrics = 0x0002,
34570 GlyphIndicesOnly = 0x0004
34572 typedef QFlags<ShaperFlag> ShaperFlags;
34574 void clearLineData();
34575 void validate() const;
34576 void itemize() const;
34577 static void bidiReorder(int numRuns, const quint8 *levels, int *visualOrder);
34578 const HB_CharAttributes *attributes() const;
34579 void shape(int item) const;
34580 void justify(const QScriptLine &si);
34581 QFixed width(int charFrom, int numChars) const;
34582 glyph_metrics_t boundingBox(int from, int len) const;
34583 glyph_metrics_t tightBoundingBox(int from, int len) const;
34584 int length(int item) const {
34585 const QScriptItem &si = layoutData->items[item];
34586 int from = si.position;
34588 return (item < layoutData->items.size() ? layoutData->items[item].position : layoutData->string.length()) - from;
34590 int length(const QScriptItem *si) const {
34592 if (si + 1 < layoutData->items.constData()+ layoutData->items.size())
34593 end = (si+1)->position;
34595 end = layoutData->string.length();
34596 return end - si->position;
34598 QFontEngine *fontEngine(const QScriptItem &si, QFixed *ascent = 0, QFixed *descent = 0) const;
34599 QFont font(const QScriptItem &si) const;
34600 inline QFont font() const { return fnt; }
34601 inline unsigned short *logClusters(const QScriptItem *si) const
34602 { return layoutData->logClustersPtr+si->position; }
34603 inline QGlyphLayout availableGlyphs(const QScriptItem *si) const {
34604 return layoutData->glyphLayout.mid(si->glyph_data_offset);
34606 inline QGlyphLayout shapedGlyphs(const QScriptItem *si) const {
34607 return layoutData->glyphLayout.mid(si->glyph_data_offset, si->num_glyphs);
34609 inline void ensureSpace(int nGlyphs) const {
34610 if (layoutData->glyphLayout.numGlyphs - layoutData->used < nGlyphs)
34611 layoutData->reallocate((((layoutData->used + nGlyphs)*3/2 + 15) >> 4) << 4);
34614 int findItem(int strPos) const;
34615 inline QTextFormatCollection *formats() const {
34616 return block.docHandle()->formatCollection();
34618 QTextCharFormat format(const QScriptItem *si) const;
34619 inline QAbstractTextDocumentLayout *docLayout() const {
34620 return block.docHandle()->document()->documentLayout();
34622 int formatIndex(const QScriptItem *si) const;
34623 QFixed calculateTabWidth(int index, QFixed x) const;
34624 mutable QScriptLineArray lines;
34628 QTextOption option;
34632 uint ignoreBidi : 1;
34633 uint cacheGlyphs : 1;
34634 uint stackEngine : 1;
34635 uint forceJustification : 1;
34636 int *underlinePositions;
34637 mutable LayoutData *layoutData;
34638 inline bool hasFormats() const { return (block.docHandle() || specialData); }
34639 struct SpecialData {
34640 int preeditPosition;
34641 QString preeditText;
34642 QList<QTextLayout::FormatRange> addFormats;
34643 QVector<int> addFormatIndices;
34644 QVector<int> resolvedFormatIndices;
34646 SpecialData *specialData;
34647 bool atWordSeparator(int position) const;
34648 bool atSpace(int position) const;
34649 void indexAdditionalFormats();
34650 QString elidedText(Qt::TextElideMode mode, const QFixed &width, int flags = 0) const;
34651 void shapeLine(const QScriptLine &line);
34653 void setBoundary(int strPos) const;
34654 void addRequiredBoundaries() const;
34655 void shapeText(int item) const;
34656 void shapeTextWithHarfbuzz(int item) const;
34657 void splitItem(int item, int pos) const;
34658 void resolveAdditionalFormats() const;
34660 class QStackTextEngine : public QTextEngine {
34662 enum { MemSize = 256*40/sizeof(void *) };
34663 QStackTextEngine(const QString &string, const QFont &f);
34664 LayoutData _layoutData;
34665 void *_memory[MemSize];
34667 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); }
34668 class __attribute__((visibility("default"))) QFontEngineGlyphCache
34671 QFontEngineGlyphCache(const QTransform &matrix) : m_transform(matrix) { }
34677 virtual ~QFontEngineGlyphCache();
34678 QTransform m_transform;
34680 typedef QHash<void *, QList<QFontEngineGlyphCache *> > GlyphPointerHash;
34681 typedef QHash<int, QList<QFontEngineGlyphCache *> > GlyphIntHash;
34682 struct glyph_metrics_t;
34683 typedef unsigned int glyph_t;
34685 class QPainterPath;
34687 struct QGlyphLayout;
34688 class __attribute__((visibility("default"))) QFontEngine : public QObject
34690 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:
34702 TestFontEngine = 0x1000
34705 virtual ~QFontEngine();
34706 struct Properties {
34707 QByteArray postscriptName;
34708 QByteArray copyright;
34709 QRectF boundingBox;
34714 QFixed italicAngle;
34718 virtual Properties properties() const;
34719 virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics);
34720 QByteArray getSfntTable(uint ) const;
34721 virtual bool getSfntTableData(uint , uchar * , uint * ) const { return false; }
34723 FaceId() : index(0), encoding(0) {}
34724 QByteArray filename;
34728 virtual FaceId faceId() const { return FaceId(); }
34729 enum SynthesizedFlags {
34730 SynthesizedItalic = 0x1,
34731 SynthesizedBold = 0x2,
34732 SynthesizedStretch = 0x4
34734 virtual int synthesized() const { return 0; }
34735 virtual QFixed emSquareSize() const { return ascent(); }
34736 virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const = 0;
34737 virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const {}
34738 virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const;
34739 virtual void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si) = 0;
34740 virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
34741 QPainterPath *path, QTextItem::RenderFlags flags);
34742 void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags,
34743 QVarLengthArray<glyph_t> &glyphs_out, QVarLengthArray<QFixedPoint> &positions);
34744 virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags);
34745 void addBitmapFontToPath(qreal x, qreal y, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags);
34746 virtual QImage alphaMapForGlyph(glyph_t) = 0;
34747 virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t);
34748 virtual QImage alphaRGBMapForGlyph(glyph_t, int margin, const QTransform &t);
34749 virtual void removeGlyphFromCache(glyph_t);
34750 virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) = 0;
34751 virtual glyph_metrics_t boundingBox(glyph_t glyph) = 0;
34752 virtual glyph_metrics_t boundingBox(glyph_t glyph, const QTransform &matrix);
34753 glyph_metrics_t tightBoundingBox(const QGlyphLayout &glyphs);
34754 virtual QFixed ascent() const = 0;
34755 virtual QFixed descent() const = 0;
34756 virtual QFixed leading() const = 0;
34757 virtual QFixed xHeight() const;
34758 virtual QFixed averageCharWidth() const;
34759 virtual QFixed lineThickness() const;
34760 virtual QFixed underlinePosition() const;
34761 virtual qreal maxCharWidth() const = 0;
34762 virtual qreal minLeftBearing() const { return qreal(); }
34763 virtual qreal minRightBearing() const { return qreal(); }
34764 virtual const char *name() const = 0;
34765 virtual bool canRender(const QChar *string, int len) = 0;
34766 virtual Type type() const = 0;
34767 virtual int glyphCount() const;
34768 HB_Font harfbuzzFont() const;
34769 HB_Face harfbuzzFace() const;
34770 virtual HB_Error getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints);
34771 void setGlyphCache(void *key, QFontEngineGlyphCache *data);
34772 void setGlyphCache(QFontEngineGlyphCache::Type key, QFontEngineGlyphCache *data);
34773 QFontEngineGlyphCache *glyphCache(void *key, const QTransform &transform) const;
34774 QFontEngineGlyphCache *glyphCache(QFontEngineGlyphCache::Type key, const QTransform &transform) const;
34775 static const uchar *getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize);
34776 static quint32 getTrueTypeGlyphIndex(const uchar *cmap, uint unicode);
34783 mutable HB_FontRec hbFont;
34784 mutable HB_Face hbFace;
34788 inline bool operator<(const KernPair &other) const
34790 return left_right < other.left_right;
34793 QVector<KernPair> kerning_pairs;
34794 void loadKerningPairs(QFixed scalingFactor);
34797 void expireGlyphCache();
34798 GlyphPointerHash m_glyphPointerHash;
34799 GlyphIntHash m_glyphIntHash;
34800 mutable QList<QFontEngineGlyphCache*> m_glyphCacheQueue;
34802 inline bool operator ==(const QFontEngine::FaceId &f1, const QFontEngine::FaceId &f2)
34804 return (f1.index == f2.index) && (f1.encoding == f2.encoding) && (f1.filename == f2.filename);
34806 inline uint qHash(const QFontEngine::FaceId &f)
34808 return qHash((f.index << 16) + f.encoding) + qHash(f.filename);
34811 class QFontEngineQPF1Data;
34812 class QFontEngineQPF1 : public QFontEngine
34815 QFontEngineQPF1(const QFontDef&, const QString &fn);
34816 ~QFontEngineQPF1();
34817 virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const;
34818 virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
34819 virtual void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si);
34820 virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags);
34821 virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
34822 virtual glyph_metrics_t boundingBox(glyph_t glyph);
34823 virtual QFixed ascent() const;
34824 virtual QFixed descent() const;
34825 virtual QFixed leading() const;
34826 virtual qreal maxCharWidth() const;
34827 virtual qreal minLeftBearing() const;
34828 virtual qreal minRightBearing() const;
34829 virtual QFixed underlinePosition() const;
34830 virtual QFixed lineThickness() const;
34831 virtual Type type() const;
34832 virtual bool canRender(const QChar *string, int len);
34833 inline const char *name() const { return 0; }
34834 virtual QImage alphaMapForGlyph(glyph_t);
34835 QFontEngineQPF1Data *d;
34837 class QFontEngineBox : public QFontEngine
34840 QFontEngineBox(int size);
34842 virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const;
34843 virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
34844 void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si);
34845 virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags);
34846 virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
34847 virtual glyph_metrics_t boundingBox(glyph_t glyph);
34848 virtual QFixed ascent() const;
34849 virtual QFixed descent() const;
34850 virtual QFixed leading() const;
34851 virtual qreal maxCharWidth() const;
34852 virtual qreal minLeftBearing() const { return 0; }
34853 virtual qreal minRightBearing() const { return 0; }
34854 virtual QImage alphaMapForGlyph(glyph_t);
34855 virtual const char *name() const;
34856 virtual bool canRender(const QChar *string, int len);
34857 virtual Type type() const;
34858 inline int size() const { return _size; }
34860 friend class QFontPrivate;
34863 class __attribute__((visibility("default"))) QFontEngineMulti : public QFontEngine
34866 explicit QFontEngineMulti(int engineCount);
34867 ~QFontEngineMulti();
34868 virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs,
34869 QTextEngine::ShaperFlags flags) const;
34870 virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
34871 virtual glyph_metrics_t boundingBox(glyph_t glyph);
34872 virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
34873 virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const;
34874 virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags);
34875 virtual QFixed ascent() const;
34876 virtual QFixed descent() const;
34877 virtual QFixed leading() const;
34878 virtual QFixed xHeight() const;
34879 virtual QFixed averageCharWidth() const;
34880 virtual QImage alphaMapForGlyph(glyph_t);
34881 virtual QFixed lineThickness() const;
34882 virtual QFixed underlinePosition() const;
34883 virtual qreal maxCharWidth() const;
34884 virtual qreal minLeftBearing() const;
34885 virtual qreal minRightBearing() const;
34886 virtual inline Type type() const
34887 { return QFontEngine::Multi; }
34888 virtual bool canRender(const QChar *string, int len);
34889 inline virtual const char *name() const
34890 { return "Multi"; }
34891 QFontEngine *engine(int at) const;
34893 friend class QPSPrintEnginePrivate;
34894 friend class QPSPrintEngineFontMulti;
34895 virtual void loadEngine(int at) = 0;
34896 QVector<QFontEngine *> engines;
34898 class QTestFontEngine : public QFontEngineBox
34901 QTestFontEngine(int size) : QFontEngineBox(size) {}
34902 virtual Type type() const { return TestFontEngine; }
34904 typedef QtValidLicenseForGuiModule QtGuiModule;
34906 class __attribute__((visibility("default"))) QBitmap : public QPixmap
34910 QBitmap(const QPixmap &);
34911 QBitmap(int w, int h);
34912 explicit QBitmap(const QSize &);
34913 explicit QBitmap(const QString &fileName, const char *format=0);
34915 QBitmap &operator=(const QPixmap &);
34916 operator QVariant() const;
34917 inline void clear() { fill(Qt::color0); }
34918 static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
34919 static QBitmap fromData(const QSize &size, const uchar *bits,
34920 QImage::Format monoFormat = QImage::Format_MonoLSB);
34921 QBitmap transformed(const QMatrix &) const;
34922 QBitmap transformed(const QTransform &matrix) const;
34924 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; }
34925 template <typename Type> class QDataBuffer
34928 QDataBuffer(int res = 64)
34931 buffer = (Type*) qMalloc(capacity * sizeof(Type));
34938 inline void reset() { siz = 0; }
34939 inline bool isEmpty() const { return siz==0; }
34940 inline int size() const { return siz; }
34941 inline Type *data() const { return buffer; }
34942 inline Type &at(int i) { qt_noop(); return buffer[i]; }
34943 inline const Type &at(int i) const { qt_noop(); return buffer[i]; }
34944 inline const Type &last() const { qt_noop(); return buffer[siz-1]; }
34945 inline const Type &first() const { qt_noop(); return buffer[0]; }
34946 inline void add(const Type &t) {
34951 inline void resize(int size) {
34955 inline void reserve(int size) {
34956 if (size > capacity) {
34957 while (capacity < size)
34959 buffer = (Type*) qRealloc(buffer, capacity * sizeof(Type));
34962 inline void shrink(int size) {
34964 buffer = (Type*) qRealloc(buffer, capacity * sizeof(Type));
34966 inline void swap(QDataBuffer<Type> &other) {
34967 qSwap(capacity, other.capacity);
34968 qSwap(siz, other.siz);
34969 qSwap(buffer, other.buffer);
34971 inline QDataBuffer &operator<<(const Type &t) { add(t); return *this; }
34977 static const union { unsigned char c[8]; double d; } qt_be_inf_bytes = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
34978 static const union { unsigned char c[8]; double d; } qt_le_inf_bytes = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
34979 static const union { unsigned char c[8]; double d; } qt_armfpa_inf_bytes = { { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 } };
34980 static inline double qt_inf()
34982 return (QSysInfo::ByteOrder == QSysInfo::BigEndian
34983 ? qt_be_inf_bytes.d
34984 : qt_le_inf_bytes.d);
34986 static const union { unsigned char c[8]; double d; } qt_be_snan_bytes = { { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 } };
34987 static const union { unsigned char c[8]; double d; } qt_le_snan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f } };
34988 static const union { unsigned char c[8]; double d; } qt_armfpa_snan_bytes = { { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 } };
34989 static inline double qt_snan()
34991 return (QSysInfo::ByteOrder == QSysInfo::BigEndian
34992 ? qt_be_snan_bytes.d
34993 : qt_le_snan_bytes.d);
34995 static const union { unsigned char c[8]; double d; } qt_be_qnan_bytes = { { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 } };
34996 static const union { unsigned char c[8]; double d; } qt_le_qnan_bytes = { { 0, 0, 0, 0, 0, 0, 0xf8, 0xff } };
34997 static const union { unsigned char c[8]; double d; } qt_armfpa_qnan_bytes = { { 0, 0, 0xf8, 0xff, 0, 0, 0, 0 } };
34998 static inline double qt_qnan()
35000 return (QSysInfo::ByteOrder == QSysInfo::BigEndian
35001 ? qt_be_qnan_bytes.d
35002 : qt_le_qnan_bytes.d);
35004 static inline bool qt_is_inf(double d)
35006 uchar *ch = (uchar *)&d;
35007 if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
35008 return (ch[0] & 0x7f) == 0x7f && ch[1] == 0xf0;
35010 return (ch[7] & 0x7f) == 0x7f && ch[6] == 0xf0;
35013 static inline bool qt_is_nan(double d)
35015 uchar *ch = (uchar *)&d;
35016 if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
35017 return (ch[0] & 0x7f) == 0x7f && ch[1] > 0xf0;
35019 return (ch[7] & 0x7f) == 0x7f && ch[6] > 0xf0;
35022 static inline bool qt_is_finite(double d)
35024 uchar *ch = (uchar *)&d;
35025 if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
35026 return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0xf0) != 0xf0;
35028 return (ch[7] & 0x7f) != 0x7f || (ch[6] & 0xf0) != 0xf0;
35031 static inline bool qt_is_inf(float d)
35033 uchar *ch = (uchar *)&d;
35034 if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
35035 return (ch[0] & 0x7f) == 0x7f && ch[1] == 0x80;
35037 return (ch[3] & 0x7f) == 0x7f && ch[2] == 0x80;
35040 static inline bool qt_is_nan(float d)
35042 uchar *ch = (uchar *)&d;
35043 if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
35044 return (ch[0] & 0x7f) == 0x7f && ch[1] > 0x80;
35046 return (ch[3] & 0x7f) == 0x7f && ch[2] > 0x80;
35049 static inline bool qt_is_finite(float d)
35051 uchar *ch = (uchar *)&d;
35052 if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
35053 return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0x80) != 0x80;
35055 return (ch[3] & 0x7f) != 0x7f || (ch[2] & 0x80) != 0x80;
35058 typedef qreal qfixed;
35063 bool operator==(const qfixed2d &other) const { return qFuzzyCompare(x, other.x)
35064 && qFuzzyCompare(y, other.y); }
35066 QPointF qt_curves_for_arc(const QRectF &rect, qreal startAngle, qreal sweepLength,
35067 QPointF *controlPoints, int *point_count);
35068 qreal qt_t_for_arc_angle(qreal angle);
35069 typedef void (*qStrokerMoveToHook)(qfixed x, qfixed y, void *data);
35070 typedef void (*qStrokerLineToHook)(qfixed x, qfixed y, void *data);
35071 typedef void (*qStrokerCubicToHook)(qfixed c1x, qfixed c1y,
35072 qfixed c2x, qfixed c2y,
35073 qfixed ex, qfixed ey,
35075 class __attribute__((visibility("default"))) QStrokerOps
35079 QPainterPath::ElementType type;
35082 inline bool isMoveTo() const { return type == QPainterPath::MoveToElement; }
35083 inline bool isLineTo() const { return type == QPainterPath::LineToElement; }
35084 inline bool isCurveTo() const { return type == QPainterPath::CurveToElement; }
35085 operator qfixed2d () { qfixed2d pt = { x, y }; return pt; }
35088 virtual ~QStrokerOps();
35089 void setMoveToHook(qStrokerMoveToHook moveToHook) { m_moveTo = moveToHook; }
35090 void setLineToHook(qStrokerLineToHook lineToHook) { m_lineTo = lineToHook; }
35091 void setCubicToHook(qStrokerCubicToHook cubicToHook) { m_cubicTo = cubicToHook; }
35092 virtual void begin(void *customData);
35093 virtual void end();
35094 inline void moveTo(qfixed x, qfixed y);
35095 inline void lineTo(qfixed x, qfixed y);
35096 inline void cubicTo(qfixed x1, qfixed y1, qfixed x2, qfixed y2, qfixed ex, qfixed ey);
35097 void strokePath(const QPainterPath &path, void *data, const QTransform &matrix);
35098 void strokePolygon(const QPointF *points, int pointCount, bool implicit_close,
35099 void *data, const QTransform &matrix);
35100 void strokeEllipse(const QRectF &ellipse, void *data, const QTransform &matrix);
35101 QRectF clipRect() const { return m_clip_rect; }
35102 void setClipRect(const QRectF &clip) { m_clip_rect = clip; }
35104 inline void emitMoveTo(qfixed x, qfixed y);
35105 inline void emitLineTo(qfixed x, qfixed y);
35106 inline void emitCubicTo(qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey);
35107 virtual void processCurrentSubpath() = 0;
35108 QDataBuffer<Element> m_elements;
35109 QRectF m_clip_rect;
35111 void *m_customData;
35112 qStrokerMoveToHook m_moveTo;
35113 qStrokerLineToHook m_lineTo;
35114 qStrokerCubicToHook m_cubicTo;
35116 class __attribute__((visibility("default"))) QStroker : public QStrokerOps
35119 enum LineJoinMode {
35129 void setStrokeWidth(qfixed width) { m_strokeWidth = width; }
35130 qfixed strokeWidth() const { return m_strokeWidth; }
35131 void setCapStyle(Qt::PenCapStyle capStyle) { m_capStyle = joinModeForCap(capStyle); }
35132 Qt::PenCapStyle capStyle() const { return capForJoinMode(m_capStyle); }
35133 LineJoinMode capStyleMode() const { return m_capStyle; }
35134 void setJoinStyle(Qt::PenJoinStyle style) { m_joinStyle = joinModeForJoin(style); }
35135 Qt::PenJoinStyle joinStyle() const { return joinForJoinMode(m_joinStyle); }
35136 LineJoinMode joinStyleMode() const { return m_joinStyle; }
35137 void setMiterLimit(qfixed length) { m_miterLimit = length; }
35138 qfixed miterLimit() const { return m_miterLimit; }
35139 void setCurveThreshold(qfixed threshold) { m_curveThreshold = threshold; }
35140 qfixed curveThreshold() const { return m_curveThreshold; }
35141 void joinPoints(qfixed x, qfixed y, const QLineF &nextLine, LineJoinMode join);
35142 inline void emitMoveTo(qfixed x, qfixed y);
35143 inline void emitLineTo(qfixed x, qfixed y);
35144 inline void emitCubicTo(qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey);
35146 static Qt::PenCapStyle capForJoinMode(LineJoinMode mode);
35147 static LineJoinMode joinModeForCap(Qt::PenCapStyle);
35148 static Qt::PenJoinStyle joinForJoinMode(LineJoinMode mode);
35149 static LineJoinMode joinModeForJoin(Qt::PenJoinStyle joinStyle);
35150 virtual void processCurrentSubpath();
35151 qfixed m_strokeWidth;
35152 qfixed m_miterLimit;
35153 qfixed m_curveThreshold;
35154 LineJoinMode m_capStyle;
35155 LineJoinMode m_joinStyle;
35161 class __attribute__((visibility("default"))) QDashStroker : public QStrokerOps
35164 QDashStroker(QStroker *stroker);
35165 QStroker *stroker() const { return m_stroker; }
35166 static QVector<qfixed> patternForStyle(Qt::PenStyle style);
35167 void setDashPattern(const QVector<qfixed> &dashPattern) { m_dashPattern = dashPattern; }
35168 QVector<qfixed> dashPattern() const { return m_dashPattern; }
35169 void setDashOffset(qreal offset) { m_dashOffset = offset; }
35170 qreal dashOffset() const { return m_dashOffset; }
35171 virtual void begin(void *data);
35172 virtual void end();
35174 virtual void processCurrentSubpath();
35175 QStroker *m_stroker;
35176 QVector<qfixed> m_dashPattern;
35177 qreal m_dashOffset;
35179 inline void QStrokerOps::emitMoveTo(qfixed x, qfixed y)
35182 m_moveTo(x, y, m_customData);
35184 inline void QStrokerOps::emitLineTo(qfixed x, qfixed y)
35187 m_lineTo(x, y, m_customData);
35189 inline void QStrokerOps::emitCubicTo(qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey)
35192 m_cubicTo(c1x, c1y, c2x, c2y, ex, ey, m_customData);
35194 inline void QStrokerOps::moveTo(qfixed x, qfixed y)
35196 if (m_elements.size()>1)
35197 processCurrentSubpath();
35198 m_elements.reset();
35199 Element e = { QPainterPath::MoveToElement, x, y };
35202 inline void QStrokerOps::lineTo(qfixed x, qfixed y)
35204 Element e = { QPainterPath::LineToElement, x, y };
35207 inline void QStrokerOps::cubicTo(qfixed x1, qfixed y1, qfixed x2, qfixed y2, qfixed ex, qfixed ey)
35209 Element c1 = { QPainterPath::CurveToElement, x1, y1 };
35210 Element c2 = { QPainterPath::CurveToDataElement, x2, y2 };
35211 Element e = { QPainterPath::CurveToDataElement, ex, ey };
35212 m_elements.add(c1);
35213 m_elements.add(c2);
35216 inline void QStroker::emitMoveTo(qfixed x, qfixed y)
35218 m_back2X = m_back1X;
35219 m_back2Y = m_back1Y;
35222 QStrokerOps::emitMoveTo(x, y);
35224 inline void QStroker::emitLineTo(qfixed x, qfixed y)
35226 m_back2X = m_back1X;
35227 m_back2Y = m_back1Y;
35230 QStrokerOps::emitLineTo(x, y);
35232 inline void QStroker::emitCubicTo(qfixed c1x, qfixed c1y,
35233 qfixed c2x, qfixed c2y,
35234 qfixed ex, qfixed ey)
35236 if (c2x == ex && c2y == ey) {
35237 if (c1x == ex && c1y == ey) {
35238 m_back2X = m_back1X;
35239 m_back2Y = m_back1Y;
35250 QStrokerOps::emitCubicTo(c1x, c1y, c2x, c2y, ex, ey);
35252 inline void QDashStroker::begin(void *data)
35255 m_stroker->begin(data);
35256 QStrokerOps::begin(data);
35258 inline void QDashStroker::end()
35261 QStrokerOps::end();
35264 typedef QtValidLicenseForGuiModule QtGuiModule;
35265 class QPrinterPrivate;
35266 class QPaintEngine;
35267 class QPrintEngine;
35268 class QPrinterInfo;
35269 class __attribute__((visibility("default"))) QPrinter : public QPaintDevice
35271 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;
35273 enum PrinterMode { ScreenResolution, PrinterResolution, HighResolution };
35274 explicit QPrinter(PrinterMode mode = ScreenResolution);
35275 explicit QPrinter(const QPrinterInfo& printer, PrinterMode mode = ScreenResolution);
35277 int devType() const;
35278 enum Orientation { Portrait, Landscape };
35279 enum PageSize { A4, B5, Letter, Legal, Executive,
35280 A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1,
35281 B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E,
35282 DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom, NPaperSize = Custom };
35283 typedef PageSize PaperSize;
35284 enum PageOrder { FirstPageFirst,
35286 enum ColorMode { GrayScale,
35288 enum PaperSource { OnlyOne,
35303 enum PrinterState { Idle,
35307 enum OutputFormat { NativeFormat, PdfFormat, PostScriptFormat };
35308 enum PrintRange { AllPages, Selection, PageRange };
35324 void setOutputFormat(OutputFormat format);
35325 OutputFormat outputFormat() const;
35326 void setPrinterName(const QString &);
35327 QString printerName() const;
35328 bool isValid() const;
35329 void setOutputFileName(const QString &);
35330 QString outputFileName()const;
35331 void setPrintProgram(const QString &);
35332 QString printProgram() const;
35333 void setDocName(const QString &);
35334 QString docName() const;
35335 void setCreator(const QString &);
35336 QString creator() const;
35337 void setOrientation(Orientation);
35338 Orientation orientation() const;
35339 void setPageSize(PageSize);
35340 PageSize pageSize() const;
35341 void setPaperSize(PaperSize);
35342 PaperSize paperSize() const;
35343 void setPaperSize(const QSizeF &paperSize, Unit unit);
35344 QSizeF paperSize(Unit unit) const;
35345 void setPageOrder(PageOrder);
35346 PageOrder pageOrder() const;
35347 void setResolution(int);
35348 int resolution() const;
35349 void setColorMode(ColorMode);
35350 ColorMode colorMode() const;
35351 void setCollateCopies(bool collate);
35352 bool collateCopies() const;
35353 void setFullPage(bool);
35354 bool fullPage() const;
35355 void setNumCopies(int);
35356 int numCopies() const;
35357 void setPaperSource(PaperSource);
35358 PaperSource paperSource() const;
35359 void setDuplex(DuplexMode duplex);
35360 DuplexMode duplex() const;
35361 QList<int> supportedResolutions() const;
35362 void setFontEmbeddingEnabled(bool enable);
35363 bool fontEmbeddingEnabled() const;
35364 void setDoubleSidedPrinting(bool enable);
35365 bool doubleSidedPrinting() const;
35366 QRect paperRect() const;
35367 QRect pageRect() const;
35368 QRectF paperRect(Unit) const;
35369 QRectF pageRect(Unit) const;
35370 QString printerSelectionOption() const;
35371 void setPrinterSelectionOption(const QString &);
35374 PrinterState printerState() const;
35375 QPaintEngine *paintEngine() const;
35376 QPrintEngine *printEngine() const;
35377 void setFromTo(int fromPage, int toPage);
35378 int fromPage() const;
35379 int toPage() const;
35380 void setPrintRange(PrintRange range);
35381 PrintRange printRange() const;
35382 void setPageMargins(qreal left, qreal top, qreal right, qreal bottom, Unit unit);
35383 void getPageMargins(qreal *left, qreal *top, qreal *right, qreal *bottom, Unit unit) const;
35385 int metric(PaintDeviceMetric) const;
35386 void setEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine);
35388 void init(PrinterMode mode);
35389 QPrinter(const QPrinter &); QPrinter &operator=(const QPrinter &);
35390 QPrinterPrivate *d_ptr;
35391 friend class QPrintDialogPrivate;
35392 friend class QAbstractPrintDialog;
35393 friend class QAbstractPrintDialogPrivate;
35394 friend class QPrintPreviewWidgetPrivate;
35395 friend class QTextDocument;
35396 friend class QPageSetupWidget;
35401 QFontSubset(QFontEngine *fe, int obj_id = 0)
35402 : object_id(obj_id), noEmbed(false), fontEngine(fe), downloaded_glyphs(0), standard_font(false)
35403 { fontEngine->ref.ref(); addGlyph(0); }
35405 if (!fontEngine->ref.deref())
35408 QByteArray toTruetype() const;
35409 QByteArray toType1() const;
35410 QByteArray type1AddedGlyphs() const;
35411 QByteArray widthArray() const;
35412 QByteArray createToUnicodeMap() const;
35413 QVector<int> getReverseMap() const;
35414 QByteArray glyphName(unsigned int glyph, const QVector<int> reverseMap) const;
35415 static QByteArray glyphName(unsigned short unicode, bool symbol);
35416 int addGlyph(int index);
35417 const int object_id;
35419 QFontEngine *fontEngine;
35420 QList<int> glyph_indices;
35421 mutable int downloaded_glyphs;
35422 mutable bool standard_font;
35423 int nGlyphs() const { return glyph_indices.size(); }
35424 mutable QFixed emSquare;
35425 mutable QVector<QFixed> widths;
35427 class QPaintDevice;
35428 class QPaintEnginePrivate
35430 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;
35432 QPaintEnginePrivate() : pdev(0), q_ptr(0), currentClipWidget(0), hasSystemTransform(0),
35433 hasSystemViewport(0) {}
35434 virtual ~QPaintEnginePrivate() { }
35435 QPaintDevice *pdev;
35436 QPaintEngine *q_ptr;
35437 QRegion systemClip;
35438 QRegion systemViewport;
35439 QTransform systemTransform;
35440 QWidget *currentClipWidget;
35441 uint hasSystemTransform : 1;
35442 uint hasSystemViewport : 1;
35443 inline void transformSystemClip()
35445 if (systemClip.isEmpty())
35447 if (systemTransform.type() <= QTransform::TxTranslate)
35448 systemClip.translate(qRound(systemTransform.dx()), qRound(systemTransform.dy()));
35450 systemClip = systemTransform.map(systemClip);
35451 if (hasSystemViewport) {
35452 systemClip &= systemViewport;
35453 if (systemClip.isEmpty()) {
35454 systemClip = QRect(systemViewport.boundingRect().topLeft(), QSize(1, 1));
35458 inline void setSystemTransform(const QTransform &xform)
35460 systemTransform = xform;
35461 if ((hasSystemTransform = !xform.isIdentity()))
35462 transformSystemClip();
35463 systemStateChanged();
35465 inline void setSystemViewport(const QRegion ®ion)
35467 systemViewport = region;
35468 hasSystemViewport = !systemViewport.isEmpty();
35470 virtual void systemStateChanged() { }
35471 void drawBoxTextItem(const QPointF &p, const QTextItemInt &ti);
35475 class QAlphaPaintEnginePrivate;
35476 class QAlphaPaintEngine : public QPaintEngine
35478 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;
35480 ~QAlphaPaintEngine();
35481 virtual bool begin(QPaintDevice *pdev);
35482 virtual bool end();
35483 virtual void updateState(const QPaintEngineState &state);
35484 virtual void drawPath(const QPainterPath &path);
35485 virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
35486 virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr);
35487 virtual void drawImage(const QRectF &r, const QImage &image, const QRectF &sr);
35488 virtual void drawTextItem(const QPointF &p, const QTextItem &textItem);
35489 virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
35491 QAlphaPaintEngine(QAlphaPaintEnginePrivate &data, PaintEngineFeatures devcaps = 0);
35492 QRegion alphaClipping() const;
35493 bool continueCall() const;
35494 void flushAndInit(bool init = true);
35497 class QAlphaPaintEnginePrivate : public QPaintEnginePrivate
35499 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;
35501 QAlphaPaintEnginePrivate();
35502 ~QAlphaPaintEnginePrivate();
35505 QPaintEngine *m_picengine;
35506 QPainter *m_picpainter;
35507 QPaintEngine::PaintEngineFeatures m_savedcaps;
35508 QPaintDevice *m_pdev;
35509 QRegion m_alphargn;
35514 bool m_alphaOpacity;
35515 bool m_advancedPen;
35516 bool m_advancedBrush;
35517 bool m_complexTransform;
35518 bool m_emulateProjectiveTransforms;
35519 bool m_continueCall;
35520 QTransform m_transform;
35522 void addAlphaRect(const QRectF &rect);
35523 QRectF addPenWidth(const QPainterPath &path);
35524 void drawAlphaImage(const QRectF &rect);
35525 QRect toRect(const QRectF &rect) const;
35526 bool fullyContained(const QRectF &rect) const;
35527 void resetState(QPainter *p);
35529 typedef QtValidLicenseForGuiModule QtGuiModule;
35530 class __attribute__((visibility("default"))) QPrintEngine
35533 virtual ~QPrintEngine() {}
35534 enum PrintEnginePropertyKey {
35540 PPK_NumberOfCopies,
35542 PPK_OutputFileName,
35549 PPK_PrinterProgram,
35551 PPK_SelectionOption,
35552 PPK_SupportedResolutions,
35553 PPK_WindowsPageSize,
35555 PPK_SuppressSystemPrintStatus,
35558 PPK_CustomPaperSize,
35560 PPK_PaperSize = PPK_PageSize,
35561 PPK_CustomBase = 0xff00
35563 virtual void setProperty(PrintEnginePropertyKey key, const QVariant &value) = 0;
35564 virtual QVariant property(PrintEnginePropertyKey key) const = 0;
35565 virtual bool newPage() = 0;
35566 virtual bool abort() = 0;
35567 virtual int metric(QPaintDevice::PaintDeviceMetric) const = 0;
35568 virtual QPrinter::PrinterState printerState() const = 0;
35570 typedef QtValidLicenseForCoreModule QtCoreModule;
35572 class QBufferPrivate;
35573 class __attribute__((visibility("default"))) QBuffer : public QIODevice
35575 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:
35577 explicit QBuffer(QObject *parent = 0);
35578 QBuffer(QByteArray *buf, QObject *parent = 0);
35580 QByteArray &buffer();
35581 const QByteArray &buffer() const;
35582 void setBuffer(QByteArray *a);
35583 void setData(const QByteArray &data);
35584 inline void setData(const char *data, int len);
35585 const QByteArray &data() const;
35586 bool open(OpenMode openMode);
35588 qint64 size() const;
35589 qint64 pos() const;
35590 bool seek(qint64 off);
35591 bool atEnd() const;
35592 bool canReadLine() const;
35594 void connectNotify(const char*);
35595 void disconnectNotify(const char*);
35596 qint64 readData(char *data, qint64 maxlen);
35597 qint64 writeData(const char *data, qint64 len);
35599 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;
35600 QBuffer(const QBuffer &); QBuffer &operator=(const QBuffer &);
35602 inline void QBuffer::setData(const char *adata, int alen)
35603 { setData(QByteArray(adata, alen)); }
35604 const char *qt_real_to_string(qreal val, char *buf);
35605 const char *qt_int_to_string(int val, char *buf);
35610 explicit ByteStream(bool fileBacking = false);
35611 explicit ByteStream(QByteArray *ba, bool fileBacking = false);
35613 ByteStream &operator <<(char chr);
35614 ByteStream &operator <<(const char *str);
35615 ByteStream &operator <<(const QByteArray &str);
35616 ByteStream &operator <<(const ByteStream &src);
35617 ByteStream &operator <<(qreal val);
35618 ByteStream &operator <<(int val);
35619 ByteStream &operator <<(const QPointF &p);
35620 QIODevice *stream();
35622 static inline int maxMemorySize() { return 100000000; }
35623 static inline int chunkSize() { return 10000000; }
35625 void constructor_helper(QIODevice *dev);
35626 void constructor_helper(QByteArray *ba);
35628 void prepareBuffer();
35632 bool fileBackingEnabled;
35633 bool fileBackingActive;
35642 QByteArray generatePath(const QPainterPath &path, const QTransform &matrix, PathFlags flags);
35643 QByteArray generateMatrix(const QTransform &matrix);
35644 QByteArray generateDashes(const QPen &pen);
35645 QByteArray patternForBrush(const QBrush &b);
35648 void setPen(const QPen &pen);
35649 void strokePath(const QPainterPath &path);
35650 ByteStream *stream;
35655 QStroker basicStroker;
35656 QDashStroker dashStroker;
35657 QStrokerOps *stroker;
35659 QByteArray ascii85Encode(const QByteArray &input);
35660 const char *toHex(ushort u, char *buffer);
35661 const char *toHex(uchar u, char *buffer);
35665 PaperSize paperSize(QPrinter::PaperSize paperSize);
35666 const char *paperSizeToString(QPrinter::PaperSize paperSize);
35667 QByteArray stripSpecialCharacters(const QByteArray &string);
35669 class QPdfPage : public QPdf::ByteStream
35673 QVector<uint> images;
35674 QVector<uint> graphicStates;
35675 QVector<uint> patterns;
35676 QVector<uint> fonts;
35677 QVector<uint> annotations;
35678 void streamImage(int w, int h, int object);
35682 class QPdfBaseEnginePrivate;
35683 class QPdfBaseEngine : public QAlphaPaintEngine, public QPrintEngine
35685 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;
35687 QPdfBaseEngine(QPdfBaseEnginePrivate &d, PaintEngineFeatures f);
35688 ~QPdfBaseEngine() {}
35689 bool begin(QPaintDevice *pdev);
35691 void drawPoints(const QPointF *points, int pointCount);
35692 void drawLines(const QLineF *lines, int lineCount);
35693 void drawRects(const QRectF *rects, int rectCount);
35694 void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
35695 void drawPath (const QPainterPath & path);
35696 void drawTextItem(const QPointF &p, const QTextItem &textItem);
35697 void updateState(const QPaintEngineState &state);
35698 int metric(QPaintDevice::PaintDeviceMetric metricType) const;
35700 void setProperty(PrintEnginePropertyKey key, const QVariant &value);
35701 QVariant property(PrintEnginePropertyKey key) const;
35703 virtual void setBrush() = 0;
35704 void setupGraphicsState(QPaintEngine::DirtyFlags flags);
35706 void updateClipPath(const QPainterPath & path, Qt::ClipOperation op);
35707 friend int qt_printerRealNumCopies(QPaintEngine *);
35709 class QPdfBaseEnginePrivate : public QAlphaPaintEnginePrivate
35711 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;
35713 QPdfBaseEnginePrivate(QPrinter::PrinterMode m);
35714 ~QPdfBaseEnginePrivate();
35715 bool openPrintDevice();
35716 void closePrintDevice();
35717 virtual void drawTextItem(const QPointF &p, const QTextItemInt &ti);
35718 inline uint requestObject() { return currentObject++; }
35719 QRect paperRect() const;
35720 QRect pageRect() const;
35723 QPdfPage* currentPage;
35724 QPdf::Stroker stroker;
35725 QPointF brushOrigin;
35728 QList<QPainterPath> clips;
35735 bool useAlphaEngine;
35736 QHash<QFontEngine::FaceId, QFontSubset *> fonts;
35737 QPaintDevice *pdev;
35738 QIODevice *outDevice;
35740 QString outputFileName;
35741 QString printerName;
35742 QString printProgram;
35743 QString selectionOption;
35746 QPrinter::DuplexMode duplex;
35752 QPrinter::PageOrder pageOrder;
35753 QPrinter::Orientation orientation;
35754 QPrinter::PaperSize paperSize;
35755 QPrinter::ColorMode colorMode;
35756 QPrinter::PaperSource paperSource;
35757 QStringList cupsOptions;
35758 QRect cupsPaperRect;
35759 QRect cupsPageRect;
35760 QString cupsStringPageSize;
35761 QSizeF customPaperSize;
35762 bool hasCustomPageMargins;
35763 qreal leftMargin, topMargin, rightMargin, bottomMargin;
35766 typedef double float_t;
35767 typedef double double_t;
35768 extern double acos (double __x) throw (); extern double __acos (double __x) throw ();
35769 extern double asin (double __x) throw (); extern double __asin (double __x) throw ();
35770 extern double atan (double __x) throw (); extern double __atan (double __x) throw ();
35771 extern double atan2 (double __y, double __x) throw (); extern double __atan2 (double __y, double __x) throw ();
35772 extern double cos (double __x) throw (); extern double __cos (double __x) throw ();
35773 extern double sin (double __x) throw (); extern double __sin (double __x) throw ();
35774 extern double tan (double __x) throw (); extern double __tan (double __x) throw ();
35775 extern double cosh (double __x) throw (); extern double __cosh (double __x) throw ();
35776 extern double sinh (double __x) throw (); extern double __sinh (double __x) throw ();
35777 extern double tanh (double __x) throw (); extern double __tanh (double __x) throw ();
35778 extern double acosh (double __x) throw (); extern double __acosh (double __x) throw ();
35779 extern double asinh (double __x) throw (); extern double __asinh (double __x) throw ();
35780 extern double atanh (double __x) throw (); extern double __atanh (double __x) throw ();
35781 extern double exp (double __x) throw (); extern double __exp (double __x) throw ();
35782 extern double frexp (double __x, int *__exponent) throw (); extern double __frexp (double __x, int *__exponent) throw ();
35783 extern double ldexp (double __x, int __exponent) throw (); extern double __ldexp (double __x, int __exponent) throw ();
35784 extern double log (double __x) throw (); extern double __log (double __x) throw ();
35785 extern double log10 (double __x) throw (); extern double __log10 (double __x) throw ();
35786 extern double modf (double __x, double *__iptr) throw (); extern double __modf (double __x, double *__iptr) throw ();
35787 extern double expm1 (double __x) throw (); extern double __expm1 (double __x) throw ();
35788 extern double log1p (double __x) throw (); extern double __log1p (double __x) throw ();
35789 extern double logb (double __x) throw (); extern double __logb (double __x) throw ();
35790 extern double exp2 (double __x) throw (); extern double __exp2 (double __x) throw ();
35791 extern double log2 (double __x) throw (); extern double __log2 (double __x) throw ();
35792 extern double pow (double __x, double __y) throw (); extern double __pow (double __x, double __y) throw ();
35793 extern double sqrt (double __x) throw (); extern double __sqrt (double __x) throw ();
35794 extern double hypot (double __x, double __y) throw (); extern double __hypot (double __x, double __y) throw ();
35795 extern double cbrt (double __x) throw (); extern double __cbrt (double __x) throw ();
35796 extern double ceil (double __x) throw () __attribute__ ((__const__)); extern double __ceil (double __x) throw () __attribute__ ((__const__));
35797 extern double fabs (double __x) throw () __attribute__ ((__const__)); extern double __fabs (double __x) throw () __attribute__ ((__const__));
35798 extern double floor (double __x) throw () __attribute__ ((__const__)); extern double __floor (double __x) throw () __attribute__ ((__const__));
35799 extern double fmod (double __x, double __y) throw (); extern double __fmod (double __x, double __y) throw ();
35800 extern int __isinf (double __value) throw () __attribute__ ((__const__));
35801 extern int __finite (double __value) throw () __attribute__ ((__const__));
35802 extern int isinf (double __value) throw () __attribute__ ((__const__));
35803 extern int finite (double __value) throw () __attribute__ ((__const__));
35804 extern double drem (double __x, double __y) throw (); extern double __drem (double __x, double __y) throw ();
35805 extern double significand (double __x) throw (); extern double __significand (double __x) throw ();
35806 extern double copysign (double __x, double __y) throw () __attribute__ ((__const__)); extern double __copysign (double __x, double __y) throw () __attribute__ ((__const__));
35807 extern double nan (__const char *__tagb) throw () __attribute__ ((__const__)); extern double __nan (__const char *__tagb) throw () __attribute__ ((__const__));
35808 extern int __isnan (double __value) throw () __attribute__ ((__const__));
35809 extern int isnan (double __value) throw () __attribute__ ((__const__));
35810 extern double j0 (double) throw (); extern double __j0 (double) throw ();
35811 extern double j1 (double) throw (); extern double __j1 (double) throw ();
35812 extern double jn (int, double) throw (); extern double __jn (int, double) throw ();
35813 extern double y0 (double) throw (); extern double __y0 (double) throw ();
35814 extern double y1 (double) throw (); extern double __y1 (double) throw ();
35815 extern double yn (int, double) throw (); extern double __yn (int, double) throw ();
35816 extern double erf (double) throw (); extern double __erf (double) throw ();
35817 extern double erfc (double) throw (); extern double __erfc (double) throw ();
35818 extern double lgamma (double) throw (); extern double __lgamma (double) throw ();
35819 extern double tgamma (double) throw (); extern double __tgamma (double) throw ();
35820 extern double gamma (double) throw (); extern double __gamma (double) throw ();
35821 extern double lgamma_r (double, int *__signgamp) throw (); extern double __lgamma_r (double, int *__signgamp) throw ();
35822 extern double rint (double __x) throw (); extern double __rint (double __x) throw ();
35823 extern double nextafter (double __x, double __y) throw () __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) throw () __attribute__ ((__const__));
35824 extern double nexttoward (double __x, long double __y) throw () __attribute__ ((__const__)); extern double __nexttoward (double __x, long double __y) throw () __attribute__ ((__const__));
35825 extern double remainder (double __x, double __y) throw (); extern double __remainder (double __x, double __y) throw ();
35826 extern double scalbn (double __x, int __n) throw (); extern double __scalbn (double __x, int __n) throw ();
35827 extern int ilogb (double __x) throw (); extern int __ilogb (double __x) throw ();
35828 extern double scalbln (double __x, long int __n) throw (); extern double __scalbln (double __x, long int __n) throw ();
35829 extern double nearbyint (double __x) throw (); extern double __nearbyint (double __x) throw ();
35830 extern double round (double __x) throw () __attribute__ ((__const__)); extern double __round (double __x) throw () __attribute__ ((__const__));
35831 extern double trunc (double __x) throw () __attribute__ ((__const__)); extern double __trunc (double __x) throw () __attribute__ ((__const__));
35832 extern double remquo (double __x, double __y, int *__quo) throw (); extern double __remquo (double __x, double __y, int *__quo) throw ();
35833 extern long int lrint (double __x) throw (); extern long int __lrint (double __x) throw ();
35834 extern long long int llrint (double __x) throw (); extern long long int __llrint (double __x) throw ();
35835 extern long int lround (double __x) throw (); extern long int __lround (double __x) throw ();
35836 extern long long int llround (double __x) throw (); extern long long int __llround (double __x) throw ();
35837 extern double fdim (double __x, double __y) throw (); extern double __fdim (double __x, double __y) throw ();
35838 extern double fmax (double __x, double __y) throw (); extern double __fmax (double __x, double __y) throw ();
35839 extern double fmin (double __x, double __y) throw (); extern double __fmin (double __x, double __y) throw ();
35840 extern int __fpclassify (double __value) throw ()
35841 __attribute__ ((__const__));
35842 extern int __signbit (double __value) throw ()
35843 __attribute__ ((__const__));
35844 extern double fma (double __x, double __y, double __z) throw (); extern double __fma (double __x, double __y, double __z) throw ();
35845 extern double scalb (double __x, double __n) throw (); extern double __scalb (double __x, double __n) throw ();
35846 extern float acosf (float __x) throw (); extern float __acosf (float __x) throw ();
35847 extern float asinf (float __x) throw (); extern float __asinf (float __x) throw ();
35848 extern float atanf (float __x) throw (); extern float __atanf (float __x) throw ();
35849 extern float atan2f (float __y, float __x) throw (); extern float __atan2f (float __y, float __x) throw ();
35850 extern float cosf (float __x) throw (); extern float __cosf (float __x) throw ();
35851 extern float sinf (float __x) throw (); extern float __sinf (float __x) throw ();
35852 extern float tanf (float __x) throw (); extern float __tanf (float __x) throw ();
35853 extern float coshf (float __x) throw (); extern float __coshf (float __x) throw ();
35854 extern float sinhf (float __x) throw (); extern float __sinhf (float __x) throw ();
35855 extern float tanhf (float __x) throw (); extern float __tanhf (float __x) throw ();
35856 extern float acoshf (float __x) throw (); extern float __acoshf (float __x) throw ();
35857 extern float asinhf (float __x) throw (); extern float __asinhf (float __x) throw ();
35858 extern float atanhf (float __x) throw (); extern float __atanhf (float __x) throw ();
35859 extern float expf (float __x) throw (); extern float __expf (float __x) throw ();
35860 extern float frexpf (float __x, int *__exponent) throw (); extern float __frexpf (float __x, int *__exponent) throw ();
35861 extern float ldexpf (float __x, int __exponent) throw (); extern float __ldexpf (float __x, int __exponent) throw ();
35862 extern float logf (float __x) throw (); extern float __logf (float __x) throw ();
35863 extern float log10f (float __x) throw (); extern float __log10f (float __x) throw ();
35864 extern float modff (float __x, float *__iptr) throw (); extern float __modff (float __x, float *__iptr) throw ();
35865 extern float expm1f (float __x) throw (); extern float __expm1f (float __x) throw ();
35866 extern float log1pf (float __x) throw (); extern float __log1pf (float __x) throw ();
35867 extern float logbf (float __x) throw (); extern float __logbf (float __x) throw ();
35868 extern float exp2f (float __x) throw (); extern float __exp2f (float __x) throw ();
35869 extern float log2f (float __x) throw (); extern float __log2f (float __x) throw ();
35870 extern float powf (float __x, float __y) throw (); extern float __powf (float __x, float __y) throw ();
35871 extern float sqrtf (float __x) throw (); extern float __sqrtf (float __x) throw ();
35872 extern float hypotf (float __x, float __y) throw (); extern float __hypotf (float __x, float __y) throw ();
35873 extern float cbrtf (float __x) throw (); extern float __cbrtf (float __x) throw ();
35874 extern float ceilf (float __x) throw () __attribute__ ((__const__)); extern float __ceilf (float __x) throw () __attribute__ ((__const__));
35875 extern float fabsf (float __x) throw () __attribute__ ((__const__)); extern float __fabsf (float __x) throw () __attribute__ ((__const__));
35876 extern float floorf (float __x) throw () __attribute__ ((__const__)); extern float __floorf (float __x) throw () __attribute__ ((__const__));
35877 extern float fmodf (float __x, float __y) throw (); extern float __fmodf (float __x, float __y) throw ();
35878 extern int __isinff (float __value) throw () __attribute__ ((__const__));
35879 extern int __finitef (float __value) throw () __attribute__ ((__const__));
35880 extern int isinff (float __value) throw () __attribute__ ((__const__));
35881 extern int finitef (float __value) throw () __attribute__ ((__const__));
35882 extern float dremf (float __x, float __y) throw (); extern float __dremf (float __x, float __y) throw ();
35883 extern float significandf (float __x) throw (); extern float __significandf (float __x) throw ();
35884 extern float copysignf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) throw () __attribute__ ((__const__));
35885 extern float nanf (__const char *__tagb) throw () __attribute__ ((__const__)); extern float __nanf (__const char *__tagb) throw () __attribute__ ((__const__));
35886 extern int __isnanf (float __value) throw () __attribute__ ((__const__));
35887 extern int isnanf (float __value) throw () __attribute__ ((__const__));
35888 extern float j0f (float) throw (); extern float __j0f (float) throw ();
35889 extern float j1f (float) throw (); extern float __j1f (float) throw ();
35890 extern float jnf (int, float) throw (); extern float __jnf (int, float) throw ();
35891 extern float y0f (float) throw (); extern float __y0f (float) throw ();
35892 extern float y1f (float) throw (); extern float __y1f (float) throw ();
35893 extern float ynf (int, float) throw (); extern float __ynf (int, float) throw ();
35894 extern float erff (float) throw (); extern float __erff (float) throw ();
35895 extern float erfcf (float) throw (); extern float __erfcf (float) throw ();
35896 extern float lgammaf (float) throw (); extern float __lgammaf (float) throw ();
35897 extern float tgammaf (float) throw (); extern float __tgammaf (float) throw ();
35898 extern float gammaf (float) throw (); extern float __gammaf (float) throw ();
35899 extern float lgammaf_r (float, int *__signgamp) throw (); extern float __lgammaf_r (float, int *__signgamp) throw ();
35900 extern float rintf (float __x) throw (); extern float __rintf (float __x) throw ();
35901 extern float nextafterf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) throw () __attribute__ ((__const__));
35902 extern float nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__)); extern float __nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__));
35903 extern float remainderf (float __x, float __y) throw (); extern float __remainderf (float __x, float __y) throw ();
35904 extern float scalbnf (float __x, int __n) throw (); extern float __scalbnf (float __x, int __n) throw ();
35905 extern int ilogbf (float __x) throw (); extern int __ilogbf (float __x) throw ();
35906 extern float scalblnf (float __x, long int __n) throw (); extern float __scalblnf (float __x, long int __n) throw ();
35907 extern float nearbyintf (float __x) throw (); extern float __nearbyintf (float __x) throw ();
35908 extern float roundf (float __x) throw () __attribute__ ((__const__)); extern float __roundf (float __x) throw () __attribute__ ((__const__));
35909 extern float truncf (float __x) throw () __attribute__ ((__const__)); extern float __truncf (float __x) throw () __attribute__ ((__const__));
35910 extern float remquof (float __x, float __y, int *__quo) throw (); extern float __remquof (float __x, float __y, int *__quo) throw ();
35911 extern long int lrintf (float __x) throw (); extern long int __lrintf (float __x) throw ();
35912 extern long long int llrintf (float __x) throw (); extern long long int __llrintf (float __x) throw ();
35913 extern long int lroundf (float __x) throw (); extern long int __lroundf (float __x) throw ();
35914 extern long long int llroundf (float __x) throw (); extern long long int __llroundf (float __x) throw ();
35915 extern float fdimf (float __x, float __y) throw (); extern float __fdimf (float __x, float __y) throw ();
35916 extern float fmaxf (float __x, float __y) throw (); extern float __fmaxf (float __x, float __y) throw ();
35917 extern float fminf (float __x, float __y) throw (); extern float __fminf (float __x, float __y) throw ();
35918 extern int __fpclassifyf (float __value) throw ()
35919 __attribute__ ((__const__));
35920 extern int __signbitf (float __value) throw ()
35921 __attribute__ ((__const__));
35922 extern float fmaf (float __x, float __y, float __z) throw (); extern float __fmaf (float __x, float __y, float __z) throw ();
35923 extern float scalbf (float __x, float __n) throw (); extern float __scalbf (float __x, float __n) throw ();
35924 extern int signgam;
35940 } _LIB_VERSION_TYPE;
35941 extern _LIB_VERSION_TYPE _LIB_VERSION;
35950 extern int matherr (struct __exception *__exc) throw ();
35952 typedef QtValidLicenseForCoreModule QtCoreModule;
35953 inline int qCeil(qreal v)
35955 if (sizeof(qreal) == sizeof(float))
35956 return int(ceilf(v));
35958 return int(ceil(v));
35960 inline int qFloor(qreal v)
35962 if (sizeof(qreal) == sizeof(float))
35963 return int(floorf(v));
35965 return int(floor(v));
35967 inline qreal qSin(qreal v)
35969 if (sizeof(qreal) == sizeof(float))
35974 inline qreal qCos(qreal v)
35976 if (sizeof(qreal) == sizeof(float))
35981 inline qreal qAcos(qreal v)
35983 if (sizeof(qreal) == sizeof(float))
35988 inline qreal qSqrt(qreal v)
35990 if (sizeof(qreal) == sizeof(float))
35995 inline qreal qLn(qreal v)
35997 if (sizeof(qreal) == sizeof(float))
36002 inline qreal qPow(qreal x, qreal y)
36004 if (sizeof(qreal) == sizeof(float))
36009 typedef QtValidLicenseForCoreModule QtCoreModule;
36010 inline void qbswap_helper(const uchar *src, uchar *dest, int size)
36012 for (int i = 0; i < size ; ++i) dest[i] = src[size - 1 - i];
36014 template <typename T> inline void qbswap(const T src, uchar *dest)
36016 qbswap_helper(reinterpret_cast<const uchar *>(&src), dest, sizeof(T));
36018 template <typename T> inline void qToUnaligned(const T src, uchar *dest)
36020 qMemCopy(dest, &src, sizeof(T));
36022 template <typename T> inline T qFromLittleEndian(const uchar *src);
36023 template <> inline quint64 qFromLittleEndian<quint64>(const uchar *src)
36027 | src[1] * static_cast<unsigned long long>(0x0000000000000100ULL)
36028 | src[2] * static_cast<unsigned long long>(0x0000000000010000ULL)
36029 | src[3] * static_cast<unsigned long long>(0x0000000001000000ULL)
36030 | src[4] * static_cast<unsigned long long>(0x0000000100000000ULL)
36031 | src[5] * static_cast<unsigned long long>(0x0000010000000000ULL)
36032 | src[6] * static_cast<unsigned long long>(0x0001000000000000ULL)
36033 | src[7] * static_cast<unsigned long long>(0x0100000000000000ULL);
36035 template <> inline quint32 qFromLittleEndian<quint32>(const uchar *src)
36039 | src[1] * quint32(0x00000100)
36040 | src[2] * quint32(0x00010000)
36041 | src[3] * quint32(0x01000000);
36043 template <> inline quint16 qFromLittleEndian<quint16>(const uchar *src)
36049 template <> inline qint64 qFromLittleEndian<qint64>(const uchar *src)
36050 { return static_cast<qint64>(qFromLittleEndian<quint64>(src)); }
36051 template <> inline qint32 qFromLittleEndian<qint32>(const uchar *src)
36052 { return static_cast<qint32>(qFromLittleEndian<quint32>(src)); }
36053 template <> inline qint16 qFromLittleEndian<qint16>(const uchar *src)
36054 { return static_cast<qint16>(qFromLittleEndian<quint16>(src)); }
36055 template <class T> inline T qFromBigEndian(const uchar *src);
36057 inline quint64 qFromBigEndian<quint64>(const uchar *src)
36061 | src[6] * static_cast<unsigned long long>(0x0000000000000100ULL)
36062 | src[5] * static_cast<unsigned long long>(0x0000000000010000ULL)
36063 | src[4] * static_cast<unsigned long long>(0x0000000001000000ULL)
36064 | src[3] * static_cast<unsigned long long>(0x0000000100000000ULL)
36065 | src[2] * static_cast<unsigned long long>(0x0000010000000000ULL)
36066 | src[1] * static_cast<unsigned long long>(0x0001000000000000ULL)
36067 | src[0] * static_cast<unsigned long long>(0x0100000000000000ULL);
36070 inline quint32 qFromBigEndian<quint32>(const uchar *src)
36074 | src[2] * quint32(0x00000100)
36075 | src[1] * quint32(0x00010000)
36076 | src[0] * quint32(0x01000000);
36079 inline quint16 qFromBigEndian<quint16>(const uchar *src)
36083 | src[0] * quint16(0x0100);
36085 template <> inline qint64 qFromBigEndian<qint64>(const uchar *src)
36086 { return static_cast<qint64>(qFromBigEndian<quint64>(src)); }
36087 template <> inline qint32 qFromBigEndian<qint32>(const uchar *src)
36088 { return static_cast<qint32>(qFromBigEndian<quint32>(src)); }
36089 template <> inline qint16 qFromBigEndian<qint16>(const uchar *src)
36090 { return static_cast<qint16>(qFromBigEndian<quint16>(src)); }
36091 template <typename T> T qbswap(T source);
36092 template <> inline quint64 qbswap<quint64>(quint64 source)
36095 | ((source & static_cast<unsigned long long>(0x00000000000000ffULL)) << 56)
36096 | ((source & static_cast<unsigned long long>(0x000000000000ff00ULL)) << 40)
36097 | ((source & static_cast<unsigned long long>(0x0000000000ff0000ULL)) << 24)
36098 | ((source & static_cast<unsigned long long>(0x00000000ff000000ULL)) << 8)
36099 | ((source & static_cast<unsigned long long>(0x000000ff00000000ULL)) >> 8)
36100 | ((source & static_cast<unsigned long long>(0x0000ff0000000000ULL)) >> 24)
36101 | ((source & static_cast<unsigned long long>(0x00ff000000000000ULL)) >> 40)
36102 | ((source & static_cast<unsigned long long>(0xff00000000000000ULL)) >> 56);
36104 template <> inline quint32 qbswap<quint32>(quint32 source)
36107 | ((source & 0x000000ff) << 24)
36108 | ((source & 0x0000ff00) << 8)
36109 | ((source & 0x00ff0000) >> 8)
36110 | ((source & 0xff000000) >> 24);
36112 template <> inline quint16 qbswap<quint16>(quint16 source)
36115 | ((source & 0x00ff) << 8)
36116 | ((source & 0xff00) >> 8);
36118 template <> inline qint64 qbswap<qint64>(qint64 source)
36120 return qbswap<quint64>(quint64(source));
36122 template <> inline qint32 qbswap<qint32>(qint32 source)
36124 return qbswap<quint32>(quint32(source));
36126 template <> inline qint16 qbswap<qint16>(qint16 source)
36128 return qbswap<quint16>(quint16(source));
36130 template <typename T> inline T qToBigEndian(T source)
36131 { return qbswap<T>(source); }
36132 template <typename T> inline T qFromBigEndian(T source)
36133 { return qbswap<T>(source); }
36134 template <typename T> inline T qToLittleEndian(T source)
36136 template <typename T> inline T qFromLittleEndian(T source)
36138 template <typename T> inline void qToBigEndian(T src, uchar *dest)
36139 { qbswap<T>(src, dest); }
36140 template <typename T> inline void qToLittleEndian(T src, uchar *dest)
36141 { qToUnaligned<T>(src, dest); }
36142 static inline bool qtransform_equals_no_translate(const QTransform &a, const QTransform &b)
36144 if (a.type() <= QTransform::TxTranslate && b.type() <= QTransform::TxTranslate) {
36149 return a.m11() == b.m11()
36150 && a.m12() == b.m12()
36151 && a.m21() == b.m21()
36152 && a.m22() == b.m22();
36155 QFontEngineGlyphCache::~QFontEngineGlyphCache()
36158 static HB_Bool hb_stringToGlyphs(HB_Font font, const HB_UChar16 *string, hb_uint32 length, HB_Glyph *glyphs, hb_uint32 *numGlyphs, HB_Bool rightToLeft)
36160 QFontEngine *fe = (QFontEngine *)font->userData;
36161 QVarLengthGlyphLayoutArray qglyphs(*numGlyphs);
36162 QTextEngine::ShaperFlags shaperFlags(QTextEngine::GlyphIndicesOnly);
36164 shaperFlags |= QTextEngine::RightToLeft;
36165 int nGlyphs = *numGlyphs;
36166 bool result = fe->stringToCMap(reinterpret_cast<const QChar *>(string), length, &qglyphs, &nGlyphs, shaperFlags);
36167 *numGlyphs = nGlyphs;
36170 for (hb_uint32 i = 0; i < *numGlyphs; ++i)
36171 glyphs[i] = qglyphs.glyphs[i];
36174 static void hb_getAdvances(HB_Font font, const HB_Glyph *glyphs, hb_uint32 numGlyphs, HB_Fixed *advances, int flags)
36176 QFontEngine *fe = (QFontEngine *)font->userData;
36177 QVarLengthGlyphLayoutArray qglyphs(numGlyphs);
36178 for (hb_uint32 i = 0; i < numGlyphs; ++i)
36179 qglyphs.glyphs[i] = glyphs[i];
36180 fe->recalcAdvances(&qglyphs, flags & HB_ShaperFlag_UseDesignMetrics ? QFlags<QTextEngine::ShaperFlag>(QTextEngine::DesignMetrics) : QFlags<QTextEngine::ShaperFlag>(0));
36181 for (hb_uint32 i = 0; i < numGlyphs; ++i)
36182 advances[i] = qglyphs.advances_x[i].value();
36184 static HB_Bool hb_canRender(HB_Font font, const HB_UChar16 *string, hb_uint32 length)
36186 QFontEngine *fe = (QFontEngine *)font->userData;
36187 return fe->canRender(reinterpret_cast<const QChar *>(string), length);
36189 static void hb_getGlyphMetrics(HB_Font font, HB_Glyph glyph, HB_GlyphMetrics *metrics)
36191 QFontEngine *fe = (QFontEngine *)font->userData;
36192 glyph_metrics_t m = fe->boundingBox(glyph);
36193 metrics->x = m.x.value();
36194 metrics->y = m.y.value();
36195 metrics->width = m.width.value();
36196 metrics->height = m.height.value();
36197 metrics->xOffset = m.xoff.value();
36198 metrics->yOffset = m.yoff.value();
36200 static HB_Fixed hb_getFontMetric(HB_Font font, HB_FontMetric metric)
36202 if (metric == HB_FontAscent) {
36203 QFontEngine *fe = (QFontEngine *)font->userData;
36204 return fe->ascent().value();
36208 HB_Error QFontEngine::getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints)
36216 return HB_Err_Not_Covered;
36218 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)
36220 QFontEngine *fe = (QFontEngine *)font->userData;
36221 return fe->getPointInOutline(glyph, flags, point, xpos, ypos, nPoints);
36223 static const HB_FontClass hb_fontClass = {
36224 hb_stringToGlyphs, hb_getAdvances, hb_canRender, hb_getPointInOutline,
36225 hb_getGlyphMetrics, hb_getFontMetric
36227 static HB_Error hb_getSFntTable(void *font, HB_Tag tableTag, HB_Byte *buffer, HB_UInt *length)
36229 QFontEngine *fe = (QFontEngine *)font;
36230 if (!fe->getSfntTableData(tableTag, buffer, length))
36231 return HB_Err_Invalid_Argument;
36234 QFontEngine::QFontEngine()
36241 memset(&hbFont, 0, sizeof(hbFont));
36242 hbFont.klass = &hb_fontClass;
36243 hbFont.userData = this;
36247 QFontEngine::~QFontEngine()
36249 for (GlyphPointerHash::iterator it = m_glyphPointerHash.begin(), end = m_glyphPointerHash.end();
36251 for (QList<QFontEngineGlyphCache*>::iterator it2 = it.value().begin(), end2 = it.value().end();
36252 it2 != end2; ++it2)
36255 m_glyphPointerHash.clear();
36256 for (GlyphIntHash::iterator it = m_glyphIntHash.begin(), end = m_glyphIntHash.end();
36258 for (QList<QFontEngineGlyphCache*>::iterator it2 = it.value().begin(), end2 = it.value().end();
36259 it2 != end2; ++it2)
36262 m_glyphIntHash.clear();
36263 qHBFreeFace(hbFace);
36265 QFixed QFontEngine::lineThickness() const
36267 int score = fontDef.weight * fontDef.pixelSize;
36268 int lw = score / 700;
36269 if (lw < 2 && score >= 1050) lw = 2;
36270 if (lw == 0) lw = 1;
36273 QFixed QFontEngine::underlinePosition() const
36275 return ((lineThickness() * 2) + 3) / 6;
36277 HB_Font QFontEngine::harfbuzzFont() const
36279 if (!hbFont.x_ppem) {
36280 QFixed emSquare = emSquareSize();
36281 hbFont.x_ppem = fontDef.pixelSize;
36282 hbFont.y_ppem = fontDef.pixelSize * fontDef.stretch / 100;
36283 hbFont.x_scale = (QFixed(hbFont.x_ppem * (1 << 16)) / emSquare).value();
36284 hbFont.y_scale = (QFixed(hbFont.y_ppem * (1 << 16)) / emSquare).value();
36288 HB_Face QFontEngine::harfbuzzFace() const
36291 hbFace = qHBNewFace(const_cast<QFontEngine *>(this), hb_getSFntTable);
36294 glyph_metrics_t QFontEngine::boundingBox(glyph_t glyph, const QTransform &matrix)
36296 glyph_metrics_t metrics = boundingBox(glyph);
36297 if (matrix.type() > QTransform::TxTranslate) {
36298 return metrics.transformed(matrix);
36302 QFixed QFontEngine::xHeight() const
36304 QGlyphLayoutArray<8> glyphs;
36306 QChar x((ushort)'x');
36307 stringToCMap(&x, 1, &glyphs, &nglyphs, QTextEngine::GlyphIndicesOnly);
36308 glyph_metrics_t bb = const_cast<QFontEngine *>(this)->boundingBox(glyphs.glyphs[0]);
36311 QFixed QFontEngine::averageCharWidth() const
36313 QGlyphLayoutArray<8> glyphs;
36315 QChar x((ushort)'x');
36316 stringToCMap(&x, 1, &glyphs, &nglyphs, QTextEngine::GlyphIndicesOnly);
36317 glyph_metrics_t bb = const_cast<QFontEngine *>(this)->boundingBox(glyphs.glyphs[0]);
36320 void QFontEngine::getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags,
36321 QVarLengthArray<glyph_t> &glyphs_out, QVarLengthArray<QFixedPoint> &positions)
36325 const bool transform = matrix.m11() != 1.
36326 || matrix.m12() != 0.
36327 || matrix.m21() != 0.
36328 || matrix.m22() != 1.;
36330 xpos = QFixed::fromReal(matrix.dx());
36331 ypos = QFixed::fromReal(matrix.dy());
36334 if (flags & QTextItem::RightToLeft) {
36335 int i = glyphs.numGlyphs;
36336 int totalKashidas = 0;
36338 xpos += glyphs.advances_x[i] + QFixed::fromFixed(glyphs.justifications[i].space_18d6);
36339 ypos += glyphs.advances_y[i];
36340 totalKashidas += glyphs.justifications[i].nKashidas;
36342 positions.resize(glyphs.numGlyphs+totalKashidas);
36343 glyphs_out.resize(glyphs.numGlyphs+totalKashidas);
36345 while(i < glyphs.numGlyphs) {
36346 if (glyphs.attributes[i].dontPrint) {
36350 xpos -= glyphs.advances_x[i];
36351 ypos -= glyphs.advances_y[i];
36352 QFixed gpos_x = xpos + glyphs.offsets[i].x;
36353 QFixed gpos_y = ypos + glyphs.offsets[i].y;
36355 QPointF gpos(gpos_x.toReal(), gpos_y.toReal());
36356 gpos = gpos * matrix;
36357 gpos_x = QFixed::fromReal(gpos.x());
36358 gpos_y = QFixed::fromReal(gpos.y());
36360 positions[current].x = gpos_x;
36361 positions[current].y = gpos_y;
36362 glyphs_out[current] = glyphs.glyphs[i];
36364 if (glyphs.justifications[i].nKashidas) {
36366 QGlyphLayoutArray<8> g;
36368 stringToCMap(&ch, 1, &g, &nglyphs, 0);
36369 for (uint k = 0; k < glyphs.justifications[i].nKashidas; ++k) {
36370 xpos -= g.advances_x[0];
36371 ypos -= g.advances_y[0];
36372 QFixed gpos_x = xpos + glyphs.offsets[i].x;
36373 QFixed gpos_y = ypos + glyphs.offsets[i].y;
36375 QPointF gpos(gpos_x.toReal(), gpos_y.toReal());
36376 gpos = gpos * matrix;
36377 gpos_x = QFixed::fromReal(gpos.x());
36378 gpos_y = QFixed::fromReal(gpos.y());
36380 positions[current].x = gpos_x;
36381 positions[current].y = gpos_y;
36382 glyphs_out[current] = g.glyphs[0];
36386 xpos -= QFixed::fromFixed(glyphs.justifications[i].space_18d6);
36391 positions.resize(glyphs.numGlyphs);
36392 glyphs_out.resize(glyphs.numGlyphs);
36395 while (i < glyphs.numGlyphs) {
36396 if (!glyphs.attributes[i].dontPrint) {
36397 positions[current].x = xpos + glyphs.offsets[i].x;
36398 positions[current].y = ypos + glyphs.offsets[i].y;
36399 glyphs_out[current] = glyphs.glyphs[i];
36400 xpos += glyphs.advances_x[i] + QFixed::fromFixed(glyphs.justifications[i].space_18d6);
36401 ypos += glyphs.advances_y[i];
36407 positions.resize(glyphs.numGlyphs);
36408 glyphs_out.resize(glyphs.numGlyphs);
36410 while (i < glyphs.numGlyphs) {
36411 if (!glyphs.attributes[i].dontPrint) {
36412 QFixed gpos_x = xpos + glyphs.offsets[i].x;
36413 QFixed gpos_y = ypos + glyphs.offsets[i].y;
36414 QPointF gpos(gpos_x.toReal(), gpos_y.toReal());
36415 gpos = gpos * matrix;
36416 positions[current].x = QFixed::fromReal(gpos.x());
36417 positions[current].y = QFixed::fromReal(gpos.y());
36418 glyphs_out[current] = glyphs.glyphs[i];
36419 xpos += glyphs.advances_x[i] + QFixed::fromFixed(glyphs.justifications[i].space_18d6);
36420 ypos += glyphs.advances_y[i];
36427 positions.resize(current);
36428 glyphs_out.resize(current);
36431 glyph_metrics_t QFontEngine::tightBoundingBox(const QGlyphLayout &glyphs)
36433 glyph_metrics_t overall;
36436 for (int i = 0; i < glyphs.numGlyphs; i++) {
36437 glyph_metrics_t bb = boundingBox(glyphs.glyphs[i]);
36438 QFixed x = overall.xoff + glyphs.offsets[i].x + bb.x;
36439 QFixed y = overall.yoff + glyphs.offsets[i].y + bb.y;
36440 overall.x = qMin(overall.x, x);
36441 overall.y = qMin(overall.y, y);
36442 xmax = qMax(xmax, x + bb.width);
36443 ymax = qMax(ymax, y + bb.height);
36444 overall.xoff += bb.xoff;
36445 overall.yoff += bb.yoff;
36447 overall.height = qMax(overall.height, ymax - overall.y);
36448 overall.width = xmax - overall.x;
36451 void QFontEngine::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path,
36452 QTextItem::RenderFlags flags)
36454 if (!glyphs.numGlyphs)
36456 QVarLengthArray<QFixedPoint> positions;
36457 QVarLengthArray<glyph_t> positioned_glyphs;
36459 matrix.translate(x, y);
36460 getGlyphPositions(glyphs, matrix, flags, positioned_glyphs, positions);
36461 addGlyphsToPath(positioned_glyphs.data(), positions.data(), positioned_glyphs.size(), path, flags);
36463 enum { EdgeRight = 0x1,
36468 static void collectSingleContour(qreal x0, qreal y0, uint *grid, int x, int y, int w, int h, QPainterPath *path)
36471 path->moveTo(x + x0, y + y0);
36472 while (grid[(y)*(w+1) + (x)]) {
36473 if (grid[(y)*(w+1) + (x)] & EdgeRight) {
36474 while (grid[(y)*(w+1) + (x)] & EdgeRight) {
36475 grid[(y)*(w+1) + (x)] &= ~EdgeRight;
36479 path->lineTo(x + x0, y + y0);
36482 if (grid[(y)*(w+1) + (x)] & EdgeDown) {
36483 while (grid[(y)*(w+1) + (x)] & EdgeDown) {
36484 grid[(y)*(w+1) + (x)] &= ~EdgeDown;
36488 path->lineTo(x + x0, y + y0);
36491 if (grid[(y)*(w+1) + (x)] & EdgeLeft) {
36492 while (grid[(y)*(w+1) + (x)] & EdgeLeft) {
36493 grid[(y)*(w+1) + (x)] &= ~EdgeLeft;
36497 path->lineTo(x + x0, y + y0);
36500 if (grid[(y)*(w+1) + (x)] & EdgeUp) {
36501 while (grid[(y)*(w+1) + (x)] & EdgeUp) {
36502 grid[(y)*(w+1) + (x)] &= ~EdgeUp;
36506 path->lineTo(x + x0, y + y0);
36510 path->closeSubpath();
36512 void qt_addBitmapToPath(qreal x0, qreal y0, const uchar *image_data, int bpl, int w, int h, QPainterPath *path)
36514 uint *grid = new uint[(w+1)*(h+1)];
36515 for (int y = 0; y <= h; ++y) {
36516 for (int x = 0; x <= w; ++x) {
36517 bool topLeft = (x == 0)|(y == 0) ? false : (*(image_data + (y - 1)*bpl + ((x - 1) >> 3)) & (0x80 >> ((x - 1) & 7)));
36518 bool topRight = (x == w)|(y == 0) ? false : (*(image_data + (y - 1)*bpl + ((x) >> 3)) & (0x80 >> ((x) & 7)));
36519 bool bottomLeft = (x == 0)|(y == h) ? false : (*(image_data + (y)*bpl + ((x - 1) >> 3)) & (0x80 >> ((x - 1) & 7)));
36520 bool bottomRight = (x == w)|(y == h) ? false : (*(image_data + (y)*bpl + ((x) >> 3)) & (0x80 >> ((x) & 7)));
36521 grid[(y)*(w+1) + (x)] = 0;
36522 if ((!topRight) & bottomRight)
36523 grid[(y)*(w+1) + (x)] |= EdgeRight;
36524 if ((!bottomRight) & bottomLeft)
36525 grid[(y)*(w+1) + (x)] |= EdgeDown;
36526 if ((!bottomLeft) & topLeft)
36527 grid[(y)*(w+1) + (x)] |= EdgeLeft;
36528 if ((!topLeft) & topRight)
36529 grid[(y)*(w+1) + (x)] |= EdgeUp;
36532 for (int y = 0; y < h; ++y) {
36533 for (int x = 0; x < w; ++x) {
36534 if (!grid[(y)*(w+1) + (x)])
36536 collectSingleContour(x0, y0, grid, x, y, w, h, path);
36541 void QFontEngine::addBitmapFontToPath(qreal x, qreal y, const QGlyphLayout &glyphs,
36542 QPainterPath *path, QTextItem::RenderFlags flags)
36545 QFixed advanceX = QFixed::fromReal(x);
36546 QFixed advanceY = QFixed::fromReal(y);
36547 for (int i=0; i < glyphs.numGlyphs; ++i) {
36548 glyph_metrics_t metrics = boundingBox(glyphs.glyphs[i]);
36549 if (metrics.width.value() == 0 || metrics.height.value() == 0) {
36550 advanceX += glyphs.advances_x[i];
36551 advanceY += glyphs.advances_y[i];
36554 const QImage alphaMask = alphaMapForGlyph(glyphs.glyphs[i]);
36555 const int w = alphaMask.width();
36556 const int h = alphaMask.height();
36557 const int srcBpl = alphaMask.bytesPerLine();
36559 if (alphaMask.depth() == 1) {
36560 bitmap = alphaMask;
36562 bitmap = QImage(w, h, QImage::Format_Mono);
36563 const uchar *imageData = alphaMask.bits();
36564 const int destBpl = bitmap.bytesPerLine();
36565 uchar *bitmapData = bitmap.bits();
36566 for (int yi = 0; yi < h; ++yi) {
36567 const uchar *src = imageData + yi*srcBpl;
36568 uchar *dst = bitmapData + yi*destBpl;
36569 for (int xi = 0; xi < w; ++xi) {
36570 const int byte = xi / 8;
36571 const int bit = xi % 8;
36575 dst[byte] |= 128 >> bit;
36579 const uchar *bitmap_data = bitmap.bits();
36580 QFixedPoint offset = glyphs.offsets[i];
36581 advanceX += offset.x;
36582 advanceY += offset.y;
36583 qt_addBitmapToPath((advanceX + metrics.x).toReal(), (advanceY + metrics.y).toReal(), bitmap_data, bitmap.bytesPerLine(), w, h, path);
36584 advanceX += glyphs.advances_x[i];
36585 advanceY += glyphs.advances_y[i];
36588 void QFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nGlyphs,
36589 QPainterPath *path, QTextItem::RenderFlags flags)
36591 qreal x = positions[0].x.toReal();
36592 qreal y = positions[0].y.toReal();
36593 QVarLengthGlyphLayoutArray g(nGlyphs);
36594 for (int i = 0; i < nGlyphs; ++i) {
36595 g.glyphs[i] = glyphs[i];
36596 if (i < nGlyphs - 1) {
36597 g.advances_x[i] = positions[i+1].x - positions[i].x;
36598 g.advances_y[i] = positions[i+1].y - positions[i].y;
36600 g.advances_x[i] = QFixed::fromReal(maxCharWidth());
36601 g.advances_y[i] = 0;
36604 addBitmapFontToPath(x, y, g, path, flags);
36606 QImage QFontEngine::alphaMapForGlyph(glyph_t glyph, const QTransform &t)
36608 QImage i = alphaMapForGlyph(glyph);
36609 if (t.type() > QTransform::TxTranslate)
36610 i = i.transformed(t);
36614 QImage QFontEngine::alphaRGBMapForGlyph(glyph_t glyph, int , const QTransform &t)
36616 QImage alphaMask = alphaMapForGlyph(glyph, t);
36617 QImage rgbMask(alphaMask.width(), alphaMask.height(), QImage::Format_RGB32);
36618 for (int y=0; y<alphaMask.height(); ++y) {
36619 uint *dst = (uint *) rgbMask.scanLine(y);
36620 uchar *src = (uchar *) alphaMask.scanLine(y);
36621 for (int x=0; x<alphaMask.width(); ++x)
36622 dst[x] = qRgb(src[x], src[x], src[x]);
36626 void QFontEngine::removeGlyphFromCache(glyph_t)
36629 QFontEngine::Properties QFontEngine::properties() const
36632 QByteArray psname = QPdf::stripSpecialCharacters(fontDef.family.toUtf8());
36634 psname += QByteArray::number(fontDef.style);
36636 psname += QByteArray::number(fontDef.weight);
36637 p.postscriptName = psname;
36638 p.ascent = ascent();
36639 p.descent = descent();
36640 p.leading = leading();
36641 p.emSquare = p.ascent;
36642 p.boundingBox = QRectF(0, -p.ascent.toReal(), maxCharWidth(), (p.ascent + p.descent).toReal());
36644 p.capHeight = p.ascent;
36645 p.lineWidth = lineThickness();
36648 void QFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics)
36650 *metrics = boundingBox(glyph);
36654 addGlyphsToPath(&glyph, &p, 1, path, QFlag(0));
36656 QByteArray QFontEngine::getSfntTable(uint tag) const
36660 if (!getSfntTableData(tag, 0, &len))
36665 if (!getSfntTableData(tag, reinterpret_cast<uchar *>(table.data()), &len))
36666 return QByteArray();
36669 void QFontEngine::expireGlyphCache()
36671 if (m_glyphCacheQueue.count() > 10) {
36672 QFontEngineGlyphCache *old = m_glyphCacheQueue.takeFirst();
36673 for (GlyphPointerHash::iterator i = m_glyphPointerHash.begin(); i != m_glyphPointerHash.end(); ++i) {
36674 QList<QFontEngineGlyphCache *> list = i.value();
36675 if (list.removeAll(old)) {
36676 if (list.isEmpty())
36677 m_glyphPointerHash.remove(i.key());
36679 m_glyphPointerHash.insert(i.key(), list);
36683 for (GlyphIntHash::iterator i = m_glyphIntHash.begin(); i != m_glyphIntHash.end(); ++i) {
36684 QList<QFontEngineGlyphCache *> list = i.value();
36685 if (list.removeAll(old)) {
36686 if (list.isEmpty())
36687 m_glyphIntHash.remove(i.key());
36689 m_glyphIntHash.insert(i.key(), list);
36696 void QFontEngine::setGlyphCache(void *key, QFontEngineGlyphCache *data)
36699 QList<QFontEngineGlyphCache*> items = m_glyphPointerHash.value(key);
36700 for (QList<QFontEngineGlyphCache*>::iterator it = items.begin(), end = items.end(); it != end; ++it) {
36701 QFontEngineGlyphCache *c = *it;
36702 if (qtransform_equals_no_translate(c->m_transform, data->m_transform)) {
36705 items.removeAll(c);
36710 items.append(data);
36711 m_glyphPointerHash.insert(key, items);
36712 m_glyphCacheQueue.append(data);
36713 expireGlyphCache();
36715 void QFontEngine::setGlyphCache(QFontEngineGlyphCache::Type key, QFontEngineGlyphCache *data)
36718 QList<QFontEngineGlyphCache*> items = m_glyphIntHash.value(key);
36719 for (QList<QFontEngineGlyphCache*>::iterator it = items.begin(), end = items.end(); it != end; ++it) {
36720 QFontEngineGlyphCache *c = *it;
36721 if (qtransform_equals_no_translate(c->m_transform, data->m_transform)) {
36724 items.removeAll(c);
36729 items.append(data);
36730 m_glyphIntHash.insert(key, items);
36731 m_glyphCacheQueue.append(data);
36732 expireGlyphCache();
36734 QFontEngineGlyphCache *QFontEngine::glyphCache(void *key, const QTransform &transform) const
36736 QList<QFontEngineGlyphCache*> items = m_glyphPointerHash.value(key);
36737 for (QList<QFontEngineGlyphCache*>::iterator it = items.begin(), end = items.end(); it != end; ++it) {
36738 QFontEngineGlyphCache *c = *it;
36739 if (qtransform_equals_no_translate(c->m_transform, transform)) {
36740 m_glyphCacheQueue.removeAll(c);
36741 m_glyphCacheQueue.append(c);
36747 QFontEngineGlyphCache *QFontEngine::glyphCache(QFontEngineGlyphCache::Type key, const QTransform &transform) const
36749 QList<QFontEngineGlyphCache*> items = m_glyphIntHash.value(key);
36750 for (QList<QFontEngineGlyphCache*>::iterator it = items.begin(), end = items.end(); it != end; ++it) {
36751 QFontEngineGlyphCache *c = *it;
36752 if (qtransform_equals_no_translate(c->m_transform, transform)) {
36753 m_glyphCacheQueue.removeAll(c);
36754 m_glyphCacheQueue.append(c);
36760 static inline QFixed kerning(int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
36762 uint left_right = (left << 16) + right;
36763 left = 0, right = numPairs - 1;
36764 while (left <= right) {
36765 int middle = left + ( ( right - left ) >> 1 );
36766 if(pairs[middle].left_right == left_right)
36767 return pairs[middle].adjust;
36768 if (pairs[middle].left_right < left_right)
36771 right = middle - 1;
36775 void QFontEngine::doKerning(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const
36777 int numPairs = kerning_pairs.size();
36780 const KernPair *pairs = kerning_pairs.constData();
36781 if(flags & QTextEngine::DesignMetrics) {
36782 for(int i = 0; i < glyphs->numGlyphs - 1; ++i)
36783 glyphs->advances_x[i] += kerning(glyphs->glyphs[i], glyphs->glyphs[i+1] , pairs, numPairs);
36785 for(int i = 0; i < glyphs->numGlyphs - 1; ++i)
36786 glyphs->advances_x[i] += qRound(kerning(glyphs->glyphs[i], glyphs->glyphs[i+1] , pairs, numPairs));
36789 void QFontEngine::loadKerningPairs(QFixed scalingFactor)
36791 kerning_pairs.clear();
36792 QByteArray tab = getSfntTable(( (((quint32)('k')) << 24) | (((quint32)('e')) << 16) | (((quint32)('r')) << 8) | ((quint32)('n')) ));
36795 const uchar *table = reinterpret_cast<const uchar *>(tab.constData());
36796 unsigned short version = qFromBigEndian<quint16>(table);
36797 if (version != 0) {
36800 unsigned short numTables = qFromBigEndian<quint16>(table + 2);
36803 for(int i = 0; i < numTables; ++i) {
36804 if (offset + 6 > tab.size()) {
36807 const uchar *header = table + offset;
36808 ushort version = qFromBigEndian<quint16>(header);
36809 ushort length = qFromBigEndian<quint16>(header+2);
36810 ushort coverage = qFromBigEndian<quint16>(header+4);
36811 if(version == 0 && coverage == 0x0001) {
36812 if (offset + length > tab.size()) {
36815 const uchar *data = table + offset + 6;
36816 ushort nPairs = qFromBigEndian<quint16>(data);
36817 if(nPairs * 6 + 8 > length - 6) {
36821 for(int i = 0; i < nPairs; ++i) {
36822 QFontEngine::KernPair p;
36823 p.left_right = (((uint)qFromBigEndian<quint16>(data+off)) << 16) + qFromBigEndian<quint16>(data+off+2);
36824 p.adjust = QFixed(((int)(short)qFromBigEndian<quint16>(data+off+4))) / scalingFactor;
36825 kerning_pairs.append(p);
36833 qSort(kerning_pairs);
36835 int QFontEngine::glyphCount() const
36837 QByteArray maxpTable = getSfntTable(( (((quint32)('m')) << 24) | (((quint32)('a')) << 16) | (((quint32)('x')) << 8) | ((quint32)('p')) ));
36838 if (maxpTable.size() < 6)
36840 return qFromBigEndian<quint16>(reinterpret_cast<const uchar *>(maxpTable.constData() + 4));
36842 const uchar *QFontEngine::getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize)
36844 const uchar *header = table;
36847 const uchar *endPtr = table + tableSize;
36848 if (qFromBigEndian<quint16>(header) != 0)
36850 unsigned short numTables = qFromBigEndian<quint16>(header + 2);
36851 const uchar *maps = table + 4;
36852 if (maps + 8 * numTables > endPtr)
36854 int tableToUse = -1;
36856 for (int n = 0; n < numTables; ++n) {
36857 const quint16 platformId = qFromBigEndian<quint16>(maps + 8 * n);
36858 const quint16 platformSpecificId = qFromBigEndian<quint16>(maps + 8 * n + 2);
36859 switch (platformId) {
36862 (platformSpecificId == 0 ||
36863 platformSpecificId == 2 ||
36864 platformSpecificId == 3)) {
36867 } else if (score < 3 && platformSpecificId == 1) {
36873 if (score < 2 && platformSpecificId == 0) {
36879 switch (platformSpecificId) {
36907 *isSymbolFont = (score == 1);
36908 unsigned int unicode_table = qFromBigEndian<quint32>(maps + 8*tableToUse + 4);
36909 if (!unicode_table || unicode_table + 8 > tableSize)
36911 header = table + unicode_table;
36912 unsigned short format = qFromBigEndian<quint16>(header);
36913 unsigned int length;
36915 length = qFromBigEndian<quint16>(header + 2);
36917 length = qFromBigEndian<quint32>(header + 4);
36918 if (table + unicode_table + length > endPtr)
36920 *cmapSize = length;
36921 return table + unicode_table;
36923 quint32 QFontEngine::getTrueTypeGlyphIndex(const uchar *cmap, uint unicode)
36925 unsigned short format = qFromBigEndian<quint16>(cmap);
36928 return (int) *(cmap+6+unicode);
36929 } else if (format == 4) {
36930 if(unicode >= 0xffff)
36932 quint16 segCountX2 = qFromBigEndian<quint16>(cmap + 6);
36933 const unsigned char *ends = cmap + 14;
36934 quint16 endIndex = 0;
36936 for (; i < segCountX2/2 && (endIndex = qFromBigEndian<quint16>(ends + 2*i)) < unicode; i++) {}
36937 const unsigned char *idx = ends + segCountX2 + 2 + 2*i;
36938 quint16 startIndex = qFromBigEndian<quint16>(idx);
36939 if (startIndex > unicode)
36942 qint16 idDelta = (qint16)qFromBigEndian<quint16>(idx);
36944 quint16 idRangeoffset_t = (quint16)qFromBigEndian<quint16>(idx);
36945 quint16 glyphIndex;
36946 if (idRangeoffset_t) {
36947 quint16 id = qFromBigEndian<quint16>(idRangeoffset_t + 2*(unicode - startIndex) + idx);
36949 glyphIndex = (idDelta + id) % 0x10000;
36953 glyphIndex = (idDelta + unicode) % 0x10000;
36956 } else if (format == 6) {
36957 quint16 tableSize = qFromBigEndian<quint16>(cmap + 2);
36958 quint16 firstCode6 = qFromBigEndian<quint16>(cmap + 6);
36959 if (unicode < firstCode6)
36961 quint16 entryCount6 = qFromBigEndian<quint16>(cmap + 8);
36962 if (entryCount6 * 2 + 10 > tableSize)
36964 quint16 sentinel6 = firstCode6 + entryCount6;
36965 if (unicode >= sentinel6)
36967 quint16 entryIndex6 = unicode - firstCode6;
36968 return qFromBigEndian<quint16>(cmap + 10 + (entryIndex6 * 2));
36969 } else if (format == 12) {
36970 quint32 nGroups = qFromBigEndian<quint32>(cmap + 12);
36972 int left = 0, right = nGroups - 1;
36973 while (left <= right) {
36974 int middle = left + ( ( right - left ) >> 1 );
36975 quint32 startCharCode = qFromBigEndian<quint32>(cmap + 12*middle);
36976 if(unicode < startCharCode)
36977 right = middle - 1;
36979 quint32 endCharCode = qFromBigEndian<quint32>(cmap + 12*middle + 4);
36980 if(unicode <= endCharCode)
36981 return qFromBigEndian<quint32>(cmap + 12*middle + 8) + unicode - startCharCode;
36986 qDebug("cmap table of format %d not implemented", format);
36990 QFontEngineBox::QFontEngineBox(int size)
36993 cache_cost = sizeof(QFontEngineBox);
36995 QFontEngineBox::~QFontEngineBox()
36998 bool QFontEngineBox::stringToCMap(const QChar *, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags) const
37000 if (*nglyphs < len) {
37004 for (int i = 0; i < len; i++) {
37005 glyphs->glyphs[i] = 0;
37006 glyphs->advances_x[i] = _size;
37007 glyphs->advances_y[i] = 0;
37010 glyphs->numGlyphs = len;
37013 void QFontEngineBox::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags) const
37015 for (int i = 0; i < glyphs->numGlyphs; i++) {
37016 glyphs->advances_x[i] = _size;
37017 glyphs->advances_y[i] = 0;
37020 void QFontEngineBox::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags)
37022 if (!glyphs.numGlyphs)
37024 QVarLengthArray<QFixedPoint> positions;
37025 QVarLengthArray<glyph_t> positioned_glyphs;
37027 matrix.translate(x, y - _size);
37028 getGlyphPositions(glyphs, matrix, flags, positioned_glyphs, positions);
37029 QSize s(_size - 3, _size - 3);
37030 for (int k = 0; k < positions.size(); k++)
37031 path->addRect(QRectF(positions[k].toPointF(), s));
37033 glyph_metrics_t QFontEngineBox::boundingBox(const QGlyphLayout &glyphs)
37035 glyph_metrics_t overall;
37036 overall.width = _size*glyphs.numGlyphs;
37037 overall.height = _size;
37038 overall.xoff = overall.width;
37041 void QFontEngineBox::draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &ti)
37043 if (!ti.glyphs.numGlyphs)
37045 QSize s(_size - 3, _size - 3);
37046 QVarLengthArray<QFixedPoint> positions;
37047 QVarLengthArray<glyph_t> glyphs;
37049 matrix.translate(x, y - _size);
37050 ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
37051 if (glyphs.size() == 0)
37053 QPainter *painter = p->painter();
37055 painter->setBrush(Qt::NoBrush);
37056 QPen pen = painter->pen();
37057 pen.setWidthF(lineThickness().toReal());
37058 painter->setPen(pen);
37059 for (int k = 0; k < positions.size(); k++)
37060 painter->drawRect(QRectF(positions[k].toPointF(), s));
37061 painter->restore();
37063 glyph_metrics_t QFontEngineBox::boundingBox(glyph_t)
37065 return glyph_metrics_t(0, -_size, _size, _size, _size, 0);
37067 QFixed QFontEngineBox::ascent() const
37071 QFixed QFontEngineBox::descent() const
37075 QFixed QFontEngineBox::leading() const
37077 QFixed l = _size * QFixed::fromReal(qreal(0.15));
37080 qreal QFontEngineBox::maxCharWidth() const
37084 const char *QFontEngineBox::name() const
37088 bool QFontEngineBox::canRender(const QChar *, int)
37092 QFontEngine::Type QFontEngineBox::type() const
37096 QImage QFontEngineBox::alphaMapForGlyph(glyph_t)
37098 QImage image(_size, _size, QImage::Format_Indexed8);
37099 QVector<QRgb> colors(256);
37100 for (int i=0; i<256; ++i)
37101 colors[i] = qRgba(0, 0, 0, i);
37102 image.setColorTable(colors);
37104 for (int i=2; i <= _size-3; ++i) {
37105 image.setPixel(i, 2, 255);
37106 image.setPixel(i, _size-3, 255);
37107 image.setPixel(2, i, 255);
37108 image.setPixel(_size-3, i, 255);
37112 static inline uchar highByte(glyph_t glyph)
37113 { return glyph >> 24; }
37114 static inline glyph_t stripped(glyph_t glyph)
37115 { return glyph & 0x00ffffff; }
37116 QFontEngineMulti::QFontEngineMulti(int engineCount)
37118 engines.fill(0, engineCount);
37121 QFontEngineMulti::~QFontEngineMulti()
37123 for (int i = 0; i < engines.size(); ++i) {
37124 QFontEngine *fontEngine = engines.at(i);
37126 fontEngine->ref.deref();
37127 if (fontEngine->cache_count == 0 && fontEngine->ref == 0)
37132 bool QFontEngineMulti::stringToCMap(const QChar *str, int len,
37133 QGlyphLayout *glyphs, int *nglyphs,
37134 QTextEngine::ShaperFlags flags) const
37137 if (!engine(0)->stringToCMap(str, len, glyphs, &ng, flags))
37140 for (int i = 0; i < len; ++i) {
37141 bool surrogate = (str[i].unicode() >= 0xd800 && str[i].unicode() < 0xdc00 && i < len-1
37142 && str[i+1].unicode() >= 0xdc00 && str[i+1].unicode() < 0xe000);
37143 if (glyphs->glyphs[glyph_pos] == 0) {
37144 QGlyphLayoutInstance tmp = glyphs->instance(glyph_pos);
37145 for (int x = 1; x < engines.size(); ++x) {
37146 QFontEngine *engine = engines.at(x);
37148 const_cast<QFontEngineMulti *>(this)->loadEngine(x);
37149 engine = engines.at(x);
37152 if (engine->type() == Box)
37154 glyphs->advances_x[glyph_pos] = glyphs->advances_y[glyph_pos] = 0;
37155 glyphs->offsets[glyph_pos] = QFixedPoint();
37157 QGlyphLayout offs = glyphs->mid(glyph_pos, num);
37158 engine->stringToCMap(str + i, surrogate ? 2 : 1, &offs, &num, flags);
37160 if (glyphs->glyphs[glyph_pos]) {
37161 glyphs->glyphs[glyph_pos] |= (x << 24);
37165 if (!glyphs->glyphs[glyph_pos]) {
37166 glyphs->setInstance(glyph_pos, tmp);
37174 glyphs->numGlyphs = ng;
37177 glyph_metrics_t QFontEngineMulti::boundingBox(const QGlyphLayout &glyphs)
37179 if (glyphs.numGlyphs <= 0)
37180 return glyph_metrics_t();
37181 glyph_metrics_t overall;
37182 int which = highByte(glyphs.glyphs[0]);
37185 for (end = 0; end < glyphs.numGlyphs; ++end) {
37186 const int e = highByte(glyphs.glyphs[end]);
37189 for (i = start; i < end; ++i)
37190 glyphs.glyphs[i] = stripped(glyphs.glyphs[i]);
37191 const glyph_metrics_t gm = engine(which)->boundingBox(glyphs.mid(start, end - start));
37192 overall.x = qMin(overall.x, gm.x);
37193 overall.y = qMin(overall.y, gm.y);
37194 overall.width = overall.xoff + gm.width;
37195 overall.height = qMax(overall.height + overall.y, gm.height + gm.y) -
37196 qMin(overall.y, gm.y);
37197 overall.xoff += gm.xoff;
37198 overall.yoff += gm.yoff;
37199 const int hi = which << 24;
37200 for (i = start; i < end; ++i)
37201 glyphs.glyphs[i] = hi | glyphs.glyphs[i];
37205 for (i = start; i < end; ++i)
37206 glyphs.glyphs[i] = stripped(glyphs.glyphs[i]);
37207 const glyph_metrics_t gm = engine(which)->boundingBox(glyphs.mid(start, end - start));
37208 overall.x = qMin(overall.x, gm.x);
37209 overall.y = qMin(overall.y, gm.y);
37210 overall.width = overall.xoff + gm.width;
37211 overall.height = qMax(overall.height + overall.y, gm.height + gm.y) -
37212 qMin(overall.y, gm.y);
37213 overall.xoff += gm.xoff;
37214 overall.yoff += gm.yoff;
37215 const int hi = which << 24;
37216 for (i = start; i < end; ++i)
37217 glyphs.glyphs[i] = hi | glyphs.glyphs[i];
37220 void QFontEngineMulti::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs,
37221 QPainterPath *path, QTextItem::RenderFlags flags)
37223 if (glyphs.numGlyphs <= 0)
37225 int which = highByte(glyphs.glyphs[0]);
37228 if (flags & QTextItem::RightToLeft) {
37229 for (int gl = 0; gl < glyphs.numGlyphs; gl++) {
37230 x += glyphs.advances_x[gl].toReal();
37231 y += glyphs.advances_y[gl].toReal();
37234 for (end = 0; end < glyphs.numGlyphs; ++end) {
37235 const int e = highByte(glyphs.glyphs[end]);
37238 if (flags & QTextItem::RightToLeft) {
37239 for (i = start; i < end; ++i) {
37240 x -= glyphs.advances_x[i].toReal();
37241 y -= glyphs.advances_y[i].toReal();
37244 for (i = start; i < end; ++i)
37245 glyphs.glyphs[i] = stripped(glyphs.glyphs[i]);
37246 engine(which)->addOutlineToPath(x, y, glyphs.mid(start, end - start), path, flags);
37247 const int hi = which << 24;
37248 for (i = start; i < end; ++i)
37249 glyphs.glyphs[i] = hi | glyphs.glyphs[i];
37250 if (!(flags & QTextItem::RightToLeft)) {
37251 for (i = start; i < end; ++i) {
37252 x += glyphs.advances_x[i].toReal();
37253 y += glyphs.advances_y[i].toReal();
37259 if (flags & QTextItem::RightToLeft) {
37260 for (i = start; i < end; ++i) {
37261 x -= glyphs.advances_x[i].toReal();
37262 y -= glyphs.advances_y[i].toReal();
37265 for (i = start; i < end; ++i)
37266 glyphs.glyphs[i] = stripped(glyphs.glyphs[i]);
37267 engine(which)->addOutlineToPath(x, y, glyphs.mid(start, end - start), path, flags);
37268 const int hi = which << 24;
37269 for (i = start; i < end; ++i)
37270 glyphs.glyphs[i] = hi | glyphs.glyphs[i];
37272 void QFontEngineMulti::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const
37274 if (glyphs->numGlyphs <= 0)
37276 int which = highByte(glyphs->glyphs[0]);
37279 for (end = 0; end < glyphs->numGlyphs; ++end) {
37280 const int e = highByte(glyphs->glyphs[end]);
37283 for (i = start; i < end; ++i)
37284 glyphs->glyphs[i] = stripped(glyphs->glyphs[i]);
37285 QGlyphLayout offs = glyphs->mid(start, end - start);
37286 engine(which)->recalcAdvances(&offs, flags);
37287 const int hi = which << 24;
37288 for (i = start; i < end; ++i)
37289 glyphs->glyphs[i] = hi | glyphs->glyphs[i];
37293 for (i = start; i < end; ++i)
37294 glyphs->glyphs[i] = stripped(glyphs->glyphs[i]);
37295 QGlyphLayout offs = glyphs->mid(start, end - start);
37296 engine(which)->recalcAdvances(&offs, flags);
37297 const int hi = which << 24;
37298 for (i = start; i < end; ++i)
37299 glyphs->glyphs[i] = hi | glyphs->glyphs[i];
37301 void QFontEngineMulti::doKerning(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const
37303 if (glyphs->numGlyphs <= 0)
37305 int which = highByte(glyphs->glyphs[0]);
37308 for (end = 0; end < glyphs->numGlyphs; ++end) {
37309 const int e = highByte(glyphs->glyphs[end]);
37312 for (i = start; i < end; ++i)
37313 glyphs->glyphs[i] = stripped(glyphs->glyphs[i]);
37314 QGlyphLayout offs = glyphs->mid(start, end - start);
37315 engine(which)->doKerning(&offs, flags);
37316 const int hi = which << 24;
37317 for (i = start; i < end; ++i)
37318 glyphs->glyphs[i] = hi | glyphs->glyphs[i];
37322 for (i = start; i < end; ++i)
37323 glyphs->glyphs[i] = stripped(glyphs->glyphs[i]);
37324 QGlyphLayout offs = glyphs->mid(start, end - start);
37325 engine(which)->doKerning(&offs, flags);
37326 const int hi = which << 24;
37327 for (i = start; i < end; ++i)
37328 glyphs->glyphs[i] = hi | glyphs->glyphs[i];
37330 glyph_metrics_t QFontEngineMulti::boundingBox(glyph_t glyph)
37332 const int which = highByte(glyph);
37334 return engine(which)->boundingBox(stripped(glyph));
37336 QFixed QFontEngineMulti::ascent() const
37337 { return engine(0)->ascent(); }
37338 QFixed QFontEngineMulti::descent() const
37339 { return engine(0)->descent(); }
37340 QFixed QFontEngineMulti::leading() const
37342 return engine(0)->leading();
37344 QFixed QFontEngineMulti::xHeight() const
37346 return engine(0)->xHeight();
37348 QFixed QFontEngineMulti::averageCharWidth() const
37350 return engine(0)->averageCharWidth();
37352 QFixed QFontEngineMulti::lineThickness() const
37354 return engine(0)->lineThickness();
37356 QFixed QFontEngineMulti::underlinePosition() const
37358 return engine(0)->underlinePosition();
37360 qreal QFontEngineMulti::maxCharWidth() const
37362 return engine(0)->maxCharWidth();
37364 qreal QFontEngineMulti::minLeftBearing() const
37366 return engine(0)->minLeftBearing();
37368 qreal QFontEngineMulti::minRightBearing() const
37370 return engine(0)->minRightBearing();
37372 bool QFontEngineMulti::canRender(const QChar *string, int len)
37374 if (engine(0)->canRender(string, len))
37376 QVarLengthGlyphLayoutArray glyphs(len);
37378 if (stringToCMap(string, len, &glyphs, &nglyphs, QTextEngine::GlyphIndicesOnly) == false) {
37379 glyphs.resize(nglyphs);
37380 stringToCMap(string, len, &glyphs, &nglyphs, QTextEngine::GlyphIndicesOnly);
37382 bool allExist = true;
37383 for (int i = 0; i < nglyphs; i++) {
37384 if (!glyphs.glyphs[i]) {
37391 QFontEngine *QFontEngineMulti::engine(int at) const
37394 return engines.at(at);
37396 QImage QFontEngineMulti::alphaMapForGlyph(glyph_t)