本文整理汇总了C++中PhysicalOutStream类的典型用法代码示例。如果您正苦于以下问题:C++ PhysicalOutStream类的具体用法?C++ PhysicalOutStream怎么用?C++ PhysicalOutStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PhysicalOutStream类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeBool
void OutText::writeBool(bool value, PhysicalOutStream& stream)
{
if(value)
stream.writeToStream(" true", 5);
else
stream.writeToStream(" false", 6);
}
示例2: writeAngle
void OutTextRaw::writeAngle(const Angle& d, PhysicalOutStream& stream)
{
if(d == SensorData::off)
sprintf(buf, "%g", static_cast<float>(d));
else
sprintf(buf, "%gdeg", d.toDegrees());
stream.writeToStream(buf, strlen(buf));
}
示例3: writeString
void OutText::writeString(const char* value, PhysicalOutStream& stream)
{
stream.writeToStream(" ", 1);
bool containsSpaces = !*value || *value == '"' || strcspn(value, " \n\r\t") < strlen(value);
if(containsSpaces)
stream.writeToStream("\"", 1);
for(; *value; ++value)
if(*value == '"' && containsSpaces)
stream.writeToStream("\\\"", 2);
else if(*value == '\n')
stream.writeToStream("\\n", 2);
else if(*value == '\r')
stream.writeToStream("\\r", 2);
else if(*value == '\t')
stream.writeToStream("\\t", 2);
else if(*value == '\\')
stream.writeToStream("\\\\", 2);
else
stream.writeToStream(value, 1);
if(containsSpaces)
stream.writeToStream("\"", 1);
}
示例4: writeInt
void OutText::writeInt(int d, PhysicalOutStream& stream)
{
sprintf(buf, " %d", d);
stream.writeToStream(buf, strlen(buf));
}
示例5: writeUShort
void OutText::writeUShort(unsigned short d, PhysicalOutStream& stream)
{
sprintf(buf, " %u", int(d));
stream.writeToStream(buf, strlen(buf));
}
示例6: writeShort
void OutText::writeShort(short d, PhysicalOutStream& stream)
{
sprintf(buf, " %d", int(d));
stream.writeToStream(buf, strlen(buf));
}
示例7: writeUChar
void OutText::writeUChar(unsigned char d, PhysicalOutStream& stream)
{
sprintf(buf, " %u", int(d));
stream.writeToStream(buf, strlen(buf));
}
示例8: writeChar
void OutText::writeChar(char d, PhysicalOutStream& stream)
{
sprintf(buf, " %d", int(d));
stream.writeToStream(buf, strlen(buf));
}
示例9: writeEndL
void OutTextRaw::writeEndL(PhysicalOutStream& stream)
{
sprintf(buf, "\n");
stream.writeToStream(buf, strlen(buf));
}
示例10: writeFloat
void OutTextRaw::writeFloat(float d, PhysicalOutStream& stream)
{
sprintf(buf, "%g", double(d));
stream.writeToStream(buf, strlen(buf));
}
示例11: writeDouble
void OutTextRaw::writeDouble(double d, PhysicalOutStream& stream)
{
sprintf(buf, "%g", d);
stream.writeToStream(buf, strlen(buf));
}
示例12: writeUInt
void OutTextRaw::writeUInt(unsigned int d, PhysicalOutStream& stream)
{
sprintf(buf, "%u", d);
stream.writeToStream(buf, strlen(buf));
}
示例13: writeString
void OutBinary::writeString(const char* d, PhysicalOutStream& stream)
{ int size = (int)strlen(d); stream.writeToStream(&size, sizeof(size)); stream.writeToStream(d, size);}