Cinder  0.9.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
cinder::IStreamUrl Class Reference

#include <Url.h>

Inherits cinder::IStreamCinder.

Public Types

enum  Endianness { STREAM_BIG_ENDIAN, STREAM_LITTLE_ENDIAN }
 

Public Member Functions

virtual size_t readDataAvailable (void *dest, size_t maxSize)
 
virtual void seekAbsolute (off_t absoluteOffset)
 
virtual void seekRelative (off_t relativeOffset)
 
virtual off_t tell () const
 
virtual off_t size () const
 
virtual bool isEof () const
 
std::string getUser () const
 
std::string getPassword () const
 
template<typename T >
void read (T *t)
 
void read (std::string *s)
 
void read (fs::path *p)
 
template<typename T >
void readEndian (T *t, uint8_t endian)
 
template<typename T >
void readBig (T *t)
 
template<typename T >
void readLittle (T *t)
 
void readFixedString (char *t, size_t maxSize, bool nullTerminate)
 
void readFixedString (std::string *t, size_t size)
 
std::string readLine ()
 
void readData (void *dest, size_t size)
 
const fs::path & getFileName () const
 
void setFileName (const fs::path &aFileName)
 
bool getDeleteOnDestroy () const
 
void setDeleteOnDestroy (bool enable=true)
 

Static Public Member Functions

static IStreamUrlRef create (const Url &url, const std::string &user="", const std::string &password="", const UrlOptions &options=UrlOptions())
 
static uint8_t getNativeEndianness ()
 

Protected Member Functions

 IStreamUrl (const std::string &url, const std::string &user, const std::string &password, const UrlOptions &options)
 
virtual void IORead (void *t, size_t size)
 
virtual void IOWrite (const void *t, size_t size)
 

Protected Attributes

std::shared_ptr< IStreamUrlImpl > mImpl
 
fs::path mFileName
 
bool mDeleteOnDestroy
 

Static Protected Attributes

static const int MINIMUM_BUFFER_SIZE = 8
 

Detailed Description

Warning
IStreamUrl does not currently support proper random access

Member Enumeration Documentation

Enumerator
STREAM_BIG_ENDIAN 
STREAM_LITTLE_ENDIAN 

Constructor & Destructor Documentation

cinder::IStreamUrl::IStreamUrl ( const std::string &  url,
const std::string &  user,
const std::string &  password,
const UrlOptions options 
)
protected

Member Function Documentation

IStreamUrlRef cinder::IStreamUrl::create ( const Url url,
const std::string &  user = "",
const std::string &  password = "",
const UrlOptions options = UrlOptions() 
)
static

Creates a new IStreamUrlRef from the Url url with an optional login and password.

virtual size_t cinder::IStreamUrl::readDataAvailable ( void *  dest,
size_t  maxSize 
)
virtual

Implements cinder::IStreamCinder.

virtual void cinder::IStreamUrl::seekAbsolute ( off_t  absoluteOffset)
virtual

Sets the current position of the stream to byte absoluteOffset. A negative offset is relative to the end of the file.

Implements cinder::StreamBase.

virtual void cinder::IStreamUrl::seekRelative ( off_t  relativeOffset)
virtual

Moves the current position of the stream by relativeOffset bytes.

Implements cinder::StreamBase.

virtual off_t cinder::IStreamUrl::tell ( ) const
virtual

Returns the current position of the stream measured in bytes **/.

Implements cinder::StreamBase.

virtual off_t cinder::IStreamUrl::size ( ) const
virtual

Implements cinder::IStreamCinder.

virtual bool cinder::IStreamUrl::isEof ( ) const
virtual

Implements cinder::IStreamCinder.

std::string cinder::IStreamUrl::getUser ( ) const
std::string cinder::IStreamUrl::getPassword ( ) const
virtual void cinder::IStreamUrl::IORead ( void *  t,
size_t  size 
)
protectedvirtual

Implements cinder::IStreamCinder.

virtual void cinder::IStreamUrl::IOWrite ( const void *  t,
size_t  size 
)
protectedvirtual

IStreamURL does not yet support writing.

template<typename T >
void cinder::IStreamCinder::read ( T *  t)
inherited
void cinder::IStreamCinder::read ( std::string *  s)
inherited

Reads characters until a null terminator.

void cinder::IStreamCinder::read ( fs::path *  p)
inherited
template<typename T >
void cinder::IStreamCinder::readEndian ( T *  t,
uint8_t  endian 
)
inherited
template<typename T >
void cinder::IStreamCinder::readBig ( T *  t)
inherited
template<typename T >
void cinder::IStreamCinder::readLittle ( T *  t)
inherited
void cinder::IStreamCinder::readFixedString ( char *  t,
size_t  maxSize,
bool  nullTerminate 
)
inherited
void cinder::IStreamCinder::readFixedString ( std::string *  t,
size_t  size 
)
inherited
std::string cinder::IStreamCinder::readLine ( )
inherited
void cinder::IStreamCinder::readData ( void *  dest,
size_t  size 
)
inherited
static uint8_t cinder::StreamBase::getNativeEndianness ( )
staticinherited

Returns the platform's endianness as a StreamBase::Endianness.

const fs::path& cinder::StreamBase::getFileName ( ) const
inherited

Returns the file name of the path from which a Stream originated when relevant. Empty string when undefined.

void cinder::StreamBase::setFileName ( const fs::path &  aFileName)
inherited

Sets the file name of the path from which a Stream originated when relevant. Empty string when undefined.

bool cinder::StreamBase::getDeleteOnDestroy ( ) const
inherited

Returns whether the Stream has been requested to destroy its source upon its own destruction. For example, IStreamFile will delete its source file. Ignored in some types of streams. Defaults to false.

void cinder::StreamBase::setDeleteOnDestroy ( bool  enable = true)
inherited

Sets whether the Stream has been requested to destroy its source upon its own destruction. For example, IStreamFile will delete its source file. Ignored in some types of streams. Defaults to false.

Member Data Documentation

std::shared_ptr<IStreamUrlImpl> cinder::IStreamUrl::mImpl
protected
const int cinder::IStreamCinder::MINIMUM_BUFFER_SIZE = 8
staticprotectedinherited
fs::path cinder::StreamBase::mFileName
protectedinherited
bool cinder::StreamBase::mDeleteOnDestroy
protectedinherited

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