mirror of https://github.com/KLayout/klayout.git
Merge remote-tracking branch 'upstream/qt6' into qt6-mac
This commit is contained in:
commit
bf8793f41f
|
|
@ -475,6 +475,8 @@ drop_class "QWSServer"
|
|||
drop_class "QWSWindow"
|
||||
|
||||
# depedencies from operators are not derived automatically currently:
|
||||
include "QPolygon", [ "<QTransform>", "<QMatrix>" ]
|
||||
include "QPolygonF", [ "<QTransform>", "<QMatrix>" ]
|
||||
include "QPoint", [ "<QPoint>", "<QMatrix>", "<QMatrix4x4>" ]
|
||||
include "QPointF", [ "<QPointF>", "<QMatrix>", "<QMatrix4x4>" ]
|
||||
include "QVector3D", [ "<QVector3D>", "<QVector2D>", "<QMatrix4x4>" ]
|
||||
|
|
|
|||
|
|
@ -226,6 +226,9 @@ drop_class "QVectorIterator"
|
|||
drop_class "QVectorTypedData"
|
||||
|
||||
drop_enum_const "QEvent", /CocoaRequestModal/ # not available on WIN
|
||||
|
||||
drop_method "QMetaType", /QMetaType::staticMetaObject/ # not available
|
||||
drop_method "QMetaType", /QMetaType::registerNormalizedType/ # needs function ptrs.
|
||||
drop_method "QCollator", /QCollator::compare\(.*QStringRef/ # clashes with QString version
|
||||
drop_method "QLocale", /QLocale::(toDouble|toFloat|toInt|toLongLong|toShort|quoteString|toUInt|toULongLong|toUShort)\(.*QStringRef/ # clashes with QString version
|
||||
drop_method "QRegularExpression", /QRegularExpression::(match|globalMatch)\(.*QStringRef/ # clashes with QString version
|
||||
|
|
@ -640,11 +643,11 @@ include "QVector3D", [ "<QVector3D>", "<QVector2D>", "<QMatrix4x4>" ]
|
|||
include "QVector4D", [ "<QVector4D>", "<QVector2D>", "<QMatrix4x4>" ]
|
||||
include "QAction", [ "<QAction>", "<QGraphicsWidget>", "<QMenu>" ]
|
||||
include "QCursor", [ "<QCursor>", "<QScreen>", "<QBitmap>" ]
|
||||
include "QGraphicsItem", [ "<QGraphicsItem>", "<QGraphicsTransform>", "<QGraphicsScene>", "<QStyleOptionGraphicsItem>", "<QGraphicsEffect>", "<QGraphicsWidget>", "<QGraphicsSceneContextMenuEvent>", "<QGraphicsSceneDragDropEvent>", "<QGraphicsSceneHoverEvent>", "<QGraphicsSceneMouseEvent>", "<QGraphicsSceneWheelEvent>" ]
|
||||
include "QGraphicsItem", [ "<QGraphicsItem>", "<QGraphicsTransform>", "<QGraphicsScene>", "<QStyleOptionGraphicsItem>", "<QGraphicsEffect>", "<QGraphicsWidget>", "<QGraphicsSceneContextMenuEvent>", "<QGraphicsSceneDragDropEvent>", "<QGraphicsSceneHoverEvent>", "<QGraphicsSceneMouseEvent>", "<QGraphicsSceneWheelEvent>", "<QPainter>" ]
|
||||
include "QGraphicsScene", [ "<QGraphicsScene>", "<QGraphicsView>", "<QGraphicsItem>", "<QGraphicsWidget>", "<QGraphicsEllipseItem>", "<QGraphicsLineItem>", "<QGraphicsPathItem>", "<QGraphicsPixmapItem>", "<QGraphicsPolygonItem>", "<QGraphicsRectItem>", "<QGraphicsSimpleTextItem>", "<QGraphicsTextItem>", "<QGraphicsProxyWidget>", "<QGraphicsItemGroup>", "<QStyle>", "<QGraphicsSceneContextMenuEvent>", "<QGraphicsSceneDragDropEvent>", "<QGraphicsSceneHelpEvent>", "<QGraphicsSceneMouseEvent>", "<QGraphicsSceneWheelEvent>" ]
|
||||
include "QGuiApplication", [ "<QGuiApplication>", "<QScreen>", "<QSessionManager>", "<QClipboard>", "<QWindow>", "<QStyleHints>" ]
|
||||
include "QGuiApplication", [ "<QGuiApplication>", "<QScreen>", "<QSessionManager>", "<QClipboard>", "<QWindow>", "<QStyleHints>", "<QFont>", "<QPalette>" ]
|
||||
include "QApplication", [ "<QApplication>", "<QSessionManager>", "<QDesktopWidget>", "<QStyle>", "<QWindow>", "<QScreen>" ]
|
||||
include "QWindow", [ "<QWindow>", "<QScreen>" ]
|
||||
include "QWindow", [ "<QWindow>", "<QScreen>", "<QAccessibleInterface>" ]
|
||||
include "QOffscreenSurface", [ "<QOffscreenSurface>", "<QScreen>" ]
|
||||
include "QScreenOrientationChangeEvent", [ "<QScreenOrientationChangeEvent>", "<QScreen>" ]
|
||||
|
||||
|
|
@ -864,7 +867,7 @@ no_copy_ctor "QIconEngine"
|
|||
# QtXml
|
||||
|
||||
include "QXmlFormatter", [ "<QXmlFormatter>", "<QXmlQuery>" ]
|
||||
include "QXmlSerializer", [ "<QXmlSerializer>", "<QXmlQuery>" ]
|
||||
include "QXmlSerializer", [ "<QXmlSerializer>", "<QXmlQuery>", "<QTextCodec>" ]
|
||||
|
||||
no_imports "QXmlStreamAttributes" # base class is a template.
|
||||
|
||||
|
|
@ -997,7 +1000,7 @@ final_class "QFormBuilder" # requires a lot of Dom* classes
|
|||
include "QCamera", [ "<QCamera>", "<QVideoWidget>", "<QGraphicsVideoItem>", "<QAbstractVideoSurface>", "<QCameraInfo>" ]
|
||||
include "QAudioBuffer", [ "<QAudioBuffer>" ]
|
||||
include "QBackingStore", [ "<QBackingStore>" ]
|
||||
include "QMediaPlayer", [ "<QMediaPlayer>", "<QVideoWidget>", "<QGraphicsVideoItem>", "<QMediaPlaylist>", "<QAbstractVideoSurface>" ]
|
||||
include "QMediaPlayer", [ "<QMediaPlayer>", "<QVideoWidget>", "<QGraphicsVideoItem>", "<QMediaPlaylist>", "<QAbstractVideoSurface>", "<QMediaService>" ]
|
||||
|
||||
drop_class "QAudioBuffer", /StereoFrameDefault/
|
||||
drop_class "QAudioBuffer", /StereoFrame/
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ drop_method :all_classes, /\(.*std::initializer_list.*\)/ # no brace initializat
|
|||
drop_method :all_classes, /\(.*std::function.*\)/ # std::function not bindable
|
||||
drop_method :all_classes, /^std::function</ # std::function not bindable as return value
|
||||
drop_method :all_classes, /::bindable/ # no QBindable available
|
||||
drop_method :all_classes, /.*QtPrivate::.*/ # no private stuff
|
||||
|
||||
rename :all_classes, /::create\(/, "qt_create" # clashes with GSI/Ruby
|
||||
rename :all_classes, /::destroy\(/, "qt_destroy" # clashes with GSI/Ruby
|
||||
|
|
@ -114,9 +115,14 @@ drop_class "QCborStreamReader" # complex API & there are better alternatives
|
|||
drop_class "QCborStreamWriter" # complex API & there are better alternatives
|
||||
drop_class "QCborValue" # complex API & there are better alternatives
|
||||
drop_class "QCborValueRef" # complex API & there are better alternatives
|
||||
drop_class "QCborKnownTags" # complex API & there are better alternatives
|
||||
drop_class "QCborNegativeInteger" # complex API & there are better alternatives
|
||||
drop_class "QCborSimpleType" # complex API & there are better alternatives
|
||||
drop_class "QtMsgType" # complex API & there are better alternatives
|
||||
drop_class "QChar"
|
||||
drop_class "QCharRef"
|
||||
drop_class "QConstIterator"
|
||||
drop_class "QConstOverload"
|
||||
drop_class "QConstString"
|
||||
drop_class "QContainerInfo"
|
||||
drop_class "QContiguousCache"
|
||||
|
|
@ -199,6 +205,7 @@ drop_class "QMutableVectorIterator"
|
|||
drop_class "QMutexLocker"
|
||||
drop_class "QNativeInterface"
|
||||
drop_class "QNoImplicitBoolCast"
|
||||
drop_class "QNonConstOverload"
|
||||
drop_class "QObjectBindableProperty"
|
||||
drop_class "QObjectCleanupHandler"
|
||||
drop_class "QObjectComputedProperty"
|
||||
|
|
@ -208,6 +215,7 @@ drop_class "QObjectUserData"
|
|||
drop_class "QOverload"
|
||||
drop_class "QPair"
|
||||
drop_class "QPointer"
|
||||
drop_class "QPromise"
|
||||
drop_class "QProperty"
|
||||
drop_class "QPropertyAlias"
|
||||
drop_class "QPropertyBinding"
|
||||
|
|
@ -216,6 +224,7 @@ drop_class "QPropertyChangeHandler"
|
|||
drop_class "QPropertyData"
|
||||
drop_class "QQueue"
|
||||
drop_class "QReturnArgument"
|
||||
drop_class "QRgbaFloat"
|
||||
drop_class "QScopedArrayPointer"
|
||||
drop_class "QScopedPointer"
|
||||
drop_class "QScopedPointerArrayDeleter"
|
||||
|
|
@ -309,6 +318,9 @@ drop_class "QWeakPointer"
|
|||
|
||||
drop_enum_const "QEvent", /CocoaRequestModal/ # not available on WIN
|
||||
|
||||
drop_method "QMetaType", /QMetaType::staticMetaObject/ # not available
|
||||
drop_method "QMetaType", /QMetaType::register.*Function\(/ # std::function not available
|
||||
drop_method "QDeadlineTimer", /QDeadlineTimer::_q_data/ # internal (@@@ TODO: QDealineTimer is present twice?)
|
||||
drop_method "QObject", /QObject::bindingStorage/ # no QBindingStorage
|
||||
drop_method "QPluginLoader", /QPluginLoader::staticPlugins/ # no QStaticPlugin
|
||||
drop_method "QKeyCombination", /QKeyCombination::operator<\(/ # deleted
|
||||
|
|
@ -444,8 +456,8 @@ drop_method "", /::operator\s*==\(const\s+QVariant\s*&\w+,\s*const\s+QVariantCom
|
|||
drop_method "", /::operator\s*!=\(const\s+QVariant\s*&\w+,\s*const\s+QVariantComparisonHelper/ # requires QVariantComparisonHelper
|
||||
drop_method "QByteArrayMatcher", /QByteArrayMatcher::indexIn\(const\s+QByteArray/ # clashes with const char * variant
|
||||
drop_method "QRegion", /QRegion::setRects/ # gets a new implementation
|
||||
drop_method "QRegion", /QRegion::crbegin/ # iterator not available
|
||||
drop_method "QRegion", /QRegion::crend/ # iterator not available
|
||||
drop_method "QRegion", /QRegion::c?rbegin/ # iterator not available
|
||||
drop_method "QRegion", /QRegion::c?rend/ # iterator not available
|
||||
drop_method "QTimer", /static\s+void\s+QTimer::singleShot\(/ # requires slots, alternative impl?
|
||||
drop_method "QDebug", /QDebug::operator\s*<<\((?!const\s+QString\s*&)/ # don't map the others right now - too many (TODO: how to map?)
|
||||
drop_method "", /::operator\s*<<\(QDebug\s*\w*\s*,\s*(?!const\s+QString\s*&)/ # don't map the others right now - too many (TODO: how to map?)
|
||||
|
|
@ -486,9 +498,6 @@ drop_method "QGuiApplication", /QGuiApplication::notify/
|
|||
# alternative implementation for QObject::findChild
|
||||
add_native_impl_QObject_findChild
|
||||
|
||||
# alternative implementation for QFont::Light, QFont::Bold, QFont::Normal, QFont::DemiBold, QFont::Black
|
||||
add_native_impl_QFont
|
||||
|
||||
# alternative implementation for QRegion::setRects
|
||||
add_native_impl_QRegion
|
||||
|
||||
|
|
@ -582,18 +591,48 @@ add_native_impl("QMessageLogger", <<'CODE', <<'DECL')
|
|||
logger->warning(cat, "%s", msg);
|
||||
}
|
||||
CODE
|
||||
gsi::method_ext("critical", &critical1, "@brief Method void QMessageLogger::critical(const char *msg)") +
|
||||
gsi::method_ext("critical", &critical2, "@brief Method void QMessageLogger::critical(const QLoggingCategory &cat, const char *msg)") +
|
||||
gsi::method_ext("debug", &debug1, "@brief Method void QMessageLogger::debug(const char *msg)") +
|
||||
gsi::method_ext("debug", &debug2, "@brief Method void QMessageLogger::debug(const QLoggingCategory &cat, const char *msg)") +
|
||||
gsi::method_ext("fatal", &fatal1, "@brief Method void QMessageLogger::fatal(const char *msg)") +
|
||||
gsi::method_ext("info", &info1, "@brief Method void QMessageLogger::info(const char *msg)") +
|
||||
gsi::method_ext("info", &info2, "@brief Method void QMessageLogger::info(const QLoggingCategory &cat, const char *msg)") +
|
||||
gsi::method_ext("noDebug", &noDebug1, "@brief Method void QMessageLogger::noDebug(const char *msg)") +
|
||||
gsi::method_ext("warning", &warning1, "@brief Method void QMessageLogger::warning(const char *msg)") +
|
||||
gsi::method_ext("warning", &warning2, "@brief Method void QMessageLogger::warning(const QLoggingCategory &cat, const char *msg)")
|
||||
gsi::method_ext("critical", &critical1, gsi::arg ("msg"), "@brief Method void QMessageLogger::critical(const char *msg)") +
|
||||
gsi::method_ext("critical", &critical2, gsi::arg ("cat"), gsi::arg ("msg"), "@brief Method void QMessageLogger::critical(const QLoggingCategory &cat, const char *msg)") +
|
||||
gsi::method_ext("debug", &debug1, gsi::arg ("msg"), "@brief Method void QMessageLogger::debug(const char *msg)") +
|
||||
gsi::method_ext("debug", &debug2, gsi::arg ("cat"), gsi::arg ("msg"), "@brief Method void QMessageLogger::debug(const QLoggingCategory &cat, const char *msg)") +
|
||||
gsi::method_ext("fatal", &fatal1, gsi::arg ("msg"), "@brief Method void QMessageLogger::fatal(const char *msg)") +
|
||||
gsi::method_ext("info", &info1, gsi::arg ("msg"), "@brief Method void QMessageLogger::info(const char *msg)") +
|
||||
gsi::method_ext("info", &info2, gsi::arg ("cat"), gsi::arg ("msg"), "@brief Method void QMessageLogger::info(const QLoggingCategory &cat, const char *msg)") +
|
||||
gsi::method_ext("noDebug", &noDebug1, gsi::arg ("msg"), "@brief Method void QMessageLogger::noDebug(const char *msg)") +
|
||||
gsi::method_ext("warning", &warning1, gsi::arg ("msg"), "@brief Method void QMessageLogger::warning(const char *msg)") +
|
||||
gsi::method_ext("warning", &warning2, gsi::arg ("cat"), gsi::arg ("msg"), "@brief Method void QMessageLogger::warning(const QLoggingCategory &cat, const char *msg)")
|
||||
DECL
|
||||
|
||||
drop_method("QStringDecoder", /::decode/)
|
||||
drop_method("QStringDecoder", /::operator\(\)/)
|
||||
|
||||
add_native_impl("QStringDecoder", <<'CODE', <<'DECL')
|
||||
static QString decode (QStringDecoder *decoder, const QByteArray &ba)
|
||||
{
|
||||
return decoder->decode (ba);
|
||||
}
|
||||
CODE
|
||||
gsi::method_ext("decode", &decode, gsi::arg ("ba"), "@brief Method QStringDecoder::EncodedData<QByteArrayView> QStringDecoder::decode(QByteArrayView ba)\n") +
|
||||
gsi::method_ext("()", &decode, gsi::arg ("ba"), "@brief Method QStringDecoder::EncodedData<QByteArrayView> QStringDecoder::decode(QByteArrayView ba)\n")
|
||||
DECL
|
||||
|
||||
drop_method("QStringEncoder", /::encode/)
|
||||
drop_method("QStringEncoder", /::operator\(\)/)
|
||||
|
||||
add_native_impl("QStringEncoder", <<'CODE', <<'DECL')
|
||||
static QByteArray encode (QStringEncoder *encoder, const QString &in)
|
||||
{
|
||||
return encoder->encode (in);
|
||||
}
|
||||
CODE
|
||||
gsi::method_ext("encode", &encode, gsi::arg ("in"), "@brief Method QStringEncoder::DecodedData<QStringView> QStringEncoder::encode(QStringView in)\n") +
|
||||
gsi::method_ext("()", &encode, gsi::arg ("in"), "@brief Method QStringEncoder::DecodedData<QStringView> QStringEncoder::operator()(QStringView in)\n")
|
||||
DECL
|
||||
|
||||
drop_method("QStringEncoder", /::appendToBuffer/) # needs char *
|
||||
drop_method("QStringDecoder", /::appendToBuffer/) # needs char *
|
||||
|
||||
|
||||
# --------------------------------------------------------------
|
||||
# QtGui
|
||||
|
||||
|
|
@ -645,7 +684,6 @@ drop_class "QProxyScreen"
|
|||
drop_class "QProxyScreenCursor"
|
||||
drop_class "QProxyStyle"
|
||||
drop_class "QRasterPaintEngine"
|
||||
drop_class "QRgba64" # some problem with quint64 type ... @@@ TODO: debug later
|
||||
drop_class "QScreenCursor"
|
||||
drop_class "QScreenDriverFactory"
|
||||
drop_class "QScreenDriverPlugin"
|
||||
|
|
@ -836,6 +874,8 @@ drop_method "QTextDocument", /QTextDocument::resourceProvider/ # needs std::func
|
|||
drop_method "QTextDocument", /QTextDocument::setResourceProvider/ # needs std::function
|
||||
drop_method "QTextDocument", /QTextDocument::defaultResourceProvider/ # needs std::function
|
||||
drop_method "QTextDocument", /QTextDocument::setDefaultResourceProvider/ # needs std::function
|
||||
drop_method "QLabel", /QLabel::resourceProvider/ # needs std::function
|
||||
drop_method "QLabel", /QLabel::setResourceProvider/ # needs std::function
|
||||
drop_method "QAccessibleInterface", /QAccessibleInterface::editableTextInterface/ # requires QAccessibleEditableTextInterface which is not available
|
||||
drop_method "QAccessibleInterface", /QAccessibleInterface::tableInterface/ # requires QAccessibleTableInterface which is not available
|
||||
drop_method "QAccessibleInterface", /QAccessibleInterface::textInterface/ # requires QAccessibleTextInterface which is not available
|
||||
|
|
@ -1135,6 +1175,10 @@ no_imports "QAbstractXmlNodeModel" # base class is QSharedData which is not ava
|
|||
# --------------------------------------------------------------
|
||||
# QtNetwork
|
||||
|
||||
include "QOcspRevocationReason", [ "<QOcspResponse>" ] # global enum without own header
|
||||
include "QOcspCertificateStatus", [ "<QOcspResponse>" ] # global enum without own header
|
||||
include "QDtlsError", [ "<QDtlsClientVerifier>" ] # global enum without own header
|
||||
|
||||
drop_class "QTlsPrivate" # private data
|
||||
drop_class "QOcspResponse" # @@@ TODO: debug
|
||||
drop_method "QSslSocket", /QSslSocket::ocspResponses\(/ # @@@ TODO: debug
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ grammar CPP
|
|||
rule id
|
||||
"operator" s "," /
|
||||
"operator" s ( bin_op / unary_op / "," ) /
|
||||
"operator" sp [a-zA-Z\*\& \t\n\r]+ &( s "(" ) /
|
||||
"operator" sp [a-zA-Z_0-9\*\& \t\n\r]+ &( s "(" ) /
|
||||
"~"? [a-zA-Z_] [a-zA-Z_0-9]*
|
||||
end
|
||||
|
||||
|
|
@ -215,7 +215,7 @@ grammar CPP
|
|||
end
|
||||
|
||||
rule class_struct_body_declarations
|
||||
( s ";" / s friend_decl / s using / s typedef / s !( "public" / "private" / "protected" ) member_declaration )*
|
||||
( s ";" / s static_assert / s friend_decl / s using / s typedef / s !( "public" / "private" / "protected" ) member_declaration )*
|
||||
end
|
||||
|
||||
rule class_struct_body
|
||||
|
|
@ -230,8 +230,8 @@ grammar CPP
|
|||
rule class_id
|
||||
# In order to easily distinguish between constructor methods without
|
||||
# a return type and class or typedef names we assume that all "name("
|
||||
# constructs are considered constructor names but "name (*func_ptr) ()" is not.
|
||||
qualified_id s ( "..." s )? !( "(" !( s "*" ) )
|
||||
# constructs are considered constructor names but "name (*func_ptr) ()" or "name (class::*method_ptr) ()" is not.
|
||||
qualified_id s ( "..." s )? !( "(" !( s "*" / s qualified_id s "::*" ) )
|
||||
end
|
||||
|
||||
rule typeof
|
||||
|
|
|
|||
|
|
@ -166,6 +166,20 @@ class CPPNamespace
|
|||
|
||||
end
|
||||
|
||||
class CPPModule
|
||||
|
||||
def collect_enum_decls(map, &filter)
|
||||
|
||||
self.decls.each do |bd|
|
||||
if bd.is_a?(CPPEnumDeclaration)
|
||||
bd.enum && filter.call(bd) && (map[bd.enum.name] ||= bd)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class CPPEnum
|
||||
|
||||
def resolve_typedefs(scope)
|
||||
|
|
@ -1360,7 +1374,7 @@ end
|
|||
|
||||
class BindingProducer
|
||||
|
||||
attr_accessor :modn
|
||||
attr_accessor :modn, :root
|
||||
|
||||
# @brief Read the input file (JSON)
|
||||
#
|
||||
|
|
@ -1454,7 +1468,7 @@ class BindingProducer
|
|||
|
||||
def produce_cpp_from_decl(conf, decl_obj)
|
||||
|
||||
if !decl_obj.is_a?(CPPStructDeclaration) && !decl_obj.is_a?(CPPNamespace)
|
||||
if !decl_obj.is_a?(CPPStructDeclaration) && !decl_obj.is_a?(CPPNamespace) && !decl_obj.is_a?(CPPEnumDeclaration)
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -1515,6 +1529,8 @@ END
|
|||
cont = produce_class(conf, decl_obj, ofile, index)
|
||||
elsif decl_obj.is_a?(CPPNamespace)
|
||||
cont = produce_namespace(conf, decl_obj, ofile, index)
|
||||
elsif decl_obj.is_a?(CPPEnumDeclaration)
|
||||
cont = produce_enum(conf, decl_obj, ofile, index)
|
||||
end
|
||||
|
||||
puts("#{ofile_name} written.")
|
||||
|
|
@ -1622,6 +1638,26 @@ END
|
|||
|
||||
end
|
||||
|
||||
def produce_enum(conf, decl_obj, ofile, index)
|
||||
|
||||
( cls, clsn ) = make_cls_names(decl_obj)
|
||||
|
||||
produce_class_include(conf, decl_obj, ofile)
|
||||
ofile.puts("#include <memory>")
|
||||
|
||||
ofile.puts("")
|
||||
ofile.puts("// -----------------------------------------------------------------------")
|
||||
ofile.puts("// enum #{cls}")
|
||||
|
||||
ofile.puts("")
|
||||
|
||||
# emit enum wrapper classes (top level, hence container class is nil)
|
||||
produce_enum_wrapper_class(ofile, conf, nil, cls, decl_obj)
|
||||
|
||||
return false
|
||||
|
||||
end
|
||||
|
||||
def produce_namespace(conf, decl_obj, ofile, index)
|
||||
|
||||
( cls, clsn ) = make_cls_names(decl_obj)
|
||||
|
|
@ -1670,7 +1706,7 @@ END
|
|||
|
||||
def produce_enum_wrapper_class(ofile, conf, cls, en, ed)
|
||||
|
||||
clsn = make_cls_name(cls)
|
||||
clsn = cls && make_cls_name(cls)
|
||||
|
||||
# emit enum wrapper classes
|
||||
|
||||
|
|
@ -1679,60 +1715,86 @@ END
|
|||
ofile.puts("namespace qt_gsi")
|
||||
ofile.puts("{")
|
||||
ofile.puts("")
|
||||
ofile.puts("static gsi::Enum<#{cls}::#{en}> decl_#{clsn}_#{en}_Enum (\"#{modn}\", \"#{clsn}_#{en}\",")
|
||||
if cls
|
||||
ofile.puts("static gsi::Enum<#{cls}::#{en}> decl_#{clsn}_#{en}_Enum (\"#{modn}\", \"#{clsn}_#{en}\",")
|
||||
else
|
||||
ofile.puts("static gsi::Enum<#{en}> decl_#{en}_Enum (\"#{modn}\", \"#{en}\",")
|
||||
end
|
||||
|
||||
edecl = []
|
||||
|
||||
ec = ed.enum.specs.collect { |s| s.name }
|
||||
ec.each_with_index do |ei,i|
|
||||
|
||||
ei_name = conf.target_name_for_enum_const(cls, "#{en}::#{ei}", ei)
|
||||
ei_name = conf.target_name_for_enum_const(cls ? cls : "::", "#{en}::#{ei}", ei)
|
||||
if ! ei_name
|
||||
# enum dropped
|
||||
next
|
||||
end
|
||||
|
||||
if ed.enum.is_class
|
||||
edecl << " gsi::enum_const (\"#{ei_name}\", #{cls}::#{en}::#{ei}, \"@brief Enum constant #{cls}::#{en}::#{ei}\")"
|
||||
if cls
|
||||
if ed.enum.is_class
|
||||
edecl << " gsi::enum_const (\"#{ei_name}\", #{cls}::#{en}::#{ei}, \"@brief Enum constant #{cls}::#{en}::#{ei}\")"
|
||||
else
|
||||
edecl << " gsi::enum_const (\"#{ei_name}\", #{cls}::#{ei}, \"@brief Enum constant #{cls}::#{ei}\")"
|
||||
end
|
||||
else
|
||||
edecl << " gsi::enum_const (\"#{ei_name}\", #{cls}::#{ei}, \"@brief Enum constant #{cls}::#{ei}\")"
|
||||
if ed.enum.is_class
|
||||
edecl << " gsi::enum_const (\"#{ei_name}\", #{en}::#{ei}, \"@brief Enum constant #{en}::#{ei}\")"
|
||||
else
|
||||
edecl << " gsi::enum_const (\"#{ei_name}\", #{ei}, \"@brief Enum constant #{ei}\")"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
ofile.puts(" " + edecl.join(" +\n ") + ",\n")
|
||||
ofile.puts(" \"@qt\\n@brief This class represents the #{cls}::#{en} enum\");")
|
||||
if cls
|
||||
ofile.puts(" \"@qt\\n@brief This class represents the #{cls}::#{en} enum\");")
|
||||
else
|
||||
ofile.puts(" \"@qt\\n@brief This class represents the #{en} enum\");")
|
||||
end
|
||||
ofile.puts("")
|
||||
|
||||
ofile.puts("static gsi::QFlagsClass<#{cls}::#{en} > decl_#{clsn}_#{en}_Enums (\"#{modn}\", \"#{clsn}_QFlags_#{en}\",")
|
||||
ofile.puts(" \"@qt\\n@brief This class represents the QFlags<#{cls}::#{en}> flag set\");")
|
||||
ofile.puts("")
|
||||
|
||||
# inject the declarations into the parent namespace or class
|
||||
pdecl_obj = ed.parent
|
||||
|
||||
pcls = pdecl_obj.myself
|
||||
o = pdecl_obj
|
||||
while o.parent && o.parent.myself
|
||||
o = o.parent
|
||||
pcls = o.myself + "::" + pcls
|
||||
if cls
|
||||
ofile.puts("static gsi::QFlagsClass<#{cls}::#{en} > decl_#{clsn}_#{en}_Enums (\"#{modn}\", \"#{clsn}_QFlags_#{en}\",")
|
||||
ofile.puts(" \"@qt\\n@brief This class represents the QFlags<#{cls}::#{en}> flag set\");")
|
||||
ofile.puts("")
|
||||
else
|
||||
ofile.puts("static gsi::QFlagsClass<#{en} > decl_#{en}_Enums (\"#{modn}\", \"QFlags_#{en}\",")
|
||||
ofile.puts(" \"@qt\\n@brief This class represents the QFlags<#{en}> flag set\");")
|
||||
ofile.puts("")
|
||||
end
|
||||
|
||||
pname = pcls
|
||||
if pdecl_obj.is_a?(CPPNamespace)
|
||||
pname = pcls + "_Namespace"
|
||||
if cls
|
||||
|
||||
# inject the declarations into the parent namespace or class
|
||||
pdecl_obj = ed.parent
|
||||
|
||||
pcls = pdecl_obj.myself
|
||||
o = pdecl_obj
|
||||
while o.parent && o.parent.myself
|
||||
o = o.parent
|
||||
pcls = o.myself + "::" + pcls
|
||||
end
|
||||
|
||||
pname = pcls
|
||||
if pdecl_obj.is_a?(CPPNamespace)
|
||||
pname = pcls + "_Namespace"
|
||||
end
|
||||
|
||||
if ! ed.enum.is_class
|
||||
ofile.puts("// Inject the declarations into the parent")
|
||||
ofile.puts("static gsi::ClassExt<#{pname}> inject_#{clsn}_#{en}_Enum_in_parent (decl_#{clsn}_#{en}_Enum.defs ());")
|
||||
end
|
||||
|
||||
ofile.puts("static gsi::ClassExt<#{pname}> decl_#{clsn}_#{en}_Enum_as_child (decl_#{clsn}_#{en}_Enum, \"#{en}\");")
|
||||
ofile.puts("static gsi::ClassExt<#{pname}> decl_#{clsn}_#{en}_Enums_as_child (decl_#{clsn}_#{en}_Enums, \"QFlags_#{en}\");")
|
||||
|
||||
ofile.puts("")
|
||||
|
||||
end
|
||||
|
||||
if ! ed.enum.is_class
|
||||
ofile.puts("// Inject the declarations into the parent")
|
||||
ofile.puts("static gsi::ClassExt<#{pname}> inject_#{clsn}_#{en}_Enum_in_parent (decl_#{clsn}_#{en}_Enum.defs ());")
|
||||
end
|
||||
|
||||
|
||||
ofile.puts("static gsi::ClassExt<#{pname}> decl_#{clsn}_#{en}_Enum_as_child (decl_#{clsn}_#{en}_Enum, \"#{en}\");")
|
||||
ofile.puts("static gsi::ClassExt<#{pname}> decl_#{clsn}_#{en}_Enums_as_child (decl_#{clsn}_#{en}_Enums, \"QFlags_#{en}\");")
|
||||
|
||||
ofile.puts("")
|
||||
ofile.puts("}")
|
||||
ofile.puts("")
|
||||
|
||||
|
|
@ -1927,6 +1989,7 @@ END
|
|||
native_impl = conf.native_impl(cls)
|
||||
|
||||
has_metaobject = ((struct.body_decl || []).find { |bd| bd.is_a?(CPPDeclaration) && bd.type.name == "metaObject" } != nil)
|
||||
has_metaobject = has_metaobject && !conf.is_dropped?(cls, cls + "::staticMetaObject")
|
||||
|
||||
mdecl = []
|
||||
mdecl_ctors = []
|
||||
|
|
|
|||
|
|
@ -296,7 +296,8 @@ class CPPEnumDeclaration
|
|||
end
|
||||
|
||||
def myself
|
||||
self.enum.name.to_s
|
||||
# exclude forward declarations
|
||||
self.enum.specs && self.enum.name.to_s
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -366,7 +367,7 @@ class CPPStructDeclaration
|
|||
|
||||
# add enum constants (CPPEnumSpec)
|
||||
(self.struct.body_decl || []).each do |bd|
|
||||
if bd.is_a?(CPPEnumDeclaration) && bd.enum && bd.enum.specs
|
||||
if bd.is_a?(CPPEnumDeclaration) && bd.enum && bd.enum.specs && !bd.enum.is_class
|
||||
c += bd.enum.specs
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -612,21 +612,13 @@ struct DB_PUBLIC_TEMPLATE box
|
|||
*/
|
||||
double double_area () const;
|
||||
|
||||
/**
|
||||
* @brief Default conversion to string
|
||||
*/
|
||||
std::string to_string () const
|
||||
{
|
||||
return to_string (0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Conversion to string
|
||||
*
|
||||
* If dbu is set, it determines the factor by which the coordinates are multiplied to render
|
||||
* micron units. In addition, a micron format is chosen for output of these coordinates.
|
||||
*/
|
||||
std::string to_string (double dbu) const
|
||||
std::string to_string (double dbu = 0.0) const
|
||||
{
|
||||
if (empty ()) {
|
||||
return "()";
|
||||
|
|
|
|||
|
|
@ -586,21 +586,13 @@ public:
|
|||
return dx_abs () + dy_abs ();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Default conversion to string
|
||||
*/
|
||||
std::string to_string () const
|
||||
{
|
||||
return to_string (0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Conversion to a string.
|
||||
*
|
||||
* If dbu is set, it determines the factor by which the coordinates are multiplied to render
|
||||
* micron units. In addition, a micron format is chosen for output of these coordinates.
|
||||
*/
|
||||
std::string to_string (double dbu) const
|
||||
std::string to_string (double dbu = 0.0) const
|
||||
{
|
||||
return "(" + m_p1.to_string (dbu) + ";" + m_p2.to_string (dbu) + ")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -387,21 +387,13 @@ public:
|
|||
return m_first.is_ortho () && m_second.is_ortho ();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Default conversion to string
|
||||
*/
|
||||
std::string to_string () const
|
||||
{
|
||||
return to_string (0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Conversion to a string.
|
||||
*
|
||||
* If dbu is set, it determines the factor by which the coordinates are multiplied to render
|
||||
* micron units. In addition, a micron format is chosen for output of these coordinates.
|
||||
*/
|
||||
std::string to_string (double dbu) const
|
||||
std::string to_string (double dbu = 0.0) const
|
||||
{
|
||||
return lesser ().to_string (dbu) + (m_symmetric ? "|" : "/") + greater ().to_string (dbu);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -613,5 +613,11 @@ private:
|
|||
|
||||
}
|
||||
|
||||
namespace tl
|
||||
{
|
||||
template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::EdgePairs &b);
|
||||
template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::EdgePairs &b);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1210,4 +1210,10 @@ private:
|
|||
|
||||
} // namespace db
|
||||
|
||||
namespace tl
|
||||
{
|
||||
template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::Edges &b);
|
||||
template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::Edges &b);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -285,14 +285,6 @@ public:
|
|||
*/
|
||||
double sq_double_distance () const;
|
||||
|
||||
/**
|
||||
* @brief Default conversion to string
|
||||
*/
|
||||
std::string to_string () const
|
||||
{
|
||||
return to_string (0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief String conversion
|
||||
*
|
||||
|
|
@ -300,7 +292,7 @@ public:
|
|||
* micron units. In addition, a micron format is chosen for output of these coordinates.
|
||||
*/
|
||||
std::string
|
||||
to_string (double dbu) const
|
||||
to_string (double dbu = 0.0) const
|
||||
{
|
||||
if (dbu == 1.0) {
|
||||
return tl::db_to_string (m_x) + "," + tl::db_to_string (m_y);
|
||||
|
|
|
|||
|
|
@ -1821,5 +1821,11 @@ private:
|
|||
|
||||
} // namespace db
|
||||
|
||||
namespace tl
|
||||
{
|
||||
template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::Region &b);
|
||||
template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::Region &b);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -757,9 +757,9 @@ public:
|
|||
/**
|
||||
* @brief String conversion
|
||||
*/
|
||||
std::string to_string () const
|
||||
std::string to_string (double dbu = 0.0) const
|
||||
{
|
||||
return std::string ("(") + tl::to_quoted_string (string ()) + "," + m_trans.to_string () + ")";
|
||||
return std::string ("(") + tl::to_quoted_string (string ()) + "," + m_trans.to_string (dbu) + ")";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -618,5 +618,11 @@ private:
|
|||
|
||||
}
|
||||
|
||||
namespace tl
|
||||
{
|
||||
template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::Texts &b);
|
||||
template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::Texts &b);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1472,10 +1472,10 @@ public:
|
|||
/**
|
||||
* @brief String conversion
|
||||
*/
|
||||
std::string to_string () const
|
||||
std::string to_string (double dbu = 0.0) const
|
||||
{
|
||||
std::string s1 = fixpoint_trans<C>::to_string ();
|
||||
std::string s2 = m_u.to_string ();
|
||||
std::string s2 = m_u.to_string (dbu);
|
||||
if (! s1.empty () && ! s2.empty ()) {
|
||||
return s1 + " " + s2;
|
||||
} else {
|
||||
|
|
@ -2242,14 +2242,6 @@ public:
|
|||
return ! equal (t);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Default string conversion
|
||||
*/
|
||||
std::string to_string () const
|
||||
{
|
||||
return to_string (false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief String conversion
|
||||
*
|
||||
|
|
@ -2257,7 +2249,7 @@ public:
|
|||
* When lazy is set to true, output that is not required (i.e. magnification when 1)
|
||||
* is dropped. If dbu is set, the coordinates are multiplied with this factor to render micron units.
|
||||
*/
|
||||
std::string to_string (bool lazy, double dbu = 0.0) const
|
||||
std::string to_string (bool lazy = false, double dbu = 0.0) const
|
||||
{
|
||||
std::string s;
|
||||
if (is_mirror ()) {
|
||||
|
|
|
|||
|
|
@ -327,14 +327,6 @@ public:
|
|||
*/
|
||||
double sq_double_length () const;
|
||||
|
||||
/**
|
||||
* @brief Default conversion to string
|
||||
*/
|
||||
std::string to_string () const
|
||||
{
|
||||
return to_string (0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief String conversion
|
||||
*
|
||||
|
|
@ -342,7 +334,7 @@ public:
|
|||
* micron units. In addition, a micron format is chosen for output of these coordinates.
|
||||
*/
|
||||
std::string
|
||||
to_string (double dbu) const
|
||||
to_string (double dbu = 0.0) const
|
||||
{
|
||||
if (dbu == 1.0) {
|
||||
return tl::db_to_string (m_x) + "," + tl::db_to_string (m_y);
|
||||
|
|
|
|||
|
|
@ -441,10 +441,13 @@ struct box_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief Returns a string representing this box\n"
|
||||
"\n"
|
||||
"This string can be turned into a box again by using \\from_s\n"
|
||||
"This string can be turned into a box again by using \\from_s\n. "
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -439,8 +439,11 @@ struct edge_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
"@brief Returns a string representing the edge\n"
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief Returns a string representing the edge\n "
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
) +
|
||||
method ("is_parallel?", &C::parallel, gsi::arg ("e"),
|
||||
"@brief Test for being parallel\n"
|
||||
|
|
|
|||
|
|
@ -156,8 +156,11 @@ struct edge_pair_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
"@brief Returns a string representing the edge pair\n"
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief Returns a string representing the edge pair\n "
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
) +
|
||||
method ("bbox", &C::bbox,
|
||||
"@brief Gets the bounding box of the edge pair\n"
|
||||
|
|
|
|||
|
|
@ -234,8 +234,11 @@ struct point_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
"@brief String conversion\n"
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief String conversion.\n"
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -345,8 +345,11 @@ struct text_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
"@brief Convert to a string\n"
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief Convert to a string.\n"
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -333,8 +333,11 @@ struct trans_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief String conversion\n"
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
) +
|
||||
method ("disp", (const vector_type &(C::*) () const) &C::disp,
|
||||
"@brief Gets to the displacement vector\n"
|
||||
|
|
@ -853,8 +856,12 @@ struct cplx_trans_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
method ("to_s", &C::to_string, gsi::arg ("lazy", false), gsi::arg ("dbu", 0.0),
|
||||
"@brief String conversion\n"
|
||||
"If 'lazy' is true, some parts are omitted when not required.\n"
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The lazy and DBU arguments have been added in version 0.27.6.\n"
|
||||
) +
|
||||
method ("disp", (displacement_type (C::*)() const) &C::disp,
|
||||
"@brief Gets the displacement\n"
|
||||
|
|
|
|||
|
|
@ -264,8 +264,11 @@ struct vector_defs
|
|||
"@brief Creates an object from a string\n"
|
||||
"Creates the object from a string representation (as returned by \\to_s)\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief String conversion\n"
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ template <class X> struct _create<X, true> { static void *call () { return new X
|
|||
|
||||
template <class X, bool> struct _clone;
|
||||
template <class X> struct _clone<X, false> { static void *call (const void *) { throw tl::Exception (tl::to_string (tr ("Object cannot be copied here"))); } };
|
||||
template <class X> struct _clone<X, true> { static void *call (const void *other) { new X (*(const X *)other); } };
|
||||
template <class X> struct _clone<X, true> { static void *call (const void *other) { return new X (*(const X *)other); } };
|
||||
|
||||
template <class X, bool> struct _assign;
|
||||
template <class X> struct _assign<X, false> { static void call (void *, const void *) { throw tl::Exception (tl::to_string (tr ("Object cannot be copied here"))); } };
|
||||
|
|
|
|||
|
|
@ -549,9 +549,12 @@ private:
|
|||
{
|
||||
check_data (as);
|
||||
|
||||
std::unique_ptr<AdaptorBase> p (*(AdaptorBase **)mp_read);
|
||||
AdaptorBase *p = *(AdaptorBase **)mp_read;
|
||||
mp_read += item_size<AdaptorBase *> ();
|
||||
tl_assert (p.get () != 0);
|
||||
|
||||
tl_assert (p != 0);
|
||||
// late-destroy the adaptor since the new X object may still need data from there (e.g. QLatin1String)
|
||||
heap.push (p);
|
||||
|
||||
X x = X ();
|
||||
copy_to<X> (*p, x, heap);
|
||||
|
|
@ -565,9 +568,12 @@ private:
|
|||
|
||||
check_data (as);
|
||||
|
||||
std::unique_ptr<AdaptorBase> p (*(AdaptorBase **)mp_read);
|
||||
AdaptorBase *p = *(AdaptorBase **)mp_read;
|
||||
mp_read += item_size<AdaptorBase *> ();
|
||||
tl_assert (p.get () != 0);
|
||||
|
||||
tl_assert (p != 0);
|
||||
// late-destroy the adaptor since the new X object may still need data from there (e.g. QLatin1String)
|
||||
heap.push (p);
|
||||
|
||||
x_type *x = new x_type ();
|
||||
heap.push (x);
|
||||
|
|
@ -601,14 +607,19 @@ private:
|
|||
|
||||
check_data (as);
|
||||
|
||||
std::unique_ptr<AdaptorBase> p (*(AdaptorBase **)mp_read);
|
||||
AdaptorBase *p = *(AdaptorBase **) mp_read;
|
||||
mp_read += item_size<AdaptorBase *> ();
|
||||
|
||||
x_type *x = 0;
|
||||
if (p.get () != 0) {
|
||||
if (p != 0) {
|
||||
|
||||
// late-destroy the adaptor since the new X object may still need data from there (e.g. QLatin1String)
|
||||
heap.push (p);
|
||||
|
||||
x = new x_type ();
|
||||
heap.push (x);
|
||||
copy_to<x_type> (*p, *x, heap);
|
||||
|
||||
}
|
||||
|
||||
return x;
|
||||
|
|
@ -895,6 +906,154 @@ private:
|
|||
mutable QByteArray m_s_utf8;
|
||||
};
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
/**
|
||||
* @brief Specialization for QString
|
||||
*/
|
||||
template <>
|
||||
class GSI_PUBLIC StringAdaptorImpl<QStringView>
|
||||
: public StringAdaptor
|
||||
{
|
||||
public:
|
||||
StringAdaptorImpl (QStringView *s)
|
||||
: mp_s (s), m_is_const (false)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
StringAdaptorImpl (const QStringView *s)
|
||||
: mp_s (const_cast<QStringView *> (s)), m_is_const (true)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
StringAdaptorImpl (const QStringView &s)
|
||||
: m_is_const (false), m_s (s)
|
||||
{
|
||||
mp_s = &m_s;
|
||||
}
|
||||
|
||||
StringAdaptorImpl ()
|
||||
: m_is_const (false)
|
||||
{
|
||||
mp_s = &m_s;
|
||||
}
|
||||
|
||||
virtual ~StringAdaptorImpl ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
virtual size_t size () const
|
||||
{
|
||||
return mp_s->toUtf8 ().size ();
|
||||
}
|
||||
|
||||
virtual const char *c_str () const
|
||||
{
|
||||
m_s_utf8 = mp_s->toUtf8 ();
|
||||
return m_s_utf8.constData ();
|
||||
}
|
||||
|
||||
virtual void set (const char *c_str, size_t s, tl::Heap &heap)
|
||||
{
|
||||
if (! m_is_const) {
|
||||
QString *hstr = heap.create<QString> ();
|
||||
*hstr = QString::fromUtf8 (c_str, int (s));
|
||||
*mp_s = QStringView (hstr->constData (), hstr->size ());
|
||||
}
|
||||
}
|
||||
|
||||
virtual void copy_to (AdaptorBase *target, tl::Heap &heap) const
|
||||
{
|
||||
StringAdaptorImpl<QStringView> *s = dynamic_cast<StringAdaptorImpl<QStringView> *>(target);
|
||||
if (s) {
|
||||
QString *hstr = heap.create<QString> ();
|
||||
*hstr = mp_s->toString ();
|
||||
*s->mp_s = QStringView (hstr->constData (), hstr->size ());
|
||||
} else {
|
||||
StringAdaptor::copy_to (target, heap);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
QStringView *mp_s;
|
||||
bool m_is_const;
|
||||
QStringView m_s;
|
||||
mutable QByteArray m_s_utf8;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= 0x50000
|
||||
|
||||
/**
|
||||
* @brief Specialization for QLatin1String
|
||||
*/
|
||||
template <>
|
||||
class GSI_PUBLIC StringAdaptorImpl<QLatin1String>
|
||||
: public StringAdaptor
|
||||
{
|
||||
public:
|
||||
StringAdaptorImpl (QLatin1String *s)
|
||||
: mp_s (s), m_is_const (false)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
StringAdaptorImpl (const QLatin1String *s)
|
||||
: mp_s (const_cast<QLatin1String *> (s)), m_is_const (true)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
StringAdaptorImpl (const QLatin1String &s)
|
||||
: m_is_const (false), m_s (s)
|
||||
{
|
||||
mp_s = &m_s;
|
||||
}
|
||||
|
||||
StringAdaptorImpl ()
|
||||
: m_is_const (false)
|
||||
{
|
||||
mp_s = &m_s;
|
||||
}
|
||||
|
||||
virtual ~StringAdaptorImpl ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
virtual size_t size () const
|
||||
{
|
||||
return QString::fromLatin1 (mp_s->data (), mp_s->size ()).toUtf8 ().size ();
|
||||
}
|
||||
|
||||
virtual const char *c_str () const
|
||||
{
|
||||
m_s_utf8 = QString::fromLatin1 (mp_s->data (), mp_s->size ()).toUtf8 ();
|
||||
return m_s_utf8.constData ();
|
||||
}
|
||||
|
||||
virtual void set (const char *c_str, size_t s, tl::Heap &)
|
||||
{
|
||||
if (! m_is_const) {
|
||||
m_latin1_holder = QString::fromUtf8 (c_str, int (s)).toLatin1 ();
|
||||
*mp_s = QLatin1String (m_latin1_holder.constData (), m_latin1_holder.size ());
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
QLatin1String *mp_s;
|
||||
bool m_is_const;
|
||||
QLatin1String m_s;
|
||||
QByteArray m_latin1_holder;
|
||||
mutable QByteArray m_s_utf8;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
@ -1211,6 +1370,84 @@ private:
|
|||
QByteArray m_s;
|
||||
};
|
||||
|
||||
#if QT_VERSION > 0x60000
|
||||
|
||||
/**
|
||||
* @brief Specialization for QByteArray
|
||||
*/
|
||||
template <>
|
||||
class GSI_PUBLIC ByteArrayAdaptorImpl<QByteArrayView>
|
||||
: public ByteArrayAdaptor
|
||||
{
|
||||
public:
|
||||
ByteArrayAdaptorImpl (QByteArrayView *s)
|
||||
: mp_s (s), m_is_const (false)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
ByteArrayAdaptorImpl (const QByteArrayView *s)
|
||||
: mp_s (const_cast<QByteArrayView *> (s)), m_is_const (true)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
ByteArrayAdaptorImpl (const QByteArrayView &s)
|
||||
: m_is_const (false), m_s (s)
|
||||
{
|
||||
mp_s = &m_s;
|
||||
}
|
||||
|
||||
ByteArrayAdaptorImpl ()
|
||||
: m_is_const (false)
|
||||
{
|
||||
mp_s = &m_s;
|
||||
}
|
||||
|
||||
virtual ~ByteArrayAdaptorImpl ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
virtual size_t size () const
|
||||
{
|
||||
return mp_s->size ();
|
||||
}
|
||||
|
||||
virtual const char *c_str () const
|
||||
{
|
||||
return mp_s->constData ();
|
||||
}
|
||||
|
||||
virtual void set (const char *c_str, size_t s, tl::Heap &heap)
|
||||
{
|
||||
if (! m_is_const) {
|
||||
QByteArray *str = heap.create<QByteArray> ();
|
||||
*str = QByteArray (c_str, s);
|
||||
*mp_s = QByteArrayView (str->constData (), str->size ());
|
||||
}
|
||||
}
|
||||
|
||||
virtual void copy_to (AdaptorBase *target, tl::Heap &heap) const
|
||||
{
|
||||
ByteArrayAdaptorImpl<QByteArrayView> *s = dynamic_cast<ByteArrayAdaptorImpl<QByteArrayView> *>(target);
|
||||
if (s) {
|
||||
QByteArray *str = heap.create<QByteArray> ();
|
||||
*str = QByteArray (mp_s->constData (), mp_s->size ());
|
||||
*s->mp_s = *str;
|
||||
} else {
|
||||
ByteArrayAdaptor::copy_to (target, heap);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
QByteArrayView *mp_s;
|
||||
bool m_is_const;
|
||||
QByteArrayView m_s;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
@ -1312,16 +1549,16 @@ public:
|
|||
/**
|
||||
* @brief Sets the variant's value
|
||||
*/
|
||||
virtual void set (const tl::Variant &v) = 0;
|
||||
virtual void set (const tl::Variant &v, tl::Heap & /*heap*/) = 0;
|
||||
|
||||
/**
|
||||
* @brief Implementation of copy_to
|
||||
*/
|
||||
virtual void copy_to (AdaptorBase *target, tl::Heap & /*heap*/) const
|
||||
virtual void copy_to (AdaptorBase *target, tl::Heap &heap) const
|
||||
{
|
||||
VariantAdaptor *v = dynamic_cast<VariantAdaptor *>(target);
|
||||
tl_assert (v);
|
||||
v->set (var ());
|
||||
v->set (var (), heap);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1383,7 +1620,7 @@ public:
|
|||
return *mp_v;
|
||||
}
|
||||
|
||||
virtual void set (const tl::Variant &v)
|
||||
virtual void set (const tl::Variant &v, tl::Heap & /*heap*/)
|
||||
{
|
||||
if (! m_is_const) {
|
||||
*mp_v = v.to_qvariant ();
|
||||
|
|
@ -1406,6 +1643,93 @@ private:
|
|||
QVariant m_v;
|
||||
};
|
||||
|
||||
#if QT_VERSION >= 0x50000
|
||||
|
||||
/**
|
||||
* @brief Specialization for QVariant
|
||||
*/
|
||||
template <typename T>
|
||||
class GSI_PUBLIC VariantAdaptorImpl<QPointer<T> >
|
||||
: public VariantAdaptor
|
||||
{
|
||||
public:
|
||||
VariantAdaptorImpl (QPointer<T> *v)
|
||||
: mp_v (v), m_is_const (false)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
VariantAdaptorImpl (const QPointer<T> *v)
|
||||
: mp_v (const_cast<QPointer<T> *> (v)), m_is_const (true)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
VariantAdaptorImpl (const QPointer<T> &v)
|
||||
: m_is_const (true), m_v (v)
|
||||
{
|
||||
mp_v = &m_v;
|
||||
}
|
||||
|
||||
VariantAdaptorImpl ()
|
||||
: m_is_const (false)
|
||||
{
|
||||
mp_v = &m_v;
|
||||
}
|
||||
|
||||
virtual ~VariantAdaptorImpl ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
virtual tl::Variant var () const
|
||||
{
|
||||
return tl::Variant::make_variant_ref (mp_v->get ());
|
||||
}
|
||||
|
||||
virtual void set (const tl::Variant &v, tl::Heap & /*heap*/)
|
||||
{
|
||||
if (m_is_const) {
|
||||
// .. can't change
|
||||
} else if (v.is_nil ()) {
|
||||
mp_v->clear ();
|
||||
} else if (v.is_user<T> ()) {
|
||||
if (v.user_is_ref ()) {
|
||||
*mp_v = (T *) v.to_user ();
|
||||
} else {
|
||||
// basically should not happen as the QPointer cannot hold anything other than a reference
|
||||
// (a tl::Variant terminology)
|
||||
tl_assert (false);
|
||||
}
|
||||
} else {
|
||||
// basically should not happen as the QPointer cannot hold anything other than a user object
|
||||
// (a tl::Variant terminology)
|
||||
tl_assert (false);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void copy_to (AdaptorBase *target, tl::Heap &heap) const
|
||||
{
|
||||
VariantAdaptorImpl<QPointer<T>> *v = dynamic_cast<VariantAdaptorImpl<QPointer<T>> *>(target);
|
||||
if (v) {
|
||||
if (mp_v->isNull ()) {
|
||||
v->mp_v->clear ();
|
||||
} else {
|
||||
*v->mp_v = QPointer<T> (*mp_v);
|
||||
}
|
||||
} else {
|
||||
VariantAdaptor::copy_to (target, heap);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
QPointer<T> *mp_v;
|
||||
bool m_is_const;
|
||||
QPointer<T> m_v;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
@ -1460,7 +1784,7 @@ public:
|
|||
return *mp_v;
|
||||
}
|
||||
|
||||
virtual void set (const tl::Variant &v)
|
||||
virtual void set (const tl::Variant &v, tl::Heap & /*heap*/)
|
||||
{
|
||||
if (! m_is_const) {
|
||||
*mp_v = v;
|
||||
|
|
@ -1483,6 +1807,85 @@ private:
|
|||
tl::Variant m_v;
|
||||
};
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
|
||||
/**
|
||||
* @brief Specialization for std::optional
|
||||
*/
|
||||
template <typename T>
|
||||
class GSI_PUBLIC VariantAdaptorImpl<std::optional<T> >
|
||||
: public VariantAdaptor
|
||||
{
|
||||
public:
|
||||
VariantAdaptorImpl (std::optional<T> *v)
|
||||
: mp_v (v), m_is_const (false)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
VariantAdaptorImpl (const std::optional<T> *v)
|
||||
: mp_v (const_cast<std::optional<T> *> (v)), m_is_const (true)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
VariantAdaptorImpl (const std::optional<T> &v)
|
||||
: m_is_const (true), m_v (v)
|
||||
{
|
||||
mp_v = &m_v;
|
||||
}
|
||||
|
||||
VariantAdaptorImpl ()
|
||||
: m_is_const (false)
|
||||
{
|
||||
mp_v = &m_v;
|
||||
}
|
||||
|
||||
virtual ~VariantAdaptorImpl ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
virtual tl::Variant var () const
|
||||
{
|
||||
return *mp_v ? tl::Variant (mp_v->value ()) : tl::Variant ();
|
||||
}
|
||||
|
||||
virtual void set (const tl::Variant &v, tl::Heap & /*heap*/)
|
||||
{
|
||||
if (m_is_const) {
|
||||
// .. can't change
|
||||
} else if (v.is_nil ()) {
|
||||
mp_v->reset ();
|
||||
} else if (v.is_user<T> ()) {
|
||||
*mp_v = v.to_user<T> ();
|
||||
} else {
|
||||
*mp_v = v.to<T> ();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void copy_to (AdaptorBase *target, tl::Heap &heap) const
|
||||
{
|
||||
VariantAdaptorImpl<std::optional<T>> *v = dynamic_cast<VariantAdaptorImpl<std::optional<T>> *>(target);
|
||||
if (v) {
|
||||
if (*mp_v) {
|
||||
v->mp_v->reset ();
|
||||
} else {
|
||||
*v->mp_v = mp_v->value ();
|
||||
}
|
||||
} else {
|
||||
VariantAdaptor::copy_to (target, heap);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
std::optional<T> *mp_v;
|
||||
bool m_is_const;
|
||||
std::optional<T> m_v;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Vector adaptor framework
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,13 @@
|
|||
#include <QSet>
|
||||
#include <QList>
|
||||
#include <QStringList>
|
||||
#if QT_VERSION >= 0x50000
|
||||
# include <QLatin1String>
|
||||
#endif
|
||||
#if QT_VERSION >= 0x60000
|
||||
# include <QByteArrayView>
|
||||
# include <QStringView>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace tl
|
||||
|
|
@ -434,12 +441,23 @@ template <> struct type_traits<__int128> : generic_type_trait
|
|||
template <> struct type_traits<double> : generic_type_traits<double_tag, double, T_double> { };
|
||||
template <> struct type_traits<float> : generic_type_traits<float_tag, float, T_float> { };
|
||||
template <> struct type_traits<std::string> : generic_type_traits<string_tag, StringAdaptor, T_string> { };
|
||||
#if __cplusplus >= 201703L
|
||||
template <typename T> struct type_traits<std::optional<T> > : generic_type_traits<var_tag, VariantAdaptor, T_var> { };
|
||||
#endif
|
||||
#if defined(HAVE_QT)
|
||||
template <> struct type_traits<QString> : generic_type_traits<string_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<QStringRef> : generic_type_traits<string_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<QByteArray> : generic_type_traits<byte_array_tag, StringAdaptor, T_byte_array> { };
|
||||
template <> struct type_traits<std::vector<char> > : generic_type_traits<byte_array_tag, StringAdaptor, T_byte_array> { };
|
||||
template <> struct type_traits<QVariant> : generic_type_traits<var_tag, VariantAdaptor, T_var> { };
|
||||
#if QT_VERSION >= 0x50000
|
||||
template <typename T> struct type_traits<QPointer<T> > : generic_type_traits<var_tag, VariantAdaptor, T_var> { };
|
||||
template <> struct type_traits<QLatin1String> : generic_type_traits<string_tag, StringAdaptor, T_string> { };
|
||||
#endif
|
||||
#if QT_VERSION >= 0x60000
|
||||
template <> struct type_traits<QStringView> : generic_type_traits<string_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<QByteArrayView> : generic_type_traits<byte_array_tag, StringAdaptor, T_byte_array> { };
|
||||
#endif
|
||||
#endif
|
||||
template <> struct type_traits<tl::Variant> : generic_type_traits<var_tag, VariantAdaptor, T_var> { };
|
||||
|
||||
|
|
@ -467,12 +485,23 @@ template <> struct type_traits<const __int128 &> : generic_type_trait
|
|||
template <> struct type_traits<const double &> : generic_type_traits<double_cref_tag, double, T_double> { };
|
||||
template <> struct type_traits<const float &> : generic_type_traits<float_cref_tag, float, T_float> { };
|
||||
template <> struct type_traits<const std::string &> : generic_type_traits<string_cref_tag, StringAdaptor, T_string> { };
|
||||
#if __cplusplus >= 201703L
|
||||
template <typename T> struct type_traits<const std::optional<T> &> : generic_type_traits<var_cref_tag, VariantAdaptor, T_var> { };
|
||||
#endif
|
||||
#if defined(HAVE_QT)
|
||||
template <> struct type_traits<const QString &> : generic_type_traits<string_cref_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<const QStringRef &> : generic_type_traits<string_cref_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<const QByteArray &> : generic_type_traits<byte_array_cref_tag, StringAdaptor, T_byte_array> { };
|
||||
template <> struct type_traits<const std::vector<char> &> : generic_type_traits<byte_array_cref_tag, StringAdaptor, T_byte_array> { };
|
||||
template <> struct type_traits<const QVariant &> : generic_type_traits<var_cref_tag, VariantAdaptor, T_var> { };
|
||||
#if QT_VERSION >= 0x50000
|
||||
template <typename T> struct type_traits<const QPointer<T> &> : generic_type_traits<var_cref_tag, VariantAdaptor, T_var> { };
|
||||
template <> struct type_traits<const QLatin1String &> : generic_type_traits<string_cref_tag, StringAdaptor, T_string> { };
|
||||
#endif
|
||||
#if QT_VERSION >= 0x60000
|
||||
template <> struct type_traits<const QStringView &> : generic_type_traits<string_cref_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<const QByteArrayView &> : generic_type_traits<byte_array_cref_tag, StringAdaptor, T_byte_array> { };
|
||||
#endif
|
||||
#endif
|
||||
template <> struct type_traits<const tl::Variant &> : generic_type_traits<var_cref_tag, VariantAdaptor, T_var> { };
|
||||
template <> struct type_traits<const char * const &> : generic_type_traits<string_cref_tag, StringAdaptor, T_string> { };
|
||||
|
|
@ -497,12 +526,23 @@ template <> struct type_traits<__int128 &> : generic_type_trait
|
|||
template <> struct type_traits<double &> : generic_type_traits<double_ref_tag, double, T_double> { };
|
||||
template <> struct type_traits<float &> : generic_type_traits<float_ref_tag, float, T_float> { };
|
||||
template <> struct type_traits<std::string &> : generic_type_traits<string_ref_tag, StringAdaptor, T_string> { };
|
||||
#if __cplusplus >= 201703L
|
||||
template <typename T> struct type_traits<std::optional<T> &> : generic_type_traits<var_ref_tag, VariantAdaptor, T_var> { };
|
||||
#endif
|
||||
#if defined(HAVE_QT)
|
||||
template <> struct type_traits<QString &> : generic_type_traits<string_ref_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<QStringRef &> : generic_type_traits<string_ref_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<QByteArray &> : generic_type_traits<byte_array_ref_tag, StringAdaptor, T_byte_array> { };
|
||||
template <> struct type_traits<std::vector<char> &> : generic_type_traits<byte_array_ref_tag, StringAdaptor, T_byte_array> { };
|
||||
template <> struct type_traits<QVariant &> : generic_type_traits<var_ref_tag, VariantAdaptor, T_var> { };
|
||||
#if QT_VERSION >= 0x50000
|
||||
template <typename T> struct type_traits<QPointer<T> &> : generic_type_traits<var_ref_tag, VariantAdaptor, T_var> { };
|
||||
template <> struct type_traits<QLatin1String &> : generic_type_traits<string_ref_tag, StringAdaptor, T_string> { };
|
||||
#endif
|
||||
#if QT_VERSION >= 0x60000
|
||||
template <> struct type_traits<QStringView &> : generic_type_traits<string_ref_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<QByteArrayView &> : generic_type_traits<byte_array_ref_tag, StringAdaptor, T_byte_array> { };
|
||||
#endif
|
||||
#endif
|
||||
template <> struct type_traits<tl::Variant &> : generic_type_traits<var_ref_tag, VariantAdaptor, T_var> { };
|
||||
template <> struct type_traits<const char * &> : generic_type_traits<string_ref_tag, StringAdaptor, T_string> { };
|
||||
|
|
@ -528,12 +568,23 @@ template <> struct type_traits<const __int128 *> : generic_type_trait
|
|||
template <> struct type_traits<const double *> : generic_type_traits<double_cptr_tag, double, T_double> { };
|
||||
template <> struct type_traits<const float *> : generic_type_traits<float_cptr_tag, float, T_float> { };
|
||||
template <> struct type_traits<const std::string *> : generic_type_traits<string_cptr_tag, StringAdaptor, T_string> { };
|
||||
#if __cplusplus >= 201703L
|
||||
template <typename T> struct type_traits<const std::optional<T> *> : generic_type_traits<var_cptr_tag, VariantAdaptor, T_var> { };
|
||||
#endif
|
||||
#if defined(HAVE_QT)
|
||||
template <> struct type_traits<const QString *> : generic_type_traits<string_cptr_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<const QStringRef *> : generic_type_traits<string_cptr_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<const QByteArray *> : generic_type_traits<byte_array_cptr_tag, StringAdaptor, T_byte_array> { };
|
||||
template <> struct type_traits<const std::vector<char> *> : generic_type_traits<byte_array_cptr_tag, StringAdaptor, T_byte_array> { };
|
||||
template <> struct type_traits<const QVariant *> : generic_type_traits<var_cptr_tag, VariantAdaptor, T_var> { };
|
||||
#if QT_VERSION >= 0x50000
|
||||
template <typename T> struct type_traits<const QPointer<T> *> : generic_type_traits<var_cptr_tag, VariantAdaptor, T_var> { };
|
||||
template <> struct type_traits<const QLatin1String *> : generic_type_traits<string_cptr_tag, StringAdaptor, T_string> { };
|
||||
#endif
|
||||
#if QT_VERSION >= 0x60000
|
||||
template <> struct type_traits<const QStringView *> : generic_type_traits<string_cptr_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<const QByteArrayView *> : generic_type_traits<byte_array_cptr_tag, StringAdaptor, T_byte_array> { };
|
||||
#endif
|
||||
#endif
|
||||
template <> struct type_traits<const tl::Variant *> : generic_type_traits<var_cptr_tag, VariantAdaptor, T_var> { };
|
||||
template <> struct type_traits<const char * const *> : generic_type_traits<string_cptr_tag, StringAdaptor, T_string> { };
|
||||
|
|
@ -559,18 +610,50 @@ template <> struct type_traits<__int128 *> : generic_type_trait
|
|||
template <> struct type_traits<double *> : generic_type_traits<double_ptr_tag, double, T_double> { };
|
||||
template <> struct type_traits<float *> : generic_type_traits<float_ptr_tag, float, T_float> { };
|
||||
template <> struct type_traits<std::string *> : generic_type_traits<string_ptr_tag, StringAdaptor, T_string> { };
|
||||
#if __cplusplus >= 201703L
|
||||
template <typename T> struct type_traits<std::optional<T> *> : generic_type_traits<var_ptr_tag, VariantAdaptor, T_var> { };
|
||||
#endif
|
||||
#if defined(HAVE_QT)
|
||||
template <> struct type_traits<QString *> : generic_type_traits<string_ptr_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<QStringRef *> : generic_type_traits<string_ptr_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<QByteArray *> : generic_type_traits<byte_array_ptr_tag, StringAdaptor, T_byte_array> { };
|
||||
template <> struct type_traits<std::vector<char> *> : generic_type_traits<byte_array_ptr_tag, StringAdaptor, T_byte_array> { };
|
||||
template <> struct type_traits<QVariant *> : generic_type_traits<var_ptr_tag, VariantAdaptor, T_var> { };
|
||||
#if QT_VERSION >= 0x50000
|
||||
template <typename T> struct type_traits<QPointer<T> *> : generic_type_traits<var_ptr_tag, VariantAdaptor, T_var> { };
|
||||
template <> struct type_traits<QLatin1String *> : generic_type_traits<string_ptr_tag, StringAdaptor, T_string> { };
|
||||
#endif
|
||||
#if QT_VERSION >= 0x60000
|
||||
template <> struct type_traits<QStringView *> : generic_type_traits<string_ptr_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<QByteArrayView *> : generic_type_traits<byte_array_ptr_tag, StringAdaptor, T_byte_array> { };
|
||||
#endif
|
||||
#endif
|
||||
template <> struct type_traits<tl::Variant *> : generic_type_traits<var_ptr_tag, VariantAdaptor, T_var> { };
|
||||
template <> struct type_traits<const char * *> : generic_type_traits<string_ptr_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<const unsigned char * *> : generic_type_traits<string_ptr_tag, StringAdaptor, T_string> { };
|
||||
template <> struct type_traits<const signed char * *> : generic_type_traits<string_ptr_tag, StringAdaptor, T_string> { };
|
||||
|
||||
template <int n> struct __unsigned_type_with_size;
|
||||
template <> struct __unsigned_type_with_size<1> { typedef uint8_t type; };
|
||||
template <> struct __unsigned_type_with_size<2> { typedef uint16_t type; };
|
||||
template <> struct __unsigned_type_with_size<4> { typedef uint32_t type; };
|
||||
|
||||
template <> struct type_traits<wchar_t> : type_traits<__unsigned_type_with_size<sizeof(wchar_t)>::type> { };
|
||||
template <> struct type_traits<char16_t> : type_traits<__unsigned_type_with_size<sizeof(char16_t)>::type> { };
|
||||
template <> struct type_traits<char32_t> : type_traits<__unsigned_type_with_size<sizeof(char32_t)>::type> { };
|
||||
template <> struct type_traits<wchar_t *> : type_traits<__unsigned_type_with_size<sizeof(wchar_t)>::type *> { };
|
||||
template <> struct type_traits<char16_t *> : type_traits<__unsigned_type_with_size<sizeof(char16_t)>::type *> { };
|
||||
template <> struct type_traits<char32_t *> : type_traits<__unsigned_type_with_size<sizeof(char32_t)>::type *> { };
|
||||
template <> struct type_traits<const wchar_t *> : type_traits<const __unsigned_type_with_size<sizeof(wchar_t)>::type *> { };
|
||||
template <> struct type_traits<const char16_t *> : type_traits<const __unsigned_type_with_size<sizeof(char16_t)>::type *> { };
|
||||
template <> struct type_traits<const char32_t *> : type_traits<const __unsigned_type_with_size<sizeof(char32_t)>::type *> { };
|
||||
template <> struct type_traits<wchar_t &> : type_traits<__unsigned_type_with_size<sizeof(wchar_t)>::type &> { };
|
||||
template <> struct type_traits<char16_t &> : type_traits<__unsigned_type_with_size<sizeof(char16_t)>::type &> { };
|
||||
template <> struct type_traits<char32_t &> : type_traits<__unsigned_type_with_size<sizeof(char32_t)>::type &> { };
|
||||
template <> struct type_traits<const wchar_t &> : type_traits<const __unsigned_type_with_size<sizeof(wchar_t)>::type &> { };
|
||||
template <> struct type_traits<const char16_t &> : type_traits<const __unsigned_type_with_size<sizeof(char16_t)>::type &> { };
|
||||
template <> struct type_traits<const char32_t &> : type_traits<const __unsigned_type_with_size<sizeof(char32_t)>::type &> { };
|
||||
|
||||
template <class X>
|
||||
struct type_traits<const X>
|
||||
: generic_type_traits<typename type_traits<X>::tag, typename type_traits<X>::value_type, T_void>
|
||||
|
|
@ -1289,10 +1372,10 @@ private:
|
|||
*/
|
||||
template <class T>
|
||||
class ArgSpec
|
||||
: public ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_destructible<T>::value>
|
||||
: public ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_default_constructible<T>::value>
|
||||
{
|
||||
public:
|
||||
typedef ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_destructible<T>::value> Base;
|
||||
typedef ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_default_constructible<T>::value> Base;
|
||||
|
||||
ArgSpec ()
|
||||
: Base ()
|
||||
|
|
@ -1326,10 +1409,10 @@ public:
|
|||
*/
|
||||
template <class T>
|
||||
class ArgSpec<const T &>
|
||||
: public ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_destructible<T>::value>
|
||||
: public ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_default_constructible<T>::value>
|
||||
{
|
||||
public:
|
||||
typedef ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_destructible<T>::value> Base;
|
||||
typedef ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_default_constructible<T>::value> Base;
|
||||
|
||||
ArgSpec ()
|
||||
: Base ()
|
||||
|
|
@ -1363,10 +1446,10 @@ public:
|
|||
*/
|
||||
template <class T>
|
||||
class ArgSpec<T &>
|
||||
: public ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_destructible<T>::value>
|
||||
: public ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_default_constructible<T>::value>
|
||||
{
|
||||
public:
|
||||
typedef ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_destructible<T>::value> Base;
|
||||
typedef ArgSpecImpl<T, std::is_copy_constructible<T>::value && std::is_default_constructible<T>::value> Base;
|
||||
typedef T &init_type;
|
||||
|
||||
ArgSpec ()
|
||||
|
|
@ -1393,7 +1476,7 @@ public:
|
|||
T &init () const
|
||||
{
|
||||
// this simplifies the implementation, but it's not really clean since the caller may modify the default.
|
||||
return const_cast<T &> (ArgSpecImpl<T, std::is_copy_constructible<T>::value>::init ());
|
||||
return const_cast<T &> (Base::init ());
|
||||
}
|
||||
|
||||
virtual ArgSpecBase *clone () const
|
||||
|
|
|
|||
|
|
@ -112,6 +112,8 @@ tl::Variant A::new_a_by_variant ()
|
|||
return tl::Variant (A ());
|
||||
}
|
||||
|
||||
#if defined(HAVE_QT)
|
||||
|
||||
std::vector<int>
|
||||
A::qba_cref_to_ia (const QByteArray &ba)
|
||||
{
|
||||
|
|
@ -134,8 +136,8 @@ A::ia_cref_to_qba (const std::vector<int> &ia)
|
|||
return ba;
|
||||
}
|
||||
|
||||
const QByteArray &
|
||||
A::ia_cref_to_qba_cref (const std::vector<int> &ia)
|
||||
QByteArray &
|
||||
A::ia_cref_to_qba_ref (const std::vector<int> &ia)
|
||||
{
|
||||
static QByteArray ba;
|
||||
ba.clear ();
|
||||
|
|
@ -145,6 +147,161 @@ A::ia_cref_to_qba_cref (const std::vector<int> &ia)
|
|||
return ba;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
std::vector<int>
|
||||
A::qbav_cref_to_ia (const QByteArrayView &ba)
|
||||
{
|
||||
const char *cp = ba.constData ();
|
||||
size_t n = ba.size ();
|
||||
std::vector<int> ia;
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
ia.push_back (int (*cp++));
|
||||
}
|
||||
return ia;
|
||||
}
|
||||
|
||||
QByteArrayView
|
||||
A::ia_cref_to_qbav (const std::vector<int> &ia)
|
||||
{
|
||||
static QByteArray ba;
|
||||
ba.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
ba.push_back (char (*i));
|
||||
}
|
||||
return ba;
|
||||
}
|
||||
|
||||
QByteArrayView &
|
||||
A::ia_cref_to_qbav_ref (const std::vector<int> &ia)
|
||||
{
|
||||
static QByteArray ba;
|
||||
ba.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
ba.push_back (char (*i));
|
||||
}
|
||||
static QByteArrayView bav;
|
||||
bav = ba;
|
||||
return bav;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
std::vector<int>
|
||||
A::qs_cref_to_ia (const QString &qs)
|
||||
{
|
||||
const QChar *cp = qs.constData ();
|
||||
size_t n = qs.size ();
|
||||
std::vector<int> ia;
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
ia.push_back ((*cp++).unicode ());
|
||||
}
|
||||
return ia;
|
||||
}
|
||||
|
||||
QString
|
||||
A::ia_cref_to_qs (const std::vector<int> &ia)
|
||||
{
|
||||
QString s;
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
s.push_back (char (*i));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
QString &
|
||||
A::ia_cref_to_qs_ref (const std::vector<int> &ia)
|
||||
{
|
||||
static QString s;
|
||||
s.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
s.push_back (char (*i));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= 0x50000
|
||||
|
||||
std::vector<int>
|
||||
A::ql1s_cref_to_ia (const QLatin1String &ql1s)
|
||||
{
|
||||
std::vector<int> ia;
|
||||
const char *cp = ql1s.data ();
|
||||
size_t n = ql1s.size ();
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
ia.push_back (*cp++);
|
||||
}
|
||||
return ia;
|
||||
}
|
||||
|
||||
QLatin1String
|
||||
A::ia_cref_to_ql1s (const std::vector<int> &ia)
|
||||
{
|
||||
static std::string str;
|
||||
str.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
str += char (*i);
|
||||
}
|
||||
return QLatin1String (str.c_str (), str.size ());
|
||||
}
|
||||
|
||||
QLatin1String &
|
||||
A::ia_cref_to_ql1s_ref (const std::vector<int> &ia)
|
||||
{
|
||||
static std::string str;
|
||||
str.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
str += char (*i);
|
||||
}
|
||||
static QLatin1String s (0);
|
||||
s = QLatin1String (str.c_str (), str.size ());
|
||||
return s;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
std::vector<int>
|
||||
A::qsv_cref_to_ia (const QStringView &qs)
|
||||
{
|
||||
const QChar *cp = qs.constData ();
|
||||
size_t n = qs.size ();
|
||||
std::vector<int> ia;
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
ia.push_back ((*cp++).unicode ());
|
||||
}
|
||||
return ia;
|
||||
}
|
||||
|
||||
QStringView
|
||||
A::ia_cref_to_qsv (const std::vector<int> &ia)
|
||||
{
|
||||
static QString s;
|
||||
s.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
s.push_back (char (*i));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
QStringView &
|
||||
A::ia_cref_to_qsv_ref (const std::vector<int> &ia)
|
||||
{
|
||||
static QString s;
|
||||
s.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
s.push_back (char (*i));
|
||||
}
|
||||
static QStringView sv;
|
||||
sv = s;
|
||||
return sv;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
std::vector<int>
|
||||
A::ba_cref_to_ia (const std::vector<char> &ba)
|
||||
{
|
||||
|
|
@ -165,8 +322,8 @@ A::ia_cref_to_ba (const std::vector<int> &ia)
|
|||
return ba;
|
||||
}
|
||||
|
||||
const std::vector<char> &
|
||||
A::ia_cref_to_ba_cref (const std::vector<int> &ia)
|
||||
std::vector<char> &
|
||||
A::ia_cref_to_ba_ref (const std::vector<int> &ia)
|
||||
{
|
||||
static std::vector<char> ba;
|
||||
ba.clear ();
|
||||
|
|
@ -877,6 +1034,7 @@ static gsi::Class<A> decl_a ("", "A",
|
|||
gsi::method ("new_a_by_variant", &A::new_a_by_variant) +
|
||||
|
||||
#if defined(HAVE_QT)
|
||||
|
||||
gsi::method ("qba_cref_to_ia", &A::qba_cref_to_ia) +
|
||||
gsi::method ("qba_ref_to_ia", &A::qba_ref_to_ia) +
|
||||
gsi::method ("qba_cptr_to_ia", &A::qba_cptr_to_ia) +
|
||||
|
|
@ -884,14 +1042,75 @@ static gsi::Class<A> decl_a ("", "A",
|
|||
gsi::method ("qba_to_ia", &A::qba_to_ia) +
|
||||
gsi::method ("ia_cref_to_qba", &A::ia_cref_to_qba) +
|
||||
gsi::method ("ia_cref_to_qba_cref", &A::ia_cref_to_qba_cref) +
|
||||
gsi::method ("ia_cref_to_qba_ref", &A::ia_cref_to_qba_ref) +
|
||||
gsi::method ("ia_cref_to_qba_cptr", &A::ia_cref_to_qba_cptr) +
|
||||
gsi::method ("ia_cref_to_qba_ptr", &A::ia_cref_to_qba_ptr) +
|
||||
|
||||
gsi::method ("qs_cref_to_ia", &A::qs_cref_to_ia) +
|
||||
gsi::method ("qs_ref_to_ia", &A::qs_ref_to_ia) +
|
||||
gsi::method ("qs_cptr_to_ia", &A::qs_cptr_to_ia) +
|
||||
gsi::method ("qs_ptr_to_ia", &A::qs_ptr_to_ia) +
|
||||
gsi::method ("qs_to_ia", &A::qs_to_ia) +
|
||||
gsi::method ("ia_cref_to_qs", &A::ia_cref_to_qs) +
|
||||
gsi::method ("ia_cref_to_qs_cref", &A::ia_cref_to_qs_cref) +
|
||||
gsi::method ("ia_cref_to_qs_ref", &A::ia_cref_to_qs_ref) +
|
||||
gsi::method ("ia_cref_to_qs_cptr", &A::ia_cref_to_qs_cptr) +
|
||||
gsi::method ("ia_cref_to_qs_ptr", &A::ia_cref_to_qs_ptr) +
|
||||
|
||||
#if QT_VERSION >= 0x50000
|
||||
|
||||
gsi::method ("ql1s_cref_to_ia", &A::ql1s_cref_to_ia) +
|
||||
gsi::method ("ql1s_ref_to_ia", &A::ql1s_ref_to_ia) +
|
||||
gsi::method ("ql1s_cptr_to_ia", &A::ql1s_cptr_to_ia) +
|
||||
gsi::method ("ql1s_ptr_to_ia", &A::ql1s_ptr_to_ia) +
|
||||
gsi::method ("ql1s_to_ia", &A::ql1s_to_ia) +
|
||||
gsi::method ("ia_cref_to_ql1s", &A::ia_cref_to_ql1s) +
|
||||
gsi::method ("ia_cref_to_ql1s_cref", &A::ia_cref_to_ql1s_cref) +
|
||||
gsi::method ("ia_cref_to_ql1s_ref", &A::ia_cref_to_ql1s_ref) +
|
||||
gsi::method ("ia_cref_to_ql1s_cptr", &A::ia_cref_to_ql1s_cptr) +
|
||||
gsi::method ("ia_cref_to_ql1s_ptr", &A::ia_cref_to_ql1s_ptr) +
|
||||
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
gsi::method ("qbav_cref_to_ia", &A::qbav_cref_to_ia) +
|
||||
gsi::method ("qbav_ref_to_ia", &A::qbav_ref_to_ia) +
|
||||
gsi::method ("qbav_cptr_to_ia", &A::qbav_cptr_to_ia) +
|
||||
gsi::method ("qbav_ptr_to_ia", &A::qbav_ptr_to_ia) +
|
||||
gsi::method ("qbav_to_ia", &A::qbav_to_ia) +
|
||||
gsi::method ("ia_cref_to_qbav", &A::ia_cref_to_qbav) +
|
||||
gsi::method ("ia_cref_to_qbav_cref", &A::ia_cref_to_qbav_cref) +
|
||||
gsi::method ("ia_cref_to_qbav_ref", &A::ia_cref_to_qbav_ref) +
|
||||
gsi::method ("ia_cref_to_qbav_cptr", &A::ia_cref_to_qbav_cptr) +
|
||||
gsi::method ("ia_cref_to_qbav_ptr", &A::ia_cref_to_qbav_ptr) +
|
||||
|
||||
gsi::method ("qsv_cref_to_ia", &A::qsv_cref_to_ia) +
|
||||
gsi::method ("qsv_ref_to_ia", &A::qsv_ref_to_ia) +
|
||||
gsi::method ("qsv_cptr_to_ia", &A::qsv_cptr_to_ia) +
|
||||
gsi::method ("qsv_ptr_to_ia", &A::qsv_ptr_to_ia) +
|
||||
gsi::method ("qsv_to_ia", &A::qsv_to_ia) +
|
||||
gsi::method ("ia_cref_to_qsv", &A::ia_cref_to_qsv) +
|
||||
gsi::method ("ia_cref_to_qsv_cref", &A::ia_cref_to_qsv_cref) +
|
||||
gsi::method ("ia_cref_to_qsv_ref", &A::ia_cref_to_qsv_ref) +
|
||||
gsi::method ("ia_cref_to_qsv_cptr", &A::ia_cref_to_qsv_cptr) +
|
||||
gsi::method ("ia_cref_to_qsv_ptr", &A::ia_cref_to_qsv_ptr) +
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
gsi::method ("ba_cref_to_ia", &A::ba_cref_to_ia) +
|
||||
gsi::method ("ba_ref_to_ia", &A::ba_ref_to_ia) +
|
||||
gsi::method ("ba_cptr_to_ia", &A::ba_cptr_to_ia) +
|
||||
gsi::method ("ba_ptr_to_ia", &A::ba_ptr_to_ia) +
|
||||
gsi::method ("ba_to_ia", &A::ba_to_ia) +
|
||||
|
||||
gsi::method ("ia_cref_to_ba", &A::ia_cref_to_ba) +
|
||||
gsi::method ("ia_cref_to_ba_ref", &A::ia_cref_to_ba_ref) +
|
||||
gsi::method ("ia_cref_to_ba_cref", &A::ia_cref_to_ba_cref) +
|
||||
gsi::method ("ia_cref_to_ba_ptr", &A::ia_cref_to_ba_ptr) +
|
||||
gsi::method ("ia_cref_to_ba_cptr", &A::ia_cref_to_ba_cptr) +
|
||||
|
||||
gsi::method ("br", &A::br) +
|
||||
gsi::method ("get_e", &A::get_e) +
|
||||
|
|
@ -1017,6 +1236,20 @@ static gsi::Class<A> decl_a ("", "A",
|
|||
static gsi::Class<A_NC> decl_a_nc (decl_a, "", "A_NC");
|
||||
|
||||
static gsi::Class<B> decl_b ("", "B",
|
||||
#if __cplusplus >= 201703L
|
||||
gsi::method ("int_to_optional", &B::int_to_optional) +
|
||||
gsi::method ("int_to_optional_a", &B::int_to_optional_a) +
|
||||
gsi::method ("optional_to_int", &B::optional_to_int) +
|
||||
gsi::method ("optional_cref_to_int", &B::optional_cref_to_int) +
|
||||
gsi::method ("optional_ref_to_int", &B::optional_ref_to_int) +
|
||||
gsi::method ("optional_cptr_to_int", &B::optional_cptr_to_int) +
|
||||
gsi::method ("optional_ptr_to_int", &B::optional_ptr_to_int) +
|
||||
gsi::method ("optional_a_to_int", &B::optional_a_to_int) +
|
||||
gsi::method ("optional_a_cref_to_int", &B::optional_a_cref_to_int) +
|
||||
gsi::method ("optional_a_ref_to_int", &B::optional_a_ref_to_int) +
|
||||
gsi::method ("optional_a_cptr_to_int", &B::optional_a_cptr_to_int) +
|
||||
gsi::method ("optional_a_ptr_to_int", &B::optional_a_ptr_to_int) +
|
||||
#endif
|
||||
gsi::method ("inst", &B::inst) +
|
||||
gsi::method ("has_inst", &B::has_inst) +
|
||||
gsi::method ("set_inst", &B::set_inst) +
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ struct A
|
|||
static tl::Variant new_a_by_variant ();
|
||||
|
||||
#if defined(HAVE_QT)
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests access to QByteArray
|
||||
*/
|
||||
|
|
@ -108,11 +109,110 @@ struct A
|
|||
static std::vector<int> qba_ptr_to_ia (QByteArray *ba) { return qba_cref_to_ia (*ba); }
|
||||
static std::vector<int> qba_to_ia (QByteArray ba) { return qba_cref_to_ia (ba); }
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests access to QByteArrayView
|
||||
*/
|
||||
static std::vector<int> qbav_cref_to_ia (const QByteArrayView &ba);
|
||||
static std::vector<int> qbav_ref_to_ia (QByteArrayView &ba) { return qbav_cref_to_ia (ba); }
|
||||
static std::vector<int> qbav_cptr_to_ia (const QByteArrayView *ba) { return qbav_cref_to_ia (*ba); }
|
||||
static std::vector<int> qbav_ptr_to_ia (QByteArrayView *ba) { return qbav_cref_to_ia (*ba); }
|
||||
static std::vector<int> qbav_to_ia (QByteArrayView ba) { return qbav_cref_to_ia (ba); }
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests access to QString
|
||||
*/
|
||||
static std::vector<int> qs_cref_to_ia (const QString &qs);
|
||||
static std::vector<int> qs_ref_to_ia (QString &qs) { return qs_cref_to_ia (qs); }
|
||||
static std::vector<int> qs_cptr_to_ia (const QString *qs) { return qs_cref_to_ia (*qs); }
|
||||
static std::vector<int> qs_ptr_to_ia (QString *qs) { return qs_cref_to_ia (*qs); }
|
||||
static std::vector<int> qs_to_ia (QString qs) { return qs_cref_to_ia (qs); }
|
||||
|
||||
#if QT_VERSION >= 0x50000
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests access to QLatin1String
|
||||
*/
|
||||
static std::vector<int> ql1s_cref_to_ia (const QLatin1String &qs);
|
||||
static std::vector<int> ql1s_ref_to_ia (QLatin1String &qs) { return ql1s_cref_to_ia (qs); }
|
||||
static std::vector<int> ql1s_cptr_to_ia (const QLatin1String *qs) { return ql1s_cref_to_ia (*qs); }
|
||||
static std::vector<int> ql1s_ptr_to_ia (QLatin1String *qs) { return ql1s_cref_to_ia (*qs); }
|
||||
static std::vector<int> ql1s_to_ia (QLatin1String qs) { return ql1s_cref_to_ia (qs); }
|
||||
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests access to QStringView
|
||||
*/
|
||||
static std::vector<int> qsv_cref_to_ia (const QStringView &qs);
|
||||
static std::vector<int> qsv_ref_to_ia (QStringView &qs) { return qsv_cref_to_ia (qs); }
|
||||
static std::vector<int> qsv_cptr_to_ia (const QStringView *qs) { return qsv_cref_to_ia (*qs); }
|
||||
static std::vector<int> qsv_ptr_to_ia (QStringView *qs) { return qsv_cref_to_ia (*qs); }
|
||||
static std::vector<int> qsv_to_ia (QStringView qs) { return qsv_cref_to_ia (qs); }
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests return of QByteArray
|
||||
*/
|
||||
static QByteArray ia_cref_to_qba (const std::vector<int> &ia);
|
||||
static const QByteArray &ia_cref_to_qba_cref (const std::vector<int> &ia);
|
||||
static QByteArray &ia_cref_to_qba_ref (const std::vector<int> &ia);
|
||||
static const QByteArray &ia_cref_to_qba_cref (const std::vector<int> &ia) { return ia_cref_to_qba_ref (ia); }
|
||||
static const QByteArray *ia_cref_to_qba_cptr (const std::vector<int> &ia) { return &ia_cref_to_qba_ref (ia); }
|
||||
static QByteArray *ia_cref_to_qba_ptr (const std::vector<int> &ia) { return &ia_cref_to_qba_ref (ia); }
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests return of QByteArrayView (uses a static buffer)
|
||||
*/
|
||||
static QByteArrayView ia_cref_to_qbav (const std::vector<int> &ia);
|
||||
static QByteArrayView &ia_cref_to_qbav_ref (const std::vector<int> &ia);
|
||||
static const QByteArrayView &ia_cref_to_qbav_cref (const std::vector<int> &ia) { return ia_cref_to_qbav_ref (ia); }
|
||||
static const QByteArrayView *ia_cref_to_qbav_cptr (const std::vector<int> &ia) { return &ia_cref_to_qbav_ref (ia); }
|
||||
static QByteArrayView *ia_cref_to_qbav_ptr (const std::vector<int> &ia) { return &ia_cref_to_qbav_ref (ia); }
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests return of QString
|
||||
*/
|
||||
static QString ia_cref_to_qs (const std::vector<int> &ia);
|
||||
static QString &ia_cref_to_qs_ref (const std::vector<int> &ia);
|
||||
static const QString &ia_cref_to_qs_cref (const std::vector<int> &ia) { return ia_cref_to_qs_ref (ia); }
|
||||
static const QString *ia_cref_to_qs_cptr (const std::vector<int> &ia) { return &ia_cref_to_qs_ref (ia); }
|
||||
static QString *ia_cref_to_qs_ptr (const std::vector<int> &ia) { return &ia_cref_to_qs_ref (ia); }
|
||||
|
||||
#if QT_VERSION >= 0x50000
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests return of QLatin1String
|
||||
*/
|
||||
static QLatin1String ia_cref_to_ql1s (const std::vector<int> &ia);
|
||||
static QLatin1String &ia_cref_to_ql1s_ref (const std::vector<int> &ia);
|
||||
static const QLatin1String &ia_cref_to_ql1s_cref (const std::vector<int> &ia) { return ia_cref_to_ql1s_ref (ia); }
|
||||
static const QLatin1String *ia_cref_to_ql1s_cptr (const std::vector<int> &ia) { return &ia_cref_to_ql1s_ref (ia); }
|
||||
static QLatin1String *ia_cref_to_ql1s_ptr (const std::vector<int> &ia) { return &ia_cref_to_ql1s_ref (ia); }
|
||||
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests return of QStringView (uses a static buffer)
|
||||
*/
|
||||
static QStringView ia_cref_to_qsv (const std::vector<int> &ia);
|
||||
static QStringView &ia_cref_to_qsv_ref (const std::vector<int> &ia);
|
||||
static const QStringView &ia_cref_to_qsv_cref (const std::vector<int> &ia) { return ia_cref_to_qsv_ref (ia); }
|
||||
static const QStringView *ia_cref_to_qsv_cptr (const std::vector<int> &ia) { return &ia_cref_to_qsv_ref (ia); }
|
||||
static QStringView *ia_cref_to_qsv_ptr (const std::vector<int> &ia) { return &ia_cref_to_qsv_ref (ia); }
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -129,7 +229,10 @@ struct A
|
|||
* @brief Byte sequences: tests return of std::vector<char>
|
||||
*/
|
||||
static std::vector<char> ia_cref_to_ba (const std::vector<int> &ia);
|
||||
static const std::vector<char> &ia_cref_to_ba_cref (const std::vector<int> &ia);
|
||||
static std::vector<char> &ia_cref_to_ba_ref (const std::vector<int> &ia);
|
||||
static const std::vector<char> &ia_cref_to_ba_cref (const std::vector<int> &ia) { return ia_cref_to_ba_ref (ia); }
|
||||
static std::vector<char> *ia_cref_to_ba_ptr (const std::vector<int> &ia) { return &ia_cref_to_ba_ref (ia); }
|
||||
static const std::vector<char> *ia_cref_to_ba_cptr (const std::vector<int> &ia) { return &ia_cref_to_ba_ref (ia); }
|
||||
|
||||
/*
|
||||
* @brief A dummy method providing a chance to set a breakpoint in the script
|
||||
|
|
@ -207,11 +310,13 @@ struct A
|
|||
|
||||
std::string a10_d (double f) { return tl::to_string (f); }
|
||||
std::vector<char> a10_d_ba (double f) { std::string s = tl::to_string (f); return std::vector<char> (s.begin (), s.end ()); }
|
||||
|
||||
#if defined(HAVE_QT)
|
||||
QByteArray a10_d_qba (double f) { return tl::to_qstring (tl::to_string (f)).toUtf8 (); }
|
||||
QString a10_d_qstr (double f) { return tl::to_qstring (tl::to_string (f)); }
|
||||
QStringRef a10_d_qstrref (double f) { m_s = tl::to_qstring (tl::to_string (f)); return QStringRef (&m_s); }
|
||||
#endif
|
||||
|
||||
std::string a10_f (float f) { return tl::to_string(f); }
|
||||
std::string a10_s (short l) { return tl::to_string(int (l)); }
|
||||
std::string a10_us (unsigned short l) { return tl::to_string(int (l)); }
|
||||
|
|
@ -494,6 +599,27 @@ struct B
|
|||
*/
|
||||
static tl::Variant new_b_by_variant ();
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
/**
|
||||
* @brief std::optional for simple and complex types
|
||||
*/
|
||||
|
||||
static std::optional<int> int_to_optional (int value, bool exists) { return exists ? std::optional<int> (value) : std::optional<int> (); }
|
||||
static std::optional<A> int_to_optional_a (int value, bool exists) { return exists ? std::optional<A> (A (value)) : std::optional<A> (); }
|
||||
|
||||
static int optional_to_int (std::optional<int> optional, int def) { return optional ? optional.value () : def; }
|
||||
static int optional_cref_to_int (const std::optional<int> &optional, int def) { return optional_to_int (optional, def); }
|
||||
static int optional_ref_to_int (std::optional<int> &optional, int def) { return optional_to_int (optional, def); }
|
||||
static int optional_cptr_to_int (const std::optional<int> *optional, int def) { return optional_to_int (*optional, def); }
|
||||
static int optional_ptr_to_int (std::optional<int> optional, int def) { return optional_to_int (*optional, def); }
|
||||
|
||||
static int optional_a_to_int (std::optional<A> optional, int def) { return optional ? optional.value ().a1 () : def; }
|
||||
static int optional_a_cref_to_int (const std::optional<A> &optional, int def) { return optional_a_to_int (optional, def); }
|
||||
static int optional_a_ref_to_int (std::optional<A> &optional, int def) { return optional_a_to_int (optional, def); }
|
||||
static int optional_a_cptr_to_int (const std::optional<A> *optional, int def) { return optional_a_to_int (*optional, def); }
|
||||
static int optional_a_ptr_to_int (std::optional<A> optional, int def) { return optional_a_to_int (*optional, def); }
|
||||
#endif
|
||||
|
||||
std::string addr () const;
|
||||
|
||||
int always_5 () const {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QObject>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
#include <QThread>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QByteArrayMatcher>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QObject>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
#include <QTranslator>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QCryptographicHash>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QIODevice>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
@ -113,25 +112,25 @@
|
|||
return v;
|
||||
}
|
||||
|
||||
static qt_gsi::Converter<class QChar>::target_type f_QDataStream_read_qchar(QDataStream *s)
|
||||
static qt_gsi::Converter<QChar>::target_type f_QDataStream_read_qchar(QDataStream *s)
|
||||
{
|
||||
QChar v = 0;
|
||||
QChar v = QChar (0);
|
||||
*s >> v;
|
||||
return qt_gsi::Converter<class QChar>::toc (v);
|
||||
return qt_gsi::Converter<QChar>::toc (v);
|
||||
}
|
||||
|
||||
static qt_gsi::Converter<class QList<int> >::target_type f_QDataStream_read_int_list(QDataStream *s)
|
||||
static qt_gsi::Converter<QList<int> >::target_type f_QDataStream_read_int_list(QDataStream *s)
|
||||
{
|
||||
QList<int> v;
|
||||
*s >> v;
|
||||
return qt_gsi::Converter<class QList<int> >::toc (v);
|
||||
return qt_gsi::Converter<QList<int> >::toc (v);
|
||||
}
|
||||
|
||||
static qt_gsi::Converter<class QVector<int> >::target_type f_QDataStream_read_int_vector(QDataStream *s)
|
||||
static qt_gsi::Converter<QVector<int> >::target_type f_QDataStream_read_int_vector(QDataStream *s)
|
||||
{
|
||||
QVector<int> v;
|
||||
*s >> v;
|
||||
return qt_gsi::Converter<class QVector<int> >::toc (v);
|
||||
return qt_gsi::Converter<QVector<int> >::toc (v);
|
||||
}
|
||||
|
||||
static QString f_QDataStream_read_string(QDataStream *s)
|
||||
|
|
@ -214,21 +213,21 @@
|
|||
return s;
|
||||
}
|
||||
|
||||
static QDataStream *f_QDataStream_put_qchar(QDataStream *s, const qt_gsi::Converter<class QChar>::target_type &v)
|
||||
static QDataStream *f_QDataStream_put_qchar(QDataStream *s, const qt_gsi::Converter<QChar>::target_type &v)
|
||||
{
|
||||
*s << qt_gsi::Converter<class QChar>::toq (v);
|
||||
*s << qt_gsi::Converter<QChar>::toq (v);
|
||||
return s;
|
||||
}
|
||||
|
||||
static QDataStream *f_QDataStream_put_int_list(QDataStream *s, const qt_gsi::Converter<class QList<int> >::target_type &v)
|
||||
static QDataStream *f_QDataStream_put_int_list(QDataStream *s, const qt_gsi::Converter<QList<int> >::target_type &v)
|
||||
{
|
||||
*s << qt_gsi::Converter<class QList<int> >::toq (v);
|
||||
*s << qt_gsi::Converter<QList<int> >::toq (v);
|
||||
return s;
|
||||
}
|
||||
|
||||
static QDataStream *f_QDataStream_put_int_vector(QDataStream *s, const qt_gsi::Converter<class QVector<int> >::target_type &v)
|
||||
static QDataStream *f_QDataStream_put_int_vector(QDataStream *s, const qt_gsi::Converter<QVector<int> >::target_type &v)
|
||||
{
|
||||
*s << qt_gsi::Converter<class QVector<int> >::toq (v);
|
||||
*s << qt_gsi::Converter<QVector<int> >::toq (v);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QDate>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
#include <QTime>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QFileInfo>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QDynamicPropertyChangeEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QEasingCurve>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QFactoryInterface>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
#include <QThread>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
#include <QFile>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
#include <QThread>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QDate>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QPoint>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
#include <QPointF>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
#include <QTime>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QMargins>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QMetaObject>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QMetaObject>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QMetaObject>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <QObject>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include <QObject>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QDataStream>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
#include <QUrl>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QAbstractItemModel>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QMutex>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -32,15 +32,21 @@
|
|||
#include <QModelIndex>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// class QPersistentModelIndex
|
||||
#if QT_VERSION < 0x60000
|
||||
static const QModelIndex &castToQModelIndex(const QPersistentModelIndex *m)
|
||||
{
|
||||
return m->operator const QModelIndex &();
|
||||
}
|
||||
#else
|
||||
static QModelIndex castToQModelIndex(const QPersistentModelIndex *m)
|
||||
{
|
||||
return m->operator QModelIndex();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Constructor QPersistentModelIndex::QPersistentModelIndex()
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
#include <QMatrix4x4>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
#include <QMatrix4x4>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include <QThread>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QProcessEnvironment>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QReadWriteLock>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QReadWriteLock>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
#include <QSize>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
#include <QSizeF>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QRegExp>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QLocale>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QSemaphore>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
#include <QWidget>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QSize>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QSize>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QStringMatcher>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QSysInfo>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QLocale>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include <QThread>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
#include <QTextEncoder>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QTextCodec>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QTextCodec>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <QTextCodec>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <QSplitter>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
@ -98,7 +97,7 @@
|
|||
|
||||
static qt_gsi::Converter<QChar>::target_type f_QTextStream_read_qchar(QTextStream *s)
|
||||
{
|
||||
QChar v = 0;
|
||||
QChar v = QChar (0);
|
||||
*s >> v;
|
||||
return qt_gsi::Converter<QChar>::toc (v);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QTime>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <QTimerEvent>
|
||||
#include "gsiQt.h"
|
||||
#include "gsiQtCoreCommon.h"
|
||||
#include "gsiDeclQtCoreTypeTraits.h"
|
||||
#include <memory>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue