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


C++ NarrowString::buffer方法代码示例

本文整理汇总了C++中NarrowString::buffer方法的典型用法代码示例。如果您正苦于以下问题:C++ NarrowString::buffer方法的具体用法?C++ NarrowString::buffer怎么用?C++ NarrowString::buffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NarrowString的用法示例。


在下文中一共展示了NarrowString::buffer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FormatPolarShape

void
PlaneGlue::Write(const Plane &plane, KeyValueFileWriter &writer)
{
  NarrowString<255> tmp;

  writer.Write("Registration", plane.registration);
  writer.Write("CompetitionID", plane.competition_id);
  writer.Write("Type", plane.type);

  tmp.Format("%u", plane.handicap);
  writer.Write("Handicap", tmp);

  writer.Write("PolarName", plane.polar_name);

  FormatPolarShape(plane.polar_shape, tmp.buffer(), tmp.MAX_SIZE);
  writer.Write("PolarInformation", tmp);

  tmp.Format("%f", (double)plane.reference_mass);
  writer.Write("PolarReferenceMass", tmp);
  tmp.Format("%f", (double)plane.dry_mass);
  writer.Write("PolarDryMass", tmp);
  tmp.Format("%f", (double)plane.max_ballast);
  writer.Write("MaxBallast", tmp);
  tmp.Format("%f", (double)plane.dump_time);
  writer.Write("DumpTime", tmp);
  tmp.Format("%f", (double)plane.max_speed);
  writer.Write("MaxSpeed", tmp);
  tmp.Format("%f", (double)plane.wing_area);
  writer.Write("WingArea", tmp);
}
开发者ID:MindMil,项目名称:XCSoar,代码行数:30,代码来源:PlaneFileGlue.cpp

示例2: CleanString

/**
 * Clean a string and write it to the Port.
 */
static bool
WriteCleanString(Port &port, const TCHAR *p,
                 OperationEnvironment &env, unsigned timeout_ms)
{
  NarrowString<256> buffer;
  buffer.SetASCII(p);

  CleanString(buffer.buffer());

  return port.FullWriteString(buffer, env, timeout_ms);
}
开发者ID:XCame,项目名称:XCSoar,代码行数:14,代码来源:EWMicroRecorder.cpp

示例3: object

static void
WritePhase(TextWriter &writer, Phase &phase)
{
  JSON::ObjectWriter object(writer);
  NarrowString<64> buffer;

  FormatISO8601(buffer.buffer(), phase.start_datetime);
  object.WriteElement("start_time", JSON::WriteString, buffer);

  FormatISO8601(buffer.buffer(), phase.end_datetime);
  object.WriteElement("end_time", JSON::WriteString, buffer);

  object.WriteElement("type", JSON::WriteString,
                      FormatPhaseType(phase.phase_type));
  object.WriteElement("duration", JSON::WriteInteger, (int)phase.duration);
  object.WriteElement("circling_direction", JSON::WriteString,
                      FormatCirclingDirection(phase.circling_direction));
  object.WriteElement("alt_diff", JSON::WriteInteger, (int)phase.alt_diff);
  object.WriteElement("distance", JSON::WriteInteger, (int)phase.distance);
  object.WriteElement("speed", JSON::WriteFixed, phase.GetSpeed());
  object.WriteElement("vario", JSON::WriteFixed, phase.GetVario());
  object.WriteElement("glide_rate", JSON::WriteFixed, phase.GetGlideRate());
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:23,代码来源:FlightPhaseJSON.cpp

示例4: object

static void
WriteEventAttributes(TextWriter &writer,
                     const BrokenDateTime &time, const GeoPoint &location)
{
  JSON::ObjectWriter object(writer);

  if (time.IsPlausible()) {
    NarrowString<64> buffer;
    FormatISO8601(buffer.buffer(), time);
    object.WriteElement("time", JSON::WriteString, buffer);
  }

  if (location.IsValid())
    JSON::WriteGeoPointAttributes(object, location);
}
开发者ID:MindMil,项目名称:XCSoar,代码行数:15,代码来源:AnalyseFlight.cpp

示例5:

static void
ReadString(NMEAInputLine &line, NarrowString<N> &value)
{
  line.Read(value.buffer(), value.capacity());
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:5,代码来源:Parser.cpp

示例6:

static void
ReadString(NMEAInputLine &line, NarrowString<N> &value)
{
  line.Read(value.buffer(), value.MAX_SIZE);
}
开发者ID:osteocool,项目名称:XCSoar-1,代码行数:5,代码来源:Parser.cpp


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