#include <ossimCurlStreamBuffer.h>
Definition at line 24 of file ossimCurlStreamBuffer.h.
◆ CurlStreamBuffer()
◆ ~CurlStreamBuffer()
virtual ossim::CurlStreamBuffer::~CurlStreamBuffer |
( |
| ) |
|
|
inlinevirtual |
◆ clearAll()
void ossim::CurlStreamBuffer::clearAll |
( |
| ) |
|
|
protected |
◆ getAbsoluteByteOffset()
ossim_int64 ossim::CurlStreamBuffer::getAbsoluteByteOffset |
( |
| ) |
const |
|
protected |
◆ getBlockIndex()
◆ getBlockOffset()
◆ getBlockRangeInBytes()
◆ getBlockSize()
ossim_uint64 ossim::CurlStreamBuffer::getBlockSize |
( |
| ) |
const |
◆ getFileSize()
ossim_int64 ossim::CurlStreamBuffer::getFileSize |
( |
| ) |
const |
◆ is_open()
bool ossim::CurlStreamBuffer::is_open |
( |
| ) |
const |
|
inline |
◆ loadBlock()
bool ossim::CurlStreamBuffer::loadBlock |
( |
ossim_int64 |
absolutePosition | ) |
|
|
protected |
Definition at line 95 of file ossimCurlStreamBuffer.cpp.
References ossimHttpResponse::convertHeaderStreamToKeywordlist(), ossimWebResponse::copyAllDataFromInputStream(), ossimRefPtr< T >::get(), ossimHttpResponse::getContentLength(), ossimHttpResponse::getStatusCode(), and ossimHttpResponse::headerKwl().
104 if(absolutePosition<0)
return false;
112 stringStream <<
"bytes=" << startRange <<
"-" << endRange;
125 if((code >=200) && (code < 300))
std::basic_stringstream< char > stringstream
Class for char mixed input and output memory streams.
ossim_int64 getBlockIndex(ossim_int64 byteOffset) const
ossim_uint32 getStatusCode() const
Represents serializable keyword/value map.
ossim_int64 getContentLength() const
ossim_int64 m_bufferActualDataSize
ossimKeywordlist & headerKwl()
virtual ossimRefPtr< ossimWebResponse > getResponse()
ossim_int64 m_currentBlockPosition
std::vector< char > m_buffer
void addHeaderOption(const ossimString &name, const ossimString &value)
bool getBlockRangeInBytes(ossim_int64 blockIndex, ossim_int64 &startRange, ossim_int64 &endRange) const
void copyAllDataFromInputStream(ByteBuffer &buffer)
ossimCurlHttpRequest m_curlHttpRequest
void clearHeaderOptions()
void convertHeaderStreamToKeywordlist()
This will parse out the response code from the status line and initialize the header variables into a...
◆ open() [1/2]
Definition at line 181 of file ossimCurlStreamBuffer.cpp.
Referenced by ossim::CurlIStream::open().
185 std::string temp(connectionString);
186 return open(temp, options, m);
CurlStreamBuffer * open(const char *connectionString, const ossimKeywordlist &options, std::ios_base::openmode mode)
◆ open() [2/2]
Definition at line 189 of file ossimCurlStreamBuffer.cpp.
196 <<
"ossim::CurlStreamBuffer::open DEBUG: entered..... with connection " << connectionString << std::endl;
206 if( (url.getProtocol() ==
"http") || (url.getProtocol() ==
"https") )
237 <<
"ossim::CurlStreamBuffer::open DEBUG: Took " << delta <<
" seconds to open" << std::endl;
239 <<
"ossim::CurlStreamBuffer::open DEBUG: leaving....." << std::endl;
unsigned long long Timer_t
Represents serializable keyword/value map.
ossim_int64 getContentLength() const
ossim_int64 m_currentBlockPosition
static ossimTimer * instance()
bool set(const ossimUrl &url, const ossimKeywordlist &headerOptions, HttpMethodType methodType=HTTP_METHOD_GET)
ossimCurlHttpRequest m_curlHttpRequest
Timer_t tick() const
Get the timers tick value.
double delta_s(Timer_t t1, Timer_t t2) const
Get the time in seconds between timer ticks t1 and t2.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
◆ seekoff()
ossim::CurlStreamBuffer::pos_type ossim::CurlStreamBuffer::seekoff |
( |
off_type |
offset, |
|
|
std::ios_base::seekdir |
dir, |
|
|
std::ios_base::openmode |
__mode = std::ios_base::in | std::ios_base::out |
|
) |
| |
|
protectedvirtual |
Definition at line 289 of file ossimCurlStreamBuffer.cpp.
296 pos_type result = pos_type(off_type(-1));
298 if((mode & std::ios_base::in)&&
299 (mode & std::ios_base::out))
305 case std::ios_base::beg:
322 result = pos_type(offset);
331 else if(mode & std::ios_base::in)
335 setg(eback(), gptr()+delta, egptr());
341 case std::ios_base::cur:
361 setg(eback(), gptr()+offset, egptr());
368 case std::ios_base::end:
389 ossim_int64 delta = absolutePosition-currentAbsolutePosition;
393 if(mode & std::ios_base::in )
395 setg(eback(), gptr()+delta, egptr());
398 result = absolutePosition;
ossim_int64 getAbsoluteByteOffset() const
bool loadBlock(ossim_int64 absolutePosition)
◆ seekpos()
ossim::CurlStreamBuffer::pos_type ossim::CurlStreamBuffer::seekpos |
( |
pos_type |
pos, |
|
|
std::ios_base::openmode |
mode = std::ios_base::in | std::ios_base::out |
|
) |
| |
|
protectedvirtual |
Definition at line 412 of file ossimCurlStreamBuffer.cpp.
415 pos_type result = pos_type(off_type(-1));
426 if(mode & std::ios_base::in)
433 setg(eback(), gptr()+delta, egptr());
ossim_int64 getAbsoluteByteOffset() const
bool loadBlock(ossim_int64 absolutePosition)
◆ underflow()
int ossim::CurlStreamBuffer::underflow |
( |
| ) |
|
|
protectedvirtual |
Definition at line 259 of file ossimCurlStreamBuffer.cpp.
268 if(absolutePosition < 0)
ossim_int64 getAbsoluteByteOffset() const
bool withinWindow() const
bool loadBlock(ossim_int64 absolutePosition)
unsigned char ossim_uint8
◆ withinWindow()
bool ossim::CurlStreamBuffer::withinWindow |
( |
| ) |
const |
|
protected |
◆ xsgetn()
std::streamsize ossim::CurlStreamBuffer::xsgetn |
( |
char_type * |
s, |
|
|
std::streamsize |
n |
|
) |
| |
|
protectedvirtual |
Definition at line 442 of file ossimCurlStreamBuffer.cpp.
References n.
474 bytesNeedToRead = (
m_fileSize - currentAbsolutePosition);
477 while(bytesNeedToRead > 0)
490 if(currentAbsolutePosition>=0)
496 if(delta <= bytesNeedToRead)
498 std::memcpy(s+bytesRead, gptr(), delta);
502 bytesNeedToRead-=delta;
504 setg(eback(), gptr()+delta, egptr());
509 std::memcpy(s+bytesRead, gptr(), bytesNeedToRead);
510 setg(eback(), gptr()+bytesNeedToRead, egptr());
513 bytesRead+=bytesNeedToRead;
522 return std::streamsize(bytesRead);
ossim_int64 getAbsoluteByteOffset() const
bool withinWindow() const
os2<< "> n<< " > nendobj n
bool loadBlock(ossim_int64 absolutePosition)
◆ m_bucket
std::string ossim::CurlStreamBuffer::m_bucket |
|
protected |
◆ m_buffer
std::vector<char> ossim::CurlStreamBuffer::m_buffer |
|
protected |
◆ m_bufferActualDataSize
ossim_int64 ossim::CurlStreamBuffer::m_bufferActualDataSize |
|
protected |
◆ m_bufferPtr
char* ossim::CurlStreamBuffer::m_bufferPtr |
|
protected |
◆ m_curlHttpRequest
◆ m_currentBlockPosition
ossim_int64 ossim::CurlStreamBuffer::m_currentBlockPosition |
|
protected |
◆ m_fileSize
◆ m_key
std::string ossim::CurlStreamBuffer::m_key |
|
protected |
◆ m_opened
bool ossim::CurlStreamBuffer::m_opened |
|
protected |
The documentation for this class was generated from the following files: