PixelLightAPI  .
Public Member Functions
PLCore::HttpHandle Class Reference

This class represents a tiny HTTP (Hypertext Transfer Protocol) client to download files via HTTP. More...

#include <HttpHandle.h>

List of all members.

Public Member Functions

PLCORE_API HttpHandle ()
 Constructor.
PLCORE_API ~HttpHandle ()
 Destructor.
PLCORE_API bool IsOpen () const
 Check if the connection is currently open.
PLCORE_API bool Open (const String &sUrl, const String &sUsername, const String &sPassword)
 Open the connection.
PLCORE_API bool Close ()
 Close the connection.
PLCORE_API String GetResponse () const
 Get HTTP response string.
PLCORE_API String GetAuthenticate () const
 Get HTTP authenticate string.
PLCORE_API String GetServer () const
 Get HTTP server string.
PLCORE_API String GetDate () const
 Get HTTP date string.
PLCORE_API String GetContentType () const
 Get HTTP ContentType string.
PLCORE_API int GetContentLength () const
 Get HTTP content-length.
PLCORE_API uint32 Read (void *pBuffer, uint32 nSize, uint32 nCount)
 Reads data from the connection.
PLCORE_API bool Seek (int32 nOffset, File::ESeek nLocation)
 Sets the starting position.
PLCORE_API int32 Tell () const
 Returns the file position.
PLCORE_API bool IsEof () const
 Returns whether end of file has been reached.

Detailed Description

This class represents a tiny HTTP (Hypertext Transfer Protocol) client to download files via HTTP.

Remarks:
You don't need to use it directly, as you can also use the HTTP protocol through the File/Directory classes, e.g.: File("http://www.pixellight.org/welcome.html")
Note:
  • Port: 80/TCP

Constructor & Destructor Documentation

Destructor.


Member Function Documentation

PLCORE_API bool PLCore::HttpHandle::IsOpen ( ) const

Check if the connection is currently open.

Returns:
'true' if the connection is currently open, else 'false'
PLCORE_API bool PLCore::HttpHandle::Open ( const String sUrl,
const String sUsername,
const String sPassword 
)

Open the connection.

Parameters:
[in]sUrlURL
[in]sUsernameUsername
[in]sPasswordPassword
Returns:
'true', if the file could be opened, 'false' on error
PLCORE_API bool PLCore::HttpHandle::Close ( )

Close the connection.

Returns:
'true', if the file could be closed, 'false' on error

Get HTTP response string.

Returns:
HTTP response

Get HTTP authenticate string.

Returns:
HTTP authenticate-field
PLCORE_API String PLCore::HttpHandle::GetServer ( ) const

Get HTTP server string.

Returns:
HTTP server-field
PLCORE_API String PLCore::HttpHandle::GetDate ( ) const

Get HTTP date string.

Returns:
HTTP date-field

Get HTTP ContentType string.

Returns:
HTTP ContentType-field
PLCORE_API int PLCore::HttpHandle::GetContentLength ( ) const

Get HTTP content-length.

Returns:
HTTP ContentLength-field
PLCORE_API uint32 PLCore::HttpHandle::Read ( void *  pBuffer,
uint32  nSize,
uint32  nCount 
)

Reads data from the connection.

Parameters:
[out]pBufferBuffer to store the data (MUST be valid and large enough!)
[in]nSizeItem size in bytes
[in]nCountNumber of items to read
Returns:
Number of full read items, if != 'nCount' an error occurred
PLCORE_API bool PLCore::HttpHandle::Seek ( int32  nOffset,
File::ESeek  nLocation 
)

Sets the starting position.

Parameters:
[in]nOffsetFile offset in bytes relative to the given location
[in]nLocationLocation
Returns:
'true' if all went fine, else 'false'
PLCORE_API int32 PLCore::HttpHandle::Tell ( ) const

Returns the file position.

Returns:
Current position within the file, or < 0 on error
PLCORE_API bool PLCore::HttpHandle::IsEof ( ) const

Returns whether end of file has been reached.

Returns:
'true', if the end of the file has been reached, else 'false'

The documentation for this class was generated from the following file:


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:14
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported