Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

stream_input_common Class Reference

interface of stream implementation for reading from file, socket More...

#include <miscxml.h>

Inheritance diagram for stream_input_common:

byte_source terimber_socket

List of all members.

Public Member Functions

 stream_input_common (mem_pool_t &small_pool, mem_pool_t &big_pool, size_t xml_size, bool subset, size_t timeout=10000)
 constructor
bool open (const xml_stream_attribute &location)
 opens stream source
void close ()
 closes stream
virtual ~stream_input_common ()
 destructor

Protected Member Functions

virtual bool data_request (ub1_t *buf, size_t &len)
 gets actual data from stream

Private Attributes

xml_stream_protocol _protocol
 stream protocol
FILE * _desc
 file decriptor
size_t _timeout
 timeout
ub4_t _file_length
 file length


Detailed Description

interface of stream implementation for reading from file, socket

Definition at line 135 of file miscxml.h.


Constructor & Destructor Documentation

stream_input_common::stream_input_common ( mem_pool_t small_pool,
mem_pool_t big_pool,
size_t  xml_size,
bool  subset,
size_t  timeout = 10000 
)

constructor

Parameters:
small_pool  small memory pool
big_pool  big memory pool
xml_size  xml size - just a tip
subset  subset flag
timeout  timeout for sockets

Definition at line 581 of file miscxml.cpp.

stream_input_common::~stream_input_common (  )  [virtual]

destructor

Definition at line 591 of file miscxml.cpp.

References close().


Member Function Documentation

void stream_input_common::close (  ) 

bool stream_input_common::data_request ( ub1_t buf,
size_t &  len 
) [protected, virtual]

gets actual data from stream

Parameters:
buf  pre-allocated buffer
len  [in,out] [in] buffer size, [out] obtained bytes

Implements byte_source.

Definition at line 598 of file miscxml.cpp.

References _desc, _file_length, _protocol, _timeout, close(), terimber_socket::receive(), STREAM_FILE, STREAM_FTP, STREAM_HTTP, STREAM_LOCAL, STREAM_RELATIVE, and STREAM_UNKNOWN.


Member Data Documentation

stream protocol

Definition at line 165 of file miscxml.h.

Referenced by close(), data_request(), and open().

FILE* stream_input_common::_desc [private]

file decriptor

Definition at line 166 of file miscxml.h.

Referenced by close(), data_request(), and open().

timeout

Definition at line 167 of file miscxml.h.

Referenced by data_request(), and open().

file length

Definition at line 168 of file miscxml.h.

Referenced by close(), data_request(), and open().


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


© Copyright Terimber 2003-.