|
Public Member Functions |
| BOOL | Download (LPCTSTR pUrl, LPCTSTR pLocal=NULL, BOOL bCloseFileAfterDownload=TRUE, HWND hWndParent=NULL) |
| | Downloads data from the specified URL.
|
| BOOL | Open (LPCTSTR pUrl, LPCTSTR pLocal=NULL) |
| | Opens the specified URL for data transfer.
|
| BOOL | HttpRequest (LPCTSTR pUrl, CRKey *pHeaders, CRKey *pData, LPCTSTR pMethod="POST", LPCTSTR pLocal=NULL, BOOL bCloseFileAfterDownload=TRUE, HWND hWndParent=NULL, DWORD dwUrlEncoding=1) |
| | Builds an HTTP request.
|
|
void | Release () |
| | Releases all resources including downloaded data.
|
| BOOL | Upload (LPCTSTR pUrl, LPBYTE buf, DWORD size, BOOL bPassive) |
| | Uploads data to the specified URL.
|
| BOOL | SetDataPtr (LPBYTE buf, DWORD size) |
| | Sets the buffer that is used for data transfers.
|
| BOOL | SetOption (DWORD option, LPVOID buf, DWORD size) |
| | Sets internet transfer options.
|
| BOOL | Upload (LPCTSTR pUrl, LPCTSTR pLocal, BOOL bPassive) |
| | Uploads data to the specified URL.
|
|
void | Close () |
| | Closes network connection and cancels any ongoing transfer.
|
| virtual BOOL | EndThread (LPVOID pData) |
| | Transfer thread cleanup.
|
| virtual BOOL | InitThread (LPVOID pData) |
| | Transfer thread initialization.
|
| virtual BOOL | DoThread (LPVOID pData) |
| | Transfer thread main body. Handles the actual data transfer.
|
|
void | Destroy () |
| | Closes network connection and cancels any ongoing transfer.
|
| | CNetFile (LPCTSTR pUserAgent="WheresJames Software (www_wheresjames_com)") |
| | Default constructor.
|
|
| ~CNetFile () |
| | Destructor.
|
| CWinFile * | GetFile () |
| | Returns the local transfer file.
|
| | operator CWinFile () |
| | Returns the local transfer file.
|
| LPBYTE | GetMem () |
| | Returns a pointer to the transfer data.
|
| DWORD | GetTransferStatus () |
| | Returns the current status of the file transfer.
|
| LPCTSTR | GetStatus () |
| | Returns a human readable string defining the current transfer status code.
|
|
DWORD | GetTransferError () |
| | Returns the last transfer error code.
|
|
DWORD | GetDataRead () |
| | Returns the number of bytes read from the remote host.
|
|
DWORD | GetDataWritten () |
| | Returns the number of bytes written to the remote host.
|
| void | CloseFileAfterDownload (BOOL b) |
| | Sets whether the file should be closed after downloading.
|
| void | SetBlockSize (DWORD bs) |
| | Sets the transfer block size.
|
|
LPCTSTR | GetUrl () |
| | Returns the current target URL.
|
|
LPCTSTR | GetLocalFile () |
| | Returns the path of the current transfer disk file.
|
| void | SetOpenFlags (DWORD f) |
| | Sets URL open flags.
|
| void | SetInternetFlags (DWORD f) |
| | Sets internet open flags.
|
| void | SetUserAgent (LPCTSTR str) |
| | Sets the user agent name.
|
| void | SetUsernamePassword (LPCTSTR un, LPCTSTR pw) |
| | Sets the username and password for URL connections.
|
| void | SetMessageTarget (HWND hWnd, UINT uMsg) |
| | Sets the window handle that will receive status messages.
|
| void | SetCallback (NetFileCallback f, DWORD user) |
| | Sets the address of a callback function that receives status messages.
|
| BOOL | DoCallback (WPARAM wParam, LPARAM lParam) |
| | Executes a callback.
|
| void | EnableCache (BOOL b) |
| | Enables fetching data from the local internet cache.
|
|
BOOL | IsWorking () |
| | Returns non-zero if a transfer is currently in progress.
|
| void | SetAccessFlags (DWORD f) |
| | Sets data access flags.
|
|
DWORD | GetTotalSize () |
| | Gets the length, in bytes, of the data being transfered.
|
Static Public Member Functions |
| static BOOL | GetErrorMsg (LPSTR msg, DWORD err) |
| | Returns a string describing the error.
|
| static LPCTSTR | GetStatus (DWORD status) |
| | Returns a human readable string defining the transfer status code.
|
Wraps the Inet API to provide HTTP file downloading and uploading. This class supports FTP through the Inet API as well.