8#ifndef INCLUDED_BSLX_OUTSTREAMFUNCTIONS
9#define INCLUDED_BSLX_OUTSTREAMFUNCTIONS
523#include <bslscm_version.h>
533#include <bsl_string.h>
534#include <bsl_vector.h>
535#include <bsl_cstdint.h>
537#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
548namespace OutStreamFunctions {
595 template <
class STREAM,
class TYPE>
611 template <
class STREAM,
class TYPE>
629 template <
class STREAM,
class TYPE>
641 template <
class STREAM,
class TYPE>
642 STREAM&
bdexStreamOut(STREAM& stream,
const TYPE& value,
int version);
652 template <
class STREAM>
653 STREAM&
bdexStreamOut(STREAM& stream,
const bool& value,
int version = 0);
661 template <
class STREAM>
662 STREAM&
bdexStreamOut(STREAM& stream,
const char& value,
int version = 0);
670 template <
class STREAM>
672 const signed char& value,
681 template <
class STREAM>
683 const unsigned char& value,
692 template <
class STREAM>
703 template <
class STREAM>
705 const unsigned short& value,
714 template <
class STREAM>
715 STREAM&
bdexStreamOut(STREAM& stream,
const int& value,
int version = 0);
723 template <
class STREAM>
725 const unsigned int& value,
737 template <
class STREAM>
738 STREAM&
bdexStreamOut(STREAM& stream,
const long& value,
int version = 0);
749 template <
class STREAM>
751 const unsigned long& value,
760 template <
class STREAM>
771 template <
class STREAM>
782 template <
class STREAM>
783 STREAM&
bdexStreamOut(STREAM& stream,
const float& value,
int version = 0);
791 template <
class STREAM>
802 template <
class STREAM>
813 template <
class STREAM,
class ALLOC>
824 template <
class STREAM,
class ALLOC>
835 template <
class STREAM,
class ALLOC>
846 template <
class STREAM,
class ALLOC>
857 template <
class STREAM,
class ALLOC>
868 template <
class STREAM,
class ALLOC>
879 template <
class STREAM,
class ALLOC>
890 template <
class STREAM,
class ALLOC>
902 template <
class STREAM,
class ALLOC>
914 template <
class STREAM,
class ALLOC>
925 template <
class STREAM,
class ALLOC>
941 template <
class STREAM,
class TYPE,
class ALLOC>
956 template <
class STREAM,
class TYPE,
class ALLOC>
971template <
class STREAM,
class TYPE>
986 return stream.putInt32(
static_cast<int>(value));
989template <
class STREAM,
class TYPE>
999 return value.bdexStreamOut(stream, version);
1002template <
class STREAM,
class TYPE>
1008 const int version = maxSupportedBdexVersion(&value,
1009 stream.bdexVersionSelector());
1011 stream.putVersion(version);
1014 return bdexStreamOut(stream, value, version);
1017template <
class STREAM,
class TYPE>
1029template <
class STREAM>
1035 return stream.putInt8(
static_cast<char>(value));
1038template <
class STREAM>
1044 return stream.putInt8(value);
1047template <
class STREAM>
1050 const signed char& value,
1053 return stream.putInt8(value);
1056template <
class STREAM>
1059 const unsigned char& value,
1062 return stream.putUint8(value);
1065template <
class STREAM>
1071 return stream.putInt16(value);
1074template <
class STREAM>
1077 const unsigned short& value,
1080 return stream.putUint16(value);
1083template <
class STREAM>
1089 return stream.putInt32(value);
1092template <
class STREAM>
1095 const unsigned int& value,
1098 return stream.putUint32(value);
1101template <
class STREAM>
1107 return stream.putInt32(
static_cast<int>(value));
1110template <
class STREAM>
1113 const unsigned long& value,
1116 return stream.putUint32(
static_cast<unsigned int>(value));
1119template <
class STREAM>
1125 return stream.putInt64(value);
1128template <
class STREAM>
1135 return stream.putUint64(value);
1138template <
class STREAM>
1144 return stream.putFloat32(value);
1147template <
class STREAM>
1150 const double& value,
1153 return stream.putFloat64(value);
1156template <
class STREAM>
1162 return stream.putString(value);
1165template <
class STREAM,
class ALLOC>
1172 const int length =
static_cast<int>(value.
size());
1173 stream.putLength(length);
1175 return 0 < length ? stream.putArrayInt8(&value[0], length) : stream;
1178template <
class STREAM,
class ALLOC>
1185 const int length =
static_cast<int>(value.
size());
1186 stream.putLength(length);
1188 return 0 < length ? stream.putArrayInt8(&value[0], length) : stream;
1191template <
class STREAM,
class ALLOC>
1198 const int length =
static_cast<int>(value.
size());
1199 stream.putLength(length);
1201 return 0 < length ? stream.putArrayUint8(&value[0], length) : stream;
1204template <
class STREAM,
class ALLOC>
1211 const int length =
static_cast<int>(value.
size());
1212 stream.putLength(length);
1214 return 0 < length ? stream.putArrayInt16(&value[0], length) : stream;
1217template <
class STREAM,
class ALLOC>
1224 const int length =
static_cast<int>(value.
size());
1225 stream.putLength(length);
1227 return 0 < length ? stream.putArrayUint16(&value[0], length) : stream;
1230template <
class STREAM,
class ALLOC>
1237 const int length =
static_cast<int>(value.
size());
1238 stream.putLength(length);
1240 return 0 < length ? stream.putArrayInt32(&value[0], length) : stream;
1243template <
class STREAM,
class ALLOC>
1250 const int length =
static_cast<int>(value.
size());
1251 stream.putLength(length);
1253 return 0 < length ? stream.putArrayUint32(&value[0], length) : stream;
1256template <
class STREAM,
class ALLOC>
1263 const int length =
static_cast<int>(value.
size());
1264 stream.putLength(length);
1266 return 0 < length ? stream.putArrayInt64(&value[0], length) : stream;
1269template <
class STREAM,
class ALLOC>
1276 const int length =
static_cast<int>(value.
size());
1277 stream.putLength(length);
1279 return 0 < length ? stream.putArrayUint64(&value[0], length) : stream;
1282template <
class STREAM,
class ALLOC>
1289 const int length =
static_cast<int>(value.
size());
1290 stream.putLength(length);
1292 return 0 < length ? stream.putArrayFloat32(&value[0], length) : stream;
1295template <
class STREAM,
class ALLOC>
1302 const int length =
static_cast<int>(value.
size());
1303 stream.putLength(length);
1305 return 0 < length ? stream.putArrayFloat64(&value[0], length) : stream;
1308template <
class STREAM,
class TYPE,
class ALLOC>
1316 const int version = maxSupportedBdexVersion(&value,
1317 stream.bdexVersionSelector());
1319 stream.putVersion(version);
1320 return bdexStreamOut(stream, value, version);
1323template <
class STREAM,
class TYPE,
class ALLOC>
1331 const int length =
static_cast<int>(value.
size());
1332 stream.putLength(length);
1334 for (Iterator it = value.
begin(); it != value.
end(); ++it) {
1335 bdexStreamOut(stream, *it, version);
Definition bslstl_string.h:1252
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this vector.
Definition bslstl_vector.h:3019
iterator begin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2866
iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2874
Definition bslstl_vector.h:1120
VALUE_TYPE const * const_iterator
Definition bslstl_vector.h:1153
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:231
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
STREAM & bdexStreamOut(STREAM &stream, const TYPE &value)
Definition bslx_outstreamfunctions.h:1004
STREAM & bdexStreamOutImp(STREAM &stream, const TYPE &value, int version, const IsEnumType &)
Definition bslx_outstreamfunctions.h:973
int maxSupportedBdexVersion(const TYPE *, int versionSelector)
Definition bslx_versionfunctions.h:531
@ k_NO_VERSION
Definition bslx_versionfunctions.h:344
Definition bslx_byteinstream.h:377
Definition bslmf_conditional.h:123
unsigned long long Uint64
Definition bsls_types.h:139
long long Int64
Definition bsls_types.h:134
Definition bslx_outstreamfunctions.h:567
Definition bslx_outstreamfunctions.h:580