io.qt.core.QStringConverter Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
import io.qt.*;
/**
* 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
*/
@QtRejectedEntries({"LastEncoding"})
public enum Encoding implements QtEnumerator {
/**
* Representing QStringConverter:: Utf8
*/
Utf8(0),
/**
* Representing QStringConverter:: Utf16
*/
Utf16(1),
/**
* Representing QStringConverter:: Utf16LE
*/
Utf16LE(2),
/**
* Representing QStringConverter:: Utf16BE
*/
Utf16BE(3),
/**
* Representing QStringConverter:: Utf32
*/
Utf32(4),
/**
* Representing QStringConverter:: Utf32LE
*/
Utf32LE(5),
/**
* Representing QStringConverter:: Utf32BE
*/
Utf32BE(6),
/**
* Representing QStringConverter:: Latin1
*/
Latin1(7),
/**
* Representing QStringConverter:: System
*/
System(8),
/**
* Representing QStringConverter:: LastEncoding
*/
LastEncoding(8);
static {
QtJambi_LibraryUtilities.initialize();
}
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 @NonNull 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 QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* See QStringConverter:: QStringConverter()
*/
protected QStringConverter(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QStringConverter instance);
/**
* See QStringConverter:: QStringConverter(QStringConverter::Encoding, QStringConverterBase::Flags)
*/
protected QStringConverter(io.qt.core.QStringConverter.@NonNull Encoding encoding, io.qt.core.QStringConverterBase.@NonNull 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);
/**
* See QStringConverter:: QStringConverter(const char*, QStringConverterBase::Flags)
*/
protected QStringConverter(java.lang.@Nullable String name, io.qt.core.QStringConverterBase.@NonNull 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
*/
@QtUninvokable
public final boolean hasError(){
return hasError_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean hasError_native_constfct(long __this__nativeId);
/**
* See QStringConverter:: isValid()const
*/
@QtUninvokable
public final boolean isValid(){
return isValid_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isValid_native_constfct(long __this__nativeId);
/**
* See QStringConverter:: name()const
*/
@QtUninvokable
public final java.lang.@Nullable String name(){
return name_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String name_native_constfct(long __this__nativeId);
/**
* See QStringConverter:: resetState()
*/
@QtUninvokable
public final void resetState(){
resetState_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void resetState_native(long __this__nativeId);
/**
* See QStringConverter:: encodingForData(QByteArrayView, char16_t)
*/
public static java.util.@NonNull Optional encodingForData(io.qt.core.@NonNull 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.@NonNull Optional encodingForHtml(io.qt.core.@NonNull 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.@NonNull Optional encodingForName(java.lang.@Nullable String name);
/**
* See QStringConverter:: nameForEncoding(QStringConverter::Encoding)
*/
public static java.lang.@Nullable String nameForEncoding(io.qt.core.QStringConverter.@NonNull Encoding e){
return nameForEncoding_native_QStringConverter_Encoding(e.value());
}
private native static java.lang.String nameForEncoding_native_QStringConverter_Encoding(int e);
/**
* See QStringConverter:: state
*/
@QtUninvokable
protected final io.qt.core.QStringConverterBase.@NonNull State state(){
return state_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QStringConverterBase.State state_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QStringConverter(QPrivateConstructor p) { super(p); }
/**
* Overloaded constructor for {@link #QStringConverter(io.qt.core.QStringConverter.Encoding, io.qt.core.QStringConverterBase.Flags)}.
*/
protected QStringConverter(io.qt.core.QStringConverter.@NonNull Encoding encoding, io.qt.core.QStringConverterBase.@NonNull Flag @NonNull... f) {
this(encoding, new io.qt.core.QStringConverterBase.Flags(f));
}
/**
* Overloaded constructor for {@link #QStringConverter(java.lang.String, io.qt.core.QStringConverterBase.Flags)}.
*/
protected QStringConverter(java.lang.@Nullable String name, io.qt.core.QStringConverterBase.@NonNull Flag @NonNull... f) {
this(name, new io.qt.core.QStringConverterBase.Flags(f));
}
/**
* Overloaded function for {@link #encodingForData(io.qt.core.QByteArrayView, char)}
* with expectedFirstCharacter = 0
.
*/
public static java.util.@NonNull Optional encodingForData(io.qt.core.@NonNull QByteArrayView data) {
return encodingForData(data, (char)0);
}
/**
* Overloaded function for {@link #encodingForData(io.qt.core.QByteArray, char)}
* with expectedFirstCharacter = 0
.
*/
public static java.util.@NonNull Optional encodingForData(io.qt.core.@NonNull QByteArray data) {
return encodingForData(data, (char)0);
}
/**
* Overloaded function for {@link #encodingForData(io.qt.core.QByteArrayView, char)}.
*/
public static java.util.@NonNull Optional encodingForData(io.qt.core.@NonNull QByteArray data, char expectedFirstCharacter) {
return encodingForData(new io.qt.core.QByteArrayView(data), expectedFirstCharacter);
}
/**
* Overloaded function for {@link #encodingForData(java.nio.ByteBuffer, char)}
* with expectedFirstCharacter = 0
.
*/
public static java.util.@NonNull Optional encodingForData(java.nio.@NonNull ByteBuffer data) {
return encodingForData(data, (char)0);
}
/**
* Overloaded function for {@link #encodingForData(io.qt.core.QByteArrayView, char)}.
*/
public static java.util.@NonNull Optional encodingForData(java.nio.@NonNull ByteBuffer data, char expectedFirstCharacter) {
return encodingForData(new io.qt.core.QByteArrayView(data), expectedFirstCharacter);
}
/**
* Overloaded function for {@link #encodingForData(byte[], char)}
* with expectedFirstCharacter = 0
.
*/
public static java.util.@NonNull Optional encodingForData(byte @NonNull[] data) {
return encodingForData(data, (char)0);
}
/**
* Overloaded function for {@link #encodingForData(io.qt.core.QByteArrayView, char)}.
*/
public static java.util.@NonNull Optional encodingForData(byte @NonNull[] data, char expectedFirstCharacter) {
return encodingForData(new io.qt.core.QByteArrayView(data), expectedFirstCharacter);
}
/**
* Overloaded function for {@link #encodingForData(java.lang.String, char)}
* with expectedFirstCharacter = 0
.
*/
public static java.util.@NonNull Optional encodingForData(java.lang.@NonNull String data) {
return encodingForData(data, (char)0);
}
/**
* Overloaded function for {@link #encodingForData(io.qt.core.QByteArrayView, char)}.
*/
public static java.util.@NonNull Optional encodingForData(java.lang.@NonNull String data, char expectedFirstCharacter) {
return encodingForData(new io.qt.core.QByteArrayView(data), expectedFirstCharacter);
}
/**
* Overloaded function for {@link #encodingForHtml(io.qt.core.QByteArrayView)}.
*/
public static java.util.@NonNull Optional encodingForHtml(io.qt.core.@NonNull QByteArray data) {
return encodingForHtml(new io.qt.core.QByteArrayView(data));
}
/**
* Overloaded function for {@link #encodingForHtml(io.qt.core.QByteArrayView)}.
*/
public static java.util.@NonNull Optional encodingForHtml(java.nio.@NonNull ByteBuffer data) {
return encodingForHtml(new io.qt.core.QByteArrayView(data));
}
/**
* Overloaded function for {@link #encodingForHtml(io.qt.core.QByteArrayView)}.
*/
public static java.util.@NonNull Optional encodingForHtml(byte @NonNull[] data) {
return encodingForHtml(new io.qt.core.QByteArrayView(data));
}
/**
* Overloaded function for {@link #encodingForHtml(io.qt.core.QByteArrayView)}.
*/
public static java.util.@NonNull Optional encodingForHtml(java.lang.@NonNull String data) {
return encodingForHtml(new io.qt.core.QByteArrayView(data));
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #state()} instead.
*/
@QtUninvokable
protected final io.qt.core.QStringConverterBase.@NonNull State getState() {
return state();
}
}