exceptioncontext_p.h 751 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef QTJSONSERIALIZER_EXCEPTIONCONTEXT_P_H
  2. #define QTJSONSERIALIZER_EXCEPTIONCONTEXT_P_H
  3. #include "qtjsonserializer_global.h"
  4. #include "exception.h"
  5. #include <QtCore/QMetaProperty>
  6. #include <QtCore/QThreadStorage>
  7. #include <QtCore/QLoggingCategory>
  8. namespace QtJsonSerializer {
  9. class Q_JSONSERIALIZER_EXPORT ExceptionContext
  10. {
  11. public:
  12. ExceptionContext(const QMetaProperty &property);
  13. ExceptionContext(int propertyType, const QByteArray &hint);
  14. ~ExceptionContext();
  15. static SerializationException::PropertyTrace currentContext();
  16. static int currentDepth();
  17. private:
  18. static QThreadStorage<SerializationException::PropertyTrace> contextStore;
  19. };
  20. Q_DECLARE_LOGGING_CATEGORY(logExceptCtx)
  21. }
  22. #endif // QTJSONSERIALIZER_EXCEPTIONCONTEXT_P_H