2024-08-25 04:08:24 +00:00
# include <QByteArray>
# include <QList>
# include <QMetaObject>
# include <QObject>
# include <QProcess>
# include <QProcessEnvironment>
# include <QString>
2024-08-29 07:01:51 +00:00
# include <QByteArray>
# include <cstring>
2024-10-16 05:07:56 +00:00
# include <qprocess.h>
2024-08-29 07:01:51 +00:00
# include "gen_qprocess.h"
2024-09-14 22:29:05 +00:00
# include "_cgo_export.h"
2024-08-25 04:08:24 +00:00
QProcessEnvironment * QProcessEnvironment_new ( ) {
return new QProcessEnvironment ( ) ;
}
QProcessEnvironment * QProcessEnvironment_new2 ( QProcessEnvironment * other ) {
return new QProcessEnvironment ( * other ) ;
}
void QProcessEnvironment_OperatorAssign ( QProcessEnvironment * self , QProcessEnvironment * other ) {
self - > operator = ( * other ) ;
}
void QProcessEnvironment_Swap ( QProcessEnvironment * self , QProcessEnvironment * other ) {
self - > swap ( * other ) ;
}
2024-09-11 05:41:09 +00:00
bool QProcessEnvironment_OperatorEqual ( const QProcessEnvironment * self , QProcessEnvironment * other ) {
return self - > operator = = ( * other ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-11 05:41:09 +00:00
bool QProcessEnvironment_OperatorNotEqual ( const QProcessEnvironment * self , QProcessEnvironment * other ) {
return self - > operator ! = ( * other ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-11 05:41:09 +00:00
bool QProcessEnvironment_IsEmpty ( const QProcessEnvironment * self ) {
return self - > isEmpty ( ) ;
2024-08-25 04:08:24 +00:00
}
void QProcessEnvironment_Clear ( QProcessEnvironment * self ) {
self - > clear ( ) ;
}
2024-10-18 23:53:33 +00:00
bool QProcessEnvironment_Contains ( const QProcessEnvironment * self , struct miqt_string name ) {
QString name_QString = QString : : fromUtf8 ( name . data , name . len ) ;
2024-09-11 05:41:09 +00:00
return self - > contains ( name_QString ) ;
2024-08-25 04:08:24 +00:00
}
2024-10-18 23:53:33 +00:00
void QProcessEnvironment_Insert ( QProcessEnvironment * self , struct miqt_string name , struct miqt_string value ) {
QString name_QString = QString : : fromUtf8 ( name . data , name . len ) ;
QString value_QString = QString : : fromUtf8 ( value . data , value . len ) ;
2024-08-25 04:08:24 +00:00
self - > insert ( name_QString , value_QString ) ;
}
2024-10-18 23:53:33 +00:00
void QProcessEnvironment_Remove ( QProcessEnvironment * self , struct miqt_string name ) {
QString name_QString = QString : : fromUtf8 ( name . data , name . len ) ;
2024-08-25 04:08:24 +00:00
self - > remove ( name_QString ) ;
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcessEnvironment_Value ( const QProcessEnvironment * self , struct miqt_string name ) {
QString name_QString = QString : : fromUtf8 ( name . data , name . len ) ;
2024-09-14 22:29:05 +00:00
QString _ret = self - > value ( name_QString ) ;
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _ms ;
_ms . len = _b . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _b . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
2024-11-17 06:21:37 +00:00
struct miqt_array /* of struct miqt_string */ QProcessEnvironment_ToStringList ( const QProcessEnvironment * self ) {
2024-09-14 22:29:05 +00:00
QStringList _ret = self - > toStringList ( ) ;
2024-09-17 06:29:11 +00:00
// Convert QList<> from C++ memory to manually-managed C memory
2024-10-18 23:53:33 +00:00
struct miqt_string * _arr = static_cast < struct miqt_string * > ( malloc ( sizeof ( struct miqt_string ) * _ret . length ( ) ) ) ;
2024-09-14 22:29:05 +00:00
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _lv_ms ;
_lv_ms . len = _lv_b . length ( ) ;
_lv_ms . data = static_cast < char * > ( malloc ( _lv_ms . len ) ) ;
memcpy ( _lv_ms . data , _lv_b . data ( ) , _lv_ms . len ) ;
_arr [ i ] = _lv_ms ;
2024-08-25 04:08:24 +00:00
}
2024-11-04 07:18:27 +00:00
struct miqt_array _out ;
_out . len = _ret . length ( ) ;
_out . data = static_cast < void * > ( _arr ) ;
2024-09-14 22:29:05 +00:00
return _out ;
2024-08-25 04:08:24 +00:00
}
2024-11-17 06:21:37 +00:00
struct miqt_array /* of struct miqt_string */ QProcessEnvironment_Keys ( const QProcessEnvironment * self ) {
2024-09-14 22:29:05 +00:00
QStringList _ret = self - > keys ( ) ;
2024-09-17 06:29:11 +00:00
// Convert QList<> from C++ memory to manually-managed C memory
2024-10-18 23:53:33 +00:00
struct miqt_string * _arr = static_cast < struct miqt_string * > ( malloc ( sizeof ( struct miqt_string ) * _ret . length ( ) ) ) ;
2024-09-14 22:29:05 +00:00
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _lv_ms ;
_lv_ms . len = _lv_b . length ( ) ;
_lv_ms . data = static_cast < char * > ( malloc ( _lv_ms . len ) ) ;
memcpy ( _lv_ms . data , _lv_b . data ( ) , _lv_ms . len ) ;
_arr [ i ] = _lv_ms ;
2024-08-25 04:08:24 +00:00
}
2024-11-04 07:18:27 +00:00
struct miqt_array _out ;
_out . len = _ret . length ( ) ;
_out . data = static_cast < void * > ( _arr ) ;
2024-09-14 22:29:05 +00:00
return _out ;
2024-08-25 04:08:24 +00:00
}
void QProcessEnvironment_InsertWithQProcessEnvironment ( QProcessEnvironment * self , QProcessEnvironment * e ) {
self - > insert ( * e ) ;
}
QProcessEnvironment * QProcessEnvironment_SystemEnvironment ( ) {
2024-09-17 06:29:11 +00:00
return new QProcessEnvironment ( QProcessEnvironment : : systemEnvironment ( ) ) ;
2024-08-25 04:08:24 +00:00
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcessEnvironment_Value2 ( const QProcessEnvironment * self , struct miqt_string name , struct miqt_string defaultValue ) {
QString name_QString = QString : : fromUtf8 ( name . data , name . len ) ;
QString defaultValue_QString = QString : : fromUtf8 ( defaultValue . data , defaultValue . len ) ;
2024-09-14 22:29:05 +00:00
QString _ret = self - > value ( name_QString , defaultValue_QString ) ;
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _ms ;
_ms . len = _b . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _b . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
void QProcessEnvironment_Delete ( QProcessEnvironment * self ) {
delete self ;
}
QProcess * QProcess_new ( ) {
return new QProcess ( ) ;
}
QProcess * QProcess_new2 ( QObject * parent ) {
return new QProcess ( parent ) ;
}
2024-09-11 05:41:09 +00:00
QMetaObject * QProcess_MetaObject ( const QProcess * self ) {
return ( QMetaObject * ) self - > metaObject ( ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-20 22:32:57 +00:00
void * QProcess_Metacast ( QProcess * self , const char * param1 ) {
return self - > qt_metacast ( param1 ) ;
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcess_Tr ( const char * s ) {
2024-09-14 22:29:05 +00:00
QString _ret = QProcess : : tr ( s ) ;
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _ms ;
_ms . len = _b . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _b . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcess_TrUtf8 ( const char * s ) {
2024-09-14 22:29:05 +00:00
QString _ret = QProcess : : trUtf8 ( s ) ;
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _ms ;
_ms . len = _b . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _b . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
2024-11-17 06:21:37 +00:00
void QProcess_Start ( QProcess * self , struct miqt_string program , struct miqt_array /* of struct miqt_string */ arguments ) {
2024-10-18 23:53:33 +00:00
QString program_QString = QString : : fromUtf8 ( program . data , program . len ) ;
2024-10-16 05:07:56 +00:00
QStringList arguments_QList ;
2024-11-04 07:18:27 +00:00
arguments_QList . reserve ( arguments . len ) ;
struct miqt_string * arguments_arr = static_cast < struct miqt_string * > ( arguments . data ) ;
for ( size_t i = 0 ; i < arguments . len ; + + i ) {
2024-10-18 23:53:33 +00:00
QString arguments_arr_i_QString = QString : : fromUtf8 ( arguments_arr [ i ] . data , arguments_arr [ i ] . len ) ;
2024-09-17 07:43:35 +00:00
arguments_QList . push_back ( arguments_arr_i_QString ) ;
2024-08-29 07:01:51 +00:00
}
self - > start ( program_QString , arguments_QList ) ;
}
2024-10-18 23:53:33 +00:00
void QProcess_StartWithCommand ( QProcess * self , struct miqt_string command ) {
QString command_QString = QString : : fromUtf8 ( command . data , command . len ) ;
2024-08-29 07:01:51 +00:00
self - > start ( command_QString ) ;
}
void QProcess_Start2 ( QProcess * self ) {
self - > start ( ) ;
}
2024-08-25 04:08:24 +00:00
bool QProcess_StartDetached ( QProcess * self ) {
return self - > startDetached ( ) ;
}
2024-08-29 07:01:51 +00:00
bool QProcess_Open ( QProcess * self ) {
return self - > open ( ) ;
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcess_Program ( const QProcess * self ) {
2024-09-14 22:29:05 +00:00
QString _ret = self - > program ( ) ;
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _ms ;
_ms . len = _b . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _b . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
2024-10-18 23:53:33 +00:00
void QProcess_SetProgram ( QProcess * self , struct miqt_string program ) {
QString program_QString = QString : : fromUtf8 ( program . data , program . len ) ;
2024-08-25 04:08:24 +00:00
self - > setProgram ( program_QString ) ;
}
2024-11-17 06:21:37 +00:00
struct miqt_array /* of struct miqt_string */ QProcess_Arguments ( const QProcess * self ) {
2024-09-14 22:29:05 +00:00
QStringList _ret = self - > arguments ( ) ;
2024-09-17 06:29:11 +00:00
// Convert QList<> from C++ memory to manually-managed C memory
2024-10-18 23:53:33 +00:00
struct miqt_string * _arr = static_cast < struct miqt_string * > ( malloc ( sizeof ( struct miqt_string ) * _ret . length ( ) ) ) ;
2024-09-14 22:29:05 +00:00
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _lv_ms ;
_lv_ms . len = _lv_b . length ( ) ;
_lv_ms . data = static_cast < char * > ( malloc ( _lv_ms . len ) ) ;
memcpy ( _lv_ms . data , _lv_b . data ( ) , _lv_ms . len ) ;
_arr [ i ] = _lv_ms ;
2024-08-25 04:08:24 +00:00
}
2024-11-04 07:18:27 +00:00
struct miqt_array _out ;
_out . len = _ret . length ( ) ;
_out . data = static_cast < void * > ( _arr ) ;
2024-09-14 22:29:05 +00:00
return _out ;
2024-08-25 04:08:24 +00:00
}
2024-11-17 06:21:37 +00:00
void QProcess_SetArguments ( QProcess * self , struct miqt_array /* of struct miqt_string */ arguments ) {
2024-10-16 05:07:56 +00:00
QStringList arguments_QList ;
2024-11-04 07:18:27 +00:00
arguments_QList . reserve ( arguments . len ) ;
struct miqt_string * arguments_arr = static_cast < struct miqt_string * > ( arguments . data ) ;
for ( size_t i = 0 ; i < arguments . len ; + + i ) {
2024-10-18 23:53:33 +00:00
QString arguments_arr_i_QString = QString : : fromUtf8 ( arguments_arr [ i ] . data , arguments_arr [ i ] . len ) ;
2024-09-17 07:43:35 +00:00
arguments_QList . push_back ( arguments_arr_i_QString ) ;
2024-08-25 04:08:24 +00:00
}
self - > setArguments ( arguments_QList ) ;
}
2024-09-18 00:12:02 +00:00
int QProcess_ReadChannelMode ( const QProcess * self ) {
2024-09-14 22:29:05 +00:00
QProcess : : ProcessChannelMode _ret = self - > readChannelMode ( ) ;
2024-09-18 00:12:02 +00:00
return static_cast < int > ( _ret ) ;
2024-08-29 07:01:51 +00:00
}
2024-09-18 00:12:02 +00:00
void QProcess_SetReadChannelMode ( QProcess * self , int mode ) {
2024-08-29 07:01:51 +00:00
self - > setReadChannelMode ( static_cast < QProcess : : ProcessChannelMode > ( mode ) ) ;
}
2024-09-18 00:12:02 +00:00
int QProcess_ProcessChannelMode ( const QProcess * self ) {
2024-09-14 22:29:05 +00:00
QProcess : : ProcessChannelMode _ret = self - > processChannelMode ( ) ;
2024-09-18 00:12:02 +00:00
return static_cast < int > ( _ret ) ;
2024-08-29 07:01:51 +00:00
}
2024-09-18 00:12:02 +00:00
void QProcess_SetProcessChannelMode ( QProcess * self , int mode ) {
2024-08-29 07:01:51 +00:00
self - > setProcessChannelMode ( static_cast < QProcess : : ProcessChannelMode > ( mode ) ) ;
}
2024-09-18 00:12:02 +00:00
int QProcess_InputChannelMode ( const QProcess * self ) {
2024-09-14 22:29:05 +00:00
QProcess : : InputChannelMode _ret = self - > inputChannelMode ( ) ;
2024-09-18 00:12:02 +00:00
return static_cast < int > ( _ret ) ;
2024-08-29 07:01:51 +00:00
}
2024-09-18 00:12:02 +00:00
void QProcess_SetInputChannelMode ( QProcess * self , int mode ) {
2024-08-29 07:01:51 +00:00
self - > setInputChannelMode ( static_cast < QProcess : : InputChannelMode > ( mode ) ) ;
}
2024-09-18 00:12:02 +00:00
int QProcess_ReadChannel ( const QProcess * self ) {
2024-09-14 22:29:05 +00:00
QProcess : : ProcessChannel _ret = self - > readChannel ( ) ;
2024-09-18 00:12:02 +00:00
return static_cast < int > ( _ret ) ;
2024-08-29 07:01:51 +00:00
}
2024-09-18 00:12:02 +00:00
void QProcess_SetReadChannel ( QProcess * self , int channel ) {
2024-08-29 07:01:51 +00:00
self - > setReadChannel ( static_cast < QProcess : : ProcessChannel > ( channel ) ) ;
}
2024-09-18 00:12:02 +00:00
void QProcess_CloseReadChannel ( QProcess * self , int channel ) {
2024-08-29 07:01:51 +00:00
self - > closeReadChannel ( static_cast < QProcess : : ProcessChannel > ( channel ) ) ;
}
2024-08-25 04:08:24 +00:00
void QProcess_CloseWriteChannel ( QProcess * self ) {
self - > closeWriteChannel ( ) ;
}
2024-10-18 23:53:33 +00:00
void QProcess_SetStandardInputFile ( QProcess * self , struct miqt_string fileName ) {
QString fileName_QString = QString : : fromUtf8 ( fileName . data , fileName . len ) ;
2024-08-25 04:08:24 +00:00
self - > setStandardInputFile ( fileName_QString ) ;
}
2024-10-18 23:53:33 +00:00
void QProcess_SetStandardOutputFile ( QProcess * self , struct miqt_string fileName ) {
QString fileName_QString = QString : : fromUtf8 ( fileName . data , fileName . len ) ;
2024-08-29 07:01:51 +00:00
self - > setStandardOutputFile ( fileName_QString ) ;
}
2024-10-18 23:53:33 +00:00
void QProcess_SetStandardErrorFile ( QProcess * self , struct miqt_string fileName ) {
QString fileName_QString = QString : : fromUtf8 ( fileName . data , fileName . len ) ;
2024-08-29 07:01:51 +00:00
self - > setStandardErrorFile ( fileName_QString ) ;
}
2024-08-25 04:08:24 +00:00
void QProcess_SetStandardOutputProcess ( QProcess * self , QProcess * destination ) {
self - > setStandardOutputProcess ( destination ) ;
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcess_WorkingDirectory ( const QProcess * self ) {
2024-09-14 22:29:05 +00:00
QString _ret = self - > workingDirectory ( ) ;
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _ms ;
_ms . len = _b . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _b . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
2024-10-18 23:53:33 +00:00
void QProcess_SetWorkingDirectory ( QProcess * self , struct miqt_string dir ) {
QString dir_QString = QString : : fromUtf8 ( dir . data , dir . len ) ;
2024-08-25 04:08:24 +00:00
self - > setWorkingDirectory ( dir_QString ) ;
}
2024-11-17 06:21:37 +00:00
void QProcess_SetEnvironment ( QProcess * self , struct miqt_array /* of struct miqt_string */ environment ) {
2024-10-16 05:07:56 +00:00
QStringList environment_QList ;
2024-11-04 07:18:27 +00:00
environment_QList . reserve ( environment . len ) ;
struct miqt_string * environment_arr = static_cast < struct miqt_string * > ( environment . data ) ;
for ( size_t i = 0 ; i < environment . len ; + + i ) {
2024-10-18 23:53:33 +00:00
QString environment_arr_i_QString = QString : : fromUtf8 ( environment_arr [ i ] . data , environment_arr [ i ] . len ) ;
2024-09-17 07:43:35 +00:00
environment_QList . push_back ( environment_arr_i_QString ) ;
2024-08-25 04:08:24 +00:00
}
self - > setEnvironment ( environment_QList ) ;
}
2024-11-17 06:21:37 +00:00
struct miqt_array /* of struct miqt_string */ QProcess_Environment ( const QProcess * self ) {
2024-09-14 22:29:05 +00:00
QStringList _ret = self - > environment ( ) ;
2024-09-17 06:29:11 +00:00
// Convert QList<> from C++ memory to manually-managed C memory
2024-10-18 23:53:33 +00:00
struct miqt_string * _arr = static_cast < struct miqt_string * > ( malloc ( sizeof ( struct miqt_string ) * _ret . length ( ) ) ) ;
2024-09-14 22:29:05 +00:00
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _lv_ms ;
_lv_ms . len = _lv_b . length ( ) ;
_lv_ms . data = static_cast < char * > ( malloc ( _lv_ms . len ) ) ;
memcpy ( _lv_ms . data , _lv_b . data ( ) , _lv_ms . len ) ;
_arr [ i ] = _lv_ms ;
2024-08-25 04:08:24 +00:00
}
2024-11-04 07:18:27 +00:00
struct miqt_array _out ;
_out . len = _ret . length ( ) ;
_out . data = static_cast < void * > ( _arr ) ;
2024-09-14 22:29:05 +00:00
return _out ;
2024-08-25 04:08:24 +00:00
}
void QProcess_SetProcessEnvironment ( QProcess * self , QProcessEnvironment * environment ) {
self - > setProcessEnvironment ( * environment ) ;
}
2024-09-11 05:41:09 +00:00
QProcessEnvironment * QProcess_ProcessEnvironment ( const QProcess * self ) {
2024-09-17 06:29:11 +00:00
return new QProcessEnvironment ( self - > processEnvironment ( ) ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-18 00:12:02 +00:00
int QProcess_Error ( const QProcess * self ) {
2024-09-14 22:29:05 +00:00
QProcess : : ProcessError _ret = self - > error ( ) ;
2024-09-18 00:12:02 +00:00
return static_cast < int > ( _ret ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-18 00:12:02 +00:00
int QProcess_State ( const QProcess * self ) {
2024-09-14 22:29:05 +00:00
QProcess : : ProcessState _ret = self - > state ( ) ;
2024-09-18 00:12:02 +00:00
return static_cast < int > ( _ret ) ;
2024-08-29 07:01:51 +00:00
}
2024-09-18 00:12:02 +00:00
long long QProcess_Pid ( const QProcess * self ) {
2024-09-01 06:50:19 +00:00
# ifdef Q_OS_LINUX
2024-09-18 00:12:02 +00:00
Q_PID _ret = self - > pid ( ) ;
return static_cast < long long > ( _ret ) ;
2024-09-01 06:50:19 +00:00
# else
2024-09-18 00:12:02 +00:00
long long _ret_invalidOS ;
2024-09-01 06:50:19 +00:00
return _ret_invalidOS ;
# endif
2024-08-29 07:01:51 +00:00
}
2024-09-11 05:41:09 +00:00
long long QProcess_ProcessId ( const QProcess * self ) {
2024-09-18 00:12:02 +00:00
qint64 _ret = self - > processId ( ) ;
return static_cast < long long > ( _ret ) ;
2024-08-25 04:08:24 +00:00
}
bool QProcess_WaitForStarted ( QProcess * self ) {
return self - > waitForStarted ( ) ;
}
bool QProcess_WaitForReadyRead ( QProcess * self ) {
return self - > waitForReadyRead ( ) ;
}
bool QProcess_WaitForBytesWritten ( QProcess * self ) {
return self - > waitForBytesWritten ( ) ;
}
bool QProcess_WaitForFinished ( QProcess * self ) {
return self - > waitForFinished ( ) ;
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcess_ReadAllStandardOutput ( QProcess * self ) {
QByteArray _qb = self - > readAllStandardOutput ( ) ;
struct miqt_string _ms ;
_ms . len = _qb . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _qb . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcess_ReadAllStandardError ( QProcess * self ) {
QByteArray _qb = self - > readAllStandardError ( ) ;
struct miqt_string _ms ;
_ms . len = _qb . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _qb . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
2024-09-11 05:41:09 +00:00
int QProcess_ExitCode ( const QProcess * self ) {
return self - > exitCode ( ) ;
2024-08-29 07:01:51 +00:00
}
2024-09-18 00:12:02 +00:00
int QProcess_ExitStatus ( const QProcess * self ) {
2024-09-14 22:29:05 +00:00
QProcess : : ExitStatus _ret = self - > exitStatus ( ) ;
2024-09-18 00:12:02 +00:00
return static_cast < int > ( _ret ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-11 05:41:09 +00:00
long long QProcess_BytesAvailable ( const QProcess * self ) {
2024-09-18 00:12:02 +00:00
qint64 _ret = self - > bytesAvailable ( ) ;
return static_cast < long long > ( _ret ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-11 05:41:09 +00:00
long long QProcess_BytesToWrite ( const QProcess * self ) {
2024-09-18 00:12:02 +00:00
qint64 _ret = self - > bytesToWrite ( ) ;
return static_cast < long long > ( _ret ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-11 05:41:09 +00:00
bool QProcess_IsSequential ( const QProcess * self ) {
return self - > isSequential ( ) ;
2024-08-25 04:08:24 +00:00
}
2024-09-11 05:41:09 +00:00
bool QProcess_CanReadLine ( const QProcess * self ) {
return self - > canReadLine ( ) ;
2024-08-25 04:08:24 +00:00
}
void QProcess_Close ( QProcess * self ) {
self - > close ( ) ;
}
2024-09-11 05:41:09 +00:00
bool QProcess_AtEnd ( const QProcess * self ) {
return self - > atEnd ( ) ;
2024-08-25 04:08:24 +00:00
}
2024-11-17 06:21:37 +00:00
int QProcess_Execute ( struct miqt_string program , struct miqt_array /* of struct miqt_string */ arguments ) {
2024-10-18 23:53:33 +00:00
QString program_QString = QString : : fromUtf8 ( program . data , program . len ) ;
2024-10-16 05:07:56 +00:00
QStringList arguments_QList ;
2024-11-04 07:18:27 +00:00
arguments_QList . reserve ( arguments . len ) ;
struct miqt_string * arguments_arr = static_cast < struct miqt_string * > ( arguments . data ) ;
for ( size_t i = 0 ; i < arguments . len ; + + i ) {
2024-10-18 23:53:33 +00:00
QString arguments_arr_i_QString = QString : : fromUtf8 ( arguments_arr [ i ] . data , arguments_arr [ i ] . len ) ;
2024-09-17 07:43:35 +00:00
arguments_QList . push_back ( arguments_arr_i_QString ) ;
2024-08-25 04:08:24 +00:00
}
return QProcess : : execute ( program_QString , arguments_QList ) ;
}
2024-10-18 23:53:33 +00:00
int QProcess_ExecuteWithCommand ( struct miqt_string command ) {
QString command_QString = QString : : fromUtf8 ( command . data , command . len ) ;
2024-08-25 04:08:24 +00:00
return QProcess : : execute ( command_QString ) ;
}
2024-11-17 06:21:37 +00:00
bool QProcess_StartDetached2 ( struct miqt_string program , struct miqt_array /* of struct miqt_string */ arguments , struct miqt_string workingDirectory ) {
2024-10-18 23:53:33 +00:00
QString program_QString = QString : : fromUtf8 ( program . data , program . len ) ;
2024-10-16 05:07:56 +00:00
QStringList arguments_QList ;
2024-11-04 07:18:27 +00:00
arguments_QList . reserve ( arguments . len ) ;
struct miqt_string * arguments_arr = static_cast < struct miqt_string * > ( arguments . data ) ;
for ( size_t i = 0 ; i < arguments . len ; + + i ) {
2024-10-18 23:53:33 +00:00
QString arguments_arr_i_QString = QString : : fromUtf8 ( arguments_arr [ i ] . data , arguments_arr [ i ] . len ) ;
2024-09-17 07:43:35 +00:00
arguments_QList . push_back ( arguments_arr_i_QString ) ;
2024-08-25 04:08:24 +00:00
}
2024-10-18 23:53:33 +00:00
QString workingDirectory_QString = QString : : fromUtf8 ( workingDirectory . data , workingDirectory . len ) ;
2024-08-25 04:08:24 +00:00
return QProcess : : startDetached ( program_QString , arguments_QList , workingDirectory_QString ) ;
}
2024-11-17 06:21:37 +00:00
bool QProcess_StartDetached3 ( struct miqt_string program , struct miqt_array /* of struct miqt_string */ arguments ) {
2024-10-18 23:53:33 +00:00
QString program_QString = QString : : fromUtf8 ( program . data , program . len ) ;
2024-10-16 05:07:56 +00:00
QStringList arguments_QList ;
2024-11-04 07:18:27 +00:00
arguments_QList . reserve ( arguments . len ) ;
struct miqt_string * arguments_arr = static_cast < struct miqt_string * > ( arguments . data ) ;
for ( size_t i = 0 ; i < arguments . len ; + + i ) {
2024-10-18 23:53:33 +00:00
QString arguments_arr_i_QString = QString : : fromUtf8 ( arguments_arr [ i ] . data , arguments_arr [ i ] . len ) ;
2024-09-17 07:43:35 +00:00
arguments_QList . push_back ( arguments_arr_i_QString ) ;
2024-08-25 04:08:24 +00:00
}
return QProcess : : startDetached ( program_QString , arguments_QList ) ;
}
2024-10-18 23:53:33 +00:00
bool QProcess_StartDetachedWithCommand ( struct miqt_string command ) {
QString command_QString = QString : : fromUtf8 ( command . data , command . len ) ;
2024-08-25 04:08:24 +00:00
return QProcess : : startDetached ( command_QString ) ;
}
2024-11-17 06:21:37 +00:00
struct miqt_array /* of struct miqt_string */ QProcess_SystemEnvironment ( ) {
2024-09-14 22:29:05 +00:00
QStringList _ret = QProcess : : systemEnvironment ( ) ;
2024-09-17 06:29:11 +00:00
// Convert QList<> from C++ memory to manually-managed C memory
2024-10-18 23:53:33 +00:00
struct miqt_string * _arr = static_cast < struct miqt_string * > ( malloc ( sizeof ( struct miqt_string ) * _ret . length ( ) ) ) ;
2024-09-14 22:29:05 +00:00
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _lv_ms ;
_lv_ms . len = _lv_b . length ( ) ;
_lv_ms . data = static_cast < char * > ( malloc ( _lv_ms . len ) ) ;
memcpy ( _lv_ms . data , _lv_b . data ( ) , _lv_ms . len ) ;
_arr [ i ] = _lv_ms ;
2024-08-25 04:08:24 +00:00
}
2024-11-04 07:18:27 +00:00
struct miqt_array _out ;
_out . len = _ret . length ( ) ;
_out . data = static_cast < void * > ( _arr ) ;
2024-09-14 22:29:05 +00:00
return _out ;
2024-08-25 04:08:24 +00:00
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcess_NullDevice ( ) {
2024-09-14 22:29:05 +00:00
QString _ret = QProcess : : nullDevice ( ) ;
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _ms ;
_ms . len = _b . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _b . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
void QProcess_Terminate ( QProcess * self ) {
self - > terminate ( ) ;
}
void QProcess_Kill ( QProcess * self ) {
self - > kill ( ) ;
}
void QProcess_Finished ( QProcess * self , int exitCode ) {
self - > finished ( static_cast < int > ( exitCode ) ) ;
}
2024-10-13 06:06:06 +00:00
void QProcess_connect_Finished ( QProcess * self , intptr_t slot ) {
2024-08-25 04:08:24 +00:00
QProcess : : connect ( self , static_cast < void ( QProcess : : * ) ( int ) > ( & QProcess : : finished ) , self , [ = ] ( int exitCode ) {
2024-09-14 22:29:05 +00:00
int sigval1 = exitCode ;
miqt_exec_callback_QProcess_Finished ( slot , sigval1 ) ;
2024-08-25 04:08:24 +00:00
} ) ;
}
2024-09-18 00:12:02 +00:00
void QProcess_Finished2 ( QProcess * self , int exitCode , int exitStatus ) {
2024-08-29 07:01:51 +00:00
self - > finished ( static_cast < int > ( exitCode ) , static_cast < QProcess : : ExitStatus > ( exitStatus ) ) ;
}
2024-10-13 06:06:06 +00:00
void QProcess_connect_Finished2 ( QProcess * self , intptr_t slot ) {
2024-08-29 07:01:51 +00:00
QProcess : : connect ( self , static_cast < void ( QProcess : : * ) ( int , QProcess : : ExitStatus ) > ( & QProcess : : finished ) , self , [ = ] ( int exitCode , QProcess : : ExitStatus exitStatus ) {
2024-09-14 22:29:05 +00:00
int sigval1 = exitCode ;
QProcess : : ExitStatus exitStatus_ret = exitStatus ;
2024-09-18 00:12:02 +00:00
int sigval2 = static_cast < int > ( exitStatus_ret ) ;
2024-09-14 22:29:05 +00:00
miqt_exec_callback_QProcess_Finished2 ( slot , sigval1 , sigval2 ) ;
2024-08-29 07:01:51 +00:00
} ) ;
}
2024-09-18 00:12:02 +00:00
void QProcess_ErrorWithError ( QProcess * self , int error ) {
2024-08-29 07:01:51 +00:00
self - > error ( static_cast < QProcess : : ProcessError > ( error ) ) ;
}
2024-10-13 06:06:06 +00:00
void QProcess_connect_ErrorWithError ( QProcess * self , intptr_t slot ) {
2024-08-29 07:01:51 +00:00
QProcess : : connect ( self , static_cast < void ( QProcess : : * ) ( QProcess : : ProcessError ) > ( & QProcess : : error ) , self , [ = ] ( QProcess : : ProcessError error ) {
2024-09-14 22:29:05 +00:00
QProcess : : ProcessError error_ret = error ;
2024-09-18 00:12:02 +00:00
int sigval1 = static_cast < int > ( error_ret ) ;
2024-09-14 22:29:05 +00:00
miqt_exec_callback_QProcess_ErrorWithError ( slot , sigval1 ) ;
2024-08-29 07:01:51 +00:00
} ) ;
}
2024-09-18 00:12:02 +00:00
void QProcess_ErrorOccurred ( QProcess * self , int error ) {
2024-08-29 07:01:51 +00:00
self - > errorOccurred ( static_cast < QProcess : : ProcessError > ( error ) ) ;
}
2024-10-13 06:06:06 +00:00
void QProcess_connect_ErrorOccurred ( QProcess * self , intptr_t slot ) {
2024-08-29 07:01:51 +00:00
QProcess : : connect ( self , static_cast < void ( QProcess : : * ) ( QProcess : : ProcessError ) > ( & QProcess : : errorOccurred ) , self , [ = ] ( QProcess : : ProcessError error ) {
2024-09-14 22:29:05 +00:00
QProcess : : ProcessError error_ret = error ;
2024-09-18 00:12:02 +00:00
int sigval1 = static_cast < int > ( error_ret ) ;
2024-09-14 22:29:05 +00:00
miqt_exec_callback_QProcess_ErrorOccurred ( slot , sigval1 ) ;
2024-08-29 07:01:51 +00:00
} ) ;
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcess_Tr2 ( const char * s , const char * c ) {
2024-09-14 22:29:05 +00:00
QString _ret = QProcess : : tr ( s , c ) ;
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _ms ;
_ms . len = _b . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _b . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcess_Tr3 ( const char * s , const char * c , int n ) {
2024-09-14 22:29:05 +00:00
QString _ret = QProcess : : tr ( s , c , static_cast < int > ( n ) ) ;
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _ms ;
_ms . len = _b . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _b . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcess_TrUtf82 ( const char * s , const char * c ) {
2024-09-14 22:29:05 +00:00
QString _ret = QProcess : : trUtf8 ( s , c ) ;
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _ms ;
_ms . len = _b . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _b . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
2024-10-18 23:53:33 +00:00
struct miqt_string QProcess_TrUtf83 ( const char * s , const char * c , int n ) {
2024-09-14 22:29:05 +00:00
QString _ret = QProcess : : trUtf8 ( s , c , static_cast < int > ( n ) ) ;
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 ( ) ;
2024-10-18 23:53:33 +00:00
struct miqt_string _ms ;
_ms . len = _b . length ( ) ;
_ms . data = static_cast < char * > ( malloc ( _ms . len ) ) ;
memcpy ( _ms . data , _b . data ( ) , _ms . len ) ;
return _ms ;
2024-08-25 04:08:24 +00:00
}
2024-11-17 06:21:37 +00:00
void QProcess_Start3 ( QProcess * self , struct miqt_string program , struct miqt_array /* of struct miqt_string */ arguments , int mode ) {
2024-10-18 23:53:33 +00:00
QString program_QString = QString : : fromUtf8 ( program . data , program . len ) ;
2024-10-16 05:07:56 +00:00
QStringList arguments_QList ;
2024-11-04 07:18:27 +00:00
arguments_QList . reserve ( arguments . len ) ;
struct miqt_string * arguments_arr = static_cast < struct miqt_string * > ( arguments . data ) ;
for ( size_t i = 0 ; i < arguments . len ; + + i ) {
2024-10-18 23:53:33 +00:00
QString arguments_arr_i_QString = QString : : fromUtf8 ( arguments_arr [ i ] . data , arguments_arr [ i ] . len ) ;
2024-09-17 07:43:35 +00:00
arguments_QList . push_back ( arguments_arr_i_QString ) ;
2024-08-29 07:01:51 +00:00
}
self - > start ( program_QString , arguments_QList , static_cast < QIODevice : : OpenMode > ( mode ) ) ;
}
2024-10-18 23:53:33 +00:00
void QProcess_Start22 ( QProcess * self , struct miqt_string command , int mode ) {
QString command_QString = QString : : fromUtf8 ( command . data , command . len ) ;
2024-08-29 07:01:51 +00:00
self - > start ( command_QString , static_cast < QIODevice : : OpenMode > ( mode ) ) ;
}
void QProcess_Start1 ( QProcess * self , int mode ) {
self - > start ( static_cast < QIODevice : : OpenMode > ( mode ) ) ;
}
bool QProcess_StartDetached1 ( QProcess * self , long long * pid ) {
return self - > startDetached ( static_cast < qint64 * > ( pid ) ) ;
}
bool QProcess_Open1 ( QProcess * self , int mode ) {
return self - > open ( static_cast < QIODevice : : OpenMode > ( mode ) ) ;
}
2024-10-18 23:53:33 +00:00
void QProcess_SetStandardOutputFile2 ( QProcess * self , struct miqt_string fileName , int mode ) {
QString fileName_QString = QString : : fromUtf8 ( fileName . data , fileName . len ) ;
2024-08-29 07:01:51 +00:00
self - > setStandardOutputFile ( fileName_QString , static_cast < QIODevice : : OpenMode > ( mode ) ) ;
}
2024-10-18 23:53:33 +00:00
void QProcess_SetStandardErrorFile2 ( QProcess * self , struct miqt_string fileName , int mode ) {
QString fileName_QString = QString : : fromUtf8 ( fileName . data , fileName . len ) ;
2024-08-29 07:01:51 +00:00
self - > setStandardErrorFile ( fileName_QString , static_cast < QIODevice : : OpenMode > ( mode ) ) ;
2024-08-25 04:08:24 +00:00
}
bool QProcess_WaitForStarted1 ( QProcess * self , int msecs ) {
return self - > waitForStarted ( static_cast < int > ( msecs ) ) ;
}
bool QProcess_WaitForReadyRead1 ( QProcess * self , int msecs ) {
return self - > waitForReadyRead ( static_cast < int > ( msecs ) ) ;
}
bool QProcess_WaitForBytesWritten1 ( QProcess * self , int msecs ) {
return self - > waitForBytesWritten ( static_cast < int > ( msecs ) ) ;
}
bool QProcess_WaitForFinished1 ( QProcess * self , int msecs ) {
return self - > waitForFinished ( static_cast < int > ( msecs ) ) ;
}
2024-11-17 06:21:37 +00:00
bool QProcess_StartDetached4 ( struct miqt_string program , struct miqt_array /* of struct miqt_string */ arguments , struct miqt_string workingDirectory , long long * pid ) {
2024-10-18 23:53:33 +00:00
QString program_QString = QString : : fromUtf8 ( program . data , program . len ) ;
2024-10-16 05:07:56 +00:00
QStringList arguments_QList ;
2024-11-04 07:18:27 +00:00
arguments_QList . reserve ( arguments . len ) ;
struct miqt_string * arguments_arr = static_cast < struct miqt_string * > ( arguments . data ) ;
for ( size_t i = 0 ; i < arguments . len ; + + i ) {
2024-10-18 23:53:33 +00:00
QString arguments_arr_i_QString = QString : : fromUtf8 ( arguments_arr [ i ] . data , arguments_arr [ i ] . len ) ;
2024-09-17 07:43:35 +00:00
arguments_QList . push_back ( arguments_arr_i_QString ) ;
2024-08-25 04:08:24 +00:00
}
2024-10-18 23:53:33 +00:00
QString workingDirectory_QString = QString : : fromUtf8 ( workingDirectory . data , workingDirectory . len ) ;
2024-08-29 07:01:51 +00:00
return QProcess : : startDetached ( program_QString , arguments_QList , workingDirectory_QString , static_cast < qint64 * > ( pid ) ) ;
2024-08-25 04:08:24 +00:00
}
void QProcess_Delete ( QProcess * self ) {
delete self ;
}