Beispiel #1
0
BinaryWriter& BinaryWriter::operator << (const std::string& value)
{
	UInt32 length = (UInt32) value.size();
	write7BitEncoded(length);
	_ostr.write(value.data(), length);
	return *this;
}
Beispiel #2
0
BinaryWriter& BinaryWriter::operator << (const char* value)
{
	poco_check_ptr (value);
	UInt32 length = (UInt32) std::strlen(value);
	write7BitEncoded(length);
	_ostr.write(value, length);
	return *this;
}
Beispiel #3
0
BinaryWriter& BinaryWriter::operator << (const std::string& value)
{
	if (_pTextConverter)
	{
		std::string converted;
		_pTextConverter->convert(value, converted);
		UInt32 length = (UInt32) converted.size();
		write7BitEncoded(length);
		_ostr.write(converted.data(), length);
	}
	else
	{
		UInt32 length = (UInt32) value.size();
		write7BitEncoded(length);
		_ostr.write(value.data(), length);
	}
	return *this;
}
Beispiel #4
0
BinaryWriter& BinaryWriter::operator << (const char* value)
{
	poco_check_ptr (value);
	
	if (_pTextConverter)
	{
		std::string converted;
		_pTextConverter->convert(value, static_cast<int>(std::strlen(value)), converted);
		UInt32 length = (UInt32) converted.size();
		write7BitEncoded(length);
		_ostr.write(converted.data(), length);
	}
	else
	{
		UInt32 length = static_cast<UInt32>(std::strlen(value));
		write7BitEncoded(length);
		_ostr.write(value, length);
	}
	return *this;
}