Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
ustl::istringstream Class Reference

A stream that reads textual data from a memory block. More...

#include <ustl.h>

Inheritance diagram for ustl::istringstream:
ustl::istream ustl::cmemlink ustl::ios_base ustl::ifstream

Public Member Functions

 istringstream (void) noexcept
 Default constructor.
 
 istringstream (const void *p, size_type n) noexcept
 
 istringstream (const cmemlink &source) noexcept
 
void iread (int8_t &v)
 
void iread (int32_t &v)
 
void iread (double &v)
 
void iread (bool &v)
 
void iread (wchar_t &v)
 
void iread (string &v)
 
void iread (int64_t &v)
 
string str (void) const
 
istringstreamstr (const string &s)
 
istringstreamget (char &c)
 
int get (void)
 
istringstreamget (char *p, size_type n, char delim= '\n')
 Reads characters into p,n until delim is found (but not stored or extracted)
 
istringstreamget (string &s, char delim= '\n')
 Reads characters into s until delim is found (but not stored or extracted)
 
istringstreamgetline (char *p, size_type n, char delim= '\n')
 Reads characters into p,n until delim is extracted (but not stored)
 
istringstreamgetline (string &s, char delim= '\n')
 Reads characters into s until delim is extracted (but not stored)
 
istringstreamignore (size_type n, char delim= '\0')
 Extract until delim or n chars have been read.
 
char peek (void)
 
istringstreamputback (char)
 
istringstreamunget (void)
 
void set_delimiters (const char *delimiters)
 Sets delimiters to the contents of delimiters.
 
void set_base (short base)
 Sets the numeric base used to read numbers.
 
void set_decimal_separator (char)
 
void set_thousand_separator (char)
 
istringstreamread (void *buffer, size_type size)
 
istringstreamread (memlink &buf)
 
istringstreamseekg (off_t p, seekdir d=beg)
 
int sync (void)
 
- Public Member Functions inherited from ustl::istream
 istream (const void *p, streamsize n)
 
 istream (const cmemlink &source)
 
 istream (const ostream &source) noexcept
 Attaches to the block pointed to by source of size source.pos()
 
iterator end (void) const
 
void link (const void *p, streamsize n)
 
void link (const cmemlink &l)
 
void link (const void *f, const void *l)
 
void relink (const void *p, streamsize n)
 
void relink (const cmemlink &l)
 
virtual void unlink (void) noexcept override
 
virtual streamsize underflow (streamsize=1)
 
uoff_t pos (void) const
 
const_iterator ipos (void) const
 
streamsize remaining (void) const
 
void seek (uoff_t newPos)
 Sets the current read position to newPos.
 
void iseek (const_iterator newPos)
 Sets the current read position to newPos.
 
void skip (streamsize nBytes)
 Skips nBytes without reading them.
 
bool aligned (streamsize grain=c_DefaultAlignment) const
 Returns true if the read position is aligned on grain.
 
bool verify_remaining (const char *op, const char *type, streamsize n)
 Checks that n bytes are available in the stream, or else throws.
 
streamsize align_size (streamsize grain=c_DefaultAlignment) const
 Returns the number of bytes to skip to be aligned on grain.
 
void align (streamsize grain=c_DefaultAlignment)
 aligns the read position on grain
 
void swap (istream &is)
 Swaps contents with is.
 
void read (void *buffer, streamsize size)
 Reads n bytes into buffer.
 
void read (memlink &buf)
 
void read_strz (string &str)
 Reads a null-terminated string into str.
 
streamsize readsome (void *s, streamsize n)
 Reads at most n bytes into s.
 
void read (istream &)
 
void write (ostream &os) const
 Writes all unread bytes into os.
 
void text_write (ostringstream &os) const
 Writes the object to stream os.
 
streamsize stream_size (void) const
 
template<typename T >
void iread (T &v)
 Reads type T from the stream via a direct pointer cast.
 
void ungetc (void)
 
off_t tellg (void) const
 
void seekg (off_t p, seekdir d=beg)
 Sets the current write position to p based on d.
 
- Public Member Functions inherited from ustl::ios_base
iostate rdstate (void) const
 
bool bad (void) const
 
bool good (void) const
 
bool fail (void) const
 
bool eof (void) const
 
bool operator! (void) const
 
 operator void * (void) const
 
void clear (iostate v=goodbit)
 
void setstate (iostate v)
 
iostate exceptions (void) const
 
iostate exceptions (iostate v)
 

Static Public Attributes

static const size_type c_MaxDelimiters = 16
 Maximum number of word delimiters.
 
- Static Public Attributes inherited from ustl::ios_base
static const char c_DefaultDelimiters [16] = DEFAULT_DELIMITERS
 Default word delimiters for stringstreams.
 

Protected Member Functions

char skip_delimiters (void)
 
- Protected Member Functions inherited from ustl::ios_base
bool set_and_throw (iostate v)
 
void overrun (const char *op, const char *type, uint32_t n, uint32_t p, uint32_t rem)
 Checks that n bytes are available in the stream, or else throws.
 

Additional Inherited Members

- Public Types inherited from ustl::ios_base
enum  fmtflags {
  boolalpha = (1 << 0),
  dec = (1 << 1),
  fixed = (1 << 2),
  hex = (1 << 3),
  internal = (1 << 4),
  left = (1 << 5),
  oct = (1 << 6),
  right = (1 << 7),
  scientific = (1 << 8),
  showbase = (1 << 9),
  showpoint = (1 << 10),
  showpos = (1 << 11),
  skipws = (1 << 12),
  unitbuf = (1 << 13),
  uppercase = (1 << 14),
  adjustfield = (1 << 15),
  basefield = (1 << 16),
  floatfield = (1 << 17)
}
 Used to set parameters for stringstreams. More...
 
enum  openmode_bits {
  in = (1 << 0),
  out = (1 << 1),
  app = (1 << 2),
  ate = (1 << 3),
  binary = (1 << 4),
  trunc = (1 << 5)
}
 For file-based streams, specifies fd mode.
 
enum  seekdir {
  beg,
  cur,
  end
}
 Seek directions, equivalent to SEEK_SET, SEEK_CUR, and SEEK_END.
 
enum  iostate_bits {
  goodbit = 0,
  badbit = (1 << 0),
  eofbit = (1 << 1),
  failbit = (1 << 2)
}
 I/O state bitmasks.
 
typedef uint32_t openmode
 Holds openmode_bits.
 
typedef uint32_t iostate
 Holds iostate_bits for a file stream.
 
typedef file_exception failure
 Thrown by fstream on errors.
 

Detailed Description

A stream that reads textual data from a memory block.


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

Generated on Mon Sep 28 2015 17:58:50 for uSTL by Doxygen 1.8.10