io.qt.core.QStringConverter Maven / Gradle / Ivy
package io.qt.core;
/**
* Base class for encoding and decoding text
* Java wrapper for Qt class QStringConverter
*/
public class QStringConverter extends io.qt.core.QStringConverterBase
{
/**
* Java wrapper for Qt enum QStringConverter::Encoding
*/
@io.qt.QtRejectedEntries({"LastEncoding"})
public enum Encoding implements io.qt.QtEnumerator {
Utf8(0),
Utf16(1),
Utf16LE(2),
Utf16BE(3),
Utf32(4),
Utf32LE(5),
Utf32BE(6),
Latin1(7),
System(8),
LastEncoding(8);
private Encoding(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static Encoding resolve(int value) {
switch (value) {
case 0: return Utf8;
case 1: return Utf16;
case 2: return Utf16LE;
case 3: return Utf16BE;
case 4: return Utf32;
case 5: return Utf32LE;
case 6: return Utf32BE;
case 7: return Latin1;
case 8: return System;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
protected QStringConverter(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QStringConverter instance);
/**
* Overloaded constructor for {@link #QStringConverter(io.qt.core.QStringConverter.Encoding, io.qt.core.QStringConverterBase.Flags)}.
*/
protected QStringConverter(io.qt.core.QStringConverter.Encoding encoding, io.qt.core.QStringConverterBase.Flag ... f){
this(encoding, new io.qt.core.QStringConverterBase.Flags(f));
}
protected QStringConverter(io.qt.core.QStringConverter.Encoding encoding, io.qt.core.QStringConverterBase.Flags f){
super((QPrivateConstructor)null);
initialize_native(this, encoding, f);
}
private native static void initialize_native(QStringConverter instance, io.qt.core.QStringConverter.Encoding encoding, io.qt.core.QStringConverterBase.Flags f);
/**
* Overloaded constructor for {@link #QStringConverter(java.lang.String, io.qt.core.QStringConverterBase.Flags)}.
*/
protected QStringConverter(java.lang.String name, io.qt.core.QStringConverterBase.Flag ... f){
this(name, new io.qt.core.QStringConverterBase.Flags(f));
}
protected QStringConverter(java.lang.String name, io.qt.core.QStringConverterBase.Flags f){
super((QPrivateConstructor)null);
initialize_native(this, name, f);
}
private native static void initialize_native(QStringConverter instance, java.lang.String name, io.qt.core.QStringConverterBase.Flags f);
/**
* See QStringConverter::hasError()const
*/
@io.qt.QtUninvokable
public final boolean hasError(){
return hasError_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean hasError_native_constfct(long __this__nativeId);
/**
* See QStringConverter::isValid()const
*/
@io.qt.QtUninvokable
public final boolean isValid(){
return isValid_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean isValid_native_constfct(long __this__nativeId);
/**
* See QStringConverter::name()const
*/
@io.qt.QtUninvokable
public final java.lang.String name(){
return name_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native java.lang.String name_native_constfct(long __this__nativeId);
/**
* See QStringConverter::resetState()
*/
@io.qt.QtUninvokable
public final void resetState(){
resetState_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native void resetState_native(long __this__nativeId);
/**
* Overloaded function for {@link #encodingForData(io.qt.core.QByteArrayView, char)}
* with expectedFirstCharacter = 0
.
*/
public static java.util.Optional encodingForData(io.qt.core.QByteArrayView data) {
return encodingForData(data, (char)0);
}
/**
* See QStringConverter::encodingForData(QByteArrayView,char16_t)
*/
public static java.util.Optional encodingForData(io.qt.core.QByteArrayView data, char expectedFirstCharacter){
return encodingForData_native_QByteArrayView_char16_t(QtJambi_LibraryUtilities.internal.checkedNativeId(data), expectedFirstCharacter);
}
private native static java.util.Optional encodingForData_native_QByteArrayView_char16_t(long data, char expectedFirstCharacter);
/**
* See QStringConverter::encodingForHtml(QByteArrayView)
*/
public static java.util.Optional encodingForHtml(io.qt.core.QByteArrayView data){
return encodingForHtml_native_QByteArrayView(QtJambi_LibraryUtilities.internal.checkedNativeId(data));
}
private native static java.util.Optional encodingForHtml_native_QByteArrayView(long data);
/**
* See QStringConverter::encodingForName(const char*)
*/
public native static java.util.Optional encodingForName(java.lang.String name);
/**
* See QStringConverter::nameForEncoding(QStringConverter::Encoding)
*/
public static java.lang.String nameForEncoding(io.qt.core.QStringConverter.Encoding e){
return nameForEncoding_native_QStringConverter_Encoding(e.value());
}
private native static java.lang.String nameForEncoding_native_QStringConverter_Encoding(int e);
@io.qt.QtUninvokable
protected final io.qt.core.QStringConverterBase.State state(){
return state_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.core.QStringConverterBase.State state_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
*/
@io.qt.NativeAccess
protected QStringConverter(QPrivateConstructor p) { super(p); }
public static java.util.Optional encodingForHtml(io.qt.core.QByteArray data){
return encodingForHtml(new io.qt.core.QByteArrayView(data));
}
public static java.util.Optional encodingForData(io.qt.core.QByteArray data){
return encodingForData(new io.qt.core.QByteArrayView(data));
}
public static java.util.Optional encodingForData(io.qt.core.QByteArray data, char expectedFirstCharacter){
return encodingForData(new io.qt.core.QByteArrayView(data), expectedFirstCharacter);
}
public static java.util.Optional encodingForHtml(byte[] data){
return encodingForHtml(new io.qt.core.QByteArrayView(data));
}
public static java.util.Optional encodingForData(byte[] data){
return encodingForData(new io.qt.core.QByteArrayView(data));
}
public static java.util.Optional encodingForData(byte[] data, char expectedFirstCharacter){
return encodingForData(new io.qt.core.QByteArrayView(data), expectedFirstCharacter);
}
public static java.util.Optional encodingForHtml(String data){
return encodingForHtml(new io.qt.core.QByteArrayView(data));
}
public static java.util.Optional encodingForData(String data){
return encodingForData(new io.qt.core.QByteArrayView(data));
}
public static java.util.Optional encodingForData(String data, char expectedFirstCharacter){
return encodingForData(new io.qt.core.QByteArrayView(data), expectedFirstCharacter);
}
public static java.util.Optional encodingForHtml(java.nio.ByteBuffer data){
return encodingForHtml(new io.qt.core.QByteArrayView(data));
}
public static java.util.Optional encodingForData(java.nio.ByteBuffer data){
return encodingForData(new io.qt.core.QByteArrayView(data));
}
public static java.util.Optional encodingForData(java.nio.ByteBuffer data, char expectedFirstCharacter){
return encodingForData(new io.qt.core.QByteArrayView(data), expectedFirstCharacter);
}
}