本文整理汇总了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);
}
示例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);
}
示例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());
}
示例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);
}
示例5:
static void
ReadString(NMEAInputLine &line, NarrowString<N> &value)
{
line.Read(value.buffer(), value.capacity());
}
示例6:
static void
ReadString(NMEAInputLine &line, NarrowString<N> &value)
{
line.Read(value.buffer(), value.MAX_SIZE);
}