8#ifndef INCLUDED_BSLX_BYTEINSTREAM
9#define INCLUDED_BSLX_BYTEINSTREAM
362#include <bslscm_version.h>
371#include <bsl_cstddef.h>
372#include <bsl_iosfwd.h>
373#include <bsl_string.h>
374#include <bsl_vector.h>
397 const char *d_buffer;
399 bsl::size_t d_numBytes;
404 bsl::size_t d_cursor;
476 void reset(
const char *buffer, bsl::size_t numBytes);
924 operator const void *()
const;
927 bsl::size_t
cursor()
const;
932 const char *
data()
const;
948 bsl::size_t
length()
const;
986, d_numBytes(numBytes)
995: d_buffer(srcData.data())
996, d_numBytes(static_cast<int>(srcData.length()))
1017 if (127 <
static_cast<unsigned char>(d_buffer[
cursor()])) {
1048 unsigned char tmp = 0;
1058 d_validFlag =
false;
1074 d_numBytes = numBytes;
1082 d_buffer = srcData.
data();
1083 d_numBytes = srcData.
length();
1378 return getInt8(
reinterpret_cast<char&
>(variable));
1390 return getInt8(
reinterpret_cast<char&
>(variable));
1456 enum { k_INITIAL_ALLOCATION_SIZE = 16 * 1024 * 1024 };
1458 const int initialLength =
length < k_INITIAL_ALLOCATION_SIZE
1460 : k_INITIAL_ALLOCATION_SIZE;
1462 variable.
resize(initialLength);
1872 return getArrayInt8(
reinterpret_cast<char *
>(variables), numVariables);
1891 return getArrayInt8(
reinterpret_cast<char *
>(variables), numVariables);
1949ByteInStream::operator
const void *()
const
1951 return isValid() ? this : 0;
1963 return d_numBytes ? d_buffer : 0;
1984template <
class TYPE>
Definition bslstl_string.h:1281
CHAR_TYPE & front()
Definition bslstl_string.h:5502
void resize(size_type newLength, CHAR_TYPE character)
Definition bslstl_string.h:5364
Definition bslstl_stringref.h:372
const CHAR_TYPE * data() const
Definition bslstl_stringref.h:936
size_type length() const
Definition bslstl_stringref.h:958
Definition bslx_byteinstream.h:394
ByteInStream & getArrayInt40(bsls::Types::Int64 *variables, int numVariables)
Definition bslx_byteinstream.h:1636
ByteInStream & getFloat64(double &variable)
Definition bslx_byteinstream.h:1396
ByteInStream & getInt8(char &variable)
Definition bslx_byteinstream.h:1357
ByteInStream & getInt56(bsls::Types::Int64 &variable)
Definition bslx_byteinstream.h:1129
bsl::size_t cursor() const
Return the index of the next byte to be extracted from this stream.
Definition bslx_byteinstream.h:1955
bool isEmpty() const
Definition bslx_byteinstream.h:1967
ByteInStream & getArrayUint16(unsigned short *variables, int numVariables)
Definition bslx_byteinstream.h:1815
bsl::size_t length() const
Definition bslx_byteinstream.h:1979
ByteInStream & getInt40(bsls::Types::Int64 &variable)
Definition bslx_byteinstream.h:1205
ByteInStream & getArrayInt64(bsls::Types::Int64 *variables, int numVariables)
Definition bslx_byteinstream.h:1480
ByteInStream & getUint8(char &variable)
Definition bslx_byteinstream.h:1382
ByteInStream & getUint16(unsigned short &variable)
Definition bslx_byteinstream.h:1338
ByteInStream & getUint48(bsls::Types::Uint64 &variable)
Definition bslx_byteinstream.h:1186
ByteInStream & getUint64(bsls::Types::Uint64 &variable)
Definition bslx_byteinstream.h:1110
ByteInStream & getUint24(unsigned int &variable)
Definition bslx_byteinstream.h:1300
ByteInStream & getUint40(bsls::Types::Uint64 &variable)
Definition bslx_byteinstream.h:1224
ByteInStream & getArrayInt24(int *variables, int numVariables)
Definition bslx_byteinstream.h:1739
ByteInStream & getArrayInt16(short *variables, int numVariables)
Definition bslx_byteinstream.h:1790
ByteInStream & getArrayInt56(bsls::Types::Int64 *variables, int numVariables)
Definition bslx_byteinstream.h:1532
ByteInStream & getLength(int &length)
Definition bslx_byteinstream.h:1009
ByteInStream()
Definition bslx_byteinstream.h:975
ByteInStream & getInt48(bsls::Types::Int64 &variable)
Definition bslx_byteinstream.h:1167
ByteInStream & getArrayUint24(unsigned int *variables, int numVariables)
Definition bslx_byteinstream.h:1764
void reset()
Definition bslx_byteinstream.h:1062
ByteInStream & getArrayFloat64(double *variables, int numVariables)
Definition bslx_byteinstream.h:1897
ByteInStream & getArrayInt48(bsls::Types::Int64 *variables, int numVariables)
Definition bslx_byteinstream.h:1584
ByteInStream & getArrayUint32(unsigned int *variables, int numVariables)
Definition bslx_byteinstream.h:1713
ByteInStream & getArrayUint56(bsls::Types::Uint64 *variables, int numVariables)
Definition bslx_byteinstream.h:1558
ByteInStream & getArrayFloat32(float *variables, int numVariables)
Definition bslx_byteinstream.h:1923
ByteInStream & getArrayUint8(char *variables, int numVariables)
Definition bslx_byteinstream.h:1876
bool isValid() const
Definition bslx_byteinstream.h:1973
ByteInStream & getArrayInt8(char *variables, int numVariables)
Definition bslx_byteinstream.h:1841
friend bsl::ostream & operator<<(bsl::ostream &stream, const ByteInStream &object)
ByteInStream & getInt32(int &variable)
Definition bslx_byteinstream.h:1243
ByteInStream & getArrayInt32(int *variables, int numVariables)
Definition bslx_byteinstream.h:1688
void invalidate()
Definition bslx_byteinstream.h:1056
ByteInStream & getArrayUint64(bsls::Types::Uint64 *variables, int numVariables)
Definition bslx_byteinstream.h:1506
ByteInStream & getArrayUint48(bsls::Types::Uint64 *variables, int numVariables)
Definition bslx_byteinstream.h:1610
~ByteInStream()
Destroy this object.
Definition bslx_byteinstream.h:1003
ByteInStream & getInt64(bsls::Types::Int64 &variable)
Definition bslx_byteinstream.h:1091
ByteInStream & getFloat32(float &variable)
Definition bslx_byteinstream.h:1415
ByteInStream & getInt16(short &variable)
Definition bslx_byteinstream.h:1319
ByteInStream & getArrayUint40(bsls::Types::Uint64 *variables, int numVariables)
Definition bslx_byteinstream.h:1662
ByteInStream & getString(bsl::string &variable)
Definition bslx_byteinstream.h:1436
ByteInStream & getUint32(unsigned int &variable)
Definition bslx_byteinstream.h:1262
ByteInStream & getUint56(bsls::Types::Uint64 &variable)
Definition bslx_byteinstream.h:1148
ByteInStream & getInt24(int &variable)
Definition bslx_byteinstream.h:1281
ByteInStream & getVersion(int &version)
Definition bslx_byteinstream.h:1041
const char * data() const
Definition bslx_byteinstream.h:1961
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
STREAM & bdexStreamIn(STREAM &stream, VALUE_TYPE &variable)
Definition bslx_instreamfunctions.h:1247
Definition bslx_byteinstream.h:377
bsl::ostream & operator<<(bsl::ostream &stream, const ByteInStream &object)
ByteInStream & operator>>(ByteInStream &stream, TYPE &value)
Definition bslx_byteinstream.h:1986
unsigned long long Uint64
Definition bsls_types.h:137
long long Int64
Definition bsls_types.h:132
static void getArrayFloat64(double *variables, const char *buffer, int numVariables)
static void getArrayInt24(int *variables, const char *buffer, int numVariables)
static void getUint24(unsigned int *variable, const char *buffer)
Definition bslx_marshallingutil.h:1291
static void getInt56(bsls::Types::Int64 *variable, const char *buffer)
Definition bslx_marshallingutil.h:1072
static void getInt32(int *variable, const char *buffer)
Definition bslx_marshallingutil.h:1222
static void getFloat32(float *variable, const char *buffer)
Definition bslx_marshallingutil.h:1412
static void getArrayUint48(bsls::Types::Uint64 *variables, const char *buffer, int numVariables)
static void getArrayFloat32(float *variables, const char *buffer, int numVariables)
static void getUint16(unsigned short *variable, const char *buffer)
Definition bslx_marshallingutil.h:1335
static void getUint64(bsls::Types::Uint64 *variable, const char *buffer)
Definition bslx_marshallingutil.h:1043
static void getInt40(bsls::Types::Int64 *variable, const char *buffer)
Definition bslx_marshallingutil.h:1174
static void getUint56(bsls::Types::Uint64 *variable, const char *buffer)
Definition bslx_marshallingutil.h:1098
static void getInt64(bsls::Types::Int64 *variable, const char *buffer)
Definition bslx_marshallingutil.h:1014
static void getArrayInt56(bsls::Types::Int64 *variables, const char *buffer, int numVariables)
@ k_SIZEOF_INT8
Definition bslx_marshallingutil.h:279
@ k_SIZEOF_INT48
Definition bslx_marshallingutil.h:274
@ k_SIZEOF_FLOAT64
Definition bslx_marshallingutil.h:280
@ k_SIZEOF_INT64
Definition bslx_marshallingutil.h:272
@ k_SIZEOF_INT24
Definition bslx_marshallingutil.h:277
@ k_SIZEOF_INT56
Definition bslx_marshallingutil.h:273
@ k_SIZEOF_INT16
Definition bslx_marshallingutil.h:278
@ k_SIZEOF_FLOAT32
Definition bslx_marshallingutil.h:281
@ k_SIZEOF_INT40
Definition bslx_marshallingutil.h:275
@ k_SIZEOF_INT32
Definition bslx_marshallingutil.h:276
static void getArrayInt32(int *variables, const char *buffer, int numVariables)
static void getArrayUint64(bsls::Types::Uint64 *variables, const char *buffer, int numVariables)
static void getArrayInt48(bsls::Types::Int64 *variables, const char *buffer, int numVariables)
static void getArrayInt8(char *variables, const char *buffer, int numVariables)
Definition bslx_marshallingutil.h:1474
static void getArrayUint56(bsls::Types::Uint64 *variables, const char *buffer, int numVariables)
static void getArrayUint16(unsigned short *variables, const char *buffer, int numVariables)
static void getInt16(short *variable, const char *buffer)
Definition bslx_marshallingutil.h:1312
static void getArrayUint32(unsigned int *variables, const char *buffer, int numVariables)
static void getFloat64(double *variable, const char *buffer)
Definition bslx_marshallingutil.h:1386
static void getArrayInt64(bsls::Types::Int64 *variables, const char *buffer, int numVariables)
static void getUint48(bsls::Types::Uint64 *variable, const char *buffer)
Definition bslx_marshallingutil.h:1149
static void getInt24(int *variable, const char *buffer)
Definition bslx_marshallingutil.h:1270
static void getArrayInt40(bsls::Types::Int64 *variables, const char *buffer, int numVariables)
static void getArrayInt16(short *variables, const char *buffer, int numVariables)
static void getUint40(bsls::Types::Uint64 *variable, const char *buffer)
Definition bslx_marshallingutil.h:1198
static void getInt48(bsls::Types::Int64 *variable, const char *buffer)
Definition bslx_marshallingutil.h:1124
static void getUint32(unsigned int *variable, const char *buffer)
Definition bslx_marshallingutil.h:1246
static void getArrayUint40(bsls::Types::Uint64 *variables, const char *buffer, int numVariables)
static void getInt8(char *variable, const char *buffer)
Definition bslx_marshallingutil.h:1357
static void getArrayUint24(unsigned int *variables, const char *buffer, int numVariables)