Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
Ice::InputStream Class Referencefinal

Represents a byte buffer used for unmarshaling data encoded using the Slice encoding. More...

#include <Ice/Ice.h>

Inheritance diagram for Ice::InputStream:

Public Types

using size_type = std::size_t
 The size type for this byte buffer.

Public Member Functions

 InputStream (const CommunicatorPtr &communicator, const std::vector< std::byte > &bytes, SliceLoaderPtr sliceLoader=nullptr)
 Constructs an InputStream using a communicator and this communicator's default encoding version.
 InputStream (const CommunicatorPtr &communicator, EncodingVersion encoding, const std::vector< std::byte > &bytes, SliceLoaderPtr sliceLoader=nullptr)
 Constructs an InputStream using a communicator and encoding version.
 InputStream (const CommunicatorPtr &communicator, EncodingVersion encoding, std::pair< const std::byte *, const std::byte * > bytes, SliceLoaderPtr sliceLoader=nullptr)
 Constructs an InputStream using a communicator and encoding version.
 InputStream (const CommunicatorPtr &communicator, std::pair< const std::byte *, const std::byte * > bytes, SliceLoaderPtr sliceLoader=nullptr)
 Constructs an InputStream using a communicator and this communicator's default encoding version.
 InputStream (InputStream &&other) noexcept
 Move constructor.
void clear ()
 Releases any data retained by encapsulations.
void endEncapsulation ()
 Ends the current encapsulation.
void endException ()
 Marks the end of a user exception.
void endSlice ()
 Indicates that the end of a value or exception slice has been reached.
SlicedDataPtr endValue ()
 Marks the end of a class instance.
std::int32_t getEncapsulationSize ()
 Gets the size of the current encapsulation, excluding the encapsulation header.
const EncodingVersiongetEncoding () const
 Gets the current encoding version.
InputStreamoperator= (InputStream &&other) noexcept
 Move assignment operator.
size_type pos ()
 Gets the current position of the stream.
void pos (size_type p)
 Sets a new position for the stream.
void read (const char *&vdata, size_t &vsize, bool convert=true)
 Reads a string from the stream.
template<typename T>
void read (std::int32_t tag, T &v)
 Reads an optional value from the stream.
void read (std::string &v, bool convert=true)
 Reads a string from the stream.
void read (std::vector< std::string > &v, bool convert=true)
 Reads a sequence of strings from the stream.
template<typename T>
void read (T &v)
 Reads a value from the stream.
template<typename T>
void readAll (std::initializer_list< std::int32_t > tags, std::optional< T > &v)
 Reads an optional value (single element list) from the stream.
template<typename T, typename... Te>
void readAll (std::initializer_list< std::int32_t > tags, std::optional< T > &v, std::optional< Te > &... ve)
 Reads a list of optional values from the stream.
template<typename T>
void readAll (T &v)
 Reads a value (single element list) from the stream.
template<typename T, typename... Te>
void readAll (T &v, Te &... ve)
 Reads a list of values from the stream.
std::int32_t readAndCheckSeqSize (int minSize)
 Reads and validates a sequence size.
void readBlob (const std::byte *&v, Container::size_type sz)
 Reads a blob of bytes from the stream.
void readBlob (std::vector< std::byte > &bytes, std::int32_t sz)
 Reads a blob of bytes from the stream.
EncodingVersion readEncapsulation (const std::byte *&v, std::int32_t &sz)
 Returns a blob of bytes representing an encapsulation.
std::int32_t readEnum (std::int32_t maxValue)
 Reads an enumerator from the stream.
bool readOptional (std::int32_t tag, OptionalFormat expectedFormat)
 Checks if an optional value is available for reading.
void readPendingValues ()
 Indicates that unmarshaling is complete, except for any class instances.
std::int32_t readSize ()
 Reads a size from the stream.
void skip (size_type size)
 Advances the current stream position by the given number of bytes.
EncodingVersion skipEmptyEncapsulation ()
 Skips an empty encapsulation.
EncodingVersion skipEncapsulation ()
 Skips over an encapsulation.
void skipOptional (OptionalFormat format)
 Skips one optional value with the given format.
void skipOptionals ()
 Skips all remaining optional values.
void skipSize ()
 Reads a size at the current position and skips that number of bytes.
void skipSlice ()
 Skips over a value or exception slice.
const EncodingVersionstartEncapsulation ()
 Reads the start of an encapsulation.
void startException ()
 Marks the start of a user exception.
void startSlice ()
 Reads the start of a value or exception slice.
void startValue ()
 Marks the start of a class instance.
void swap (InputStream &other) noexcept
 Swaps the contents of one stream with another.
void throwException (UserExceptionFactory factory=nullptr)
 Reads a user exception from the stream and throws it.

Detailed Description

Represents a byte buffer used for unmarshaling data encoded using the Slice encoding.

Definition at line 49 of file InputStream.h.


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