2012-05-08 15:14 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbqt/qtnetwork/qth/QFtp.qth
  * contrib/hbqt/qtnetwork/qth/QHttp.qth
  * contrib/hbqt/qtnetwork/qth/QHttpHeader.qth
  * contrib/hbqt/qtnetwork/qth/QHttpRequestHeader.qth
  * contrib/hbqt/qtnetwork/qth/QHttpResponseHeader.qth
  * contrib/hbqt/qtnetwork/qth/QNetworkProxy.qth
  * contrib/hbqt/qtnetwork/qth/QNetworkRequest.qth
  * contrib/hbqt/qtnetwork/qth/QUrlInfo.qth
    - Replaced: HB_ISOBJECT() => hbqt_par_isDerivedFrom()
    * Rationalized: constructors.
This commit is contained in:
Pritpal Bedi
2012-05-08 22:16:55 +00:00
parent c9e121e4ea
commit f764b317a6
9 changed files with 112 additions and 10 deletions

View File

@@ -16,6 +16,18 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-05-08 15:14 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtnetwork/qth/QFtp.qth
* contrib/hbqt/qtnetwork/qth/QHttp.qth
* contrib/hbqt/qtnetwork/qth/QHttpHeader.qth
* contrib/hbqt/qtnetwork/qth/QHttpRequestHeader.qth
* contrib/hbqt/qtnetwork/qth/QHttpResponseHeader.qth
* contrib/hbqt/qtnetwork/qth/QNetworkProxy.qth
* contrib/hbqt/qtnetwork/qth/QNetworkRequest.qth
* contrib/hbqt/qtnetwork/qth/QUrlInfo.qth
- Replaced: HB_ISOBJECT() => hbqt_par_isDerivedFrom()
* Rationalized: constructors.
2012-05-08 18:20 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbnetio/utils/hbnetio/netiosrv.prg
* contrib/hbrun/plugins.prg

View File

@@ -29,7 +29,14 @@ New = pParent
*/
HB_FUNC( QT_QFTP )
{
__HB_RETPTRGC__( new QFtp( hbqt_par_QObject( 1 ) ) );
if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) )
{
__HB_RETPTRGC__( new QFtp( hbqt_par_QObject( 1 ) ) );
}
else
{
__HB_RETPTRGC__( new QFtp() );
}
}
/*

View File

@@ -31,7 +31,20 @@ New = pParent
*/
HB_FUNC( QT_QHTTP )
{
__HB_RETPTRGC__( new QHttp( hbqt_par_QObject( 1 ) ) );
if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QOBJECT" ) )
{
__HB_RETPTRGC__( new QHttp( hbqt_par_QObject( 1 ) ) );
}
else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
{
void * pText01 = NULL;
__HB_RETPTRGC__( new QHttp( hb_parstr_utf8( 1, &pText01, NULL ) ) );
hb_strfree( pText01 );
}
else
{
__HB_RETPTRGC__( new QHttp() );
}
}
/*
@@ -83,7 +96,7 @@ int request ( const QHttpRequestHeader & header, const QByteArray & data, QIODev
//int setHost ( const QString & hostName, quint16 port = 80 )
int setHost ( const QString & hostName, ConnectionMode mode, quint16 port = 0 )
int setProxy ( const QString & host, int port, const QString & username = QString(), const QString & password = QString() )
// int setProxy ( const QNetworkProxy & proxy )
int setProxy ( const QNetworkProxy & proxy )
// int setSocket ( QTcpSocket * socket )
int setUser ( const QString & userName, const QString & password = QString() )
State state () const

View File

@@ -32,7 +32,22 @@ Constructor = no
*/
HB_FUNC( QT_QHTTPHEADER )
{
/* //QHttpHeader.cpp:128:67: error: cannot allocate an object of abstract type 'QHttpHeader' // This can be subclassed only
if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
{
void * pText01 = NULL;
__HB_RETPTRGC__( new QHttpHeader( hb_parstr_utf8( 1, &pText01, NULL ) ) );
hb_strfree( pText01 );
}
else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QHTTPHEADER" ) )
{
__HB_RETPTRGC__( new QHttpHeader( *hbqt_par_QHttpHeader( 1 ) ) );
}
else
{
__HB_RETPTRGC__( new QHttpHeader() );
}
*/
}
</CODE>

View File

@@ -30,7 +30,28 @@ Destructor =
*/
HB_FUNC( QT_QHTTPREQUESTHEADER )
{
__HB_RETPTRGC__( new QHttpRequestHeader() );
if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
{
void * pText01 = NULL;
__HB_RETPTRGC__( new QHttpRequestHeader( hb_parstr_utf8( 1, &pText01, NULL ) ) );
hb_strfree( pText01 );
}
else if( hb_pcount() >= 2 && HB_ISCHAR( 1 ) && HB_ISCHAR( 2 ) )
{
void * pText01 = NULL;
void * pText02 = NULL;
__HB_RETPTRGC__( new QHttpRequestHeader( hb_parstr_utf8( 1, &pText01, NULL ), hb_parstr_utf8( 2, &pText02, NULL ), HB_ISNUM( 3 ) ? hb_parni( 3 ) : 1, HB_ISNUM( 4 ) ? hb_parni( 4 ) : 1 ) );
hb_strfree( pText01 );
hb_strfree( pText02 );
}
else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QHTTPREQUESTHEADER" ) )
{
__HB_RETPTRGC__( new QHttpRequestHeader( *hbqt_par_QHttpRequestHeader( 1 ) ) );
}
else
{
__HB_RETPTRGC__( new QHttpRequestHeader() );
}
}
</CODE>

View File

@@ -30,7 +30,30 @@ Destructor =
*/
HB_FUNC( QT_QHTTPRESPONSEHEADER )
{
__HB_RETPTRGC__( new QHttpResponseHeader() );
if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
{
void * pText01 = NULL;
__HB_RETPTRGC__( new QHttpResponseHeader( hb_parstr_utf8( 1, &pText01, NULL ) ) );
hb_strfree( pText01 );
}
else if( hb_pcount() >= 2 && HB_ISNUM( 1 ) && HB_ISCHAR( 2 ) )
{
void * pText01 = NULL;
__HB_RETPTRGC__( new QHttpResponseHeader( hb_parni( 1 ), hb_parstr_utf8( 2, &pText01, NULL ), HB_ISNUM( 3 ) ? hb_parni( 3 ) : 1, HB_ISNUM( 4 ) ? hb_parni( 4 ) : 1 ) );
hb_strfree( pText01 );
}
else if( hb_pcount() == 1 && HB_ISNUM( 1 ) )
{
__HB_RETPTRGC__( new QHttpResponseHeader( hb_parni( 1 ) ) );
}
else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QHTTPRESPONSEHEADER" ) )
{
__HB_RETPTRGC__( new QHttpResponseHeader( *hbqt_par_QHttpResponseHeader( 1 ) ) );
}
else
{
__HB_RETPTRGC__( new QHttpResponseHeader() );
}
}
</CODE>

View File

@@ -32,14 +32,14 @@ New =
*/
HB_FUNC( QT_QNETWORKPROXY )
{
if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QNETWORKPROXY" ) )
{
__HB_RETPTRGC__( new QNetworkProxy( *hbqt_par_QNetworkProxy( 1 ) ) );
}
else if( hb_pcount() >= 2 && HB_ISNUM( 1 ) && HB_ISCHAR( 2 ) )
{
void * pText01 = NULL;
__HB_RETPTRGC__( new QNetworkProxy( ( QNetworkProxy::ProxyType ) hb_parni( 1 ), hb_parstr_utf8( 2, &pText01, NULL ), ( quint16 ) ( HB_ISNUM( 3 ) ? hb_parni( 3 ) : 0 ), ( HB_ISCHAR( 4 ) ? hbqt_par_QString( 4 ) : QString() ), ( HB_ISCHAR( 5 ) ? hbqt_par_QString( 5 ) : QString() ) ) );
__HB_RETPTRGC__( new QNetworkProxy( ( QNetworkProxy::ProxyType ) hb_parni( 1 ), hb_parstr_utf8( 2, &pText01, NULL ), ( quint16 ) hb_parni( 3 ), QString(), QString() ) );
hb_strfree( pText01 );
}
else if( hb_pcount() >= 1 && HB_ISNUM( 1 ) )

View File

@@ -29,7 +29,18 @@ Destructor =
*/
HB_FUNC( QT_QNETWORKREQUEST )
{
__HB_RETPTRGC__( new QNetworkRequest() );
if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QURL" ) )
{
__HB_RETPTRGC__( new QNetworkRequest( *hbqt_par_QUrl( 1 ) ) );
}
else if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QNETWORKREQUEST" ) )
{
__HB_RETPTRGC__( new QNetworkRequest( *hbqt_par_QNetworkRequest( 1 ) ) );
}
else
{
__HB_RETPTRGC__( new QNetworkRequest() );
}
}
</CODE>

View File

@@ -34,7 +34,7 @@ New =
*/
HB_FUNC( QT_QURLINFO )
{
if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) )
if( hb_pcount() == 1 && hbqt_par_isDerivedFrom( 1, "QURLINFO" ) )
{
__HB_RETPTRGC__( new QUrlInfo( *hbqt_par_QUrlInfo( 1 ) ) );
}