当前位置: 首页>>代码示例>>C++>>正文


C++ PhysicalOutStream类代码示例

本文整理汇总了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);
}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:7,代码来源:OutStreams.cpp

示例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));
}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:8,代码来源:OutStreams.cpp

示例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);
}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:22,代码来源:OutStreams.cpp

示例4: writeInt

void OutText::writeInt(int d, PhysicalOutStream& stream)
{
  sprintf(buf, " %d", d);
  stream.writeToStream(buf, strlen(buf));
}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:5,代码来源:OutStreams.cpp

示例5: writeUShort

void OutText::writeUShort(unsigned short d, PhysicalOutStream& stream)
{
  sprintf(buf, " %u", int(d));
  stream.writeToStream(buf, strlen(buf));
}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:5,代码来源:OutStreams.cpp

示例6: writeShort

void OutText::writeShort(short d, PhysicalOutStream& stream)
{
  sprintf(buf, " %d", int(d));
  stream.writeToStream(buf, strlen(buf));
}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:5,代码来源:OutStreams.cpp

示例7: writeUChar

void OutText::writeUChar(unsigned char d, PhysicalOutStream& stream)
{
  sprintf(buf, " %u", int(d));
  stream.writeToStream(buf, strlen(buf));
}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:5,代码来源:OutStreams.cpp

示例8: writeChar

void OutText::writeChar(char d, PhysicalOutStream& stream)
{
  sprintf(buf, " %d", int(d));
  stream.writeToStream(buf, strlen(buf));
}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:5,代码来源:OutStreams.cpp

示例9: writeEndL

void OutTextRaw::writeEndL(PhysicalOutStream& stream)
{
  sprintf(buf, "\n");
  stream.writeToStream(buf, strlen(buf));
}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:5,代码来源:OutStreams.cpp

示例10: writeFloat

void OutTextRaw::writeFloat(float d, PhysicalOutStream& stream)
{
  sprintf(buf, "%g", double(d));
  stream.writeToStream(buf, strlen(buf));
}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:5,代码来源:OutStreams.cpp

示例11: writeDouble

void OutTextRaw::writeDouble(double d, PhysicalOutStream& stream)
{
  sprintf(buf, "%g", d);
  stream.writeToStream(buf, strlen(buf));
}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:5,代码来源:OutStreams.cpp

示例12: writeUInt

void OutTextRaw::writeUInt(unsigned int d, PhysicalOutStream& stream)
{
  sprintf(buf, "%u", d);
  stream.writeToStream(buf, strlen(buf));
}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:5,代码来源:OutStreams.cpp

示例13: writeString

void OutBinary::writeString(const char* d, PhysicalOutStream& stream)
{ int size = (int)strlen(d); stream.writeToStream(&size, sizeof(size)); stream.writeToStream(d, size);}
开发者ID:Bigshan,项目名称:BHuman2013,代码行数:2,代码来源:OutStreams.cpp


注:本文中的PhysicalOutStream类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。