diff --git a/scripts/mkqtdecl4/mkqtdecl.conf b/scripts/mkqtdecl4/mkqtdecl.conf index 768518232..b6bc2f11d 100644 --- a/scripts/mkqtdecl4/mkqtdecl.conf +++ b/scripts/mkqtdecl4/mkqtdecl.conf @@ -183,6 +183,10 @@ drop_class "QVectorIterator" drop_class "QVectorTypedData" drop_enum_const "QEvent", /CocoaRequestModal/ # not available on WIN +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 +drop_method "QSignalBlocker", /QSignalBlocker::QSignalBlocker\(.*&/ # clashes with pointer version drop_method "QFont", /QFont::initialize/ # Must not hide Ruby's initialize and is not public drop_method "QColormap", /QColormap::initialize/ # Must not hide Ruby's initialize and is not public drop_method "QAccessible", /QAccessible::initialize/ # Must not hide Ruby's initialize and is not public @@ -193,6 +197,7 @@ drop_method "QMetaObject", /QMetaObject::invokeMethod/ # requires QGenericArgume drop_method "QMetaObject", /QMetaObject::metacall/ # requires void** drop_method "QMetaMethod", /QMetaMethod::invoke/ # requires QGenericArgument which is a macro drop_method "QMetaMethod", /QMetaMethod::newInstance/ # requires QGenericArgument which is a macro +drop_method "QMetaObject", /QMetaObject::cast\(/ # internal drop_method "QMetaObject", /QMetaObject::activate/ # requires void** drop_method "QMetaObject", /QMetaObject::static_metacall/ # requires void** drop_method "QMetaObject", /QMetaObject::addGuard/ # requires QObject** @@ -563,6 +568,8 @@ drop_method "QMessageBox", /QMessageBox::critical.*QMessageBox::StandardButton\s drop_method "QMessageBox", /QMessageBox::information.*QMessageBox::StandardButton\s+\w+,\s*QMessageBox::StandardButton\s+\w+\s*\)/ # clashes with enum version drop_method "QTreeWidgetItem", /::QTreeWidgetItem\(const\s+QTreeWidgetItem\s*&/ # will hide the parent-constructor otherwise. Use dup/copy protocol instead. +rename "QRawFont", /QRawFont::supportsCharacter\(.*ucs4/, "supportsCharacter_ucs4" +drop_method "QTextLine", /QTextLine::cursorToX\(.*int\s*\*/ # clashes with int-only version drop_method "QPainter", /QPainter::drawRects.*QRect\s+\*/ # requires pointers, alternative available drop_method "QPainter", /QPainter::drawRects.*QRectF\s+\*/ # requires pointers, alternative available drop_method "QPainter", /QPainter::drawConvexPolygon.*QPoint\s+\*/ # requires pointers, alternative available @@ -672,6 +679,11 @@ final_class "QAccessibleWidget" # because navigate cannot be implemented # -------------------------------------------------------------- # QtXml + +drop_method "QXmlReader", /QXmlReader::parse\(.*QXmlInputSource\s*&/ # Clashes with pointer version +drop_method "QXmlStreamReader", /QXmlStreamReader::QXmlStreamReader\(.*const\s+char\s*\*/ # Clashes with QString version +drop_method "QXmlStreamReader", /QXmlStreamReader::addData\(.*const\s+char\s*\*/ # Clashes with QString version +drop_method "QXmlStreamStringRef", /QXmlStreamStringRef::QXmlStreamStringRef\(.*const\s+char\s*\*/ # Clashes with QString version drop_method "QXmlAttributes", /QXmlAttributes::value\(\s*const\s+QLatin1String/ # QLatin1String not available drop_method "QXmlAttributes", /QXmlAttributes::index\(\s*const\s+QLatin1String/ # QLatin1String not available drop_method "QXmlInputSource", /QXmlInputSource::setData\(.*QByteArray/ # clashes with QString version diff --git a/scripts/mkqtdecl5/mkqtdecl.conf b/scripts/mkqtdecl5/mkqtdecl.conf index 570a19204..4d5b23f09 100644 --- a/scripts/mkqtdecl5/mkqtdecl.conf +++ b/scripts/mkqtdecl5/mkqtdecl.conf @@ -223,8 +223,14 @@ drop_class "QVectorIterator" drop_class "QVectorTypedData" drop_enum_const "QEvent", /CocoaRequestModal/ # not available on WIN +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 +drop_method "QSignalBlocker", /QSignalBlocker::QSignalBlocker\(.*&/ # clashes with pointer version drop_method "QQuaternion", /QQuaternion::toRotationMatrix\(/ # GenericMatrix not available drop_method "QQuaternion", /QQuaternion::fromRotationMatrix\(/ # GenericMatrix not available +drop_method "QJsonValue", /QJsonValue::QJsonValue\(\s*const\s+char\s*\*/ # clashes with QString version +drop_method "QJsonValue", /QJsonValue::QJsonValue\(\s*int\s+/ # clashes with long version drop_method "QJsonValue", /QJsonValue::QJsonValue\(\s*QLatin1String/ # QLatin1String not available drop_method "QTextBoundaryFinder", /QTextBoundaryFinder::QTextBoundaryFinder\(.*unsigned\s+char\s*\*/ # unsigned char * not available drop_method "QMessageLogger", /QMessageLogger::critical\(.*catFunc/ # function pointers not supported currently @@ -246,6 +252,7 @@ drop_method "QEasingCurve", /QEasingCurve::setCustomType/ # requires function * drop_method "QEasingCurve", /QEasingCurve::customType/ # requires function * drop_method "QLibrary", /QLibrary::resolve/ # requires function * drop_method "QLoggingCategory", /QLoggingCategory::installFilter/ # requires function * +drop_method "QMetaObject", /QMetaObject::cast\(/ # internal drop_method "QMetaObject", /QMetaObject::d\(/ # invalid return value (struct) drop_method "QMetaObject", /QMetaObject::invokeMethod/ # requires QGenericArgument which is a macro drop_method "QMetaObject", /QMetaObject::metacall/ # requires void** @@ -674,6 +681,8 @@ drop_method "QMenu", /QMenu::setPlatformMenu/ # QPlatformMenu not available drop_method "QMenuBar", /QMenuBar::platformMenuBar/ # QPlatformMenu not available drop_method "QTreeWidgetItem", /::QTreeWidgetItem\(const\s+QTreeWidgetItem\s*&/ # will hide the parent-constructor otherwise. Use dup/copy protocol instead. +rename "QRawFont", /QRawFont::supportsCharacter\(.*ucs4/, "supportsCharacter_ucs4" +drop_method "QTextLine", /QTextLine::cursorToX\(.*int\s*\*/ # clashes with int-only version drop_method "QPainter", /QPainter::drawRects.*QRect\s+\*/ # requires pointers, alternative available drop_method "QPainter", /QPainter::drawRects.*QRectF\s+\*/ # requires pointers, alternative available drop_method "QPainter", /QPainter::drawConvexPolygon.*QPoint\s+\*/ # requires pointers, alternative available @@ -797,6 +806,10 @@ include "QXmlSerializer", [ "", "" ] no_imports "QXmlStreamAttributes" # base class is a template. +drop_method "QXmlReader", /QXmlReader::parse\(.*QXmlInputSource\s*&/ # Clashes with pointer version +drop_method "QXmlStreamReader", /QXmlStreamReader::QXmlStreamReader\(.*const\s+char\s*\*/ # Clashes with QString version +drop_method "QXmlStreamReader", /QXmlStreamReader::addData\(.*const\s+char\s*\*/ # Clashes with QString version +drop_method "QXmlStreamStringRef", /QXmlStreamStringRef::QXmlStreamStringRef\(.*const\s+char\s*\*/ # Clashes with QString version drop_method "QXmlStreamAttributes", /QXmlStreamAttributes::append\(const\s+QVector/ # QVector is a template drop_method "QXmlStreamAttributes", /QXmlStreamAttributes::hasAttribute\(\s*QLatin1String/ # QLatin1String is not available drop_method "QXmlStreamAttributes", /QXmlStreamAttributes::value\(.*QLatin1String/ # QLatin1String is not available @@ -934,10 +947,6 @@ drop_method "QAbstractVideoBuffer", /QAbstractVideoBuffer::mapPlanes/ # int[] no drop_method "QAbstractVideoBuffer", /QAbstractVideoBuffer::map\(QAbstractVideoBuffer::MapMode/ # unsigned char * not available drop_method "QVideoFrame", /^unsigned\s+char\s*\*/ # unsigned char * not available -# -------------------------------------------------------------- -# QtDesigner - - # -------------------------------------------------------------- no_default_ctor "QRadioTunerControl" diff --git a/src/db/db/dbRegion.cc b/src/db/db/dbRegion.cc index 85c793917..72f8742c7 100644 --- a/src/db/db/dbRegion.cc +++ b/src/db/db/dbRegion.cc @@ -31,9 +31,11 @@ #include "dbFlatEdges.h" #include "dbPolygonTools.h" #include "dbCompoundOperation.h" -#include "gsiClassBase.h" #include "tlGlobPattern.h" +// NOTE: include this to provide the symbols for "make_variant" +#include "gsiDecl.h" + namespace db { diff --git a/src/gsi/gsi/gsiClassBase.cc b/src/gsi/gsi/gsiClassBase.cc index c9506999d..f0e705de3 100644 --- a/src/gsi/gsi/gsiClassBase.cc +++ b/src/gsi/gsi/gsiClassBase.cc @@ -422,6 +422,53 @@ static const std::set > &name_map_for_class (const return cc->second; } +#if defined(_DEBUG) +static std::string type_signature (const gsi::ArgType &t) +{ + gsi::ArgType tr (t); + tr.set_is_ptr (false); + tr.set_is_ref (false); + tr.set_is_cptr (false); + tr.set_is_cref (false); + return tr.to_string (); +} + +static std::string signature (const gsi::MethodBase *m, const gsi::MethodBase::MethodSynonym &s) +{ + std::string res; + + if (m->is_static ()) { + res += "static "; + } + + res += type_signature (m->ret_type ()); + res += " "; + res += s.name; + if (s.is_predicate) { + res += "?"; + } + if (s.is_setter) { + res += "="; + } + + res += "("; + for (gsi::MethodBase::argument_iterator a = m->begin_arguments (); a != m->end_arguments (); ++a) { + if (a != m->begin_arguments ()) { + res += ", "; + } + res += type_signature (*a); + } + + res += ")"; + + if (m->is_const ()) { + res += " const"; + } + + return res; +} +#endif + void ClassBase::merge_declarations () { @@ -564,6 +611,30 @@ ClassBase::merge_declarations () // lym::ExternalClass) tl_assert (! c->declaration () || c->declaration () == &*c); } + +#if defined(_DEBUG) + // do a sanity check + for (gsi::ClassBase::class_iterator c = gsi::ClassBase::begin_classes (); c != gsi::ClassBase::end_classes (); ++c) { + + std::map method_counts; + + for (gsi::ClassBase::method_iterator m = c->begin_methods (); m != c->end_methods (); ++m) { + if (! (*m)->is_callback ()) { + for (gsi::MethodBase::synonym_iterator s = (*m)->begin_synonyms (); s != (*m)->end_synonyms (); ++s) { + method_counts [signature (*m, *s)] += 1; + } + } + } + + for (std::map::const_iterator mc = method_counts.begin (); mc != method_counts.end (); ++mc) { + if (mc->second > 1) { + tl::warn << "Ambiguous method declarations in class " << c->name () << " for method " << mc->first; + } + } + + } +#endif + } static void collect_classes (const gsi::ClassBase *cls, std::list &unsorted_classes) diff --git a/src/gsi/gsi/gsiSerialisation.h b/src/gsi/gsi/gsiSerialisation.h index 86d6a6719..3801d1553 100644 --- a/src/gsi/gsi/gsiSerialisation.h +++ b/src/gsi/gsi/gsiSerialisation.h @@ -698,76 +698,6 @@ class GSI_PUBLIC_TEMPLATE StringAdaptorImpl #if defined(HAVE_QT) -/** - * @brief Specialization for QByteArray - */ -template <> -class GSI_PUBLIC StringAdaptorImpl - : public StringAdaptor -{ -public: - StringAdaptorImpl (QByteArray *s) - : mp_s (s), m_is_const (false) - { - // .. nothing yet .. - } - - StringAdaptorImpl (const QByteArray *s) - : mp_s (const_cast (s)), m_is_const (true) - { - // .. nothing yet .. - } - - StringAdaptorImpl (const QByteArray &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->size (); - } - - virtual const char *c_str () const - { - return mp_s->constData (); - } - - virtual void set (const char *c_str, size_t s, tl::Heap &) - { - if (! m_is_const) { - *mp_s = QByteArray (c_str, int (s)); - } - } - - virtual void copy_to (AdaptorBase *target, tl::Heap &heap) const - { - StringAdaptorImpl *s = dynamic_cast *>(target); - if (s) { - *s->mp_s = *mp_s; - } else { - StringAdaptor::copy_to (target, heap); - } - } - -private: - QByteArray *mp_s; - bool m_is_const; - QByteArray m_s; -}; - /** * @brief Specialization for QString */ @@ -1102,6 +1032,206 @@ public: StringAdaptorImpl (const char_type *s) : StringAdaptorImplCCP (s) { } }; +// ------------------------------------------------------------ +// ByteArray adaptor framework + +/** + * @brief A generic adaptor for strings + * This is the base class for implementing generic access to strings + */ +class GSI_PUBLIC ByteArrayAdaptor + : public AdaptorBase +{ +public: + /** + * @brief Default constructor + */ + ByteArrayAdaptor () { } + + /** + * @brief Destructor + */ + virtual ~ByteArrayAdaptor () { } + + /** + * @brief Returns the size of the string + */ + virtual size_t size () const = 0; + + /** + * @brief Returns a pointer to a UTF8 encoded character array with size size() + */ + virtual const char *c_str () const = 0; + + /** + * @brief Sets the string to the given UTF8 string with length s + */ + virtual void set (const char *c_str, size_t s, tl::Heap &heap) = 0; + + /** + * @brief copy_to implementation + */ + virtual void copy_to (AdaptorBase *target, tl::Heap &heap) const + { + ByteArrayAdaptor *s = dynamic_cast(target); + tl_assert (s); + s->set (c_str (), size (), heap); + } +}; + +/** + * @brief Generic string adaptor implementation + */ +template +class GSI_PUBLIC_TEMPLATE ByteArrayAdaptorImpl + : public ByteArrayAdaptor +{ +}; + +#if defined(HAVE_QT) + +/** + * @brief Specialization for QByteArray + */ +template <> +class GSI_PUBLIC ByteArrayAdaptorImpl + : public ByteArrayAdaptor +{ +public: + ByteArrayAdaptorImpl (QByteArray *s) + : mp_s (s), m_is_const (false) + { + // .. nothing yet .. + } + + ByteArrayAdaptorImpl (const QByteArray *s) + : mp_s (const_cast (s)), m_is_const (true) + { + // .. nothing yet .. + } + + ByteArrayAdaptorImpl (const QByteArray &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 &) + { + if (! m_is_const) { + *mp_s = QByteArray (c_str, int (s)); + } + } + + virtual void copy_to (AdaptorBase *target, tl::Heap &heap) const + { + ByteArrayAdaptorImpl *s = dynamic_cast *>(target); + if (s) { + *s->mp_s = *mp_s; + } else { + ByteArrayAdaptor::copy_to (target, heap); + } + } + +private: + QByteArray *mp_s; + bool m_is_const; + QByteArray m_s; +}; + +#endif + +/** + * @brief Specialization for std::string + */ +template <> +class GSI_PUBLIC ByteArrayAdaptorImpl > + : public ByteArrayAdaptor +{ +public: + ByteArrayAdaptorImpl (std::vector *s) + : mp_s (s), m_is_const (false) + { + // .. nothing yet .. + } + + ByteArrayAdaptorImpl (const std::vector *s) + : mp_s (const_cast *> (s)), m_is_const (true) + { + // .. nothing yet .. + } + + ByteArrayAdaptorImpl (const std::vector &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->front (); + } + + virtual void set (const char *c_str, size_t s, tl::Heap &) + { + if (! m_is_const) { + *mp_s = std::vector (c_str, c_str + s); + } + } + + virtual void copy_to (AdaptorBase *target, tl::Heap &heap) const + { + ByteArrayAdaptorImpl > *s = dynamic_cast > *>(target); + if (s) { + *s->mp_s = *mp_s; + } else { + ByteArrayAdaptor::copy_to (target, heap); + } + } + +private: + std::vector *mp_s; + bool m_is_const; + std::vector m_s; +}; + // ------------------------------------------------------------ // Variant adaptor framework @@ -1914,6 +2044,12 @@ inline AdaptorBase *create_adaptor_by_category(const string_adaptor_tag & /*tag* return new StringAdaptorImpl (v); } +template +inline AdaptorBase *create_adaptor_by_category(const byte_array_adaptor_tag & /*tag*/, V v) +{ + return new ByteArrayAdaptorImpl (v); +} + template inline AdaptorBase *create_adaptor_by_category(const variant_adaptor_tag & /*tag*/, const V &v) { diff --git a/src/gsi/gsi/gsiTypes.cc b/src/gsi/gsi/gsiTypes.cc index 81d0e35fe..ae5091d8d 100644 --- a/src/gsi/gsi/gsiTypes.cc +++ b/src/gsi/gsi/gsiTypes.cc @@ -76,6 +76,8 @@ ArgType::to_string () const s += "float"; break; case T_string: s += "string"; break; + case T_byte_array: + s += "byte array"; break; case T_var: s += "variant"; break; case T_object: diff --git a/src/gsi/gsi/gsiTypes.h b/src/gsi/gsi/gsiTypes.h index cfa40e929..945b3499c 100644 --- a/src/gsi/gsi/gsiTypes.h +++ b/src/gsi/gsi/gsiTypes.h @@ -26,6 +26,7 @@ #include "tlInternational.h" #include "tlException.h" +#include "tlTypeTraits.h" #include "gsiCommon.h" #include @@ -37,6 +38,7 @@ #if defined(HAVE_QT) #include #include +#include #include #include #include @@ -61,6 +63,7 @@ class GSI_PUBLIC SerialArgs; class GSI_PUBLIC VectorAdaptor; class GSI_PUBLIC MapAdaptor; class GSI_PUBLIC StringAdaptor; +class GSI_PUBLIC ByteArrayAdaptor; class GSI_PUBLIC VariantAdaptor; class GSI_PUBLIC ClassBase; struct NoAdaptorTag; @@ -112,6 +115,7 @@ enum BasicType T_float = 14, T_var = 15, T_string = 16, + T_byte_array = 17, T_void_ptr = 19, T_object = 20, T_vector = 21, @@ -175,6 +179,7 @@ struct adaptor_category_tag { }; struct vector_adaptor_tag : public adaptor_category_tag { }; struct map_adaptor_tag : public adaptor_category_tag { }; struct string_adaptor_tag : public adaptor_category_tag { }; +struct byte_array_adaptor_tag : public adaptor_category_tag { }; struct variant_adaptor_tag : public adaptor_category_tag { }; struct basic_type_tag : public type_tag_base { }; @@ -224,6 +229,7 @@ struct adaptor_ptr_tag : public npod_ptr_tag { }; struct vector_tag : public adaptor_direct_tag, public vector_adaptor_tag { }; struct map_tag : public adaptor_direct_tag, public map_adaptor_tag { }; struct string_tag : public adaptor_direct_tag, public string_adaptor_tag { }; +struct byte_array_tag : public adaptor_direct_tag, public byte_array_adaptor_tag { }; struct var_tag : public adaptor_direct_tag, public variant_adaptor_tag { }; struct bool_cref_tag : public pod_cref_tag { }; @@ -247,6 +253,7 @@ struct float_cref_tag : public pod_cref_tag { }; struct vector_cref_tag : public adaptor_cref_tag, public vector_adaptor_tag { }; struct map_cref_tag : public adaptor_cref_tag, public map_adaptor_tag { }; struct string_cref_tag : public adaptor_cref_tag, public string_adaptor_tag { }; +struct byte_array_cref_tag : public adaptor_cref_tag, public byte_array_adaptor_tag { }; struct var_cref_tag : public adaptor_cref_tag, public variant_adaptor_tag { }; struct bool_ref_tag : public pod_ref_tag { }; @@ -270,6 +277,7 @@ struct float_ref_tag : public pod_ref_tag { }; struct vector_ref_tag : public adaptor_ref_tag, public vector_adaptor_tag { }; struct map_ref_tag : public adaptor_ref_tag, public map_adaptor_tag { }; struct string_ref_tag : public adaptor_ref_tag, public string_adaptor_tag { }; +struct byte_array_ref_tag : public adaptor_ref_tag, public byte_array_adaptor_tag { }; struct var_ref_tag : public adaptor_ref_tag, public variant_adaptor_tag { }; struct bool_cptr_tag : public pod_cptr_tag { }; @@ -293,6 +301,7 @@ struct float_cptr_tag : public pod_cptr_tag { }; struct vector_cptr_tag : public adaptor_cptr_tag, public vector_adaptor_tag { }; struct map_cptr_tag : public adaptor_cptr_tag, public map_adaptor_tag { }; struct string_cptr_tag : public adaptor_cptr_tag, public string_adaptor_tag { }; +struct byte_array_cptr_tag : public adaptor_cptr_tag, public byte_array_adaptor_tag { }; struct var_cptr_tag : public adaptor_cptr_tag, public variant_adaptor_tag { }; struct bool_ptr_tag : public pod_ptr_tag { }; @@ -316,6 +325,7 @@ struct float_ptr_tag : public pod_ptr_tag { }; struct vector_ptr_tag : public adaptor_ptr_tag, public vector_adaptor_tag { }; struct map_ptr_tag : public adaptor_ptr_tag, public map_adaptor_tag { }; struct string_ptr_tag : public adaptor_ptr_tag, public string_adaptor_tag { }; +struct byte_array_ptr_tag : public adaptor_ptr_tag, public byte_array_adaptor_tag { }; struct var_ptr_tag : public adaptor_ptr_tag, public variant_adaptor_tag { }; // all other objects @@ -427,7 +437,8 @@ template <> struct type_traits : generic_type_trait #if defined(HAVE_QT) template <> struct type_traits : generic_type_traits { }; template <> struct type_traits : generic_type_traits { }; -template <> struct type_traits : generic_type_traits { }; +template <> struct type_traits : generic_type_traits { }; +template <> struct type_traits > : generic_type_traits { }; template <> struct type_traits : generic_type_traits { }; #endif template <> struct type_traits : generic_type_traits { }; @@ -459,7 +470,8 @@ template <> struct type_traits : generic_type_trait #if defined(HAVE_QT) template <> struct type_traits : generic_type_traits { }; template <> struct type_traits : generic_type_traits { }; -template <> struct type_traits : generic_type_traits { }; +template <> struct type_traits : generic_type_traits { }; +template <> struct type_traits &> : generic_type_traits { }; template <> struct type_traits : generic_type_traits { }; #endif template <> struct type_traits : generic_type_traits { }; @@ -488,7 +500,8 @@ template <> struct type_traits : generic_type_trait #if defined(HAVE_QT) template <> struct type_traits : generic_type_traits { }; template <> struct type_traits : generic_type_traits { }; -template <> struct type_traits : generic_type_traits { }; +template <> struct type_traits : generic_type_traits { }; +template <> struct type_traits &> : generic_type_traits { }; template <> struct type_traits : generic_type_traits { }; #endif template <> struct type_traits : generic_type_traits { }; @@ -518,7 +531,8 @@ template <> struct type_traits : generic_type_trait #if defined(HAVE_QT) template <> struct type_traits : generic_type_traits { }; template <> struct type_traits : generic_type_traits { }; -template <> struct type_traits : generic_type_traits { }; +template <> struct type_traits : generic_type_traits { }; +template <> struct type_traits *> : generic_type_traits { }; template <> struct type_traits : generic_type_traits { }; #endif template <> struct type_traits : generic_type_traits { }; @@ -548,7 +562,8 @@ template <> struct type_traits : generic_type_trait #if defined(HAVE_QT) template <> struct type_traits : generic_type_traits { }; template <> struct type_traits : generic_type_traits { }; -template <> struct type_traits : generic_type_traits { }; +template <> struct type_traits : generic_type_traits { }; +template <> struct type_traits *> : generic_type_traits { }; template <> struct type_traits : generic_type_traits { }; #endif template <> struct type_traits : generic_type_traits { }; @@ -1976,6 +1991,11 @@ struct ObjectType { }; */ struct StringType { }; +/** + * @brief Represents "T_byte_array" as a C++ type + */ +struct ByteArrayType { }; + /** * @brief Represents "T_var" as a C++ type */ @@ -2053,7 +2073,10 @@ void do_on_type_impl (gsi::BasicType type, const A1 *arg1, const A2 *arg2, const case gsi::T_string: call_variadic_function, A1, A2, A3, A4, A5> () (arg1, arg2, arg3, arg4, arg5); break; - case gsi::T_var: + case gsi::T_byte_array: + call_variadic_function, A1, A2, A3, A4, A5> () (arg1, arg2, arg3, arg4, arg5); + break; + case gsi::T_var: call_variadic_function, A1, A2, A3, A4, A5> () (arg1, arg2, arg3, arg4, arg5); break; case gsi::T_object: diff --git a/src/gsi/gsi_test/gsiTest.cc b/src/gsi/gsi_test/gsiTest.cc index 3693f1931..ba53486cb 100644 --- a/src/gsi/gsi_test/gsiTest.cc +++ b/src/gsi/gsi_test/gsiTest.cc @@ -112,6 +112,71 @@ tl::Variant A::new_a_by_variant () return tl::Variant (A ()); } +std::vector +A::qba_cref_to_ia (const QByteArray &ba) +{ + const char *cp = ba.constData (); + size_t n = ba.size (); + std::vector ia; + for (size_t i = 0; i < n; ++i) { + ia.push_back (int (*cp++)); + } + return ia; +} + +QByteArray +A::ia_cref_to_qba (const std::vector &ia) +{ + QByteArray ba; + for (std::vector::const_iterator i = ia.begin (); i != ia.end (); ++i) { + ba.push_back (char (*i)); + } + return ba; +} + +const QByteArray & +A::ia_cref_to_qba_cref (const std::vector &ia) +{ + static QByteArray ba; + ba.clear (); + for (std::vector::const_iterator i = ia.begin (); i != ia.end (); ++i) { + ba.push_back (char (*i)); + } + return ba; +} + +std::vector +A::ba_cref_to_ia (const std::vector &ba) +{ + std::vector ia; + for (std::vector::const_iterator i = ba.begin (); i != ba.end (); ++i) { + ia.push_back (int (*i)); + } + return ia; +} + +std::vector +A::ia_cref_to_ba (const std::vector &ia) +{ + std::vector ba; + for (std::vector::const_iterator i = ia.begin (); i != ia.end (); ++i) { + ba.push_back (char (*i)); + } + return ba; +} + +const std::vector & +A::ia_cref_to_ba_cref (const std::vector &ia) +{ + static std::vector ba; + ba.clear (); + for (std::vector::const_iterator i = ia.begin (); i != ia.end (); ++i) { + ba.push_back (char (*i)); + } + return ba; +} + + static A *a_ctor (int i) { return new A (i); @@ -810,6 +875,24 @@ static gsi::Class decl_a ("", "A", gsi::constructor ("new_a|new", &a_ctor) + gsi::method ("instance_count", &A::instance_count) + 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) + + gsi::method ("qba_ptr_to_ia", &A::qba_ptr_to_ia) + + 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) + +#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_cref", &A::ia_cref_to_ba_cref) + + gsi::method ("br", &A::br) + gsi::method ("get_e", &A::get_e) + gsi::method ("get_eptr", &A::get_eptr) + diff --git a/src/gsi/gsi_test/gsiTest.h b/src/gsi/gsi_test/gsiTest.h index b2d68776e..2811b5c4a 100644 --- a/src/gsi/gsi_test/gsiTest.h +++ b/src/gsi/gsi_test/gsiTest.h @@ -98,6 +98,39 @@ struct A */ static tl::Variant new_a_by_variant (); +#if defined(HAVE_QT) + /** + * @brief Byte sequences: tests access to QByteArray + */ + static std::vector qba_cref_to_ia (const QByteArray &ba); + static std::vector qba_ref_to_ia (QByteArray &ba) { return qba_cref_to_ia (ba); } + static std::vector qba_cptr_to_ia (const QByteArray *ba) { return qba_cref_to_ia (*ba); } + static std::vector qba_ptr_to_ia (QByteArray *ba) { return qba_cref_to_ia (*ba); } + static std::vector qba_to_ia (QByteArray ba) { return qba_cref_to_ia (ba); } + + /** + * @brief Byte sequences: tests return of QByteArray + */ + static QByteArray ia_cref_to_qba (const std::vector &ia); + static const QByteArray &ia_cref_to_qba_cref (const std::vector &ia); + +#endif + + /** + * @brief Byte sequences: tests access to std::vector (another byte array) + */ + static std::vector ba_cref_to_ia (const std::vector &ba); + static std::vector ba_ref_to_ia (std::vector &ba) { return ba_cref_to_ia (ba); } + static std::vector ba_cptr_to_ia (const std::vector *ba) { return ba_cref_to_ia (*ba); } + static std::vector ba_ptr_to_ia (std::vector *ba) { return ba_cref_to_ia (*ba); } + static std::vector ba_to_ia (std::vector ba) { return ba_cref_to_ia (ba); } + + /** + * @brief Byte sequences: tests return of std::vector + */ + static std::vector ia_cref_to_ba (const std::vector &ia); + static const std::vector &ia_cref_to_ba_cref (const std::vector &ia); + /* * @brief A dummy method providing a chance to set a breakpoint in the script */ @@ -120,6 +153,9 @@ struct A int a3 (const std::string &x) { return int (x.size ()); } + int a3_ba (const std::vector &x) { + return x.size (); + } #if defined(HAVE_QT) int a3_qstr (const QString &x) { return x.size (); @@ -131,7 +167,7 @@ struct A return x.size (); } #endif - double a4 (const std::vector &d) { + double a4 (const std::vector &d) { m_d = d; return d.back (); } @@ -170,6 +206,7 @@ struct A unsigned long long a11_ull (double f) { return (unsigned long long)(f); } std::string a10_d (double f) { return tl::to_string (f); } + std::vector a10_d_ba (double f) { std::string s = tl::to_string (f); return std::vector (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)); } diff --git a/src/gsiqt/qt4/QtCore/gsiDeclQMetaObject.cc b/src/gsiqt/qt4/QtCore/gsiDeclQMetaObject.cc index 1f5cbe5fa..4b5a7c058 100644 --- a/src/gsiqt/qt4/QtCore/gsiDeclQMetaObject.cc +++ b/src/gsiqt/qt4/QtCore/gsiDeclQMetaObject.cc @@ -56,25 +56,6 @@ static void _call_ctor_QMetaObject_0 (const qt_gsi::GenericStaticMethod * /*decl } -// QObject *QMetaObject::cast(QObject *obj) - - -static void _init_f_cast_c1302 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("obj"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_cast_c1302 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QObject *arg1 = gsi::arg_reader() (args, heap); - ret.write ((QObject *)((QMetaObject *)cls)->cast (arg1)); -} - - // QMetaClassInfo QMetaObject::classInfo(int index) @@ -754,7 +735,6 @@ namespace gsi static gsi::Methods methods_QMetaObject () { gsi::Methods methods; methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QMetaObject::QMetaObject()\nThis method creates an object of class QMetaObject.", &_init_ctor_QMetaObject_0, &_call_ctor_QMetaObject_0); - methods += new qt_gsi::GenericMethod ("cast", "@brief Method QObject *QMetaObject::cast(QObject *obj)\n", true, &_init_f_cast_c1302, &_call_f_cast_c1302); methods += new qt_gsi::GenericMethod ("classInfo", "@brief Method QMetaClassInfo QMetaObject::classInfo(int index)\n", true, &_init_f_classInfo_c767, &_call_f_classInfo_c767); methods += new qt_gsi::GenericMethod ("classInfoCount", "@brief Method int QMetaObject::classInfoCount()\n", true, &_init_f_classInfoCount_c0, &_call_f_classInfoCount_c0); methods += new qt_gsi::GenericMethod ("classInfoOffset", "@brief Method int QMetaObject::classInfoOffset()\n", true, &_init_f_classInfoOffset_c0, &_call_f_classInfoOffset_c0); diff --git a/src/gsiqt/qt4/QtGui/gsiDeclQTextLine.cc b/src/gsiqt/qt4/QtGui/gsiDeclQTextLine.cc index d51349248..b8c353254 100644 --- a/src/gsiqt/qt4/QtGui/gsiDeclQTextLine.cc +++ b/src/gsiqt/qt4/QtGui/gsiDeclQTextLine.cc @@ -69,28 +69,6 @@ static void _call_f_ascent_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls } -// double QTextLine::cursorToX(int *cursorPos, QTextLine::Edge edge) - - -static void _init_f_cursorToX_c2664 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("cursorPos"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("edge", true, "QTextLine::Leading"); - decl->add_arg::target_type & > (argspec_1); - decl->set_return (); -} - -static void _call_f_cursorToX_c2664 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - int *arg1 = gsi::arg_reader() (args, heap); - const qt_gsi::Converter::target_type & arg2 = args ? gsi::arg_reader::target_type & >() (args, heap) : gsi::arg_maker::target_type & >() (qt_gsi::CppToQtReadAdaptor(heap, QTextLine::Leading), heap); - ret.write ((double)((QTextLine *)cls)->cursorToX (arg1, qt_gsi::QtToCppAdaptor(arg2).cref())); -} - - // double QTextLine::cursorToX(int cursorPos, QTextLine::Edge edge) @@ -497,7 +475,6 @@ static gsi::Methods methods_QTextLine () { gsi::Methods methods; methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QTextLine::QTextLine()\nThis method creates an object of class QTextLine.", &_init_ctor_QTextLine_0, &_call_ctor_QTextLine_0); methods += new qt_gsi::GenericMethod ("ascent", "@brief Method double QTextLine::ascent()\n", true, &_init_f_ascent_c0, &_call_f_ascent_c0); - methods += new qt_gsi::GenericMethod ("cursorToX", "@brief Method double QTextLine::cursorToX(int *cursorPos, QTextLine::Edge edge)\n", true, &_init_f_cursorToX_c2664, &_call_f_cursorToX_c2664); methods += new qt_gsi::GenericMethod ("cursorToX", "@brief Method double QTextLine::cursorToX(int cursorPos, QTextLine::Edge edge)\n", true, &_init_f_cursorToX_c2478, &_call_f_cursorToX_c2478); methods += new qt_gsi::GenericMethod ("descent", "@brief Method double QTextLine::descent()\n", true, &_init_f_descent_c0, &_call_f_descent_c0); methods += new qt_gsi::GenericMethod ("draw", "@brief Method void QTextLine::draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection)\n", true, &_init_f_draw_c6879, &_call_f_draw_c6879); diff --git a/src/gsiqt/qt4/QtXml/gsiDeclQXmlReader.cc b/src/gsiqt/qt4/QtXml/gsiDeclQXmlReader.cc index f30fd62a7..4d777082e 100644 --- a/src/gsiqt/qt4/QtXml/gsiDeclQXmlReader.cc +++ b/src/gsiqt/qt4/QtXml/gsiDeclQXmlReader.cc @@ -193,25 +193,6 @@ static void _call_f_lexicalHandler_c0 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QXmlReader::parse(const QXmlInputSource &input) - - -static void _init_f_parse_2852 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("input"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_parse_2852 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlInputSource &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QXmlReader *)cls)->parse (arg1)); -} - - // bool QXmlReader::parse(const QXmlInputSource *input) @@ -419,6 +400,7 @@ static void _call_f_setProperty_2973 (const qt_gsi::GenericMethod * /*decl*/, vo } + namespace gsi { @@ -433,7 +415,6 @@ static gsi::Methods methods_QXmlReader () { methods += new qt_gsi::GenericMethod ("hasFeature", "@brief Method bool QXmlReader::hasFeature(const QString &name)\n", true, &_init_f_hasFeature_c2025, &_call_f_hasFeature_c2025); methods += new qt_gsi::GenericMethod ("hasProperty", "@brief Method bool QXmlReader::hasProperty(const QString &name)\n", true, &_init_f_hasProperty_c2025, &_call_f_hasProperty_c2025); methods += new qt_gsi::GenericMethod (":lexicalHandler", "@brief Method QXmlLexicalHandler *QXmlReader::lexicalHandler()\n", true, &_init_f_lexicalHandler_c0, &_call_f_lexicalHandler_c0); - methods += new qt_gsi::GenericMethod ("parse", "@brief Method bool QXmlReader::parse(const QXmlInputSource &input)\n", false, &_init_f_parse_2852, &_call_f_parse_2852); methods += new qt_gsi::GenericMethod ("parse", "@brief Method bool QXmlReader::parse(const QXmlInputSource *input)\n", false, &_init_f_parse_2856, &_call_f_parse_2856); methods += new qt_gsi::GenericMethod ("property", "@brief Method void *QXmlReader::property(const QString &name, bool *ok)\n", true, &_init_f_property_c2967, &_call_f_property_c2967); methods += new qt_gsi::GenericMethod ("setContentHandler|contentHandler=", "@brief Method void QXmlReader::setContentHandler(QXmlContentHandler *handler)\n", false, &_init_f_setContentHandler_2441, &_call_f_setContentHandler_2441); @@ -447,893 +428,12 @@ static gsi::Methods methods_QXmlReader () { return methods; } -gsi::Class decl_QXmlReader ("QtXml", "QXmlReader_Native", +gsi::Class decl_QXmlReader ("QtXml", "QXmlReader", methods_QXmlReader (), - "@hide\n@alias QXmlReader"); + "@qt\n@brief Binding of QXmlReader"); + GSI_QTXML_PUBLIC gsi::Class &qtdecl_QXmlReader () { return decl_QXmlReader; } } - -class QXmlReader_Adaptor : public QXmlReader, public qt_gsi::QtObjectBase -{ -public: - - virtual ~QXmlReader_Adaptor(); - - // [adaptor ctor] QXmlReader::QXmlReader() - QXmlReader_Adaptor() : QXmlReader() - { - qt_gsi::QtObjectBase::init (this); - } - - // [adaptor impl] QXmlDTDHandler *QXmlReader::DTDHandler() - QXmlDTDHandler * cbs_DTDHandler_c0_0() const - { - throw qt_gsi::AbstractMethodCalledException("DTDHandler"); - } - - virtual QXmlDTDHandler * DTDHandler() const - { - if (cb_DTDHandler_c0_0.can_issue()) { - return cb_DTDHandler_c0_0.issue(&QXmlReader_Adaptor::cbs_DTDHandler_c0_0); - } else { - throw qt_gsi::AbstractMethodCalledException("DTDHandler"); - } - } - - // [adaptor impl] QXmlContentHandler *QXmlReader::contentHandler() - QXmlContentHandler * cbs_contentHandler_c0_0() const - { - throw qt_gsi::AbstractMethodCalledException("contentHandler"); - } - - virtual QXmlContentHandler * contentHandler() const - { - if (cb_contentHandler_c0_0.can_issue()) { - return cb_contentHandler_c0_0.issue(&QXmlReader_Adaptor::cbs_contentHandler_c0_0); - } else { - throw qt_gsi::AbstractMethodCalledException("contentHandler"); - } - } - - // [adaptor impl] QXmlDeclHandler *QXmlReader::declHandler() - QXmlDeclHandler * cbs_declHandler_c0_0() const - { - throw qt_gsi::AbstractMethodCalledException("declHandler"); - } - - virtual QXmlDeclHandler * declHandler() const - { - if (cb_declHandler_c0_0.can_issue()) { - return cb_declHandler_c0_0.issue(&QXmlReader_Adaptor::cbs_declHandler_c0_0); - } else { - throw qt_gsi::AbstractMethodCalledException("declHandler"); - } - } - - // [adaptor impl] QXmlEntityResolver *QXmlReader::entityResolver() - QXmlEntityResolver * cbs_entityResolver_c0_0() const - { - throw qt_gsi::AbstractMethodCalledException("entityResolver"); - } - - virtual QXmlEntityResolver * entityResolver() const - { - if (cb_entityResolver_c0_0.can_issue()) { - return cb_entityResolver_c0_0.issue(&QXmlReader_Adaptor::cbs_entityResolver_c0_0); - } else { - throw qt_gsi::AbstractMethodCalledException("entityResolver"); - } - } - - // [adaptor impl] QXmlErrorHandler *QXmlReader::errorHandler() - QXmlErrorHandler * cbs_errorHandler_c0_0() const - { - throw qt_gsi::AbstractMethodCalledException("errorHandler"); - } - - virtual QXmlErrorHandler * errorHandler() const - { - if (cb_errorHandler_c0_0.can_issue()) { - return cb_errorHandler_c0_0.issue(&QXmlReader_Adaptor::cbs_errorHandler_c0_0); - } else { - throw qt_gsi::AbstractMethodCalledException("errorHandler"); - } - } - - // [adaptor impl] bool QXmlReader::feature(const QString &name, bool *ok) - bool cbs_feature_c2967_1(const QString &name, bool *ok) const - { - __SUPPRESS_UNUSED_WARNING (name); - __SUPPRESS_UNUSED_WARNING (ok); - throw qt_gsi::AbstractMethodCalledException("feature"); - } - - virtual bool feature(const QString &name, bool *ok) const - { - if (cb_feature_c2967_1.can_issue()) { - return cb_feature_c2967_1.issue(&QXmlReader_Adaptor::cbs_feature_c2967_1, name, ok); - } else { - throw qt_gsi::AbstractMethodCalledException("feature"); - } - } - - // [adaptor impl] bool QXmlReader::hasFeature(const QString &name) - bool cbs_hasFeature_c2025_0(const QString &name) const - { - __SUPPRESS_UNUSED_WARNING (name); - throw qt_gsi::AbstractMethodCalledException("hasFeature"); - } - - virtual bool hasFeature(const QString &name) const - { - if (cb_hasFeature_c2025_0.can_issue()) { - return cb_hasFeature_c2025_0.issue(&QXmlReader_Adaptor::cbs_hasFeature_c2025_0, name); - } else { - throw qt_gsi::AbstractMethodCalledException("hasFeature"); - } - } - - // [adaptor impl] bool QXmlReader::hasProperty(const QString &name) - bool cbs_hasProperty_c2025_0(const QString &name) const - { - __SUPPRESS_UNUSED_WARNING (name); - throw qt_gsi::AbstractMethodCalledException("hasProperty"); - } - - virtual bool hasProperty(const QString &name) const - { - if (cb_hasProperty_c2025_0.can_issue()) { - return cb_hasProperty_c2025_0.issue(&QXmlReader_Adaptor::cbs_hasProperty_c2025_0, name); - } else { - throw qt_gsi::AbstractMethodCalledException("hasProperty"); - } - } - - // [adaptor impl] QXmlLexicalHandler *QXmlReader::lexicalHandler() - QXmlLexicalHandler * cbs_lexicalHandler_c0_0() const - { - throw qt_gsi::AbstractMethodCalledException("lexicalHandler"); - } - - virtual QXmlLexicalHandler * lexicalHandler() const - { - if (cb_lexicalHandler_c0_0.can_issue()) { - return cb_lexicalHandler_c0_0.issue(&QXmlReader_Adaptor::cbs_lexicalHandler_c0_0); - } else { - throw qt_gsi::AbstractMethodCalledException("lexicalHandler"); - } - } - - // [adaptor impl] bool QXmlReader::parse(const QXmlInputSource &input) - bool cbs_parse_2852_0(const QXmlInputSource &input) - { - __SUPPRESS_UNUSED_WARNING (input); - throw qt_gsi::AbstractMethodCalledException("parse"); - } - - virtual bool parse(const QXmlInputSource &input) - { - if (cb_parse_2852_0.can_issue()) { - return cb_parse_2852_0.issue(&QXmlReader_Adaptor::cbs_parse_2852_0, input); - } else { - throw qt_gsi::AbstractMethodCalledException("parse"); - } - } - - // [adaptor impl] bool QXmlReader::parse(const QXmlInputSource *input) - bool cbs_parse_2856_0(const QXmlInputSource *input) - { - __SUPPRESS_UNUSED_WARNING (input); - throw qt_gsi::AbstractMethodCalledException("parse"); - } - - virtual bool parse(const QXmlInputSource *input) - { - if (cb_parse_2856_0.can_issue()) { - return cb_parse_2856_0.issue(&QXmlReader_Adaptor::cbs_parse_2856_0, input); - } else { - throw qt_gsi::AbstractMethodCalledException("parse"); - } - } - - // [adaptor impl] void *QXmlReader::property(const QString &name, bool *ok) - void * cbs_property_c2967_1(const QString &name, bool *ok) const - { - __SUPPRESS_UNUSED_WARNING (name); - __SUPPRESS_UNUSED_WARNING (ok); - throw qt_gsi::AbstractMethodCalledException("property"); - } - - virtual void * property(const QString &name, bool *ok) const - { - if (cb_property_c2967_1.can_issue()) { - return cb_property_c2967_1.issue(&QXmlReader_Adaptor::cbs_property_c2967_1, name, ok); - } else { - throw qt_gsi::AbstractMethodCalledException("property"); - } - } - - // [adaptor impl] void QXmlReader::setContentHandler(QXmlContentHandler *handler) - void cbs_setContentHandler_2441_0(QXmlContentHandler *handler) - { - __SUPPRESS_UNUSED_WARNING (handler); - throw qt_gsi::AbstractMethodCalledException("setContentHandler"); - } - - virtual void setContentHandler(QXmlContentHandler *handler) - { - if (cb_setContentHandler_2441_0.can_issue()) { - cb_setContentHandler_2441_0.issue(&QXmlReader_Adaptor::cbs_setContentHandler_2441_0, handler); - } else { - throw qt_gsi::AbstractMethodCalledException("setContentHandler"); - } - } - - // [adaptor impl] void QXmlReader::setDTDHandler(QXmlDTDHandler *handler) - void cbs_setDTDHandler_1930_0(QXmlDTDHandler *handler) - { - __SUPPRESS_UNUSED_WARNING (handler); - throw qt_gsi::AbstractMethodCalledException("setDTDHandler"); - } - - virtual void setDTDHandler(QXmlDTDHandler *handler) - { - if (cb_setDTDHandler_1930_0.can_issue()) { - cb_setDTDHandler_1930_0.issue(&QXmlReader_Adaptor::cbs_setDTDHandler_1930_0, handler); - } else { - throw qt_gsi::AbstractMethodCalledException("setDTDHandler"); - } - } - - // [adaptor impl] void QXmlReader::setDeclHandler(QXmlDeclHandler *handler) - void cbs_setDeclHandler_2086_0(QXmlDeclHandler *handler) - { - __SUPPRESS_UNUSED_WARNING (handler); - throw qt_gsi::AbstractMethodCalledException("setDeclHandler"); - } - - virtual void setDeclHandler(QXmlDeclHandler *handler) - { - if (cb_setDeclHandler_2086_0.can_issue()) { - cb_setDeclHandler_2086_0.issue(&QXmlReader_Adaptor::cbs_setDeclHandler_2086_0, handler); - } else { - throw qt_gsi::AbstractMethodCalledException("setDeclHandler"); - } - } - - // [adaptor impl] void QXmlReader::setEntityResolver(QXmlEntityResolver *handler) - void cbs_setEntityResolver_2495_0(QXmlEntityResolver *handler) - { - __SUPPRESS_UNUSED_WARNING (handler); - throw qt_gsi::AbstractMethodCalledException("setEntityResolver"); - } - - virtual void setEntityResolver(QXmlEntityResolver *handler) - { - if (cb_setEntityResolver_2495_0.can_issue()) { - cb_setEntityResolver_2495_0.issue(&QXmlReader_Adaptor::cbs_setEntityResolver_2495_0, handler); - } else { - throw qt_gsi::AbstractMethodCalledException("setEntityResolver"); - } - } - - // [adaptor impl] void QXmlReader::setErrorHandler(QXmlErrorHandler *handler) - void cbs_setErrorHandler_2232_0(QXmlErrorHandler *handler) - { - __SUPPRESS_UNUSED_WARNING (handler); - throw qt_gsi::AbstractMethodCalledException("setErrorHandler"); - } - - virtual void setErrorHandler(QXmlErrorHandler *handler) - { - if (cb_setErrorHandler_2232_0.can_issue()) { - cb_setErrorHandler_2232_0.issue(&QXmlReader_Adaptor::cbs_setErrorHandler_2232_0, handler); - } else { - throw qt_gsi::AbstractMethodCalledException("setErrorHandler"); - } - } - - // [adaptor impl] void QXmlReader::setFeature(const QString &name, bool value) - void cbs_setFeature_2781_0(const QString &name, bool value) - { - __SUPPRESS_UNUSED_WARNING (name); - __SUPPRESS_UNUSED_WARNING (value); - throw qt_gsi::AbstractMethodCalledException("setFeature"); - } - - virtual void setFeature(const QString &name, bool value) - { - if (cb_setFeature_2781_0.can_issue()) { - cb_setFeature_2781_0.issue(&QXmlReader_Adaptor::cbs_setFeature_2781_0, name, value); - } else { - throw qt_gsi::AbstractMethodCalledException("setFeature"); - } - } - - // [adaptor impl] void QXmlReader::setLexicalHandler(QXmlLexicalHandler *handler) - void cbs_setLexicalHandler_2416_0(QXmlLexicalHandler *handler) - { - __SUPPRESS_UNUSED_WARNING (handler); - throw qt_gsi::AbstractMethodCalledException("setLexicalHandler"); - } - - virtual void setLexicalHandler(QXmlLexicalHandler *handler) - { - if (cb_setLexicalHandler_2416_0.can_issue()) { - cb_setLexicalHandler_2416_0.issue(&QXmlReader_Adaptor::cbs_setLexicalHandler_2416_0, handler); - } else { - throw qt_gsi::AbstractMethodCalledException("setLexicalHandler"); - } - } - - // [adaptor impl] void QXmlReader::setProperty(const QString &name, void *value) - void cbs_setProperty_2973_0(const QString &name, void *value) - { - __SUPPRESS_UNUSED_WARNING (name); - __SUPPRESS_UNUSED_WARNING (value); - throw qt_gsi::AbstractMethodCalledException("setProperty"); - } - - virtual void setProperty(const QString &name, void *value) - { - if (cb_setProperty_2973_0.can_issue()) { - cb_setProperty_2973_0.issue(&QXmlReader_Adaptor::cbs_setProperty_2973_0, name, value); - } else { - throw qt_gsi::AbstractMethodCalledException("setProperty"); - } - } - - gsi::Callback cb_DTDHandler_c0_0; - gsi::Callback cb_contentHandler_c0_0; - gsi::Callback cb_declHandler_c0_0; - gsi::Callback cb_entityResolver_c0_0; - gsi::Callback cb_errorHandler_c0_0; - gsi::Callback cb_feature_c2967_1; - gsi::Callback cb_hasFeature_c2025_0; - gsi::Callback cb_hasProperty_c2025_0; - gsi::Callback cb_lexicalHandler_c0_0; - gsi::Callback cb_parse_2852_0; - gsi::Callback cb_parse_2856_0; - gsi::Callback cb_property_c2967_1; - gsi::Callback cb_setContentHandler_2441_0; - gsi::Callback cb_setDTDHandler_1930_0; - gsi::Callback cb_setDeclHandler_2086_0; - gsi::Callback cb_setEntityResolver_2495_0; - gsi::Callback cb_setErrorHandler_2232_0; - gsi::Callback cb_setFeature_2781_0; - gsi::Callback cb_setLexicalHandler_2416_0; - gsi::Callback cb_setProperty_2973_0; -}; - -QXmlReader_Adaptor::~QXmlReader_Adaptor() { } - -// Constructor QXmlReader::QXmlReader() (adaptor class) - -static void _init_ctor_QXmlReader_Adaptor_0 (qt_gsi::GenericStaticMethod *decl) -{ - decl->set_return_new (); -} - -static void _call_ctor_QXmlReader_Adaptor_0 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write (new QXmlReader_Adaptor ()); -} - - -// QXmlDTDHandler *QXmlReader::DTDHandler() - -static void _init_cbs_DTDHandler_c0_0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return (); -} - -static void _call_cbs_DTDHandler_c0_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write ((QXmlDTDHandler *)((QXmlReader_Adaptor *)cls)->cbs_DTDHandler_c0_0 ()); -} - -static void _set_callback_cbs_DTDHandler_c0_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_DTDHandler_c0_0 = cb; -} - - -// QXmlContentHandler *QXmlReader::contentHandler() - -static void _init_cbs_contentHandler_c0_0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return (); -} - -static void _call_cbs_contentHandler_c0_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write ((QXmlContentHandler *)((QXmlReader_Adaptor *)cls)->cbs_contentHandler_c0_0 ()); -} - -static void _set_callback_cbs_contentHandler_c0_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_contentHandler_c0_0 = cb; -} - - -// QXmlDeclHandler *QXmlReader::declHandler() - -static void _init_cbs_declHandler_c0_0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return (); -} - -static void _call_cbs_declHandler_c0_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write ((QXmlDeclHandler *)((QXmlReader_Adaptor *)cls)->cbs_declHandler_c0_0 ()); -} - -static void _set_callback_cbs_declHandler_c0_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_declHandler_c0_0 = cb; -} - - -// QXmlEntityResolver *QXmlReader::entityResolver() - -static void _init_cbs_entityResolver_c0_0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return (); -} - -static void _call_cbs_entityResolver_c0_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write ((QXmlEntityResolver *)((QXmlReader_Adaptor *)cls)->cbs_entityResolver_c0_0 ()); -} - -static void _set_callback_cbs_entityResolver_c0_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_entityResolver_c0_0 = cb; -} - - -// QXmlErrorHandler *QXmlReader::errorHandler() - -static void _init_cbs_errorHandler_c0_0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return (); -} - -static void _call_cbs_errorHandler_c0_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write ((QXmlErrorHandler *)((QXmlReader_Adaptor *)cls)->cbs_errorHandler_c0_0 ()); -} - -static void _set_callback_cbs_errorHandler_c0_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_errorHandler_c0_0 = cb; -} - - -// bool QXmlReader::feature(const QString &name, bool *ok) - -static void _init_cbs_feature_c2967_1 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("name"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("ok"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_cbs_feature_c2967_1 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QString &arg1 = args.read (heap); - bool *arg2 = args.read (heap); - ret.write ((bool)((QXmlReader_Adaptor *)cls)->cbs_feature_c2967_1 (arg1, arg2)); -} - -static void _set_callback_cbs_feature_c2967_1 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_feature_c2967_1 = cb; -} - - -// bool QXmlReader::hasFeature(const QString &name) - -static void _init_cbs_hasFeature_c2025_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("name"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_hasFeature_c2025_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QString &arg1 = args.read (heap); - ret.write ((bool)((QXmlReader_Adaptor *)cls)->cbs_hasFeature_c2025_0 (arg1)); -} - -static void _set_callback_cbs_hasFeature_c2025_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_hasFeature_c2025_0 = cb; -} - - -// bool QXmlReader::hasProperty(const QString &name) - -static void _init_cbs_hasProperty_c2025_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("name"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_hasProperty_c2025_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QString &arg1 = args.read (heap); - ret.write ((bool)((QXmlReader_Adaptor *)cls)->cbs_hasProperty_c2025_0 (arg1)); -} - -static void _set_callback_cbs_hasProperty_c2025_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_hasProperty_c2025_0 = cb; -} - - -// QXmlLexicalHandler *QXmlReader::lexicalHandler() - -static void _init_cbs_lexicalHandler_c0_0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return (); -} - -static void _call_cbs_lexicalHandler_c0_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write ((QXmlLexicalHandler *)((QXmlReader_Adaptor *)cls)->cbs_lexicalHandler_c0_0 ()); -} - -static void _set_callback_cbs_lexicalHandler_c0_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_lexicalHandler_c0_0 = cb; -} - - -// bool QXmlReader::parse(const QXmlInputSource &input) - -static void _init_cbs_parse_2852_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("input"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_parse_2852_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlInputSource &arg1 = args.read (heap); - ret.write ((bool)((QXmlReader_Adaptor *)cls)->cbs_parse_2852_0 (arg1)); -} - -static void _set_callback_cbs_parse_2852_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_parse_2852_0 = cb; -} - - -// bool QXmlReader::parse(const QXmlInputSource *input) - -static void _init_cbs_parse_2856_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("input"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_parse_2856_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlInputSource *arg1 = args.read (heap); - ret.write ((bool)((QXmlReader_Adaptor *)cls)->cbs_parse_2856_0 (arg1)); -} - -static void _set_callback_cbs_parse_2856_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_parse_2856_0 = cb; -} - - -// void *QXmlReader::property(const QString &name, bool *ok) - -static void _init_cbs_property_c2967_1 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("name"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("ok"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_cbs_property_c2967_1 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QString &arg1 = args.read (heap); - bool *arg2 = args.read (heap); - ret.write ((void *)((QXmlReader_Adaptor *)cls)->cbs_property_c2967_1 (arg1, arg2)); -} - -static void _set_callback_cbs_property_c2967_1 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_property_c2967_1 = cb; -} - - -// void QXmlReader::setContentHandler(QXmlContentHandler *handler) - -static void _init_cbs_setContentHandler_2441_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("handler"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_setContentHandler_2441_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QXmlContentHandler *arg1 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setContentHandler_2441_0 (arg1); -} - -static void _set_callback_cbs_setContentHandler_2441_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setContentHandler_2441_0 = cb; -} - - -// void QXmlReader::setDTDHandler(QXmlDTDHandler *handler) - -static void _init_cbs_setDTDHandler_1930_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("handler"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_setDTDHandler_1930_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QXmlDTDHandler *arg1 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setDTDHandler_1930_0 (arg1); -} - -static void _set_callback_cbs_setDTDHandler_1930_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setDTDHandler_1930_0 = cb; -} - - -// void QXmlReader::setDeclHandler(QXmlDeclHandler *handler) - -static void _init_cbs_setDeclHandler_2086_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("handler"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_setDeclHandler_2086_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QXmlDeclHandler *arg1 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setDeclHandler_2086_0 (arg1); -} - -static void _set_callback_cbs_setDeclHandler_2086_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setDeclHandler_2086_0 = cb; -} - - -// void QXmlReader::setEntityResolver(QXmlEntityResolver *handler) - -static void _init_cbs_setEntityResolver_2495_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("handler"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_setEntityResolver_2495_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QXmlEntityResolver *arg1 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setEntityResolver_2495_0 (arg1); -} - -static void _set_callback_cbs_setEntityResolver_2495_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setEntityResolver_2495_0 = cb; -} - - -// void QXmlReader::setErrorHandler(QXmlErrorHandler *handler) - -static void _init_cbs_setErrorHandler_2232_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("handler"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_setErrorHandler_2232_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QXmlErrorHandler *arg1 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setErrorHandler_2232_0 (arg1); -} - -static void _set_callback_cbs_setErrorHandler_2232_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setErrorHandler_2232_0 = cb; -} - - -// void QXmlReader::setFeature(const QString &name, bool value) - -static void _init_cbs_setFeature_2781_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("name"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("value"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_cbs_setFeature_2781_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QString &arg1 = args.read (heap); - bool arg2 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setFeature_2781_0 (arg1, arg2); -} - -static void _set_callback_cbs_setFeature_2781_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setFeature_2781_0 = cb; -} - - -// void QXmlReader::setLexicalHandler(QXmlLexicalHandler *handler) - -static void _init_cbs_setLexicalHandler_2416_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("handler"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_setLexicalHandler_2416_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QXmlLexicalHandler *arg1 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setLexicalHandler_2416_0 (arg1); -} - -static void _set_callback_cbs_setLexicalHandler_2416_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setLexicalHandler_2416_0 = cb; -} - - -// void QXmlReader::setProperty(const QString &name, void *value) - -static void _init_cbs_setProperty_2973_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("name"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("value"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_cbs_setProperty_2973_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QString &arg1 = args.read (heap); - void *arg2 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setProperty_2973_0 (arg1, arg2); -} - -static void _set_callback_cbs_setProperty_2973_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setProperty_2973_0 = cb; -} - - -namespace gsi -{ - -gsi::Class &qtdecl_QXmlReader (); - -static gsi::Methods methods_QXmlReader_Adaptor () { - gsi::Methods methods; - methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QXmlReader::QXmlReader()\nThis method creates an object of class QXmlReader.", &_init_ctor_QXmlReader_Adaptor_0, &_call_ctor_QXmlReader_Adaptor_0); - methods += new qt_gsi::GenericMethod ("DTDHandler", "@brief Virtual method QXmlDTDHandler *QXmlReader::DTDHandler()\nThis method can be reimplemented in a derived class.", true, &_init_cbs_DTDHandler_c0_0, &_call_cbs_DTDHandler_c0_0); - methods += new qt_gsi::GenericMethod ("DTDHandler", "@hide", true, &_init_cbs_DTDHandler_c0_0, &_call_cbs_DTDHandler_c0_0, &_set_callback_cbs_DTDHandler_c0_0); - methods += new qt_gsi::GenericMethod ("contentHandler", "@brief Virtual method QXmlContentHandler *QXmlReader::contentHandler()\nThis method can be reimplemented in a derived class.", true, &_init_cbs_contentHandler_c0_0, &_call_cbs_contentHandler_c0_0); - methods += new qt_gsi::GenericMethod ("contentHandler", "@hide", true, &_init_cbs_contentHandler_c0_0, &_call_cbs_contentHandler_c0_0, &_set_callback_cbs_contentHandler_c0_0); - methods += new qt_gsi::GenericMethod ("declHandler", "@brief Virtual method QXmlDeclHandler *QXmlReader::declHandler()\nThis method can be reimplemented in a derived class.", true, &_init_cbs_declHandler_c0_0, &_call_cbs_declHandler_c0_0); - methods += new qt_gsi::GenericMethod ("declHandler", "@hide", true, &_init_cbs_declHandler_c0_0, &_call_cbs_declHandler_c0_0, &_set_callback_cbs_declHandler_c0_0); - methods += new qt_gsi::GenericMethod ("entityResolver", "@brief Virtual method QXmlEntityResolver *QXmlReader::entityResolver()\nThis method can be reimplemented in a derived class.", true, &_init_cbs_entityResolver_c0_0, &_call_cbs_entityResolver_c0_0); - methods += new qt_gsi::GenericMethod ("entityResolver", "@hide", true, &_init_cbs_entityResolver_c0_0, &_call_cbs_entityResolver_c0_0, &_set_callback_cbs_entityResolver_c0_0); - methods += new qt_gsi::GenericMethod ("errorHandler", "@brief Virtual method QXmlErrorHandler *QXmlReader::errorHandler()\nThis method can be reimplemented in a derived class.", true, &_init_cbs_errorHandler_c0_0, &_call_cbs_errorHandler_c0_0); - methods += new qt_gsi::GenericMethod ("errorHandler", "@hide", true, &_init_cbs_errorHandler_c0_0, &_call_cbs_errorHandler_c0_0, &_set_callback_cbs_errorHandler_c0_0); - methods += new qt_gsi::GenericMethod ("feature", "@brief Virtual method bool QXmlReader::feature(const QString &name, bool *ok)\nThis method can be reimplemented in a derived class.", true, &_init_cbs_feature_c2967_1, &_call_cbs_feature_c2967_1); - methods += new qt_gsi::GenericMethod ("feature", "@hide", true, &_init_cbs_feature_c2967_1, &_call_cbs_feature_c2967_1, &_set_callback_cbs_feature_c2967_1); - methods += new qt_gsi::GenericMethod ("hasFeature", "@brief Virtual method bool QXmlReader::hasFeature(const QString &name)\nThis method can be reimplemented in a derived class.", true, &_init_cbs_hasFeature_c2025_0, &_call_cbs_hasFeature_c2025_0); - methods += new qt_gsi::GenericMethod ("hasFeature", "@hide", true, &_init_cbs_hasFeature_c2025_0, &_call_cbs_hasFeature_c2025_0, &_set_callback_cbs_hasFeature_c2025_0); - methods += new qt_gsi::GenericMethod ("hasProperty", "@brief Virtual method bool QXmlReader::hasProperty(const QString &name)\nThis method can be reimplemented in a derived class.", true, &_init_cbs_hasProperty_c2025_0, &_call_cbs_hasProperty_c2025_0); - methods += new qt_gsi::GenericMethod ("hasProperty", "@hide", true, &_init_cbs_hasProperty_c2025_0, &_call_cbs_hasProperty_c2025_0, &_set_callback_cbs_hasProperty_c2025_0); - methods += new qt_gsi::GenericMethod ("lexicalHandler", "@brief Virtual method QXmlLexicalHandler *QXmlReader::lexicalHandler()\nThis method can be reimplemented in a derived class.", true, &_init_cbs_lexicalHandler_c0_0, &_call_cbs_lexicalHandler_c0_0); - methods += new qt_gsi::GenericMethod ("lexicalHandler", "@hide", true, &_init_cbs_lexicalHandler_c0_0, &_call_cbs_lexicalHandler_c0_0, &_set_callback_cbs_lexicalHandler_c0_0); - methods += new qt_gsi::GenericMethod ("parse", "@brief Virtual method bool QXmlReader::parse(const QXmlInputSource &input)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_parse_2852_0, &_call_cbs_parse_2852_0); - methods += new qt_gsi::GenericMethod ("parse", "@hide", false, &_init_cbs_parse_2852_0, &_call_cbs_parse_2852_0, &_set_callback_cbs_parse_2852_0); - methods += new qt_gsi::GenericMethod ("parse", "@brief Virtual method bool QXmlReader::parse(const QXmlInputSource *input)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_parse_2856_0, &_call_cbs_parse_2856_0); - methods += new qt_gsi::GenericMethod ("parse", "@hide", false, &_init_cbs_parse_2856_0, &_call_cbs_parse_2856_0, &_set_callback_cbs_parse_2856_0); - methods += new qt_gsi::GenericMethod ("property", "@brief Virtual method void *QXmlReader::property(const QString &name, bool *ok)\nThis method can be reimplemented in a derived class.", true, &_init_cbs_property_c2967_1, &_call_cbs_property_c2967_1); - methods += new qt_gsi::GenericMethod ("property", "@hide", true, &_init_cbs_property_c2967_1, &_call_cbs_property_c2967_1, &_set_callback_cbs_property_c2967_1); - methods += new qt_gsi::GenericMethod ("setContentHandler", "@brief Virtual method void QXmlReader::setContentHandler(QXmlContentHandler *handler)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setContentHandler_2441_0, &_call_cbs_setContentHandler_2441_0); - methods += new qt_gsi::GenericMethod ("setContentHandler", "@hide", false, &_init_cbs_setContentHandler_2441_0, &_call_cbs_setContentHandler_2441_0, &_set_callback_cbs_setContentHandler_2441_0); - methods += new qt_gsi::GenericMethod ("setDTDHandler", "@brief Virtual method void QXmlReader::setDTDHandler(QXmlDTDHandler *handler)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setDTDHandler_1930_0, &_call_cbs_setDTDHandler_1930_0); - methods += new qt_gsi::GenericMethod ("setDTDHandler", "@hide", false, &_init_cbs_setDTDHandler_1930_0, &_call_cbs_setDTDHandler_1930_0, &_set_callback_cbs_setDTDHandler_1930_0); - methods += new qt_gsi::GenericMethod ("setDeclHandler", "@brief Virtual method void QXmlReader::setDeclHandler(QXmlDeclHandler *handler)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setDeclHandler_2086_0, &_call_cbs_setDeclHandler_2086_0); - methods += new qt_gsi::GenericMethod ("setDeclHandler", "@hide", false, &_init_cbs_setDeclHandler_2086_0, &_call_cbs_setDeclHandler_2086_0, &_set_callback_cbs_setDeclHandler_2086_0); - methods += new qt_gsi::GenericMethod ("setEntityResolver", "@brief Virtual method void QXmlReader::setEntityResolver(QXmlEntityResolver *handler)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setEntityResolver_2495_0, &_call_cbs_setEntityResolver_2495_0); - methods += new qt_gsi::GenericMethod ("setEntityResolver", "@hide", false, &_init_cbs_setEntityResolver_2495_0, &_call_cbs_setEntityResolver_2495_0, &_set_callback_cbs_setEntityResolver_2495_0); - methods += new qt_gsi::GenericMethod ("setErrorHandler", "@brief Virtual method void QXmlReader::setErrorHandler(QXmlErrorHandler *handler)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setErrorHandler_2232_0, &_call_cbs_setErrorHandler_2232_0); - methods += new qt_gsi::GenericMethod ("setErrorHandler", "@hide", false, &_init_cbs_setErrorHandler_2232_0, &_call_cbs_setErrorHandler_2232_0, &_set_callback_cbs_setErrorHandler_2232_0); - methods += new qt_gsi::GenericMethod ("setFeature", "@brief Virtual method void QXmlReader::setFeature(const QString &name, bool value)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setFeature_2781_0, &_call_cbs_setFeature_2781_0); - methods += new qt_gsi::GenericMethod ("setFeature", "@hide", false, &_init_cbs_setFeature_2781_0, &_call_cbs_setFeature_2781_0, &_set_callback_cbs_setFeature_2781_0); - methods += new qt_gsi::GenericMethod ("setLexicalHandler", "@brief Virtual method void QXmlReader::setLexicalHandler(QXmlLexicalHandler *handler)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setLexicalHandler_2416_0, &_call_cbs_setLexicalHandler_2416_0); - methods += new qt_gsi::GenericMethod ("setLexicalHandler", "@hide", false, &_init_cbs_setLexicalHandler_2416_0, &_call_cbs_setLexicalHandler_2416_0, &_set_callback_cbs_setLexicalHandler_2416_0); - methods += new qt_gsi::GenericMethod ("setProperty", "@brief Virtual method void QXmlReader::setProperty(const QString &name, void *value)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setProperty_2973_0, &_call_cbs_setProperty_2973_0); - methods += new qt_gsi::GenericMethod ("setProperty", "@hide", false, &_init_cbs_setProperty_2973_0, &_call_cbs_setProperty_2973_0, &_set_callback_cbs_setProperty_2973_0); - return methods; -} - -gsi::Class decl_QXmlReader_Adaptor (qtdecl_QXmlReader (), "QtXml", "QXmlReader", - methods_QXmlReader_Adaptor (), - "@qt\n@brief Binding of QXmlReader"); - -} - diff --git a/src/gsiqt/qt4/QtXml/gsiDeclQtXmlTypeTraits.h b/src/gsiqt/qt4/QtXml/gsiDeclQtXmlTypeTraits.h index 1b0cd03bd..dedb0f70c 100644 --- a/src/gsiqt/qt4/QtXml/gsiDeclQtXmlTypeTraits.h +++ b/src/gsiqt/qt4/QtXml/gsiDeclQtXmlTypeTraits.h @@ -387,12 +387,6 @@ template <> struct type_traits : public type_traits { }; } -class QXmlReader_Adaptor; -namespace tl { -template <> struct type_traits : public type_traits { -}; -} - class QXmlSimpleReader; namespace tl { template <> struct type_traits : public type_traits { diff --git a/src/gsiqt/qt5/QtCore/gsiDeclQCollator.cc b/src/gsiqt/qt5/QtCore/gsiDeclQCollator.cc index e3b55f4c7..b47a5a4a4 100644 --- a/src/gsiqt/qt5/QtCore/gsiDeclQCollator.cc +++ b/src/gsiqt/qt5/QtCore/gsiDeclQCollator.cc @@ -113,28 +113,6 @@ static void _call_f_compare_c3942 (const qt_gsi::GenericMethod * /*decl*/, void } -// int QCollator::compare(const QStringRef &s1, const QStringRef &s2) - - -static void _init_f_compare_c4512 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("s1"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("s2"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_f_compare_c4512 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QStringRef &arg1 = gsi::arg_reader() (args, heap); - const QStringRef &arg2 = gsi::arg_reader() (args, heap); - ret.write ((int)((QCollator *)cls)->compare (arg1, arg2)); -} - - // int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) @@ -378,7 +356,6 @@ static gsi::Methods methods_QCollator () { methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QCollator::QCollator(const QCollator &)\nThis method creates an object of class QCollator.", &_init_ctor_QCollator_2226, &_call_ctor_QCollator_2226); methods += new qt_gsi::GenericMethod (":caseSensitivity", "@brief Method Qt::CaseSensitivity QCollator::caseSensitivity()\n", true, &_init_f_caseSensitivity_c0, &_call_f_caseSensitivity_c0); methods += new qt_gsi::GenericMethod ("compare", "@brief Method int QCollator::compare(const QString &s1, const QString &s2)\n", true, &_init_f_compare_c3942, &_call_f_compare_c3942); - methods += new qt_gsi::GenericMethod ("compare", "@brief Method int QCollator::compare(const QStringRef &s1, const QStringRef &s2)\n", true, &_init_f_compare_c4512, &_call_f_compare_c4512); methods += new qt_gsi::GenericMethod ("compare", "@brief Method int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2)\n", true, &_init_f_compare_c4770, &_call_f_compare_c4770); methods += new qt_gsi::GenericMethod (":ignorePunctuation", "@brief Method bool QCollator::ignorePunctuation()\n", true, &_init_f_ignorePunctuation_c0, &_call_f_ignorePunctuation_c0); methods += new qt_gsi::GenericMethod (":locale", "@brief Method QLocale QCollator::locale()\n", true, &_init_f_locale_c0, &_call_f_locale_c0); diff --git a/src/gsiqt/qt5/QtCore/gsiDeclQJsonValue.cc b/src/gsiqt/qt5/QtCore/gsiDeclQJsonValue.cc index 2ab130d64..c5dfbff8c 100644 --- a/src/gsiqt/qt5/QtCore/gsiDeclQJsonValue.cc +++ b/src/gsiqt/qt5/QtCore/gsiDeclQJsonValue.cc @@ -95,25 +95,6 @@ static void _call_ctor_QJsonValue_1071 (const qt_gsi::GenericStaticMethod * /*de } -// Constructor QJsonValue::QJsonValue(int n) - - -static void _init_ctor_QJsonValue_767 (qt_gsi::GenericStaticMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("n"); - decl->add_arg (argspec_0); - decl->set_return_new (); -} - -static void _call_ctor_QJsonValue_767 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - int arg1 = gsi::arg_reader() (args, heap); - ret.write (new QJsonValue (arg1)); -} - - // Constructor QJsonValue::QJsonValue(qint64 n) @@ -152,25 +133,6 @@ static void _call_ctor_QJsonValue_2025 (const qt_gsi::GenericStaticMethod * /*de } -// Constructor QJsonValue::QJsonValue(const char *s) - - -static void _init_ctor_QJsonValue_1731 (qt_gsi::GenericStaticMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("s"); - decl->add_arg (argspec_0); - decl->set_return_new (); -} - -static void _call_ctor_QJsonValue_1731 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const char *arg1 = gsi::arg_reader() (args, heap); - ret.write (new QJsonValue (arg1)); -} - - // Constructor QJsonValue::QJsonValue(const QJsonArray &a) @@ -592,10 +554,8 @@ static gsi::Methods methods_QJsonValue () { methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonValue::QJsonValue(QJsonValue::Type)\nThis method creates an object of class QJsonValue.", &_init_ctor_QJsonValue_1970, &_call_ctor_QJsonValue_1970); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonValue::QJsonValue(bool b)\nThis method creates an object of class QJsonValue.", &_init_ctor_QJsonValue_864, &_call_ctor_QJsonValue_864); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonValue::QJsonValue(double n)\nThis method creates an object of class QJsonValue.", &_init_ctor_QJsonValue_1071, &_call_ctor_QJsonValue_1071); - methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonValue::QJsonValue(int n)\nThis method creates an object of class QJsonValue.", &_init_ctor_QJsonValue_767, &_call_ctor_QJsonValue_767); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonValue::QJsonValue(qint64 n)\nThis method creates an object of class QJsonValue.", &_init_ctor_QJsonValue_986, &_call_ctor_QJsonValue_986); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonValue::QJsonValue(const QString &s)\nThis method creates an object of class QJsonValue.", &_init_ctor_QJsonValue_2025, &_call_ctor_QJsonValue_2025); - methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonValue::QJsonValue(const char *s)\nThis method creates an object of class QJsonValue.", &_init_ctor_QJsonValue_1731, &_call_ctor_QJsonValue_1731); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonValue::QJsonValue(const QJsonArray &a)\nThis method creates an object of class QJsonValue.", &_init_ctor_QJsonValue_2315, &_call_ctor_QJsonValue_2315); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonValue::QJsonValue(const QJsonObject &o)\nThis method creates an object of class QJsonValue.", &_init_ctor_QJsonValue_2403, &_call_ctor_QJsonValue_2403); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonValue::QJsonValue(const QJsonValue &other)\nThis method creates an object of class QJsonValue.", &_init_ctor_QJsonValue_2313, &_call_ctor_QJsonValue_2313); diff --git a/src/gsiqt/qt5/QtCore/gsiDeclQLocale.cc b/src/gsiqt/qt5/QtCore/gsiDeclQLocale.cc index cdbb71060..f0eeffb34 100644 --- a/src/gsiqt/qt5/QtCore/gsiDeclQLocale.cc +++ b/src/gsiqt/qt5/QtCore/gsiDeclQLocale.cc @@ -593,28 +593,6 @@ static void _call_f_quoteString_c4635 (const qt_gsi::GenericMethod * /*decl*/, v } -// QString QLocale::quoteString(const QStringRef &str, QLocale::QuotationStyle style) - - -static void _init_f_quoteString_c4920 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("str"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("style", true, "QLocale::StandardQuotation"); - decl->add_arg::target_type & > (argspec_1); - decl->set_return (); -} - -static void _call_f_quoteString_c4920 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QStringRef &arg1 = gsi::arg_reader() (args, heap); - const qt_gsi::Converter::target_type & arg2 = args ? gsi::arg_reader::target_type & >() (args, heap) : gsi::arg_maker::target_type & >() (qt_gsi::CppToQtReadAdaptor(heap, QLocale::StandardQuotation), heap); - ret.write ((QString)((QLocale *)cls)->quoteString (arg1, qt_gsi::QtToCppAdaptor(arg2).cref())); -} - - // QLocale::Script QLocale::script() @@ -1014,28 +992,6 @@ static void _call_f_toDouble_c2967 (const qt_gsi::GenericMethod * /*decl*/, void } -// double QLocale::toDouble(const QStringRef &s, bool *ok) - - -static void _init_f_toDouble_c3252 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("s"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("ok", true, "0"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_f_toDouble_c3252 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QStringRef &arg1 = gsi::arg_reader() (args, heap); - bool *arg2 = args ? gsi::arg_reader() (args, heap) : gsi::arg_maker() (0, heap); - ret.write ((double)((QLocale *)cls)->toDouble (arg1, arg2)); -} - - // float QLocale::toFloat(const QString &s, bool *ok) @@ -1058,28 +1014,6 @@ static void _call_f_toFloat_c2967 (const qt_gsi::GenericMethod * /*decl*/, void } -// float QLocale::toFloat(const QStringRef &s, bool *ok) - - -static void _init_f_toFloat_c3252 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("s"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("ok", true, "0"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_f_toFloat_c3252 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QStringRef &arg1 = gsi::arg_reader() (args, heap); - bool *arg2 = args ? gsi::arg_reader() (args, heap) : gsi::arg_maker() (0, heap); - ret.write ((float)((QLocale *)cls)->toFloat (arg1, arg2)); -} - - // int QLocale::toInt(const QString &s, bool *ok) @@ -1102,28 +1036,6 @@ static void _call_f_toInt_c2967 (const qt_gsi::GenericMethod * /*decl*/, void *c } -// int QLocale::toInt(const QStringRef &s, bool *ok) - - -static void _init_f_toInt_c3252 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("s"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("ok", true, "0"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_f_toInt_c3252 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QStringRef &arg1 = gsi::arg_reader() (args, heap); - bool *arg2 = args ? gsi::arg_reader() (args, heap) : gsi::arg_maker() (0, heap); - ret.write ((int)((QLocale *)cls)->toInt (arg1, arg2)); -} - - // qlonglong QLocale::toLongLong(const QString &s, bool *ok) @@ -1146,28 +1058,6 @@ static void _call_f_toLongLong_c2967 (const qt_gsi::GenericMethod * /*decl*/, vo } -// qlonglong QLocale::toLongLong(const QStringRef &s, bool *ok) - - -static void _init_f_toLongLong_c3252 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("s"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("ok", true, "0"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_f_toLongLong_c3252 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QStringRef &arg1 = gsi::arg_reader() (args, heap); - bool *arg2 = args ? gsi::arg_reader() (args, heap) : gsi::arg_maker() (0, heap); - ret.write ((qlonglong)((QLocale *)cls)->toLongLong (arg1, arg2)); -} - - // QString QLocale::toLower(const QString &str) @@ -1209,28 +1099,6 @@ static void _call_f_toShort_c2967 (const qt_gsi::GenericMethod * /*decl*/, void } -// short int QLocale::toShort(const QStringRef &s, bool *ok) - - -static void _init_f_toShort_c3252 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("s"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("ok", true, "0"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_f_toShort_c3252 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QStringRef &arg1 = gsi::arg_reader() (args, heap); - bool *arg2 = args ? gsi::arg_reader() (args, heap) : gsi::arg_maker() (0, heap); - ret.write ((short int)((QLocale *)cls)->toShort (arg1, arg2)); -} - - // QString QLocale::toString(qlonglong i) @@ -1593,28 +1461,6 @@ static void _call_f_toUInt_c2967 (const qt_gsi::GenericMethod * /*decl*/, void * } -// unsigned int QLocale::toUInt(const QStringRef &s, bool *ok) - - -static void _init_f_toUInt_c3252 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("s"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("ok", true, "0"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_f_toUInt_c3252 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QStringRef &arg1 = gsi::arg_reader() (args, heap); - bool *arg2 = args ? gsi::arg_reader() (args, heap) : gsi::arg_maker() (0, heap); - ret.write ((unsigned int)((QLocale *)cls)->toUInt (arg1, arg2)); -} - - // qulonglong QLocale::toULongLong(const QString &s, bool *ok) @@ -1637,28 +1483,6 @@ static void _call_f_toULongLong_c2967 (const qt_gsi::GenericMethod * /*decl*/, v } -// qulonglong QLocale::toULongLong(const QStringRef &s, bool *ok) - - -static void _init_f_toULongLong_c3252 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("s"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("ok", true, "0"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_f_toULongLong_c3252 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QStringRef &arg1 = gsi::arg_reader() (args, heap); - bool *arg2 = args ? gsi::arg_reader() (args, heap) : gsi::arg_maker() (0, heap); - ret.write ((qulonglong)((QLocale *)cls)->toULongLong (arg1, arg2)); -} - - // unsigned short int QLocale::toUShort(const QString &s, bool *ok) @@ -1681,28 +1505,6 @@ static void _call_f_toUShort_c2967 (const qt_gsi::GenericMethod * /*decl*/, void } -// unsigned short int QLocale::toUShort(const QStringRef &s, bool *ok) - - -static void _init_f_toUShort_c3252 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("s"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("ok", true, "0"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_f_toUShort_c3252 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QStringRef &arg1 = gsi::arg_reader() (args, heap); - bool *arg2 = args ? gsi::arg_reader() (args, heap) : gsi::arg_maker() (0, heap); - ret.write ((unsigned short int)((QLocale *)cls)->toUShort (arg1, arg2)); -} - - // QString QLocale::toUpper(const QString &str) @@ -1956,7 +1758,6 @@ static gsi::Methods methods_QLocale () { methods += new qt_gsi::GenericMethod ("pmText", "@brief Method QString QLocale::pmText()\n", true, &_init_f_pmText_c0, &_call_f_pmText_c0); methods += new qt_gsi::GenericMethod ("positiveSign", "@brief Method QChar QLocale::positiveSign()\n", true, &_init_f_positiveSign_c0, &_call_f_positiveSign_c0); methods += new qt_gsi::GenericMethod ("quoteString", "@brief Method QString QLocale::quoteString(const QString &str, QLocale::QuotationStyle style)\n", true, &_init_f_quoteString_c4635, &_call_f_quoteString_c4635); - methods += new qt_gsi::GenericMethod ("quoteString", "@brief Method QString QLocale::quoteString(const QStringRef &str, QLocale::QuotationStyle style)\n", true, &_init_f_quoteString_c4920, &_call_f_quoteString_c4920); methods += new qt_gsi::GenericMethod ("script", "@brief Method QLocale::Script QLocale::script()\n", true, &_init_f_script_c0, &_call_f_script_c0); methods += new qt_gsi::GenericMethod ("setNumberOptions|numberOptions=", "@brief Method void QLocale::setNumberOptions(QFlags options)\n", false, &_init_f_setNumberOptions_3171, &_call_f_setNumberOptions_3171); methods += new qt_gsi::GenericMethod ("standaloneDayName", "@brief Method QString QLocale::standaloneDayName(int, QLocale::FormatType format)\n", true, &_init_f_standaloneDayName_c2919, &_call_f_standaloneDayName_c2919); @@ -1976,16 +1777,11 @@ static gsi::Methods methods_QLocale () { methods += new qt_gsi::GenericMethod ("toDateTime", "@brief Method QDateTime QLocale::toDateTime(const QString &string, QLocale::FormatType format)\n", true, &_init_f_toDateTime_c4177, &_call_f_toDateTime_c4177); methods += new qt_gsi::GenericMethod ("toDateTime", "@brief Method QDateTime QLocale::toDateTime(const QString &string, const QString &format)\n", true, &_init_f_toDateTime_c3942, &_call_f_toDateTime_c3942); methods += new qt_gsi::GenericMethod ("toDouble", "@brief Method double QLocale::toDouble(const QString &s, bool *ok)\n", true, &_init_f_toDouble_c2967, &_call_f_toDouble_c2967); - methods += new qt_gsi::GenericMethod ("toDouble", "@brief Method double QLocale::toDouble(const QStringRef &s, bool *ok)\n", true, &_init_f_toDouble_c3252, &_call_f_toDouble_c3252); methods += new qt_gsi::GenericMethod ("toFloat", "@brief Method float QLocale::toFloat(const QString &s, bool *ok)\n", true, &_init_f_toFloat_c2967, &_call_f_toFloat_c2967); - methods += new qt_gsi::GenericMethod ("toFloat", "@brief Method float QLocale::toFloat(const QStringRef &s, bool *ok)\n", true, &_init_f_toFloat_c3252, &_call_f_toFloat_c3252); methods += new qt_gsi::GenericMethod ("toInt", "@brief Method int QLocale::toInt(const QString &s, bool *ok)\n", true, &_init_f_toInt_c2967, &_call_f_toInt_c2967); - methods += new qt_gsi::GenericMethod ("toInt", "@brief Method int QLocale::toInt(const QStringRef &s, bool *ok)\n", true, &_init_f_toInt_c3252, &_call_f_toInt_c3252); methods += new qt_gsi::GenericMethod ("toLongLong", "@brief Method qlonglong QLocale::toLongLong(const QString &s, bool *ok)\n", true, &_init_f_toLongLong_c2967, &_call_f_toLongLong_c2967); - methods += new qt_gsi::GenericMethod ("toLongLong", "@brief Method qlonglong QLocale::toLongLong(const QStringRef &s, bool *ok)\n", true, &_init_f_toLongLong_c3252, &_call_f_toLongLong_c3252); methods += new qt_gsi::GenericMethod ("toLower", "@brief Method QString QLocale::toLower(const QString &str)\n", true, &_init_f_toLower_c2025, &_call_f_toLower_c2025); methods += new qt_gsi::GenericMethod ("toShort", "@brief Method short int QLocale::toShort(const QString &s, bool *ok)\n", true, &_init_f_toShort_c2967, &_call_f_toShort_c2967); - methods += new qt_gsi::GenericMethod ("toShort", "@brief Method short int QLocale::toShort(const QStringRef &s, bool *ok)\n", true, &_init_f_toShort_c3252, &_call_f_toShort_c3252); methods += new qt_gsi::GenericMethod ("toString_ll", "@brief Method QString QLocale::toString(qlonglong i)\n", true, &_init_f_toString_c1413, &_call_f_toString_c1413); methods += new qt_gsi::GenericMethod ("toString_ull", "@brief Method QString QLocale::toString(qulonglong i)\n", true, &_init_f_toString_c1530, &_call_f_toString_c1530); methods += new qt_gsi::GenericMethod ("toString_s", "@brief Method QString QLocale::toString(short int i)\n", true, &_init_f_toString_c1471, &_call_f_toString_c1471); @@ -2003,11 +1799,8 @@ static gsi::Methods methods_QLocale () { methods += new qt_gsi::GenericMethod ("toTime", "@brief Method QTime QLocale::toTime(const QString &string, QLocale::FormatType)\n", true, &_init_f_toTime_c4177, &_call_f_toTime_c4177); methods += new qt_gsi::GenericMethod ("toTime", "@brief Method QTime QLocale::toTime(const QString &string, const QString &format)\n", true, &_init_f_toTime_c3942, &_call_f_toTime_c3942); methods += new qt_gsi::GenericMethod ("toUInt", "@brief Method unsigned int QLocale::toUInt(const QString &s, bool *ok)\n", true, &_init_f_toUInt_c2967, &_call_f_toUInt_c2967); - methods += new qt_gsi::GenericMethod ("toUInt", "@brief Method unsigned int QLocale::toUInt(const QStringRef &s, bool *ok)\n", true, &_init_f_toUInt_c3252, &_call_f_toUInt_c3252); methods += new qt_gsi::GenericMethod ("toULongLong", "@brief Method qulonglong QLocale::toULongLong(const QString &s, bool *ok)\n", true, &_init_f_toULongLong_c2967, &_call_f_toULongLong_c2967); - methods += new qt_gsi::GenericMethod ("toULongLong", "@brief Method qulonglong QLocale::toULongLong(const QStringRef &s, bool *ok)\n", true, &_init_f_toULongLong_c3252, &_call_f_toULongLong_c3252); methods += new qt_gsi::GenericMethod ("toUShort", "@brief Method unsigned short int QLocale::toUShort(const QString &s, bool *ok)\n", true, &_init_f_toUShort_c2967, &_call_f_toUShort_c2967); - methods += new qt_gsi::GenericMethod ("toUShort", "@brief Method unsigned short int QLocale::toUShort(const QStringRef &s, bool *ok)\n", true, &_init_f_toUShort_c3252, &_call_f_toUShort_c3252); methods += new qt_gsi::GenericMethod ("toUpper", "@brief Method QString QLocale::toUpper(const QString &str)\n", true, &_init_f_toUpper_c2025, &_call_f_toUpper_c2025); methods += new qt_gsi::GenericMethod ("uiLanguages", "@brief Method QStringList QLocale::uiLanguages()\n", true, &_init_f_uiLanguages_c0, &_call_f_uiLanguages_c0); methods += new qt_gsi::GenericMethod ("weekdays", "@brief Method QList QLocale::weekdays()\n", true, &_init_f_weekdays_c0, &_call_f_weekdays_c0); diff --git a/src/gsiqt/qt5/QtCore/gsiDeclQMetaObject.cc b/src/gsiqt/qt5/QtCore/gsiDeclQMetaObject.cc index 274143965..f78985b67 100644 --- a/src/gsiqt/qt5/QtCore/gsiDeclQMetaObject.cc +++ b/src/gsiqt/qt5/QtCore/gsiDeclQMetaObject.cc @@ -56,44 +56,6 @@ static void _call_ctor_QMetaObject_0 (const qt_gsi::GenericStaticMethod * /*decl } -// QObject *QMetaObject::cast(QObject *obj) - - -static void _init_f_cast_c1302 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("obj"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_cast_c1302 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QObject *arg1 = gsi::arg_reader() (args, heap); - ret.write ((QObject *)((QMetaObject *)cls)->cast (arg1)); -} - - -// const QObject *QMetaObject::cast(const QObject *obj) - - -static void _init_f_cast_c1997 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("obj"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_cast_c1997 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QObject *arg1 = gsi::arg_reader() (args, heap); - ret.write ((const QObject *)((QMetaObject *)cls)->cast (arg1)); -} - - // QMetaClassInfo QMetaObject::classInfo(int index) @@ -726,8 +688,6 @@ namespace gsi static gsi::Methods methods_QMetaObject () { gsi::Methods methods; methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QMetaObject::QMetaObject()\nThis method creates an object of class QMetaObject.", &_init_ctor_QMetaObject_0, &_call_ctor_QMetaObject_0); - methods += new qt_gsi::GenericMethod ("cast", "@brief Method QObject *QMetaObject::cast(QObject *obj)\n", true, &_init_f_cast_c1302, &_call_f_cast_c1302); - methods += new qt_gsi::GenericMethod ("cast", "@brief Method const QObject *QMetaObject::cast(const QObject *obj)\n", true, &_init_f_cast_c1997, &_call_f_cast_c1997); methods += new qt_gsi::GenericMethod ("classInfo", "@brief Method QMetaClassInfo QMetaObject::classInfo(int index)\n", true, &_init_f_classInfo_c767, &_call_f_classInfo_c767); methods += new qt_gsi::GenericMethod ("classInfoCount", "@brief Method int QMetaObject::classInfoCount()\n", true, &_init_f_classInfoCount_c0, &_call_f_classInfoCount_c0); methods += new qt_gsi::GenericMethod ("classInfoOffset", "@brief Method int QMetaObject::classInfoOffset()\n", true, &_init_f_classInfoOffset_c0, &_call_f_classInfoOffset_c0); diff --git a/src/gsiqt/qt5/QtCore/gsiDeclQRegularExpression.cc b/src/gsiqt/qt5/QtCore/gsiDeclQRegularExpression.cc index a80440411..f25476c74 100644 --- a/src/gsiqt/qt5/QtCore/gsiDeclQRegularExpression.cc +++ b/src/gsiqt/qt5/QtCore/gsiDeclQRegularExpression.cc @@ -152,34 +152,6 @@ static void _call_f_globalMatch_c10055 (const qt_gsi::GenericMethod * /*decl*/, } -// QRegularExpressionMatchIterator QRegularExpression::globalMatch(const QStringRef &subjectRef, int offset, QRegularExpression::MatchType matchType, QFlags matchOptions) - - -static void _init_f_globalMatch_c10340 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("subjectRef"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("offset", true, "0"); - decl->add_arg (argspec_1); - static gsi::ArgSpecBase argspec_2 ("matchType", true, "QRegularExpression::NormalMatch"); - decl->add_arg::target_type & > (argspec_2); - static gsi::ArgSpecBase argspec_3 ("matchOptions", true, "QRegularExpression::NoMatchOption"); - decl->add_arg > (argspec_3); - decl->set_return (); -} - -static void _call_f_globalMatch_c10340 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QStringRef &arg1 = gsi::arg_reader() (args, heap); - int arg2 = args ? gsi::arg_reader() (args, heap) : gsi::arg_maker() (0, heap); - const qt_gsi::Converter::target_type & arg3 = args ? gsi::arg_reader::target_type & >() (args, heap) : gsi::arg_maker::target_type & >() (qt_gsi::CppToQtReadAdaptor(heap, QRegularExpression::NormalMatch), heap); - QFlags arg4 = args ? gsi::arg_reader >() (args, heap) : gsi::arg_maker >() (QRegularExpression::NoMatchOption, heap); - ret.write ((QRegularExpressionMatchIterator)((QRegularExpression *)cls)->globalMatch (arg1, arg2, qt_gsi::QtToCppAdaptor(arg3).cref(), arg4)); -} - - // bool QRegularExpression::isValid() @@ -223,34 +195,6 @@ static void _call_f_match_c10055 (const qt_gsi::GenericMethod * /*decl*/, void * } -// QRegularExpressionMatch QRegularExpression::match(const QStringRef &subjectRef, int offset, QRegularExpression::MatchType matchType, QFlags matchOptions) - - -static void _init_f_match_c10340 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("subjectRef"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("offset", true, "0"); - decl->add_arg (argspec_1); - static gsi::ArgSpecBase argspec_2 ("matchType", true, "QRegularExpression::NormalMatch"); - decl->add_arg::target_type & > (argspec_2); - static gsi::ArgSpecBase argspec_3 ("matchOptions", true, "QRegularExpression::NoMatchOption"); - decl->add_arg > (argspec_3); - decl->set_return (); -} - -static void _call_f_match_c10340 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QStringRef &arg1 = gsi::arg_reader() (args, heap); - int arg2 = args ? gsi::arg_reader() (args, heap) : gsi::arg_maker() (0, heap); - const qt_gsi::Converter::target_type & arg3 = args ? gsi::arg_reader::target_type & >() (args, heap) : gsi::arg_maker::target_type & >() (qt_gsi::CppToQtReadAdaptor(heap, QRegularExpression::NormalMatch), heap); - QFlags arg4 = args ? gsi::arg_reader >() (args, heap) : gsi::arg_maker >() (QRegularExpression::NoMatchOption, heap); - ret.write ((QRegularExpressionMatch)((QRegularExpression *)cls)->match (arg1, arg2, qt_gsi::QtToCppAdaptor(arg3).cref(), arg4)); -} - - // QStringList QRegularExpression::namedCaptureGroups() @@ -475,10 +419,8 @@ static gsi::Methods methods_QRegularExpression () { methods += new qt_gsi::GenericMethod ("captureCount", "@brief Method int QRegularExpression::captureCount()\n", true, &_init_f_captureCount_c0, &_call_f_captureCount_c0); methods += new qt_gsi::GenericMethod ("errorString", "@brief Method QString QRegularExpression::errorString()\n", true, &_init_f_errorString_c0, &_call_f_errorString_c0); methods += new qt_gsi::GenericMethod ("globalMatch", "@brief Method QRegularExpressionMatchIterator QRegularExpression::globalMatch(const QString &subject, int offset, QRegularExpression::MatchType matchType, QFlags matchOptions)\n", true, &_init_f_globalMatch_c10055, &_call_f_globalMatch_c10055); - methods += new qt_gsi::GenericMethod ("globalMatch", "@brief Method QRegularExpressionMatchIterator QRegularExpression::globalMatch(const QStringRef &subjectRef, int offset, QRegularExpression::MatchType matchType, QFlags matchOptions)\n", true, &_init_f_globalMatch_c10340, &_call_f_globalMatch_c10340); methods += new qt_gsi::GenericMethod ("isValid?", "@brief Method bool QRegularExpression::isValid()\n", true, &_init_f_isValid_c0, &_call_f_isValid_c0); methods += new qt_gsi::GenericMethod ("match", "@brief Method QRegularExpressionMatch QRegularExpression::match(const QString &subject, int offset, QRegularExpression::MatchType matchType, QFlags matchOptions)\n", true, &_init_f_match_c10055, &_call_f_match_c10055); - methods += new qt_gsi::GenericMethod ("match", "@brief Method QRegularExpressionMatch QRegularExpression::match(const QStringRef &subjectRef, int offset, QRegularExpression::MatchType matchType, QFlags matchOptions)\n", true, &_init_f_match_c10340, &_call_f_match_c10340); methods += new qt_gsi::GenericMethod ("namedCaptureGroups", "@brief Method QStringList QRegularExpression::namedCaptureGroups()\n", true, &_init_f_namedCaptureGroups_c0, &_call_f_namedCaptureGroups_c0); methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QRegularExpression::operator!=(const QRegularExpression &re)\n", true, &_init_f_operator_excl__eq__c3188, &_call_f_operator_excl__eq__c3188); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QRegularExpression &QRegularExpression::operator=(const QRegularExpression &re)\n", false, &_init_f_operator_eq__3188, &_call_f_operator_eq__3188); diff --git a/src/gsiqt/qt5/QtCore/gsiDeclQSignalBlocker.cc b/src/gsiqt/qt5/QtCore/gsiDeclQSignalBlocker.cc index f0c2bf210..6712a051d 100644 --- a/src/gsiqt/qt5/QtCore/gsiDeclQSignalBlocker.cc +++ b/src/gsiqt/qt5/QtCore/gsiDeclQSignalBlocker.cc @@ -56,25 +56,6 @@ static void _call_ctor_QSignalBlocker_1302 (const qt_gsi::GenericStaticMethod * } -// Constructor QSignalBlocker::QSignalBlocker(QObject &o) - - -static void _init_ctor_QSignalBlocker_1298 (qt_gsi::GenericStaticMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("o"); - decl->add_arg (argspec_0); - decl->set_return_new (); -} - -static void _call_ctor_QSignalBlocker_1298 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QObject &arg1 = gsi::arg_reader() (args, heap); - ret.write (new QSignalBlocker (arg1)); -} - - // void QSignalBlocker::reblock() @@ -114,7 +95,6 @@ namespace gsi static gsi::Methods methods_QSignalBlocker () { gsi::Methods methods; methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QSignalBlocker::QSignalBlocker(QObject *o)\nThis method creates an object of class QSignalBlocker.", &_init_ctor_QSignalBlocker_1302, &_call_ctor_QSignalBlocker_1302); - methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QSignalBlocker::QSignalBlocker(QObject &o)\nThis method creates an object of class QSignalBlocker.", &_init_ctor_QSignalBlocker_1298, &_call_ctor_QSignalBlocker_1298); methods += new qt_gsi::GenericMethod ("reblock", "@brief Method void QSignalBlocker::reblock()\n", false, &_init_f_reblock_0, &_call_f_reblock_0); methods += new qt_gsi::GenericMethod ("unblock", "@brief Method void QSignalBlocker::unblock()\n", false, &_init_f_unblock_0, &_call_f_unblock_0); return methods; diff --git a/src/gsiqt/qt5/QtCore/gsiDeclQXmlStreamReader.cc b/src/gsiqt/qt5/QtCore/gsiDeclQXmlStreamReader.cc index b089b5689..ff60ae3f0 100644 --- a/src/gsiqt/qt5/QtCore/gsiDeclQXmlStreamReader.cc +++ b/src/gsiqt/qt5/QtCore/gsiDeclQXmlStreamReader.cc @@ -114,25 +114,6 @@ static void _call_ctor_QXmlStreamReader_2025 (const qt_gsi::GenericStaticMethod } -// Constructor QXmlStreamReader::QXmlStreamReader(const char *data) - - -static void _init_ctor_QXmlStreamReader_1731 (qt_gsi::GenericStaticMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("data"); - decl->add_arg (argspec_0); - decl->set_return_new (); -} - -static void _call_ctor_QXmlStreamReader_1731 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const char *arg1 = gsi::arg_reader() (args, heap); - ret.write (new QXmlStreamReader (arg1)); -} - - // void QXmlStreamReader::addData(const QByteArray &data) @@ -173,26 +154,6 @@ static void _call_f_addData_2025 (const qt_gsi::GenericMethod * /*decl*/, void * } -// void QXmlStreamReader::addData(const char *data) - - -static void _init_f_addData_1731 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("data"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_addData_1731 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const char *arg1 = gsi::arg_reader() (args, heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlStreamReader *)cls)->addData (arg1); -} - - // void QXmlStreamReader::addExtraNamespaceDeclaration(const QXmlStreamNamespaceDeclaration &extraNamespaceDeclaraction) @@ -1004,10 +965,8 @@ static gsi::Methods methods_QXmlStreamReader () { methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QXmlStreamReader::QXmlStreamReader(QIODevice *device)\nThis method creates an object of class QXmlStreamReader.", &_init_ctor_QXmlStreamReader_1447, &_call_ctor_QXmlStreamReader_1447); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QXmlStreamReader::QXmlStreamReader(const QByteArray &data)\nThis method creates an object of class QXmlStreamReader.", &_init_ctor_QXmlStreamReader_2309, &_call_ctor_QXmlStreamReader_2309); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QXmlStreamReader::QXmlStreamReader(const QString &data)\nThis method creates an object of class QXmlStreamReader.", &_init_ctor_QXmlStreamReader_2025, &_call_ctor_QXmlStreamReader_2025); - methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QXmlStreamReader::QXmlStreamReader(const char *data)\nThis method creates an object of class QXmlStreamReader.", &_init_ctor_QXmlStreamReader_1731, &_call_ctor_QXmlStreamReader_1731); methods += new qt_gsi::GenericMethod ("addData", "@brief Method void QXmlStreamReader::addData(const QByteArray &data)\n", false, &_init_f_addData_2309, &_call_f_addData_2309); methods += new qt_gsi::GenericMethod ("addData", "@brief Method void QXmlStreamReader::addData(const QString &data)\n", false, &_init_f_addData_2025, &_call_f_addData_2025); - methods += new qt_gsi::GenericMethod ("addData", "@brief Method void QXmlStreamReader::addData(const char *data)\n", false, &_init_f_addData_1731, &_call_f_addData_1731); methods += new qt_gsi::GenericMethod ("addExtraNamespaceDeclaration", "@brief Method void QXmlStreamReader::addExtraNamespaceDeclaration(const QXmlStreamNamespaceDeclaration &extraNamespaceDeclaraction)\n", false, &_init_f_addExtraNamespaceDeclaration_4354, &_call_f_addExtraNamespaceDeclaration_4354); methods += new qt_gsi::GenericMethod ("addExtraNamespaceDeclarations", "@brief Method void QXmlStreamReader::addExtraNamespaceDeclarations(const QVector &extraNamespaceDeclaractions)\n", false, &_init_f_addExtraNamespaceDeclarations_5184, &_call_f_addExtraNamespaceDeclarations_5184); methods += new qt_gsi::GenericMethod ("atEnd", "@brief Method bool QXmlStreamReader::atEnd()\n", true, &_init_f_atEnd_c0, &_call_f_atEnd_c0); diff --git a/src/gsiqt/qt5/QtGui/gsiDeclQRawFont.cc b/src/gsiqt/qt5/QtGui/gsiDeclQRawFont.cc index 92d05463c..7dc891a30 100644 --- a/src/gsiqt/qt5/QtGui/gsiDeclQRawFont.cc +++ b/src/gsiqt/qt5/QtGui/gsiDeclQRawFont.cc @@ -852,7 +852,7 @@ static gsi::Methods methods_QRawFont () { methods += new qt_gsi::GenericMethod ("style", "@brief Method QFont::Style QRawFont::style()\n", true, &_init_f_style_c0, &_call_f_style_c0); methods += new qt_gsi::GenericMethod ("styleName", "@brief Method QString QRawFont::styleName()\n", true, &_init_f_styleName_c0, &_call_f_styleName_c0); methods += new qt_gsi::GenericMethod ("supportedWritingSystems", "@brief Method QList QRawFont::supportedWritingSystems()\n", true, &_init_f_supportedWritingSystems_c0, &_call_f_supportedWritingSystems_c0); - methods += new qt_gsi::GenericMethod ("supportsCharacter", "@brief Method bool QRawFont::supportsCharacter(unsigned int ucs4)\n", true, &_init_f_supportsCharacter_c1772, &_call_f_supportsCharacter_c1772); + methods += new qt_gsi::GenericMethod ("supportsCharacter_ucs4", "@brief Method bool QRawFont::supportsCharacter(unsigned int ucs4)\n", true, &_init_f_supportsCharacter_c1772, &_call_f_supportsCharacter_c1772); methods += new qt_gsi::GenericMethod ("supportsCharacter", "@brief Method bool QRawFont::supportsCharacter(QChar character)\n", true, &_init_f_supportsCharacter_c899, &_call_f_supportsCharacter_c899); methods += new qt_gsi::GenericMethod ("swap", "@brief Method void QRawFont::swap(QRawFont &other)\n", false, &_init_f_swap_1404, &_call_f_swap_1404); methods += new qt_gsi::GenericMethod ("underlinePosition", "@brief Method double QRawFont::underlinePosition()\n", true, &_init_f_underlinePosition_c0, &_call_f_underlinePosition_c0); diff --git a/src/gsiqt/qt5/QtGui/gsiDeclQTextLine.cc b/src/gsiqt/qt5/QtGui/gsiDeclQTextLine.cc index 186eacc7e..2a3f13d06 100644 --- a/src/gsiqt/qt5/QtGui/gsiDeclQTextLine.cc +++ b/src/gsiqt/qt5/QtGui/gsiDeclQTextLine.cc @@ -70,28 +70,6 @@ static void _call_f_ascent_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls } -// double QTextLine::cursorToX(int *cursorPos, QTextLine::Edge edge) - - -static void _init_f_cursorToX_c2664 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("cursorPos"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("edge", true, "QTextLine::Leading"); - decl->add_arg::target_type & > (argspec_1); - decl->set_return (); -} - -static void _call_f_cursorToX_c2664 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - int *arg1 = gsi::arg_reader() (args, heap); - const qt_gsi::Converter::target_type & arg2 = args ? gsi::arg_reader::target_type & >() (args, heap) : gsi::arg_maker::target_type & >() (qt_gsi::CppToQtReadAdaptor(heap, QTextLine::Leading), heap); - ret.write ((double)((QTextLine *)cls)->cursorToX (arg1, qt_gsi::QtToCppAdaptor(arg2).cref())); -} - - // double QTextLine::cursorToX(int cursorPos, QTextLine::Edge edge) @@ -535,7 +513,6 @@ static gsi::Methods methods_QTextLine () { gsi::Methods methods; methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QTextLine::QTextLine()\nThis method creates an object of class QTextLine.", &_init_ctor_QTextLine_0, &_call_ctor_QTextLine_0); methods += new qt_gsi::GenericMethod ("ascent", "@brief Method double QTextLine::ascent()\n", true, &_init_f_ascent_c0, &_call_f_ascent_c0); - methods += new qt_gsi::GenericMethod ("cursorToX", "@brief Method double QTextLine::cursorToX(int *cursorPos, QTextLine::Edge edge)\n", true, &_init_f_cursorToX_c2664, &_call_f_cursorToX_c2664); methods += new qt_gsi::GenericMethod ("cursorToX", "@brief Method double QTextLine::cursorToX(int cursorPos, QTextLine::Edge edge)\n", true, &_init_f_cursorToX_c2478, &_call_f_cursorToX_c2478); methods += new qt_gsi::GenericMethod ("descent", "@brief Method double QTextLine::descent()\n", true, &_init_f_descent_c0, &_call_f_descent_c0); methods += new qt_gsi::GenericMethod ("draw", "@brief Method void QTextLine::draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection)\n", true, &_init_f_draw_c6879, &_call_f_draw_c6879); diff --git a/src/gsiqt/qt5/QtXml/gsiDeclQXmlReader.cc b/src/gsiqt/qt5/QtXml/gsiDeclQXmlReader.cc index f30fd62a7..4d777082e 100644 --- a/src/gsiqt/qt5/QtXml/gsiDeclQXmlReader.cc +++ b/src/gsiqt/qt5/QtXml/gsiDeclQXmlReader.cc @@ -193,25 +193,6 @@ static void _call_f_lexicalHandler_c0 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QXmlReader::parse(const QXmlInputSource &input) - - -static void _init_f_parse_2852 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("input"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_parse_2852 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlInputSource &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QXmlReader *)cls)->parse (arg1)); -} - - // bool QXmlReader::parse(const QXmlInputSource *input) @@ -419,6 +400,7 @@ static void _call_f_setProperty_2973 (const qt_gsi::GenericMethod * /*decl*/, vo } + namespace gsi { @@ -433,7 +415,6 @@ static gsi::Methods methods_QXmlReader () { methods += new qt_gsi::GenericMethod ("hasFeature", "@brief Method bool QXmlReader::hasFeature(const QString &name)\n", true, &_init_f_hasFeature_c2025, &_call_f_hasFeature_c2025); methods += new qt_gsi::GenericMethod ("hasProperty", "@brief Method bool QXmlReader::hasProperty(const QString &name)\n", true, &_init_f_hasProperty_c2025, &_call_f_hasProperty_c2025); methods += new qt_gsi::GenericMethod (":lexicalHandler", "@brief Method QXmlLexicalHandler *QXmlReader::lexicalHandler()\n", true, &_init_f_lexicalHandler_c0, &_call_f_lexicalHandler_c0); - methods += new qt_gsi::GenericMethod ("parse", "@brief Method bool QXmlReader::parse(const QXmlInputSource &input)\n", false, &_init_f_parse_2852, &_call_f_parse_2852); methods += new qt_gsi::GenericMethod ("parse", "@brief Method bool QXmlReader::parse(const QXmlInputSource *input)\n", false, &_init_f_parse_2856, &_call_f_parse_2856); methods += new qt_gsi::GenericMethod ("property", "@brief Method void *QXmlReader::property(const QString &name, bool *ok)\n", true, &_init_f_property_c2967, &_call_f_property_c2967); methods += new qt_gsi::GenericMethod ("setContentHandler|contentHandler=", "@brief Method void QXmlReader::setContentHandler(QXmlContentHandler *handler)\n", false, &_init_f_setContentHandler_2441, &_call_f_setContentHandler_2441); @@ -447,893 +428,12 @@ static gsi::Methods methods_QXmlReader () { return methods; } -gsi::Class decl_QXmlReader ("QtXml", "QXmlReader_Native", +gsi::Class decl_QXmlReader ("QtXml", "QXmlReader", methods_QXmlReader (), - "@hide\n@alias QXmlReader"); + "@qt\n@brief Binding of QXmlReader"); + GSI_QTXML_PUBLIC gsi::Class &qtdecl_QXmlReader () { return decl_QXmlReader; } } - -class QXmlReader_Adaptor : public QXmlReader, public qt_gsi::QtObjectBase -{ -public: - - virtual ~QXmlReader_Adaptor(); - - // [adaptor ctor] QXmlReader::QXmlReader() - QXmlReader_Adaptor() : QXmlReader() - { - qt_gsi::QtObjectBase::init (this); - } - - // [adaptor impl] QXmlDTDHandler *QXmlReader::DTDHandler() - QXmlDTDHandler * cbs_DTDHandler_c0_0() const - { - throw qt_gsi::AbstractMethodCalledException("DTDHandler"); - } - - virtual QXmlDTDHandler * DTDHandler() const - { - if (cb_DTDHandler_c0_0.can_issue()) { - return cb_DTDHandler_c0_0.issue(&QXmlReader_Adaptor::cbs_DTDHandler_c0_0); - } else { - throw qt_gsi::AbstractMethodCalledException("DTDHandler"); - } - } - - // [adaptor impl] QXmlContentHandler *QXmlReader::contentHandler() - QXmlContentHandler * cbs_contentHandler_c0_0() const - { - throw qt_gsi::AbstractMethodCalledException("contentHandler"); - } - - virtual QXmlContentHandler * contentHandler() const - { - if (cb_contentHandler_c0_0.can_issue()) { - return cb_contentHandler_c0_0.issue(&QXmlReader_Adaptor::cbs_contentHandler_c0_0); - } else { - throw qt_gsi::AbstractMethodCalledException("contentHandler"); - } - } - - // [adaptor impl] QXmlDeclHandler *QXmlReader::declHandler() - QXmlDeclHandler * cbs_declHandler_c0_0() const - { - throw qt_gsi::AbstractMethodCalledException("declHandler"); - } - - virtual QXmlDeclHandler * declHandler() const - { - if (cb_declHandler_c0_0.can_issue()) { - return cb_declHandler_c0_0.issue(&QXmlReader_Adaptor::cbs_declHandler_c0_0); - } else { - throw qt_gsi::AbstractMethodCalledException("declHandler"); - } - } - - // [adaptor impl] QXmlEntityResolver *QXmlReader::entityResolver() - QXmlEntityResolver * cbs_entityResolver_c0_0() const - { - throw qt_gsi::AbstractMethodCalledException("entityResolver"); - } - - virtual QXmlEntityResolver * entityResolver() const - { - if (cb_entityResolver_c0_0.can_issue()) { - return cb_entityResolver_c0_0.issue(&QXmlReader_Adaptor::cbs_entityResolver_c0_0); - } else { - throw qt_gsi::AbstractMethodCalledException("entityResolver"); - } - } - - // [adaptor impl] QXmlErrorHandler *QXmlReader::errorHandler() - QXmlErrorHandler * cbs_errorHandler_c0_0() const - { - throw qt_gsi::AbstractMethodCalledException("errorHandler"); - } - - virtual QXmlErrorHandler * errorHandler() const - { - if (cb_errorHandler_c0_0.can_issue()) { - return cb_errorHandler_c0_0.issue(&QXmlReader_Adaptor::cbs_errorHandler_c0_0); - } else { - throw qt_gsi::AbstractMethodCalledException("errorHandler"); - } - } - - // [adaptor impl] bool QXmlReader::feature(const QString &name, bool *ok) - bool cbs_feature_c2967_1(const QString &name, bool *ok) const - { - __SUPPRESS_UNUSED_WARNING (name); - __SUPPRESS_UNUSED_WARNING (ok); - throw qt_gsi::AbstractMethodCalledException("feature"); - } - - virtual bool feature(const QString &name, bool *ok) const - { - if (cb_feature_c2967_1.can_issue()) { - return cb_feature_c2967_1.issue(&QXmlReader_Adaptor::cbs_feature_c2967_1, name, ok); - } else { - throw qt_gsi::AbstractMethodCalledException("feature"); - } - } - - // [adaptor impl] bool QXmlReader::hasFeature(const QString &name) - bool cbs_hasFeature_c2025_0(const QString &name) const - { - __SUPPRESS_UNUSED_WARNING (name); - throw qt_gsi::AbstractMethodCalledException("hasFeature"); - } - - virtual bool hasFeature(const QString &name) const - { - if (cb_hasFeature_c2025_0.can_issue()) { - return cb_hasFeature_c2025_0.issue(&QXmlReader_Adaptor::cbs_hasFeature_c2025_0, name); - } else { - throw qt_gsi::AbstractMethodCalledException("hasFeature"); - } - } - - // [adaptor impl] bool QXmlReader::hasProperty(const QString &name) - bool cbs_hasProperty_c2025_0(const QString &name) const - { - __SUPPRESS_UNUSED_WARNING (name); - throw qt_gsi::AbstractMethodCalledException("hasProperty"); - } - - virtual bool hasProperty(const QString &name) const - { - if (cb_hasProperty_c2025_0.can_issue()) { - return cb_hasProperty_c2025_0.issue(&QXmlReader_Adaptor::cbs_hasProperty_c2025_0, name); - } else { - throw qt_gsi::AbstractMethodCalledException("hasProperty"); - } - } - - // [adaptor impl] QXmlLexicalHandler *QXmlReader::lexicalHandler() - QXmlLexicalHandler * cbs_lexicalHandler_c0_0() const - { - throw qt_gsi::AbstractMethodCalledException("lexicalHandler"); - } - - virtual QXmlLexicalHandler * lexicalHandler() const - { - if (cb_lexicalHandler_c0_0.can_issue()) { - return cb_lexicalHandler_c0_0.issue(&QXmlReader_Adaptor::cbs_lexicalHandler_c0_0); - } else { - throw qt_gsi::AbstractMethodCalledException("lexicalHandler"); - } - } - - // [adaptor impl] bool QXmlReader::parse(const QXmlInputSource &input) - bool cbs_parse_2852_0(const QXmlInputSource &input) - { - __SUPPRESS_UNUSED_WARNING (input); - throw qt_gsi::AbstractMethodCalledException("parse"); - } - - virtual bool parse(const QXmlInputSource &input) - { - if (cb_parse_2852_0.can_issue()) { - return cb_parse_2852_0.issue(&QXmlReader_Adaptor::cbs_parse_2852_0, input); - } else { - throw qt_gsi::AbstractMethodCalledException("parse"); - } - } - - // [adaptor impl] bool QXmlReader::parse(const QXmlInputSource *input) - bool cbs_parse_2856_0(const QXmlInputSource *input) - { - __SUPPRESS_UNUSED_WARNING (input); - throw qt_gsi::AbstractMethodCalledException("parse"); - } - - virtual bool parse(const QXmlInputSource *input) - { - if (cb_parse_2856_0.can_issue()) { - return cb_parse_2856_0.issue(&QXmlReader_Adaptor::cbs_parse_2856_0, input); - } else { - throw qt_gsi::AbstractMethodCalledException("parse"); - } - } - - // [adaptor impl] void *QXmlReader::property(const QString &name, bool *ok) - void * cbs_property_c2967_1(const QString &name, bool *ok) const - { - __SUPPRESS_UNUSED_WARNING (name); - __SUPPRESS_UNUSED_WARNING (ok); - throw qt_gsi::AbstractMethodCalledException("property"); - } - - virtual void * property(const QString &name, bool *ok) const - { - if (cb_property_c2967_1.can_issue()) { - return cb_property_c2967_1.issue(&QXmlReader_Adaptor::cbs_property_c2967_1, name, ok); - } else { - throw qt_gsi::AbstractMethodCalledException("property"); - } - } - - // [adaptor impl] void QXmlReader::setContentHandler(QXmlContentHandler *handler) - void cbs_setContentHandler_2441_0(QXmlContentHandler *handler) - { - __SUPPRESS_UNUSED_WARNING (handler); - throw qt_gsi::AbstractMethodCalledException("setContentHandler"); - } - - virtual void setContentHandler(QXmlContentHandler *handler) - { - if (cb_setContentHandler_2441_0.can_issue()) { - cb_setContentHandler_2441_0.issue(&QXmlReader_Adaptor::cbs_setContentHandler_2441_0, handler); - } else { - throw qt_gsi::AbstractMethodCalledException("setContentHandler"); - } - } - - // [adaptor impl] void QXmlReader::setDTDHandler(QXmlDTDHandler *handler) - void cbs_setDTDHandler_1930_0(QXmlDTDHandler *handler) - { - __SUPPRESS_UNUSED_WARNING (handler); - throw qt_gsi::AbstractMethodCalledException("setDTDHandler"); - } - - virtual void setDTDHandler(QXmlDTDHandler *handler) - { - if (cb_setDTDHandler_1930_0.can_issue()) { - cb_setDTDHandler_1930_0.issue(&QXmlReader_Adaptor::cbs_setDTDHandler_1930_0, handler); - } else { - throw qt_gsi::AbstractMethodCalledException("setDTDHandler"); - } - } - - // [adaptor impl] void QXmlReader::setDeclHandler(QXmlDeclHandler *handler) - void cbs_setDeclHandler_2086_0(QXmlDeclHandler *handler) - { - __SUPPRESS_UNUSED_WARNING (handler); - throw qt_gsi::AbstractMethodCalledException("setDeclHandler"); - } - - virtual void setDeclHandler(QXmlDeclHandler *handler) - { - if (cb_setDeclHandler_2086_0.can_issue()) { - cb_setDeclHandler_2086_0.issue(&QXmlReader_Adaptor::cbs_setDeclHandler_2086_0, handler); - } else { - throw qt_gsi::AbstractMethodCalledException("setDeclHandler"); - } - } - - // [adaptor impl] void QXmlReader::setEntityResolver(QXmlEntityResolver *handler) - void cbs_setEntityResolver_2495_0(QXmlEntityResolver *handler) - { - __SUPPRESS_UNUSED_WARNING (handler); - throw qt_gsi::AbstractMethodCalledException("setEntityResolver"); - } - - virtual void setEntityResolver(QXmlEntityResolver *handler) - { - if (cb_setEntityResolver_2495_0.can_issue()) { - cb_setEntityResolver_2495_0.issue(&QXmlReader_Adaptor::cbs_setEntityResolver_2495_0, handler); - } else { - throw qt_gsi::AbstractMethodCalledException("setEntityResolver"); - } - } - - // [adaptor impl] void QXmlReader::setErrorHandler(QXmlErrorHandler *handler) - void cbs_setErrorHandler_2232_0(QXmlErrorHandler *handler) - { - __SUPPRESS_UNUSED_WARNING (handler); - throw qt_gsi::AbstractMethodCalledException("setErrorHandler"); - } - - virtual void setErrorHandler(QXmlErrorHandler *handler) - { - if (cb_setErrorHandler_2232_0.can_issue()) { - cb_setErrorHandler_2232_0.issue(&QXmlReader_Adaptor::cbs_setErrorHandler_2232_0, handler); - } else { - throw qt_gsi::AbstractMethodCalledException("setErrorHandler"); - } - } - - // [adaptor impl] void QXmlReader::setFeature(const QString &name, bool value) - void cbs_setFeature_2781_0(const QString &name, bool value) - { - __SUPPRESS_UNUSED_WARNING (name); - __SUPPRESS_UNUSED_WARNING (value); - throw qt_gsi::AbstractMethodCalledException("setFeature"); - } - - virtual void setFeature(const QString &name, bool value) - { - if (cb_setFeature_2781_0.can_issue()) { - cb_setFeature_2781_0.issue(&QXmlReader_Adaptor::cbs_setFeature_2781_0, name, value); - } else { - throw qt_gsi::AbstractMethodCalledException("setFeature"); - } - } - - // [adaptor impl] void QXmlReader::setLexicalHandler(QXmlLexicalHandler *handler) - void cbs_setLexicalHandler_2416_0(QXmlLexicalHandler *handler) - { - __SUPPRESS_UNUSED_WARNING (handler); - throw qt_gsi::AbstractMethodCalledException("setLexicalHandler"); - } - - virtual void setLexicalHandler(QXmlLexicalHandler *handler) - { - if (cb_setLexicalHandler_2416_0.can_issue()) { - cb_setLexicalHandler_2416_0.issue(&QXmlReader_Adaptor::cbs_setLexicalHandler_2416_0, handler); - } else { - throw qt_gsi::AbstractMethodCalledException("setLexicalHandler"); - } - } - - // [adaptor impl] void QXmlReader::setProperty(const QString &name, void *value) - void cbs_setProperty_2973_0(const QString &name, void *value) - { - __SUPPRESS_UNUSED_WARNING (name); - __SUPPRESS_UNUSED_WARNING (value); - throw qt_gsi::AbstractMethodCalledException("setProperty"); - } - - virtual void setProperty(const QString &name, void *value) - { - if (cb_setProperty_2973_0.can_issue()) { - cb_setProperty_2973_0.issue(&QXmlReader_Adaptor::cbs_setProperty_2973_0, name, value); - } else { - throw qt_gsi::AbstractMethodCalledException("setProperty"); - } - } - - gsi::Callback cb_DTDHandler_c0_0; - gsi::Callback cb_contentHandler_c0_0; - gsi::Callback cb_declHandler_c0_0; - gsi::Callback cb_entityResolver_c0_0; - gsi::Callback cb_errorHandler_c0_0; - gsi::Callback cb_feature_c2967_1; - gsi::Callback cb_hasFeature_c2025_0; - gsi::Callback cb_hasProperty_c2025_0; - gsi::Callback cb_lexicalHandler_c0_0; - gsi::Callback cb_parse_2852_0; - gsi::Callback cb_parse_2856_0; - gsi::Callback cb_property_c2967_1; - gsi::Callback cb_setContentHandler_2441_0; - gsi::Callback cb_setDTDHandler_1930_0; - gsi::Callback cb_setDeclHandler_2086_0; - gsi::Callback cb_setEntityResolver_2495_0; - gsi::Callback cb_setErrorHandler_2232_0; - gsi::Callback cb_setFeature_2781_0; - gsi::Callback cb_setLexicalHandler_2416_0; - gsi::Callback cb_setProperty_2973_0; -}; - -QXmlReader_Adaptor::~QXmlReader_Adaptor() { } - -// Constructor QXmlReader::QXmlReader() (adaptor class) - -static void _init_ctor_QXmlReader_Adaptor_0 (qt_gsi::GenericStaticMethod *decl) -{ - decl->set_return_new (); -} - -static void _call_ctor_QXmlReader_Adaptor_0 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write (new QXmlReader_Adaptor ()); -} - - -// QXmlDTDHandler *QXmlReader::DTDHandler() - -static void _init_cbs_DTDHandler_c0_0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return (); -} - -static void _call_cbs_DTDHandler_c0_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write ((QXmlDTDHandler *)((QXmlReader_Adaptor *)cls)->cbs_DTDHandler_c0_0 ()); -} - -static void _set_callback_cbs_DTDHandler_c0_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_DTDHandler_c0_0 = cb; -} - - -// QXmlContentHandler *QXmlReader::contentHandler() - -static void _init_cbs_contentHandler_c0_0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return (); -} - -static void _call_cbs_contentHandler_c0_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write ((QXmlContentHandler *)((QXmlReader_Adaptor *)cls)->cbs_contentHandler_c0_0 ()); -} - -static void _set_callback_cbs_contentHandler_c0_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_contentHandler_c0_0 = cb; -} - - -// QXmlDeclHandler *QXmlReader::declHandler() - -static void _init_cbs_declHandler_c0_0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return (); -} - -static void _call_cbs_declHandler_c0_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write ((QXmlDeclHandler *)((QXmlReader_Adaptor *)cls)->cbs_declHandler_c0_0 ()); -} - -static void _set_callback_cbs_declHandler_c0_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_declHandler_c0_0 = cb; -} - - -// QXmlEntityResolver *QXmlReader::entityResolver() - -static void _init_cbs_entityResolver_c0_0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return (); -} - -static void _call_cbs_entityResolver_c0_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write ((QXmlEntityResolver *)((QXmlReader_Adaptor *)cls)->cbs_entityResolver_c0_0 ()); -} - -static void _set_callback_cbs_entityResolver_c0_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_entityResolver_c0_0 = cb; -} - - -// QXmlErrorHandler *QXmlReader::errorHandler() - -static void _init_cbs_errorHandler_c0_0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return (); -} - -static void _call_cbs_errorHandler_c0_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write ((QXmlErrorHandler *)((QXmlReader_Adaptor *)cls)->cbs_errorHandler_c0_0 ()); -} - -static void _set_callback_cbs_errorHandler_c0_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_errorHandler_c0_0 = cb; -} - - -// bool QXmlReader::feature(const QString &name, bool *ok) - -static void _init_cbs_feature_c2967_1 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("name"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("ok"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_cbs_feature_c2967_1 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QString &arg1 = args.read (heap); - bool *arg2 = args.read (heap); - ret.write ((bool)((QXmlReader_Adaptor *)cls)->cbs_feature_c2967_1 (arg1, arg2)); -} - -static void _set_callback_cbs_feature_c2967_1 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_feature_c2967_1 = cb; -} - - -// bool QXmlReader::hasFeature(const QString &name) - -static void _init_cbs_hasFeature_c2025_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("name"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_hasFeature_c2025_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QString &arg1 = args.read (heap); - ret.write ((bool)((QXmlReader_Adaptor *)cls)->cbs_hasFeature_c2025_0 (arg1)); -} - -static void _set_callback_cbs_hasFeature_c2025_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_hasFeature_c2025_0 = cb; -} - - -// bool QXmlReader::hasProperty(const QString &name) - -static void _init_cbs_hasProperty_c2025_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("name"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_hasProperty_c2025_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QString &arg1 = args.read (heap); - ret.write ((bool)((QXmlReader_Adaptor *)cls)->cbs_hasProperty_c2025_0 (arg1)); -} - -static void _set_callback_cbs_hasProperty_c2025_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_hasProperty_c2025_0 = cb; -} - - -// QXmlLexicalHandler *QXmlReader::lexicalHandler() - -static void _init_cbs_lexicalHandler_c0_0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return (); -} - -static void _call_cbs_lexicalHandler_c0_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write ((QXmlLexicalHandler *)((QXmlReader_Adaptor *)cls)->cbs_lexicalHandler_c0_0 ()); -} - -static void _set_callback_cbs_lexicalHandler_c0_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_lexicalHandler_c0_0 = cb; -} - - -// bool QXmlReader::parse(const QXmlInputSource &input) - -static void _init_cbs_parse_2852_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("input"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_parse_2852_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlInputSource &arg1 = args.read (heap); - ret.write ((bool)((QXmlReader_Adaptor *)cls)->cbs_parse_2852_0 (arg1)); -} - -static void _set_callback_cbs_parse_2852_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_parse_2852_0 = cb; -} - - -// bool QXmlReader::parse(const QXmlInputSource *input) - -static void _init_cbs_parse_2856_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("input"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_parse_2856_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlInputSource *arg1 = args.read (heap); - ret.write ((bool)((QXmlReader_Adaptor *)cls)->cbs_parse_2856_0 (arg1)); -} - -static void _set_callback_cbs_parse_2856_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_parse_2856_0 = cb; -} - - -// void *QXmlReader::property(const QString &name, bool *ok) - -static void _init_cbs_property_c2967_1 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("name"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("ok"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_cbs_property_c2967_1 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QString &arg1 = args.read (heap); - bool *arg2 = args.read (heap); - ret.write ((void *)((QXmlReader_Adaptor *)cls)->cbs_property_c2967_1 (arg1, arg2)); -} - -static void _set_callback_cbs_property_c2967_1 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_property_c2967_1 = cb; -} - - -// void QXmlReader::setContentHandler(QXmlContentHandler *handler) - -static void _init_cbs_setContentHandler_2441_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("handler"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_setContentHandler_2441_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QXmlContentHandler *arg1 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setContentHandler_2441_0 (arg1); -} - -static void _set_callback_cbs_setContentHandler_2441_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setContentHandler_2441_0 = cb; -} - - -// void QXmlReader::setDTDHandler(QXmlDTDHandler *handler) - -static void _init_cbs_setDTDHandler_1930_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("handler"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_setDTDHandler_1930_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QXmlDTDHandler *arg1 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setDTDHandler_1930_0 (arg1); -} - -static void _set_callback_cbs_setDTDHandler_1930_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setDTDHandler_1930_0 = cb; -} - - -// void QXmlReader::setDeclHandler(QXmlDeclHandler *handler) - -static void _init_cbs_setDeclHandler_2086_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("handler"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_setDeclHandler_2086_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QXmlDeclHandler *arg1 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setDeclHandler_2086_0 (arg1); -} - -static void _set_callback_cbs_setDeclHandler_2086_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setDeclHandler_2086_0 = cb; -} - - -// void QXmlReader::setEntityResolver(QXmlEntityResolver *handler) - -static void _init_cbs_setEntityResolver_2495_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("handler"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_setEntityResolver_2495_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QXmlEntityResolver *arg1 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setEntityResolver_2495_0 (arg1); -} - -static void _set_callback_cbs_setEntityResolver_2495_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setEntityResolver_2495_0 = cb; -} - - -// void QXmlReader::setErrorHandler(QXmlErrorHandler *handler) - -static void _init_cbs_setErrorHandler_2232_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("handler"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_setErrorHandler_2232_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QXmlErrorHandler *arg1 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setErrorHandler_2232_0 (arg1); -} - -static void _set_callback_cbs_setErrorHandler_2232_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setErrorHandler_2232_0 = cb; -} - - -// void QXmlReader::setFeature(const QString &name, bool value) - -static void _init_cbs_setFeature_2781_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("name"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("value"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_cbs_setFeature_2781_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QString &arg1 = args.read (heap); - bool arg2 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setFeature_2781_0 (arg1, arg2); -} - -static void _set_callback_cbs_setFeature_2781_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setFeature_2781_0 = cb; -} - - -// void QXmlReader::setLexicalHandler(QXmlLexicalHandler *handler) - -static void _init_cbs_setLexicalHandler_2416_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("handler"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_cbs_setLexicalHandler_2416_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - QXmlLexicalHandler *arg1 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setLexicalHandler_2416_0 (arg1); -} - -static void _set_callback_cbs_setLexicalHandler_2416_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setLexicalHandler_2416_0 = cb; -} - - -// void QXmlReader::setProperty(const QString &name, void *value) - -static void _init_cbs_setProperty_2973_0 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("name"); - decl->add_arg (argspec_0); - static gsi::ArgSpecBase argspec_1 ("value"); - decl->add_arg (argspec_1); - decl->set_return (); -} - -static void _call_cbs_setProperty_2973_0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QString &arg1 = args.read (heap); - void *arg2 = args.read (heap); - __SUPPRESS_UNUSED_WARNING(ret); - ((QXmlReader_Adaptor *)cls)->cbs_setProperty_2973_0 (arg1, arg2); -} - -static void _set_callback_cbs_setProperty_2973_0 (void *cls, const gsi::Callback &cb) -{ - ((QXmlReader_Adaptor *)cls)->cb_setProperty_2973_0 = cb; -} - - -namespace gsi -{ - -gsi::Class &qtdecl_QXmlReader (); - -static gsi::Methods methods_QXmlReader_Adaptor () { - gsi::Methods methods; - methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QXmlReader::QXmlReader()\nThis method creates an object of class QXmlReader.", &_init_ctor_QXmlReader_Adaptor_0, &_call_ctor_QXmlReader_Adaptor_0); - methods += new qt_gsi::GenericMethod ("DTDHandler", "@brief Virtual method QXmlDTDHandler *QXmlReader::DTDHandler()\nThis method can be reimplemented in a derived class.", true, &_init_cbs_DTDHandler_c0_0, &_call_cbs_DTDHandler_c0_0); - methods += new qt_gsi::GenericMethod ("DTDHandler", "@hide", true, &_init_cbs_DTDHandler_c0_0, &_call_cbs_DTDHandler_c0_0, &_set_callback_cbs_DTDHandler_c0_0); - methods += new qt_gsi::GenericMethod ("contentHandler", "@brief Virtual method QXmlContentHandler *QXmlReader::contentHandler()\nThis method can be reimplemented in a derived class.", true, &_init_cbs_contentHandler_c0_0, &_call_cbs_contentHandler_c0_0); - methods += new qt_gsi::GenericMethod ("contentHandler", "@hide", true, &_init_cbs_contentHandler_c0_0, &_call_cbs_contentHandler_c0_0, &_set_callback_cbs_contentHandler_c0_0); - methods += new qt_gsi::GenericMethod ("declHandler", "@brief Virtual method QXmlDeclHandler *QXmlReader::declHandler()\nThis method can be reimplemented in a derived class.", true, &_init_cbs_declHandler_c0_0, &_call_cbs_declHandler_c0_0); - methods += new qt_gsi::GenericMethod ("declHandler", "@hide", true, &_init_cbs_declHandler_c0_0, &_call_cbs_declHandler_c0_0, &_set_callback_cbs_declHandler_c0_0); - methods += new qt_gsi::GenericMethod ("entityResolver", "@brief Virtual method QXmlEntityResolver *QXmlReader::entityResolver()\nThis method can be reimplemented in a derived class.", true, &_init_cbs_entityResolver_c0_0, &_call_cbs_entityResolver_c0_0); - methods += new qt_gsi::GenericMethod ("entityResolver", "@hide", true, &_init_cbs_entityResolver_c0_0, &_call_cbs_entityResolver_c0_0, &_set_callback_cbs_entityResolver_c0_0); - methods += new qt_gsi::GenericMethod ("errorHandler", "@brief Virtual method QXmlErrorHandler *QXmlReader::errorHandler()\nThis method can be reimplemented in a derived class.", true, &_init_cbs_errorHandler_c0_0, &_call_cbs_errorHandler_c0_0); - methods += new qt_gsi::GenericMethod ("errorHandler", "@hide", true, &_init_cbs_errorHandler_c0_0, &_call_cbs_errorHandler_c0_0, &_set_callback_cbs_errorHandler_c0_0); - methods += new qt_gsi::GenericMethod ("feature", "@brief Virtual method bool QXmlReader::feature(const QString &name, bool *ok)\nThis method can be reimplemented in a derived class.", true, &_init_cbs_feature_c2967_1, &_call_cbs_feature_c2967_1); - methods += new qt_gsi::GenericMethod ("feature", "@hide", true, &_init_cbs_feature_c2967_1, &_call_cbs_feature_c2967_1, &_set_callback_cbs_feature_c2967_1); - methods += new qt_gsi::GenericMethod ("hasFeature", "@brief Virtual method bool QXmlReader::hasFeature(const QString &name)\nThis method can be reimplemented in a derived class.", true, &_init_cbs_hasFeature_c2025_0, &_call_cbs_hasFeature_c2025_0); - methods += new qt_gsi::GenericMethod ("hasFeature", "@hide", true, &_init_cbs_hasFeature_c2025_0, &_call_cbs_hasFeature_c2025_0, &_set_callback_cbs_hasFeature_c2025_0); - methods += new qt_gsi::GenericMethod ("hasProperty", "@brief Virtual method bool QXmlReader::hasProperty(const QString &name)\nThis method can be reimplemented in a derived class.", true, &_init_cbs_hasProperty_c2025_0, &_call_cbs_hasProperty_c2025_0); - methods += new qt_gsi::GenericMethod ("hasProperty", "@hide", true, &_init_cbs_hasProperty_c2025_0, &_call_cbs_hasProperty_c2025_0, &_set_callback_cbs_hasProperty_c2025_0); - methods += new qt_gsi::GenericMethod ("lexicalHandler", "@brief Virtual method QXmlLexicalHandler *QXmlReader::lexicalHandler()\nThis method can be reimplemented in a derived class.", true, &_init_cbs_lexicalHandler_c0_0, &_call_cbs_lexicalHandler_c0_0); - methods += new qt_gsi::GenericMethod ("lexicalHandler", "@hide", true, &_init_cbs_lexicalHandler_c0_0, &_call_cbs_lexicalHandler_c0_0, &_set_callback_cbs_lexicalHandler_c0_0); - methods += new qt_gsi::GenericMethod ("parse", "@brief Virtual method bool QXmlReader::parse(const QXmlInputSource &input)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_parse_2852_0, &_call_cbs_parse_2852_0); - methods += new qt_gsi::GenericMethod ("parse", "@hide", false, &_init_cbs_parse_2852_0, &_call_cbs_parse_2852_0, &_set_callback_cbs_parse_2852_0); - methods += new qt_gsi::GenericMethod ("parse", "@brief Virtual method bool QXmlReader::parse(const QXmlInputSource *input)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_parse_2856_0, &_call_cbs_parse_2856_0); - methods += new qt_gsi::GenericMethod ("parse", "@hide", false, &_init_cbs_parse_2856_0, &_call_cbs_parse_2856_0, &_set_callback_cbs_parse_2856_0); - methods += new qt_gsi::GenericMethod ("property", "@brief Virtual method void *QXmlReader::property(const QString &name, bool *ok)\nThis method can be reimplemented in a derived class.", true, &_init_cbs_property_c2967_1, &_call_cbs_property_c2967_1); - methods += new qt_gsi::GenericMethod ("property", "@hide", true, &_init_cbs_property_c2967_1, &_call_cbs_property_c2967_1, &_set_callback_cbs_property_c2967_1); - methods += new qt_gsi::GenericMethod ("setContentHandler", "@brief Virtual method void QXmlReader::setContentHandler(QXmlContentHandler *handler)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setContentHandler_2441_0, &_call_cbs_setContentHandler_2441_0); - methods += new qt_gsi::GenericMethod ("setContentHandler", "@hide", false, &_init_cbs_setContentHandler_2441_0, &_call_cbs_setContentHandler_2441_0, &_set_callback_cbs_setContentHandler_2441_0); - methods += new qt_gsi::GenericMethod ("setDTDHandler", "@brief Virtual method void QXmlReader::setDTDHandler(QXmlDTDHandler *handler)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setDTDHandler_1930_0, &_call_cbs_setDTDHandler_1930_0); - methods += new qt_gsi::GenericMethod ("setDTDHandler", "@hide", false, &_init_cbs_setDTDHandler_1930_0, &_call_cbs_setDTDHandler_1930_0, &_set_callback_cbs_setDTDHandler_1930_0); - methods += new qt_gsi::GenericMethod ("setDeclHandler", "@brief Virtual method void QXmlReader::setDeclHandler(QXmlDeclHandler *handler)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setDeclHandler_2086_0, &_call_cbs_setDeclHandler_2086_0); - methods += new qt_gsi::GenericMethod ("setDeclHandler", "@hide", false, &_init_cbs_setDeclHandler_2086_0, &_call_cbs_setDeclHandler_2086_0, &_set_callback_cbs_setDeclHandler_2086_0); - methods += new qt_gsi::GenericMethod ("setEntityResolver", "@brief Virtual method void QXmlReader::setEntityResolver(QXmlEntityResolver *handler)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setEntityResolver_2495_0, &_call_cbs_setEntityResolver_2495_0); - methods += new qt_gsi::GenericMethod ("setEntityResolver", "@hide", false, &_init_cbs_setEntityResolver_2495_0, &_call_cbs_setEntityResolver_2495_0, &_set_callback_cbs_setEntityResolver_2495_0); - methods += new qt_gsi::GenericMethod ("setErrorHandler", "@brief Virtual method void QXmlReader::setErrorHandler(QXmlErrorHandler *handler)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setErrorHandler_2232_0, &_call_cbs_setErrorHandler_2232_0); - methods += new qt_gsi::GenericMethod ("setErrorHandler", "@hide", false, &_init_cbs_setErrorHandler_2232_0, &_call_cbs_setErrorHandler_2232_0, &_set_callback_cbs_setErrorHandler_2232_0); - methods += new qt_gsi::GenericMethod ("setFeature", "@brief Virtual method void QXmlReader::setFeature(const QString &name, bool value)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setFeature_2781_0, &_call_cbs_setFeature_2781_0); - methods += new qt_gsi::GenericMethod ("setFeature", "@hide", false, &_init_cbs_setFeature_2781_0, &_call_cbs_setFeature_2781_0, &_set_callback_cbs_setFeature_2781_0); - methods += new qt_gsi::GenericMethod ("setLexicalHandler", "@brief Virtual method void QXmlReader::setLexicalHandler(QXmlLexicalHandler *handler)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setLexicalHandler_2416_0, &_call_cbs_setLexicalHandler_2416_0); - methods += new qt_gsi::GenericMethod ("setLexicalHandler", "@hide", false, &_init_cbs_setLexicalHandler_2416_0, &_call_cbs_setLexicalHandler_2416_0, &_set_callback_cbs_setLexicalHandler_2416_0); - methods += new qt_gsi::GenericMethod ("setProperty", "@brief Virtual method void QXmlReader::setProperty(const QString &name, void *value)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_setProperty_2973_0, &_call_cbs_setProperty_2973_0); - methods += new qt_gsi::GenericMethod ("setProperty", "@hide", false, &_init_cbs_setProperty_2973_0, &_call_cbs_setProperty_2973_0, &_set_callback_cbs_setProperty_2973_0); - return methods; -} - -gsi::Class decl_QXmlReader_Adaptor (qtdecl_QXmlReader (), "QtXml", "QXmlReader", - methods_QXmlReader_Adaptor (), - "@qt\n@brief Binding of QXmlReader"); - -} - diff --git a/src/gsiqt/qt5/QtXml/gsiDeclQtXmlTypeTraits.h b/src/gsiqt/qt5/QtXml/gsiDeclQtXmlTypeTraits.h index 8733928f3..94a714a9e 100644 --- a/src/gsiqt/qt5/QtXml/gsiDeclQtXmlTypeTraits.h +++ b/src/gsiqt/qt5/QtXml/gsiDeclQtXmlTypeTraits.h @@ -1759,12 +1759,6 @@ template <> struct type_traits : public type_traits { }; } -class QXmlReader_Adaptor; -namespace tl { -template <> struct type_traits : public type_traits { -}; -} - class QXmlSimpleReader; namespace tl { template <> struct type_traits : public type_traits { diff --git a/src/pya/pya/pyaConvert.cc b/src/pya/pya/pyaConvert.cc index 5a0e6625f..9c091b568 100644 --- a/src/pya/pya/pyaConvert.cc +++ b/src/pya/pya/pyaConvert.cc @@ -192,6 +192,42 @@ std::string python2c_func::operator() (PyObject *rval) } } +template <> +std::vector python2c_func >::operator() (PyObject *rval) +{ +#if PY_MAJOR_VERSION < 3 + if (PyString_Check (rval)) { + const char *cp = PyString_AsString (rval); + return std::vector (cp, cp + PyString_Size (rval)); + } else +#else + if (PyBytes_Check (rval)) { + char *cp = 0; + ssize_t sz = 0; + PyBytes_AsStringAndSize (rval, &cp, &sz); + tl_assert (cp != 0); + return std::vector (cp, cp + sz); + } else +#endif + if (PyUnicode_Check (rval)) { + PythonRef ba (PyUnicode_AsUTF8String (rval)); + if (! ba) { + check_error (); + } + char *cp = 0; + ssize_t sz = 0; + PyBytes_AsStringAndSize (ba.get (), &cp, &sz); + tl_assert (cp != 0); + return std::vector (cp, cp + sz); + } else if (PyByteArray_Check (rval)) { + char *cp = PyByteArray_AsString (rval); + ssize_t sz = PyByteArray_Size (rval); + return std::vector (cp, cp + sz); + } else { + throw tl::Exception (tl::to_string (tr ("Argument cannot be converted to a byte array"))); + } +} + #if defined(HAVE_QT) template <> QByteArray python2c_func::operator() (PyObject *rval) @@ -515,6 +551,16 @@ PyObject *c2python_func::operator() (const std::string &c) #endif } +template <> +PyObject *c2python_func &>::operator() (const std::vector &c) +{ +#if PY_MAJOR_VERSION < 3 + return PyByteArray_FromStringAndSize (&c.front (), Py_ssize_t (c.size ())); +#else + return PyBytes_FromStringAndSize (&c.front (), Py_ssize_t (c.size ())); +#endif +} + template <> PyObject *c2python_func::operator() (const char *p) { @@ -542,9 +588,9 @@ PyObject *c2python_func::operator() (const QByteArray &qba) Py_RETURN_NONE; } else { #if PY_MAJOR_VERSION < 3 - return PyString_FromStringAndSize (qba.constData (), Py_ssize_t (qba.size ())); -#else return PyByteArray_FromStringAndSize (qba.constData (), Py_ssize_t (qba.size ())); +#else + return PyBytes_FromStringAndSize (qba.constData (), Py_ssize_t (qba.size ())); #endif } } diff --git a/src/pya/pya/pyaConvert.h b/src/pya/pya/pyaConvert.h index f3702cac0..7b45dbc68 100644 --- a/src/pya/pya/pyaConvert.h +++ b/src/pya/pya/pyaConvert.h @@ -185,6 +185,7 @@ struct test_type_func }; template <> struct test_type_func : public test_type_func { }; +template <> struct test_type_func > : public test_type_func { }; #if defined(HAVE_QT) template <> struct test_type_func : public test_type_func { }; template <> struct test_type_func : public test_type_func { }; @@ -333,6 +334,7 @@ template <> PYA_PUBLIC double python2c_func::operator() (PyObject *rval) template <> struct python2c_func : public python2c_func_cast { }; template <> PYA_PUBLIC std::string python2c_func::operator() (PyObject *rval); +template <> PYA_PUBLIC std::vector python2c_func >::operator() (PyObject *rval); #if defined(HAVE_QT) template <> PYA_PUBLIC QByteArray python2c_func::operator() (PyObject *rval); template <> PYA_PUBLIC QString python2c_func::operator() (PyObject *rval); @@ -620,6 +622,7 @@ template <> struct c2python_func : public c2python_func PYA_PUBLIC PyObject *c2python_func::operator() (const std::string &c); template <> struct c2python_func : public c2python_func { }; +template <> struct c2python_func > : public c2python_func &> { }; template <> struct c2python_func diff --git a/src/pya/pya/pyaMarshal.cc b/src/pya/pya/pyaMarshal.cc index 827240aa0..ad72b4c12 100644 --- a/src/pya/pya/pyaMarshal.cc +++ b/src/pya/pya/pyaMarshal.cc @@ -61,6 +61,7 @@ public: virtual void set (const char * /*c_str*/, size_t /*s*/, tl::Heap & /*heap*/) { // TODO: is there a setter for a string? + // So far it's not possible to have string OUT parameter } private: @@ -68,6 +69,40 @@ private: PythonPtr m_string; }; +/** + * @brief An adaptor for a byte array from ruby objects + */ +class PythonBasedByteArrayAdaptor + : public gsi::ByteArrayAdaptor +{ +public: + PythonBasedByteArrayAdaptor (const PythonPtr &ba) + : m_bytearray (python2c > (ba.get ())), m_bytes (ba) + { + // .. nothing yet .. + } + + virtual const char *c_str () const + { + return &m_bytearray.front (); + } + + virtual size_t size () const + { + return m_bytearray.size (); + } + + virtual void set (const char * /*c_str*/, size_t /*s*/, tl::Heap & /*heap*/) + { + // TODO: is there a setter for a byte array? + // So far it's not possible to have bytes OUT parameter + } + +private: + std::vector m_bytearray; + PythonPtr m_bytes; +}; + /** * @brief An adaptor for a variant from ruby objects */ @@ -303,6 +338,55 @@ struct writer } }; +/** + * @brief Serialization for strings + */ +template <> +struct writer +{ + void operator() (gsi::SerialArgs *aa, PyObject *arg, const gsi::ArgType &atype, tl::Heap *heap) + { + // Cannot pass ownership currently + tl_assert (!atype.pass_obj ()); + + if (arg == Py_None || arg == NULL) { + + if (! (atype.is_ptr () || atype.is_cptr ())) { + // nil is treated as an empty string for references + aa->write ((void *)new gsi::ByteArrayAdaptorImpl > (std::vector ())); + } else { + aa->write ((void *)0); + } + + } else { + + if (atype.is_ref () || atype.is_ptr ()) { + + // references or pointers require a boxed object. Pointers also allow nil. + void *vc = 0; + get_boxed_value_func > () (&vc, arg, heap); + if (! vc && atype.is_ref ()) { + throw tl::Exception (tl::to_string (tr ("Arguments or return values of reference or direct type cannot be passed nil or an empty boxed value object"))); + } + + // NOTE: by convention we pass the ownership to the receiver for adaptors. + if (! vc) { + aa->write (0); + } else { + aa->write ((void *)new gsi::ByteArrayAdaptorImpl > ((std::vector *) vc)); + } + + } else { + + // NOTE: by convention we pass the ownership to the receiver for adaptors. + aa->write ((void *)new PythonBasedByteArrayAdaptor (arg)); + + } + + } + } +}; + /** * @brief Specialization for Variant */ @@ -533,6 +617,29 @@ struct reader } }; +/** + * @brief Deseralisation wrapper: specialization for byte arrays + */ +template <> +struct reader +{ + void operator() (gsi::SerialArgs *rr, PythonRef *ret, PYAObjectBase * /*self*/, const gsi::ArgType &, tl::Heap *heap) + { + std::unique_ptr a ((gsi::ByteArrayAdaptor *) rr->read(*heap)); + if (!a.get ()) { + *ret = PythonRef (Py_None, false /*borrowed*/); + } else { + const char *cp = a->c_str (); + size_t sz = a->size (); +#if PY_MAJOR_VERSION < 3 + *ret = PyByteArray_FromStringAndSize (cp, sz); +#else + *ret = PyBytes_FromStringAndSize (cp, sz); +#endif + } + } +}; + static PyObject *object_from_variant (tl::Variant &var, PYAObjectBase *self, const gsi::ArgType &atype) { diff --git a/src/rba/rba/rbaConvert.h b/src/rba/rba/rbaConvert.h index 63c5d2f8e..4d04e6d7e 100644 --- a/src/rba/rba/rbaConvert.h +++ b/src/rba/rba/rbaConvert.h @@ -182,6 +182,12 @@ inline bool test_type (VALUE rval, bool /*loose*/) return TYPE (rval) == T_STRING; } +template <> +inline bool test_type (VALUE rval, bool /*loose*/) +{ + return TYPE (rval) == T_STRING; +} + template <> inline bool test_type (VALUE /*rval*/, bool /*loose*/) { @@ -313,6 +319,15 @@ inline std::string ruby2c (VALUE rval) return std::string (RSTRING_PTR(str), RSTRING_LEN(str)); } +template <> +inline std::vector ruby2c > (VALUE rval) +{ + VALUE str = rba_safe_string_value (rval); + char *cp = RSTRING_PTR(str); + size_t sz = RSTRING_LEN(str); + return std::vector (cp, cp + sz); +} + #if defined(HAVE_QT) template <> inline QByteArray ruby2c (VALUE rval) @@ -450,6 +465,12 @@ inline VALUE c2ruby (const std::string &c) return rb_str_new (c.c_str (), long (c.size ())); } +template <> +inline VALUE c2ruby > (const std::vector &c) +{ + return rb_str_new (&c.front (), c.size ()); +} + #if defined(HAVE_QT) template <> inline VALUE c2ruby (const QByteArray &qba) diff --git a/src/rba/rba/rbaMarshal.cc b/src/rba/rba/rbaMarshal.cc index 30ea8fa6c..58db2cb3f 100644 --- a/src/rba/rba/rbaMarshal.cc +++ b/src/rba/rba/rbaMarshal.cc @@ -68,12 +68,51 @@ public: virtual void set (const char * /*c_str*/, size_t /*s*/, tl::Heap & /*heap*/) { // TODO: is there a setter for a string? + // -> so far, string OUT parameters are not supported } private: VALUE m_string; }; +/** + * @brief An adaptor for a byte array from ruby objects + */ +class RubyBasedByteArrayAdaptor + : public gsi::ByteArrayAdaptor +{ +public: + RubyBasedByteArrayAdaptor (VALUE value) + { + m_bytes = rba_safe_string_value (value); + gc_lock_object (m_bytes); + } + + ~RubyBasedByteArrayAdaptor () + { + gc_unlock_object (m_bytes); + } + + virtual const char *c_str () const + { + return RSTRING_PTR (m_bytes); + } + + virtual size_t size () const + { + return RSTRING_LEN (m_bytes); + } + + virtual void set (const char * /*c_str*/, size_t /*s*/, tl::Heap & /*heap*/) + { + // TODO: is there a setter for a string? + // -> so far, byte array OUT parameters are not supported + } + +private: + VALUE m_bytes; +}; + /** * @brief An adaptor for a variant from ruby objects */ @@ -214,6 +253,7 @@ struct get_boxed_value_func_error template <> struct get_boxed_value_func : get_boxed_value_func_error { }; template <> struct get_boxed_value_func : get_boxed_value_func_error { }; +template <> struct get_boxed_value_func : get_boxed_value_func_error { }; template <> struct get_boxed_value_func : get_boxed_value_func_error { }; template <> struct get_boxed_value_func : get_boxed_value_func_error { }; template <> struct get_boxed_value_func : get_boxed_value_func_error { }; @@ -321,6 +361,55 @@ struct writer } }; +/** + * @brief Serialization for strings + */ +template <> +struct writer +{ + void operator() (gsi::SerialArgs *aa, VALUE arg, const gsi::ArgType &atype, tl::Heap *heap) + { + // Cannot pass ownership currently + tl_assert (!atype.pass_obj ()); + + if (arg == Qnil) { + + if (! (atype.is_ptr () || atype.is_cptr ())) { + // nil is treated as an empty string for references + aa->write ((void *)new gsi::ByteArrayAdaptorImpl > (std::vector ())); + } else { + aa->write ((void *)0); + } + + } else { + + if (atype.is_ref () || atype.is_ptr ()) { + + // references or pointers require a boxed object. Pointers also allow nil. + void *vc = 0; + get_boxed_value_func > () (&vc, arg, heap); + if (! vc && atype.is_ref ()) { + throw tl::Exception (tl::to_string (tr ("Arguments or return values of reference or direct type cannot be passed nil or an empty boxed value object"))); + } + + // NOTE: by convention we pass the ownership to the receiver for adaptors. + if (! vc) { + aa->write (0); + } else { + aa->write ((void *)new gsi::ByteArrayAdaptorImpl > ((std::vector *) vc)); + } + + } else { + + // NOTE: by convention we pass the ownership to the receiver for adaptors. + aa->write ((void *)new RubyBasedByteArrayAdaptor (arg)); + + } + + } + } +}; + /** * @brief Specialization for Variant */ @@ -556,6 +645,23 @@ struct reader } }; +/** + * @brief Deseralisation wrapper: specialization for strings + */ +template <> +struct reader +{ + void operator() (gsi::SerialArgs *rr, VALUE *ret, Proxy * /*self*/, const gsi::ArgType &, tl::Heap *heap) + { + std::unique_ptr a ((gsi::ByteArrayAdaptor *) rr->read(*heap)); + if (!a.get ()) { + *ret = Qnil; + } else { + *ret = rb_str_new (a->c_str (), long (a->size ())); + } + } +}; + static VALUE object_from_variant (tl::Variant &var, Proxy *self, const gsi::ArgType &atype) { if (var.is_user()) { diff --git a/src/tl/tl/tlVariant.cc b/src/tl/tl/tlVariant.cc index f428436ec..a2b71ac90 100644 --- a/src/tl/tl/tlVariant.cc +++ b/src/tl/tl/tlVariant.cc @@ -238,6 +238,12 @@ Variant::Variant () // .. nothing yet .. } +Variant::Variant (const std::vector &ba) + : m_type (t_bytearray), m_string (0) +{ + m_var.m_bytearray = new std::vector (ba); +} + #if defined(HAVE_QT) Variant::Variant (const QByteArray &qba) @@ -574,6 +580,8 @@ Variant::reset () delete m_var.m_list; } else if (m_type == t_array) { delete m_var.m_array; + } else if (m_type == t_bytearray) { + delete m_var.m_bytearray; #if defined(HAVE_QT) } else if (m_type == t_qstring) { delete m_var.m_qstring; @@ -622,6 +630,20 @@ Variant::operator= (const std::string &s) return *this; } +Variant & +Variant::operator= (const std::vector &s) +{ + if (m_type == t_bytearray && &s == m_var.m_bytearray) { + // we are assigning to ourselves + } else { + std::vector *snew = new std::vector (s); + reset (); + m_type = t_bytearray; + m_var.m_bytearray = snew; + } + return *this; +} + #if defined(HAVE_QT) Variant & @@ -837,6 +859,8 @@ Variant::operator= (const Variant &v) #endif } else if (m_type == t_id) { m_var.m_id = v.m_var.m_id; + } else if (m_type == t_bytearray) { + m_var.m_bytearray = new std::vector (*v.m_var.m_bytearray); #if defined(HAVE_QT) } else if (m_type == t_qstring) { m_var.m_qstring = new QString (*v.m_var.m_qstring); @@ -922,6 +946,8 @@ normalized_type (Variant::type type) case Variant::t_stdstring: case Variant::t_string: return Variant::t_string; + case Variant::t_bytearray: + return Variant::t_bytearray; default: #if defined(HAVE_64BIT_COORD) case Variant::t_int128: @@ -989,6 +1015,9 @@ Variant::operator== (const tl::Variant &d) const return to_double () == d.to_double (); } else if (t == t_string) { return strcmp (to_string (), d.to_string ()) == 0; + } else if (t == t_bytearray) { + // TODO: can't compare std::vector with QByteArray currently + return *m_var.m_bytearray == *d.m_var.m_bytearray; #if defined(HAVE_QT) } else if (t == t_qstring) { return *m_var.m_qstring == *d.m_var.m_qstring; @@ -1042,6 +1071,9 @@ Variant::operator< (const tl::Variant &d) const return to_double () < d.to_double (); } else if (t == t_string) { return strcmp (to_string (), d.to_string ()) < 0; + } else if (t == t_bytearray) { + // TODO: can't compare std::vector with QByteArray currently + return *m_var.m_bytearray < *d.m_var.m_bytearray; #if defined(HAVE_QT) } else if (t == t_qstring) { return *m_var.m_qstring < *d.m_var.m_qstring; @@ -1099,6 +1131,7 @@ Variant::can_convert_to_float () const case t_qstring: case t_qbytearray: #endif + case t_bytearray: case t_stdstring: case t_string: { @@ -1138,6 +1171,7 @@ Variant::can_convert_to_double () const case t_qstring: case t_qbytearray: #endif + case t_bytearray: case t_stdstring: case t_string: { @@ -1177,6 +1211,7 @@ Variant::can_convert_to_int128 () const case t_qstring: case t_qbytearray: #endif + case t_bytearray: case t_stdstring: // TODO: there is no range checking currently return true; @@ -1191,7 +1226,7 @@ Variant::can_convert_to_ulonglong () const { switch (m_type) { case t_double: - return m_var.m_double <= std::numeric_limits::max () && m_var.m_double >= std::numeric_limits::min (); + return m_var.m_double <= double (std::numeric_limits::max ()) && m_var.m_double >= double (std::numeric_limits::min ()); case t_float: return m_var.m_float <= float (std::numeric_limits::max ()) && m_var.m_float >= float (std::numeric_limits::min ()); case t_longlong: @@ -1224,6 +1259,7 @@ Variant::can_convert_to_ulonglong () const case t_qbytearray: #endif case t_stdstring: + case t_bytearray: { tl::Extractor ex (to_string ()); try { @@ -1243,7 +1279,7 @@ Variant::can_convert_to_longlong () const { switch (m_type) { case t_double: - return m_var.m_double <= std::numeric_limits::max () && m_var.m_double >= std::numeric_limits::min (); + return m_var.m_double <= double (std::numeric_limits::max ()) && m_var.m_double >= double (std::numeric_limits::min ()); case t_float: return m_var.m_float <= float (std::numeric_limits::max ()) && m_var.m_float >= float (std::numeric_limits::min ()); #if defined(HAVE_64BIT_COORD) @@ -1271,6 +1307,7 @@ Variant::can_convert_to_longlong () const case t_qbytearray: #endif case t_stdstring: + case t_bytearray: { tl::Extractor ex (to_string ()); try { @@ -1290,9 +1327,9 @@ Variant::can_convert_to_ulong () const { switch (m_type) { case t_double: - return m_var.m_double <= std::numeric_limits::max () && m_var.m_double >= std::numeric_limits::min (); + return m_var.m_double <= double (std::numeric_limits::max ()) && m_var.m_double >= double (std::numeric_limits::min ()); case t_float: - return m_var.m_float <= std::numeric_limits::max () && m_var.m_float >= std::numeric_limits::min (); + return m_var.m_float <= float (std::numeric_limits::max ()) && m_var.m_float >= float (std::numeric_limits::min ()); #if defined(HAVE_64BIT_COORD) case t_int128: return m_var.m_int128 <= __int128 (std::numeric_limits::max ()) && m_var.m_int128 >= __int128 (std::numeric_limits::min ()); @@ -1324,6 +1361,7 @@ Variant::can_convert_to_ulong () const case t_qbytearray: #endif case t_stdstring: + case t_bytearray: { tl::Extractor ex (to_string ()); try { @@ -1343,7 +1381,7 @@ Variant::can_convert_to_long () const { switch (m_type) { case t_double: - return m_var.m_double <= std::numeric_limits::max () && m_var.m_double >= std::numeric_limits::min (); + return m_var.m_double <= double (std::numeric_limits::max ()) && m_var.m_double >= double (std::numeric_limits::min ()); case t_float: return m_var.m_float <= float (std::numeric_limits::max ()) && m_var.m_float >= float (std::numeric_limits::min ()); #if defined(HAVE_64BIT_COORD) @@ -1373,6 +1411,7 @@ Variant::can_convert_to_long () const case t_qbytearray: #endif case t_stdstring: + case t_bytearray: { tl::Extractor ex (to_string ()); try { @@ -1392,9 +1431,9 @@ Variant::can_convert_to_int () const { switch (m_type) { case t_double: - return m_var.m_double <= std::numeric_limits::max () && m_var.m_double >= std::numeric_limits::min (); + return m_var.m_double <= double (std::numeric_limits::max ()) && m_var.m_double >= double (std::numeric_limits::min ()); case t_float: - return m_var.m_float <= std::numeric_limits::max () && m_var.m_float >= std::numeric_limits::min (); + return m_var.m_float <= float (std::numeric_limits::max ()) && m_var.m_float >= float (std::numeric_limits::min ()); #if defined(HAVE_64BIT_COORD) case t_int128: return m_var.m_int128 <= __int128 (std::numeric_limits::max ()) && m_var.m_int128 >= __int128 (std::numeric_limits::min ()); @@ -1424,6 +1463,7 @@ Variant::can_convert_to_int () const case t_qbytearray: #endif case t_stdstring: + case t_bytearray: { tl::Extractor ex (to_string ()); try { @@ -1443,9 +1483,9 @@ Variant::can_convert_to_uint () const { switch (m_type) { case t_double: - return m_var.m_double <= std::numeric_limits::max () && m_var.m_double >= std::numeric_limits::min (); + return m_var.m_double <= double (std::numeric_limits::max ()) && m_var.m_double >= double (std::numeric_limits::min ()); case t_float: - return m_var.m_float <= std::numeric_limits::max () && m_var.m_float >= std::numeric_limits::min (); + return m_var.m_float <= float (std::numeric_limits::max ()) && m_var.m_float >= float (std::numeric_limits::min ()); #if defined(HAVE_64BIT_COORD) case t_int128: return m_var.m_int128 <= __int128 (std::numeric_limits::max ()) && m_var.m_int128 >= __int128 (std::numeric_limits::min ()); @@ -1475,6 +1515,7 @@ Variant::can_convert_to_uint () const case t_qbytearray: #endif case t_stdstring: + case t_bytearray: { tl::Extractor ex (to_string ()); try { @@ -1526,6 +1567,8 @@ Variant::to_qbytearray () const { if (m_type == t_qbytearray) { return *m_var.m_qbytearray; + } else if (m_type == t_bytearray) { + return QByteArray (&m_var.m_bytearray->front (), m_var.m_bytearray->size ()); } else if (m_type == t_qstring) { return m_var.m_qstring->toUtf8 (); } else if (m_type == t_stdstring) { @@ -1544,6 +1587,8 @@ Variant::to_qstring () const return *m_var.m_qstring; } else if (m_type == t_qbytearray) { return QString::fromUtf8 (*m_var.m_qbytearray); + } else if (m_type == t_bytearray) { + return QString::fromUtf8 (&m_var.m_bytearray->front ()); } else { return tl::to_qstring (to_string ()); } @@ -1551,11 +1596,34 @@ Variant::to_qstring () const #endif +std::vector +Variant::to_bytearray () const +{ + if (m_type == t_bytearray) { + return *m_var.m_bytearray; +#if defined(HAVE_QT) + } else if (m_type == t_qstring) { + QByteArray ba = m_var.m_qstring->toUtf8 (); + return std::vector (ba.constBegin (), ba.constEnd ()); + } else if (m_type == t_qbytearray) { + return std::vector (m_var.m_qbytearray->constBegin (), m_var.m_qbytearray->constEnd ()); +#endif + } else if (m_type == t_stdstring) { + return std::vector (m_var.m_stdstring->begin (), m_var.m_stdstring->end ()); + } else { + // TODO: maybe some other conversion makes sense? I.e. byte representation of int? + std::string s = to_string (); + return std::vector (s.begin (), s.end ()); + } +} + std::string Variant::to_stdstring () const { if (m_type == t_stdstring) { return *m_var.m_stdstring; + } else if (m_type == t_bytearray) { + return std::string (m_var.m_bytearray->begin (), m_var.m_bytearray->end ()); #if defined(HAVE_QT) } else if (m_type == t_qstring) { return tl::to_string (*m_var.m_qstring); @@ -1574,11 +1642,31 @@ Variant::to_string () const return m_var.m_stdstring->c_str (); + } else if (m_type == t_bytearray) { + + // need to add a terminating 0 for safety + if (! m_string) { + size_t n = m_var.m_bytearray->size (); + m_string = new char [n + 1]; + strncpy (m_string, &m_var.m_bytearray->front (), n); + m_string[n] = 0; + } + + return m_string; + #if defined(HAVE_QT) } else if (m_type == t_qbytearray) { - // TODO: content may be longer - const char * terminates at first 0 character - return m_var.m_qbytearray->constData (); + // need to add a terminating 0 for safety + if (! m_string) { + size_t n = m_var.m_qbytearray->size (); + m_string = new char [n + 1]; + strncpy (m_string, m_var.m_qbytearray->constData (), n); + m_string[n] = 0; + } + + return m_string; + #endif // conversion needed @@ -1623,8 +1711,6 @@ Variant::to_string () const #if defined(HAVE_QT) } else if (m_type == t_qstring) { r = tl::to_string (*m_var.m_qstring); - } else if (m_type == t_qbytearray) { - r = std::string (m_var.m_qbytearray->constData (), m_var.m_qbytearray->size ()); #endif } else if (m_type == t_list) { for (std::vector::const_iterator v = m_var.m_list->begin (); v != m_var.m_list->end (); ++v) { @@ -1709,8 +1795,8 @@ Variant::to_int128 () const } else if (m_type == t_bool) { return m_var.m_bool; #if defined(HAVE_QT) - } else if (m_type == t_qbytearray) { - tl::Extractor ex (m_var.m_qbytearray->constData ()); + } else if (m_type == t_qbytearray || m_type == t_bytearray) { + tl::Extractor ex (to_string ()); __int128 l = 0; ex.read (l); return l; @@ -1780,9 +1866,9 @@ Variant::to_ulonglong () const tl::from_string (*m_var.m_stdstring, l); return l; #if defined(HAVE_QT) - } else if (m_type == t_string || m_type == t_qstring || m_type == t_qbytearray) { + } else if (m_type == t_string || m_type == t_qstring || m_type == t_qbytearray || m_type == t_bytearray) { #else - } else if (m_type == t_string) { + } else if (m_type == t_string || m_type == t_bytearray) { #endif unsigned long long l = 0; tl::from_string (to_string (), l); @@ -1834,9 +1920,9 @@ Variant::to_longlong () const tl::from_string (*m_var.m_stdstring, l); return l; #if defined(HAVE_QT) - } else if (m_type == t_string || m_type == t_qstring || m_type == t_qbytearray) { + } else if (m_type == t_string || m_type == t_qstring || m_type == t_qbytearray || m_type == t_bytearray) { #else - } else if (m_type == t_string) { + } else if (m_type == t_string || m_type == t_bytearray) { #endif long long l = 0; tl::from_string (to_string (), l); @@ -1888,9 +1974,9 @@ Variant::to_ulong () const tl::from_string (*m_var.m_stdstring, l); return l; #if defined(HAVE_QT) - } else if (m_type == t_string || m_type == t_qstring || m_type == t_qbytearray) { + } else if (m_type == t_string || m_type == t_qstring || m_type == t_qbytearray || m_type == t_bytearray) { #else - } else if (m_type == t_string) { + } else if (m_type == t_string || m_type == t_bytearray) { #endif unsigned long l = 0; tl::from_string (to_string (), l); @@ -1942,9 +2028,9 @@ Variant::to_long () const tl::from_string (*m_var.m_stdstring, l); return l; #if defined(HAVE_QT) - } else if (m_type == t_string || m_type == t_qstring || m_type == t_qbytearray) { + } else if (m_type == t_string || m_type == t_qstring || m_type == t_qbytearray || m_type == t_bytearray) { #else - } else if (m_type == t_string) { + } else if (m_type == t_string || m_type == t_bytearray) { #endif long l = 0; tl::from_string (to_string (), l); @@ -2048,9 +2134,9 @@ Variant::to_double () const tl::from_string (*m_var.m_stdstring, d); return d; #if defined(HAVE_QT) - } else if (m_type == t_string || m_type == t_qstring || m_type == t_qbytearray) { + } else if (m_type == t_string || m_type == t_qstring || m_type == t_qbytearray || m_type == t_bytearray) { #else - } else if (m_type == t_string) { + } else if (m_type == t_string || m_type == t_bytearray) { #endif double d = 0; tl::from_string (to_string (), d); @@ -2114,6 +2200,8 @@ Variant::native_ptr () const case t_qbytearray: return m_var.m_qbytearray; #endif + case t_bytearray: + return m_var.m_bytearray; case t_stdstring: return m_var.m_stdstring; case t_array: @@ -2198,9 +2286,9 @@ Variant::to_parsable_string () const } else if (is_stdstring ()) { return tl::to_quoted_string (*m_var.m_stdstring); #if defined(HAVE_QT) - } else if (is_cstring () || is_qstring () || is_qbytearray ()) { + } else if (is_cstring () || is_qstring () || is_qbytearray () || is_bytearray ()) { #else - } else if (is_cstring ()) { + } else if (is_cstring () || is_bytearray ()) { #endif return tl::to_quoted_string (to_string ()); } else if (is_list ()) { @@ -2314,6 +2402,8 @@ QVariant Variant::to_qvariant () const case t_qbytearray: return QVariant (*m_var.m_qbytearray); #endif + case t_bytearray: + return QVariant (to_qbytearray ()); case t_list: { QList l; diff --git a/src/tl/tl/tlVariant.h b/src/tl/tl/tlVariant.h index 46101ea8b..960566844 100644 --- a/src/tl/tl/tlVariant.h +++ b/src/tl/tl/tlVariant.h @@ -164,6 +164,7 @@ public: t_double, t_string, t_stdstring, + t_bytearray, #if defined(HAVE_QT) t_qstring, t_qbytearray, @@ -190,6 +191,11 @@ public: */ Variant (const tl::Variant &d); + /** + * @brief Initialize the Variant with a std::vector + */ + Variant (const std::vector &s); + #if defined(HAVE_QT) /** * @brief Initialize the Variant with a QByteArray @@ -447,6 +453,11 @@ public: */ Variant &operator= (const std::string &v); + /** + * @brief Assignment of a STL byte array + */ + Variant &operator= (const std::vector &v); + /** * @brief Assignment of a double */ @@ -625,6 +636,14 @@ public: QString to_qstring () const; #endif + /** + * @brief Conversion to a STL byte array + * + * This performs the conversion to a std::vector as far as possible. + * No conversion is provided to user types currently. + */ + std::vector to_bytearray () const; + /** * @brief Conversion to a std::string * @@ -1331,6 +1350,14 @@ public: return m_type == t_id; } + /** + * @brief Test, if it is a std::vector byte array + */ + bool is_bytearray () const + { + return m_type == t_bytearray; + } + #if defined(HAVE_QT) /** @@ -1373,12 +1400,24 @@ public: bool is_a_string () const { #if defined(HAVE_QT) - return m_type == t_string || m_type == t_stdstring || m_type == t_qstring || m_type == t_qbytearray; + return m_type == t_string || m_type == t_stdstring || m_type == t_qstring; #else return m_type == t_string || m_type == t_stdstring; #endif } + /** + * @brief Test, if it is a byte array + */ + bool is_a_bytearray () const + { +#if defined(HAVE_QT) + return m_type == t_bytearray || m_type == t_qbytearray; +#else + return m_type == t_bytearray; +#endif + } + /** * @brief Returns true if the variant is of the given type internally * @@ -1530,6 +1569,7 @@ private: QString *m_qstring; QByteArray *m_qbytearray; #endif + std::vector *m_bytearray; std::string *m_stdstring; } m_var; @@ -1558,6 +1598,7 @@ template<> inline __int128 Variant::to<__int128> () const template<> inline double Variant::to () const { return to_double (); } template<> inline float Variant::to () const { return to_float (); } template<> inline std::string Variant::to () const { return to_stdstring (); } +template<> inline std::vector Variant::to > () const { return to_bytearray (); } #if defined(HAVE_QT) template<> inline QString Variant::to () const { return to_qstring (); } template<> inline QByteArray Variant::to () const { return to_qbytearray (); } @@ -1583,6 +1624,7 @@ template<> inline bool Variant::is<__int128> () const { return m_typ template<> inline bool Variant::is () const { return m_type == t_double; } template<> inline bool Variant::is () const { return m_type == t_float; } template<> inline bool Variant::is () const { return m_type == t_stdstring; } +template<> inline bool Variant::is > () const { return m_type == t_bytearray; } #if defined(HAVE_QT) template<> inline bool Variant::is () const { return m_type == t_qstring; } template<> inline bool Variant::is () const { return m_type == t_qbytearray; } @@ -1608,6 +1650,7 @@ template<> inline bool Variant::can_convert_to<__int128> () const { template<> inline bool Variant::can_convert_to () const { return can_convert_to_double (); } template<> inline bool Variant::can_convert_to () const { return can_convert_to_float (); } template<> inline bool Variant::can_convert_to () const { return true; } +template<> inline bool Variant::can_convert_to > () const { return true; } #if defined(HAVE_QT) template<> inline bool Variant::can_convert_to () const { return true; } template<> inline bool Variant::can_convert_to () const { return true; } diff --git a/testdata/pymod/import_QtCore.py b/testdata/pymod/import_QtCore.py index 8f12d5a8c..8780961b5 100755 --- a/testdata/pymod/import_QtCore.py +++ b/testdata/pymod/import_QtCore.py @@ -34,9 +34,9 @@ class BasicTest(unittest.TestCase): b = QtCore.QBuffer() b.setData("all you can eat") b.open(QtCore.QIODevice.ReadOnly) - self.assertEqual(b.read(3), "all") + self.assertEqual(b.read(3), b"all") b.read(1) - self.assertEqual(b.read(3), "you") + self.assertEqual(b.read(3), b"you") # run unit tests if __name__ == '__main__': diff --git a/testdata/pymod/import_QtNetwork.py b/testdata/pymod/import_QtNetwork.py index 1820f3c81..684adf4c2 100755 --- a/testdata/pymod/import_QtNetwork.py +++ b/testdata/pymod/import_QtNetwork.py @@ -31,7 +31,7 @@ class BasicTest(unittest.TestCase): def test_2(self): q = QtNetwork.QNetworkRequest() q.setRawHeader("abc", "xyz") - self.assertEqual(q.rawHeader("abc"), "xyz") + self.assertEqual(q.rawHeader("abc"), b"xyz") # run unit tests if __name__ == '__main__': diff --git a/testdata/python/basic.py b/testdata/python/basic.py index fc7a444bf..f078d093f 100644 --- a/testdata/python/basic.py +++ b/testdata/python/basic.py @@ -2837,6 +2837,36 @@ class BasicTest(unittest.TestCase): self.assertEqual(sc.got_s0a, 0) self.assertEqual(sc.got_s0b, 0) + def test_74(self): + + # binary strings + + qba = pya.A.ia_cref_to_qba([ 17, 42, 0, 8 ]) + self.assertEqual(repr(qba), "b'\\x11*\\x00\\x08'") + self.assertEqual(pya.A.qba_to_ia(qba), [ 17, 42, 0, 8 ]) + self.assertEqual(pya.A.qba_cref_to_ia(qba), [ 17, 42, 0, 8 ]) + self.assertEqual(pya.A.qba_cptr_to_ia(qba), [ 17, 42, 0, 8 ]) + self.assertEqual(pya.A.qba_ref_to_ia(qba), [ 17, 42, 0, 8 ]) + self.assertEqual(pya.A.qba_ptr_to_ia(qba), [ 17, 42, 0, 8 ]) + + qba = pya.A.ia_cref_to_qba_cref([ 17, 42, 0, 8 ]) + self.assertEqual(repr(qba), "b'\\x11*\\x00\\x08'") + + self.assertEqual(pya.A.qba_to_ia(b'\x00\x01\x02'), [ 0, 1, 2 ]) + + ba = pya.A.ia_cref_to_ba([ 17, 42, 0, 8 ]) + self.assertEqual(repr(ba), "b'\\x11*\\x00\\x08'") + self.assertEqual(pya.A.ba_to_ia(ba), [ 17, 42, 0, 8 ]) + self.assertEqual(pya.A.ba_cref_to_ia(ba), [ 17, 42, 0, 8 ]) + self.assertEqual(pya.A.ba_cptr_to_ia(ba), [ 17, 42, 0, 8 ]) + self.assertEqual(pya.A.ba_ref_to_ia(ba), [ 17, 42, 0, 8 ]) + self.assertEqual(pya.A.ba_ptr_to_ia(ba), [ 17, 42, 0, 8 ]) + + ba = pya.A.ia_cref_to_ba_cref([ 17, 42, 0, 8 ]) + self.assertEqual(repr(ba), "b'\\x11*\\x00\\x08'") + + self.assertEqual(pya.A.ba_to_ia(b'\x00\x01\x02'), [ 0, 1, 2 ]) + # Custom factory implemented in Python def test_80(self): gc = pya.GObject.g_inst_count() diff --git a/testdata/python/qtbinding.py b/testdata/python/qtbinding.py index 42b5eee56..0a7cfcfc5 100644 --- a/testdata/python/qtbinding.py +++ b/testdata/python/qtbinding.py @@ -487,12 +487,12 @@ class QtBindingTest(unittest.TestCase): slm = MyStandardItemModel() rn = slm.roleNames() - self.assertEqual(map2str(rn), "{0: display, 1: decoration, 2: edit, 3: toolTip, 4: statusTip, 5: whatsThis}") + self.assertEqual(map2str(rn), "{0: b'display', 1: b'decoration', 2: b'edit', 3: b'toolTip', 4: b'statusTip', 5: b'whatsThis'}") rnNew = slm.roleNames() rnNew[7] = "blabla" slm.srn(rnNew) rn = slm.roleNames() - self.assertEqual(map2str(rn), "{0: display, 1: decoration, 2: edit, 3: toolTip, 4: statusTip, 5: whatsThis, 7: blabla}") + self.assertEqual(map2str(rn), "{0: b'display', 1: b'decoration', 2: b'edit', 3: b'toolTip', 4: b'statusTip', 5: b'whatsThis', 7: b'blabla'}") def test_44(self): @@ -586,6 +586,43 @@ class QtBindingTest(unittest.TestCase): b.emit_clicked(False) self.assertEqual(trigger_log, "+-xx") + def test_51(self): + + # issue #707 (QJsonValue constructor ambiguous) + if "QJsonValue" in pya.__dict__: + + v = pya.QJsonValue("hello") + self.assertEqual(v.toString(), "hello") + self.assertEqual(v.toVariant(), "hello") + self.assertEqual(v.toInt(), 0) + + v = pya.QJsonValue(17) + self.assertEqual(v.toString(), "") + self.assertEqual(v.toVariant(), 17) + self.assertEqual(v.toInt(), 17) + + v = pya.QJsonValue(2.5) + self.assertEqual(v.toString(), "") + self.assertEqual(v.toVariant(), 2.5) + self.assertEqual(v.toDouble(), 2.5) + + v = pya.QJsonValue(True) + self.assertEqual(v.toString(), "") + self.assertEqual(v.toVariant(), True) + self.assertEqual(v.toBool(), True) + + def test_52(self): + + # issue #708 (Image serialization to QByteArray) + img = pya.QImage(10, 10, pya.QImage.Format_Mono) + img.fill(0) + + buf = pya.QBuffer() + img.save(buf, "PNG") + + self.assertEqual(len(buf.data) > 100, True) + self.assertEqual(buf.data[0:8], b'\x89PNG\r\n\x1a\n') + # run unit tests if __name__ == '__main__': diff --git a/testdata/ruby/basic_testcore.rb b/testdata/ruby/basic_testcore.rb index 92fb8de4c..f800503d2 100644 --- a/testdata/ruby/basic_testcore.rb +++ b/testdata/ruby/basic_testcore.rb @@ -2778,6 +2778,38 @@ class Basic_TestClass < TestBase end + def test_74 + + # binary strings + + qba = RBA::A::ia_cref_to_qba([ 17, 42, 0, 8 ]) + assert_equal(qba.inspect, "\"\\x11*\\x00\\b\"") + assert_equal(RBA::A::qba_to_ia(qba), [ 17, 42, 0, 8 ]) + assert_equal(RBA::A::qba_cref_to_ia(qba), [ 17, 42, 0, 8 ]) + assert_equal(RBA::A::qba_cptr_to_ia(qba), [ 17, 42, 0, 8 ]) + assert_equal(RBA::A::qba_ref_to_ia(qba), [ 17, 42, 0, 8 ]) + assert_equal(RBA::A::qba_ptr_to_ia(qba), [ 17, 42, 0, 8 ]) + + qba = RBA::A::ia_cref_to_qba_cref([ 17, 42, 0, 8 ]) + assert_equal(qba.inspect, "\"\\x11*\\x00\\b\"") + + assert_equal(RBA::A::qba_to_ia("\x00\x01\x02"), [ 0, 1, 2 ]) + + ba = RBA::A::ia_cref_to_ba([ 17, 42, 0, 8 ]) + assert_equal(ba.inspect, "\"\\x11*\\x00\\b\"") + assert_equal(RBA::A::ba_to_ia(ba), [ 17, 42, 0, 8 ]) + assert_equal(RBA::A::ba_cref_to_ia(ba), [ 17, 42, 0, 8 ]) + assert_equal(RBA::A::ba_cptr_to_ia(ba), [ 17, 42, 0, 8 ]) + assert_equal(RBA::A::ba_ref_to_ia(ba), [ 17, 42, 0, 8 ]) + assert_equal(RBA::A::ba_ptr_to_ia(ba), [ 17, 42, 0, 8 ]) + + ba = RBA::A::ia_cref_to_ba_cref([ 17, 42, 0, 8 ]) + assert_equal(ba.inspect, "\"\\x11*\\x00\\b\"") + + assert_equal(RBA::A::ba_to_ia("\x00\x01\x02"), [ 0, 1, 2 ]) + + end + # Custom factory implemented in Ruby def test_80 diff --git a/testdata/ruby/qtbinding.rb b/testdata/ruby/qtbinding.rb index d714835c0..dfd4ecac3 100644 --- a/testdata/ruby/qtbinding.rb +++ b/testdata/ruby/qtbinding.rb @@ -701,6 +701,49 @@ class QtBinding_TestClass < TestBase end + def test_51 + + # issue #707 (QJsonValue constructor ambiguous) + if RBA.const_defined?("QJsonValue") + + v = RBA::QJsonValue::new("hello") + assert_equal(v.toString, "hello") + assert_equal(v.toVariant, "hello") + assert_equal(v.toInt, 0) + + v = RBA::QJsonValue::new(17) + assert_equal(v.toString, "") + assert_equal(v.toVariant, 17) + assert_equal(v.toInt, 17) + + v = RBA::QJsonValue::new(2.5) + assert_equal(v.toString, "") + assert_equal(v.toVariant, 2.5) + assert_equal(v.toDouble, 2.5) + + v = RBA::QJsonValue::new(true) + assert_equal(v.toString, "") + assert_equal(v.toVariant, true) + assert_equal(v.toBool, true) + + end + + end + + def test_52 + + # issue #708 (Image serialization to QByteArray) + img = RBA::QImage::new(10, 10, RBA::QImage::Format_Mono) + img.fill(0) + + buf = RBA::QBuffer::new + img.save(buf, "PNG") + + assert_equal(buf.data.size > 100, true) + assert_equal(buf.data[0..7].inspect, "\"\\x89PNG\\r\\n\\x1A\\n\"") + + end + end load("test_epilogue.rb")