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 {
590 template <
class STREAM,
class TYPE>
605 template <
class STREAM,
class TYPE>
622 template <
class STREAM,
class TYPE>
633 template <
class STREAM,
class TYPE>
634 STREAM&
bdexStreamOut(STREAM& stream,
const TYPE& value,
int version);
644 template <
class STREAM>
645 STREAM&
bdexStreamOut(STREAM& stream,
const bool& value,
int version = 0);
653 template <
class STREAM>
654 STREAM&
bdexStreamOut(STREAM& stream,
const char& value,
int version = 0);
662 template <
class STREAM>
664 const signed char& value,
673 template <
class STREAM>
675 const unsigned char& value,
684 template <
class STREAM>
695 template <
class STREAM>
697 const unsigned short& value,
706 template <
class STREAM>
707 STREAM&
bdexStreamOut(STREAM& stream,
const int& value,
int version = 0);
715 template <
class STREAM>
717 const unsigned int& value,
728 template <
class STREAM>
729 STREAM&
bdexStreamOut(STREAM& stream,
const long& value,
int version = 0);
739 template <
class STREAM>
741 const unsigned long& value,
750 template <
class STREAM>
761 template <
class STREAM>
772 template <
class STREAM>
773 STREAM&
bdexStreamOut(STREAM& stream,
const float& value,
int version = 0);
781 template <
class STREAM>
792 template <
class STREAM>
803 template <
class STREAM,
class ALLOC>
814 template <
class STREAM,
class ALLOC>
825 template <
class STREAM,
class ALLOC>
836 template <
class STREAM,
class ALLOC>
847 template <
class STREAM,
class ALLOC>
858 template <
class STREAM,
class ALLOC>
869 template <
class STREAM,
class ALLOC>
880 template <
class STREAM,
class ALLOC>
892 template <
class STREAM,
class ALLOC>
904 template <
class STREAM,
class ALLOC>
915 template <
class STREAM,
class ALLOC>
930 template <
class STREAM,
class TYPE,
class ALLOC>
944 template <
class STREAM,
class TYPE,
class ALLOC>
959template <
class STREAM,
class TYPE>
974 return stream.putInt32(
static_cast<int>(value));
977template <
class STREAM,
class TYPE>
987 return value.bdexStreamOut(stream, version);
990template <
class STREAM,
class TYPE>
996 const int version = maxSupportedBdexVersion(&value,
997 stream.bdexVersionSelector());
999 stream.putVersion(version);
1002 return bdexStreamOut(stream, value, version);
1005template <
class STREAM,
class TYPE>
1017template <
class STREAM>
1023 return stream.putInt8(
static_cast<char>(value));
1026template <
class STREAM>
1032 return stream.putInt8(value);
1035template <
class STREAM>
1038 const signed char& value,
1041 return stream.putInt8(value);
1044template <
class STREAM>
1047 const unsigned char& value,
1050 return stream.putUint8(value);
1053template <
class STREAM>
1059 return stream.putInt16(value);
1062template <
class STREAM>
1065 const unsigned short& value,
1068 return stream.putUint16(value);
1071template <
class STREAM>
1077 return stream.putInt32(value);
1080template <
class STREAM>
1083 const unsigned int& value,
1086 return stream.putUint32(value);
1089template <
class STREAM>
1095 return stream.putInt32(
static_cast<int>(value));
1098template <
class STREAM>
1101 const unsigned long& value,
1104 return stream.putUint32(
static_cast<unsigned int>(value));
1107template <
class STREAM>
1113 return stream.putInt64(value);
1116template <
class STREAM>
1123 return stream.putUint64(value);
1126template <
class STREAM>
1132 return stream.putFloat32(value);
1135template <
class STREAM>
1138 const double& value,
1141 return stream.putFloat64(value);
1144template <
class STREAM>
1150 return stream.putString(value);
1153template <
class STREAM,
class ALLOC>
1160 const int length =
static_cast<int>(value.
size());
1161 stream.putLength(length);
1163 return 0 < length ? stream.putArrayInt8(&value[0], length) : stream;
1166template <
class STREAM,
class ALLOC>
1173 const int length =
static_cast<int>(value.
size());
1174 stream.putLength(length);
1176 return 0 < length ? stream.putArrayInt8(&value[0], length) : stream;
1179template <
class STREAM,
class ALLOC>
1186 const int length =
static_cast<int>(value.
size());
1187 stream.putLength(length);
1189 return 0 < length ? stream.putArrayUint8(&value[0], length) : stream;
1192template <
class STREAM,
class ALLOC>
1199 const int length =
static_cast<int>(value.
size());
1200 stream.putLength(length);
1202 return 0 < length ? stream.putArrayInt16(&value[0], length) : stream;
1205template <
class STREAM,
class ALLOC>
1212 const int length =
static_cast<int>(value.
size());
1213 stream.putLength(length);
1215 return 0 < length ? stream.putArrayUint16(&value[0], length) : stream;
1218template <
class STREAM,
class ALLOC>
1225 const int length =
static_cast<int>(value.
size());
1226 stream.putLength(length);
1228 return 0 < length ? stream.putArrayInt32(&value[0], length) : stream;
1231template <
class STREAM,
class ALLOC>
1238 const int length =
static_cast<int>(value.
size());
1239 stream.putLength(length);
1241 return 0 < length ? stream.putArrayUint32(&value[0], length) : stream;
1244template <
class STREAM,
class ALLOC>
1251 const int length =
static_cast<int>(value.
size());
1252 stream.putLength(length);
1254 return 0 < length ? stream.putArrayInt64(&value[0], length) : stream;
1257template <
class STREAM,
class ALLOC>
1264 const int length =
static_cast<int>(value.
size());
1265 stream.putLength(length);
1267 return 0 < length ? stream.putArrayUint64(&value[0], length) : stream;
1270template <
class STREAM,
class ALLOC>
1277 const int length =
static_cast<int>(value.
size());
1278 stream.putLength(length);
1280 return 0 < length ? stream.putArrayFloat32(&value[0], length) : stream;
1283template <
class STREAM,
class ALLOC>
1290 const int length =
static_cast<int>(value.
size());
1291 stream.putLength(length);
1293 return 0 < length ? stream.putArrayFloat64(&value[0], length) : stream;
1296template <
class STREAM,
class TYPE,
class ALLOC>
1304 const int version = maxSupportedBdexVersion(&value,
1305 stream.bdexVersionSelector());
1307 stream.putVersion(version);
1308 return bdexStreamOut(stream, value, version);
1311template <
class STREAM,
class TYPE,
class ALLOC>
1319 const int length =
static_cast<int>(value.
size());
1320 stream.putLength(length);
1322 for (Iterator it = value.
begin(); it != value.
end(); ++it) {
1323 bdexStreamOut(stream, *it, version);
Definition bslstl_string.h:1281
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this vector.
Definition bslstl_vector.h:2664
iterator begin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2511
iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2519
Definition bslstl_vector.h:1025
VALUE_TYPE const * const_iterator
Definition bslstl_vector.h:1058
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
STREAM & bdexStreamOut(STREAM &stream, const TYPE &value)
Definition bslx_outstreamfunctions.h:992
STREAM & bdexStreamOutImp(STREAM &stream, const TYPE &value, int version, const IsEnumType &)
Definition bslx_outstreamfunctions.h:961
int maxSupportedBdexVersion(const TYPE *, int versionSelector)
Definition bslx_versionfunctions.h:519
@ k_NO_VERSION
Definition bslx_versionfunctions.h:334
Definition bslx_byteinstream.h:377
Definition bslmf_conditional.h:120
unsigned long long Uint64
Definition bsls_types.h:137
long long Int64
Definition bsls_types.h:132
Definition bslx_outstreamfunctions.h:565
Definition bslx_outstreamfunctions.h:576