JNI: remove compatibility alias for CTString
Add compile-time testing to make sure that we can declare a JNI class String that maps to java/lang/String. Change-Id: I2b68b2b46112e56b279f3fcddc3d71847a005924 Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io> Reviewed-by: Zoltan Gera <zoltan.gera@qt.io> Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
This commit is contained in:
parent
74b67c8f84
commit
281f499b20
@ -131,10 +131,6 @@ struct CTString
|
||||
}
|
||||
};
|
||||
|
||||
// compatibility alias until submodules are ported
|
||||
template<size_t N_WITH_NULL, typename BaseType = char>
|
||||
using String = CTString<N_WITH_NULL, BaseType>;
|
||||
|
||||
// Helper types that allow us to disable variadic overloads that would conflict
|
||||
// with overloads that take a const char*.
|
||||
template<typename T, size_t N = 0> struct IsStringType : std::false_type {};
|
||||
|
@ -56,6 +56,12 @@ static_assert(QtJniTypes::Traits<QtJniTypes::JavaType>::signature() == "Lorg/qtp
|
||||
Q_DECLARE_JNI_TYPE(ArrayType, "[Lorg/qtproject/qt/ArrayType;")
|
||||
static_assert(QtJniTypes::Traits<QtJniTypes::ArrayType>::signature() == "[Lorg/qtproject/qt/ArrayType;");
|
||||
|
||||
Q_DECLARE_JNI_CLASS(String, "java/lang/String");
|
||||
static_assert(QtJniTypes::Traits<jstring>::className() == "java/lang/String");
|
||||
static_assert(QtJniTypes::Traits<QtJniTypes::String>::className() == "java/lang/String");
|
||||
static_assert(QtJniTypes::Traits<QtJniTypes::String>::signature() == "Ljava/lang/String;");
|
||||
static_assert(QtJniTypes::Traits<QtJniTypes::String[]>::signature() == "[Ljava/lang/String;");
|
||||
|
||||
Q_DECLARE_JNI_CLASS(QtTextToSpeech, "org/qtproject/qt/android/speech/QtTextToSpeech")
|
||||
static_assert(QtJniTypes::Traits<QtJniTypes::QtTextToSpeech>::className() == "org/qtproject/qt/android/speech/QtTextToSpeech");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user