BazisLib::Network::HTTP::HTTPFile Class Reference

Represents an AIFile-compatible HTTP-accessed file. More...

#include <http.h>

Inherits BazisLib::BasicFileBase.

Collaboration diagram for BazisLib::Network::HTTP::HTTPFile:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 HTTPFile (ManagedPointer< AutoHTTPClient > pClient, const std::string &URL, const std::string &Login, const std::string &Password, bool CacheRead=true, PNETPROGRESSPROC pProgress=NULL, void *pContext=NULL, unsigned ThreadID=0, unsigned MaxReconnectAttempts=10, const ConstManagedPointer< ACHTTPRequest > *ppHeaderOverride=NULL)
virtual ~HTTPFile ()
virtual bool Valid ()
virtual size_t Read (void *pBuffer, size_t size, ActionStatus *pStatus=NULL, bool IncompleteReadSupported=false) override
 Reads data from the file (or stream).
size_t ReadAt (void *pBuffer, ULONGLONG offset, size_t size, IoCompletion *pCompletion=NULL, ActionStatus *pStatus=NULL, bool IncompleteReadSupported=false)
virtual size_t ReadAt (void *pBuffer, ULONGLONG offset, size_t size, IoCompletion *pCompletion=NULL, ActionStatus *pStatus=NULL) override
virtual LONGLONG GetSize (ActionStatus *pStatus=NULL) override
virtual LONGLONG Seek (LONGLONG Offset, FileFlags::SeekType seekType, ActionStatus *pStatus=NULL) override
virtual LONGLONG GetPosition (ActionStatus *pStatus=NULL) override
void CancelIO ()
unsigned GetHTTPErrorCode ()

Protected Member Functions

bool CreateStream (size_t BytesToRead=0, ActionStatus *pStatus=NULL)
 Creates a HTTP reply stream for current offset.

Private Types

enum  { MAX_SKIP_BY_READ_AMOUNT = 512 }

Private Member Functions

 DECLARE_REFERENCE (AutoHTTPClient, m_pClient)
 DECLARE_REFERENCE (CHTTPReplyStream, m_pStream)
 DECLARE_REFERENCE (ACHTTPRequest, m_pHeaderOverride)

Private Attributes

InProcessMutex m_StreamDeletionMutex
std::string m_URL
std::string m_Login
std::string m_Password
ULONGLONG m_CurrentOffset
PNETPROGRESSPROC m_pProgress
void * m_pProgressCtx
bool m_bCacheRead
bool m_bNonSeekable
unsigned m_ThreadID
unsigned m_LastHTTPResultCode
unsigned m_MaxReconnectAttempts


Detailed Description

Represents an AIFile-compatible HTTP-accessed file.

Objects of this class are created inside the AutoHTTPClient class and should not be created directly.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
MAX_SKIP_BY_READ_AMOUNT 


Constructor & Destructor Documentation

BazisLib::Network::HTTP::HTTPFile::HTTPFile ( ManagedPointer< AutoHTTPClient pClient,
const std::string &  URL,
const std::string &  Login,
const std::string &  Password,
bool  CacheRead = true,
PNETPROGRESSPROC  pProgress = NULL,
void *  pContext = NULL,
unsigned  ThreadID = 0,
unsigned  MaxReconnectAttempts = 10,
const ConstManagedPointer< ACHTTPRequest > *  ppHeaderOverride = NULL 
) [inline]

virtual BazisLib::Network::HTTP::HTTPFile::~HTTPFile (  )  [virtual]


Member Function Documentation

void BazisLib::Network::HTTP::HTTPFile::CancelIO (  )  [inline]

bool BazisLib::Network::HTTP::HTTPFile::CreateStream ( size_t  BytesToRead = 0,
ActionStatus pStatus = NULL 
) [protected]

Creates a HTTP reply stream for current offset.

BazisLib::Network::HTTP::HTTPFile::DECLARE_REFERENCE ( ACHTTPRequest  ,
m_pHeaderOverride   
) [private]

BazisLib::Network::HTTP::HTTPFile::DECLARE_REFERENCE ( CHTTPReplyStream  ,
m_pStream   
) [private]

BazisLib::Network::HTTP::HTTPFile::DECLARE_REFERENCE ( AutoHTTPClient  ,
m_pClient   
) [private]

unsigned BazisLib::Network::HTTP::HTTPFile::GetHTTPErrorCode (  )  [inline]

virtual LONGLONG BazisLib::Network::HTTP::HTTPFile::GetPosition ( ActionStatus pStatus = NULL  )  [override, virtual]

Reimplemented from BazisLib::BasicFileBase.

virtual LONGLONG BazisLib::Network::HTTP::HTTPFile::GetSize ( ActionStatus pStatus = NULL  )  [override, virtual]

Reimplemented from BazisLib::BasicFileBase.

virtual size_t BazisLib::Network::HTTP::HTTPFile::Read ( void *  pBuffer,
size_t  size,
ActionStatus pStatus = NULL,
bool  IncompleteReadSupported = false 
) [override, virtual]

Reads data from the file (or stream).

Parameters:
IncompleteReadSupported If this parameter is true, the Read() method can return a value different from the size parameter even when the EOF is not reached. For example, this can happen if a file is actually a network stream and some data is already in the buffer. However, if this parameter is false, the stream will wait till the end of connection, or till the requested amount of bytes will be received. Non-stream implementations can safely ignore this parameter and always wait for the end-of-file, or exactly the requested number of bytes.

Reimplemented from BazisLib::BasicFileBase.

virtual size_t BazisLib::Network::HTTP::HTTPFile::ReadAt ( void *  pBuffer,
ULONGLONG  offset,
size_t  size,
IoCompletion *  pCompletion = NULL,
ActionStatus pStatus = NULL 
) [inline, override, virtual]

Reimplemented from BazisLib::BasicFileBase.

Here is the call graph for this function:

size_t BazisLib::Network::HTTP::HTTPFile::ReadAt ( void *  pBuffer,
ULONGLONG  offset,
size_t  size,
IoCompletion *  pCompletion = NULL,
ActionStatus pStatus = NULL,
bool  IncompleteReadSupported = false 
)

virtual LONGLONG BazisLib::Network::HTTP::HTTPFile::Seek ( LONGLONG  Offset,
FileFlags::SeekType  seekType,
ActionStatus pStatus = NULL 
) [override, virtual]

Reimplemented from BazisLib::BasicFileBase.

virtual bool BazisLib::Network::HTTP::HTTPFile::Valid (  )  [inline, virtual]


Member Data Documentation


The documentation for this class was generated from the following file:
SourceForge.net Logo