2024-08-25 04:08:24 +00:00
# include <QCommandLineOption>
# include <QList>
# include <QString>
2024-08-29 07:01:51 +00:00
# include <QByteArray>
# include <cstring>
# include "qcommandlineoption.h"
# include "gen_qcommandlineoption.h"
2024-09-14 22:29:05 +00:00
# include "_cgo_export.h"
2024-08-25 04:08:24 +00:00
2024-09-14 22:29:05 +00:00
QCommandLineOption * QCommandLineOption_new ( struct miqt_string * name ) {
QString name_QString = QString : : fromUtf8 ( & name - > data , name - > len ) ;
2024-08-25 04:08:24 +00:00
return new QCommandLineOption ( name_QString ) ;
}
2024-09-16 07:33:40 +00:00
QCommandLineOption * QCommandLineOption_new2 ( struct miqt_array * /* of struct miqt_string* */ names ) {
2024-08-25 04:08:24 +00:00
QList < QString > names_QList ;
2024-09-14 22:29:05 +00:00
names_QList . reserve ( names - > len ) ;
2024-09-17 07:43:35 +00:00
struct miqt_string * * names_arr = static_cast < struct miqt_string * * > ( names - > data ) ;
2024-09-14 22:29:05 +00:00
for ( size_t i = 0 ; i < names - > len ; + + i ) {
2024-09-17 07:43:35 +00:00
QString names_arr_i_QString = QString : : fromUtf8 ( & names_arr [ i ] - > data , names_arr [ i ] - > len ) ;
names_QList . push_back ( names_arr_i_QString ) ;
2024-08-25 04:08:24 +00:00
}
return new QCommandLineOption ( names_QList ) ;
}
2024-09-14 22:29:05 +00:00
QCommandLineOption * QCommandLineOption_new3 ( struct miqt_string * name , struct miqt_string * description ) {
QString name_QString = QString : : fromUtf8 ( & name - > data , name - > len ) ;
QString description_QString = QString : : fromUtf8 ( & description - > data , description - > len ) ;
2024-08-25 04:08:24 +00:00
return new QCommandLineOption ( name_QString , description_QString ) ;
}
2024-09-16 07:33:40 +00:00
QCommandLineOption * QCommandLineOption_new4 ( struct miqt_array * /* of struct miqt_string* */ names , struct miqt_string * description ) {
2024-08-25 04:08:24 +00:00
QList < QString > names_QList ;
2024-09-14 22:29:05 +00:00
names_QList . reserve ( names - > len ) ;
2024-09-17 07:43:35 +00:00
struct miqt_string * * names_arr = static_cast < struct miqt_string * * > ( names - > data ) ;
2024-09-14 22:29:05 +00:00
for ( size_t i = 0 ; i < names - > len ; + + i ) {
2024-09-17 07:43:35 +00:00
QString names_arr_i_QString = QString : : fromUtf8 ( & names_arr [ i ] - > data , names_arr [ i ] - > len ) ;
names_QList . push_back ( names_arr_i_QString ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-14 22:29:05 +00:00
QString description_QString = QString : : fromUtf8 ( & description - > data , description - > len ) ;
2024-08-25 04:08:24 +00:00
return new QCommandLineOption ( names_QList , description_QString ) ;
}
QCommandLineOption * QCommandLineOption_new5 ( QCommandLineOption * other ) {
return new QCommandLineOption ( * other ) ;
}
2024-09-14 22:29:05 +00:00
QCommandLineOption * QCommandLineOption_new6 ( struct miqt_string * name , struct miqt_string * description , struct miqt_string * valueName ) {
QString name_QString = QString : : fromUtf8 ( & name - > data , name - > len ) ;
QString description_QString = QString : : fromUtf8 ( & description - > data , description - > len ) ;
QString valueName_QString = QString : : fromUtf8 ( & valueName - > data , valueName - > len ) ;
2024-08-25 04:08:24 +00:00
return new QCommandLineOption ( name_QString , description_QString , valueName_QString ) ;
}
2024-09-14 22:29:05 +00:00
QCommandLineOption * QCommandLineOption_new7 ( struct miqt_string * name , struct miqt_string * description , struct miqt_string * valueName , struct miqt_string * defaultValue ) {
QString name_QString = QString : : fromUtf8 ( & name - > data , name - > len ) ;
QString description_QString = QString : : fromUtf8 ( & description - > data , description - > len ) ;
QString valueName_QString = QString : : fromUtf8 ( & valueName - > data , valueName - > len ) ;
QString defaultValue_QString = QString : : fromUtf8 ( & defaultValue - > data , defaultValue - > len ) ;
2024-08-25 04:08:24 +00:00
return new QCommandLineOption ( name_QString , description_QString , valueName_QString , defaultValue_QString ) ;
}
2024-09-16 07:33:40 +00:00
QCommandLineOption * QCommandLineOption_new8 ( struct miqt_array * /* of struct miqt_string* */ names , struct miqt_string * description , struct miqt_string * valueName ) {
2024-08-25 04:08:24 +00:00
QList < QString > names_QList ;
2024-09-14 22:29:05 +00:00
names_QList . reserve ( names - > len ) ;
2024-09-17 07:43:35 +00:00
struct miqt_string * * names_arr = static_cast < struct miqt_string * * > ( names - > data ) ;
2024-09-14 22:29:05 +00:00
for ( size_t i = 0 ; i < names - > len ; + + i ) {
2024-09-17 07:43:35 +00:00
QString names_arr_i_QString = QString : : fromUtf8 ( & names_arr [ i ] - > data , names_arr [ i ] - > len ) ;
names_QList . push_back ( names_arr_i_QString ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-14 22:29:05 +00:00
QString description_QString = QString : : fromUtf8 ( & description - > data , description - > len ) ;
QString valueName_QString = QString : : fromUtf8 ( & valueName - > data , valueName - > len ) ;
2024-08-25 04:08:24 +00:00
return new QCommandLineOption ( names_QList , description_QString , valueName_QString ) ;
}
2024-09-16 07:33:40 +00:00
QCommandLineOption * QCommandLineOption_new9 ( struct miqt_array * /* of struct miqt_string* */ names , struct miqt_string * description , struct miqt_string * valueName , struct miqt_string * defaultValue ) {
2024-08-25 04:08:24 +00:00
QList < QString > names_QList ;
2024-09-14 22:29:05 +00:00
names_QList . reserve ( names - > len ) ;
2024-09-17 07:43:35 +00:00
struct miqt_string * * names_arr = static_cast < struct miqt_string * * > ( names - > data ) ;
2024-09-14 22:29:05 +00:00
for ( size_t i = 0 ; i < names - > len ; + + i ) {
2024-09-17 07:43:35 +00:00
QString names_arr_i_QString = QString : : fromUtf8 ( & names_arr [ i ] - > data , names_arr [ i ] - > len ) ;
names_QList . push_back ( names_arr_i_QString ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-14 22:29:05 +00:00
QString description_QString = QString : : fromUtf8 ( & description - > data , description - > len ) ;
QString valueName_QString = QString : : fromUtf8 ( & valueName - > data , valueName - > len ) ;
QString defaultValue_QString = QString : : fromUtf8 ( & defaultValue - > data , defaultValue - > len ) ;
2024-08-25 04:08:24 +00:00
return new QCommandLineOption ( names_QList , description_QString , valueName_QString , defaultValue_QString ) ;
}
void QCommandLineOption_OperatorAssign ( QCommandLineOption * self , QCommandLineOption * other ) {
self - > operator = ( * other ) ;
}
void QCommandLineOption_Swap ( QCommandLineOption * self , QCommandLineOption * other ) {
self - > swap ( * other ) ;
}
2024-09-14 22:29:05 +00:00
struct miqt_array * QCommandLineOption_Names ( const QCommandLineOption * self ) {
QStringList _ret = self - > names ( ) ;
2024-09-17 06:29:11 +00:00
// Convert QList<> from C++ memory to manually-managed C memory
2024-09-14 22:29:05 +00:00
struct miqt_string * * _arr = static_cast < struct miqt_string * * > ( malloc ( sizeof ( struct miqt_string * ) * _ret . length ( ) ) ) ;
for ( size_t i = 0 , e = _ret . length ( ) ; i < e ; + + i ) {
QString _lv_ret = _ret [ i ] ;
2024-08-25 04:08:24 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
2024-09-14 22:29:05 +00:00
QByteArray _lv_b = _lv_ret . toUtf8 ( ) ;
_arr [ i ] = miqt_strdup ( _lv_b . data ( ) , _lv_b . length ( ) ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-14 22:29:05 +00:00
struct miqt_array * _out = static_cast < struct miqt_array * > ( malloc ( sizeof ( struct miqt_array ) ) ) ;
_out - > len = _ret . length ( ) ;
_out - > data = static_cast < void * > ( _arr ) ;
return _out ;
2024-08-25 04:08:24 +00:00
}
2024-09-14 22:29:05 +00:00
void QCommandLineOption_SetValueName ( QCommandLineOption * self , struct miqt_string * name ) {
QString name_QString = QString : : fromUtf8 ( & name - > data , name - > len ) ;
2024-08-25 04:08:24 +00:00
self - > setValueName ( name_QString ) ;
}
2024-09-14 22:29:05 +00:00
struct miqt_string * QCommandLineOption_ValueName ( const QCommandLineOption * self ) {
QString _ret = self - > valueName ( ) ;
2024-08-25 04:08:24 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
2024-09-14 22:29:05 +00:00
QByteArray _b = _ret . toUtf8 ( ) ;
return miqt_strdup ( _b . data ( ) , _b . length ( ) ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-14 22:29:05 +00:00
void QCommandLineOption_SetDescription ( QCommandLineOption * self , struct miqt_string * description ) {
QString description_QString = QString : : fromUtf8 ( & description - > data , description - > len ) ;
2024-08-25 04:08:24 +00:00
self - > setDescription ( description_QString ) ;
}
2024-09-14 22:29:05 +00:00
struct miqt_string * QCommandLineOption_Description ( const QCommandLineOption * self ) {
QString _ret = self - > description ( ) ;
2024-08-25 04:08:24 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
2024-09-14 22:29:05 +00:00
QByteArray _b = _ret . toUtf8 ( ) ;
return miqt_strdup ( _b . data ( ) , _b . length ( ) ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-14 22:29:05 +00:00
void QCommandLineOption_SetDefaultValue ( QCommandLineOption * self , struct miqt_string * defaultValue ) {
QString defaultValue_QString = QString : : fromUtf8 ( & defaultValue - > data , defaultValue - > len ) ;
2024-08-25 04:08:24 +00:00
self - > setDefaultValue ( defaultValue_QString ) ;
}
2024-09-16 07:33:40 +00:00
void QCommandLineOption_SetDefaultValues ( QCommandLineOption * self , struct miqt_array * /* of struct miqt_string* */ defaultValues ) {
2024-08-25 04:08:24 +00:00
QList < QString > defaultValues_QList ;
2024-09-14 22:29:05 +00:00
defaultValues_QList . reserve ( defaultValues - > len ) ;
2024-09-17 07:43:35 +00:00
struct miqt_string * * defaultValues_arr = static_cast < struct miqt_string * * > ( defaultValues - > data ) ;
2024-09-14 22:29:05 +00:00
for ( size_t i = 0 ; i < defaultValues - > len ; + + i ) {
2024-09-17 07:43:35 +00:00
QString defaultValues_arr_i_QString = QString : : fromUtf8 ( & defaultValues_arr [ i ] - > data , defaultValues_arr [ i ] - > len ) ;
defaultValues_QList . push_back ( defaultValues_arr_i_QString ) ;
2024-08-25 04:08:24 +00:00
}
self - > setDefaultValues ( defaultValues_QList ) ;
}
2024-09-14 22:29:05 +00:00
struct miqt_array * QCommandLineOption_DefaultValues ( const QCommandLineOption * self ) {
QStringList _ret = self - > defaultValues ( ) ;
2024-09-17 06:29:11 +00:00
// Convert QList<> from C++ memory to manually-managed C memory
2024-09-14 22:29:05 +00:00
struct miqt_string * * _arr = static_cast < struct miqt_string * * > ( malloc ( sizeof ( struct miqt_string * ) * _ret . length ( ) ) ) ;
for ( size_t i = 0 , e = _ret . length ( ) ; i < e ; + + i ) {
QString _lv_ret = _ret [ i ] ;
2024-08-25 04:08:24 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
2024-09-14 22:29:05 +00:00
QByteArray _lv_b = _lv_ret . toUtf8 ( ) ;
_arr [ i ] = miqt_strdup ( _lv_b . data ( ) , _lv_b . length ( ) ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-14 22:29:05 +00:00
struct miqt_array * _out = static_cast < struct miqt_array * > ( malloc ( sizeof ( struct miqt_array ) ) ) ;
_out - > len = _ret . length ( ) ;
_out - > data = static_cast < void * > ( _arr ) ;
return _out ;
2024-08-25 04:08:24 +00:00
}
2024-09-11 05:41:09 +00:00
int QCommandLineOption_Flags ( const QCommandLineOption * self ) {
2024-09-14 22:29:05 +00:00
QCommandLineOption : : Flags _ret = self - > flags ( ) ;
return static_cast < int > ( _ret ) ;
2024-08-29 07:01:51 +00:00
}
void QCommandLineOption_SetFlags ( QCommandLineOption * self , int aflags ) {
self - > setFlags ( static_cast < QCommandLineOption : : Flags > ( aflags ) ) ;
}
2024-08-25 04:08:24 +00:00
void QCommandLineOption_SetHidden ( QCommandLineOption * self , bool hidden ) {
self - > setHidden ( hidden ) ;
}
2024-09-11 05:41:09 +00:00
bool QCommandLineOption_IsHidden ( const QCommandLineOption * self ) {
return self - > isHidden ( ) ;
2024-08-25 04:08:24 +00:00
}
void QCommandLineOption_Delete ( QCommandLineOption * self ) {
delete self ;
}