本文整理汇总了C++中TextWriter::FormatLine方法的典型用法代码示例。如果您正苦于以下问题:C++ TextWriter::FormatLine方法的具体用法?C++ TextWriter::FormatLine怎么用?C++ TextWriter::FormatLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextWriter
的用法示例。
在下文中一共展示了TextWriter::FormatLine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteAngleDMM
void
WriteCup(TextWriter &writer, const Waypoint &wp)
{
// Write Title
writer.Format(_T("\"%s\","), wp.name.c_str());
// Write Code
writer.Write(',');
// Write Country
writer.Write(',');
// Write Latitude
WriteAngleDMM(writer, wp.location.latitude, true);
writer.Write(',');
// Write Longitude
WriteAngleDMM(writer, wp.location.longitude, false);
writer.Write(',');
// Write Elevation
WriteAltitude(writer, wp.elevation);
writer.Write(',');
// Write Style
WriteSeeYouFlags(writer, wp);
writer.Write(',');
// Write Runway Direction
if ((wp.type == Waypoint::Type::AIRFIELD ||
wp.type == Waypoint::Type::OUTLANDING) &&
wp.runway.IsDirectionDefined())
writer.Format("%03u", wp.runway.GetDirectionDegrees());
writer.Write(',');
// Write Runway Length
if ((wp.type == Waypoint::Type::AIRFIELD ||
wp.type == Waypoint::Type::OUTLANDING) &&
wp.runway.IsLengthDefined())
writer.Format("%03uM", wp.runway.GetLength());
writer.Write(',');
// Write Airport Frequency
if (wp.radio_frequency.IsDefined()) {
const unsigned freq = wp.radio_frequency.GetKiloHertz();
writer.Format("\"%u.%03u\"", freq / 1000, freq % 1000);
}
writer.Write(',');
// Write Description
writer.FormatLine(_T("\"%s\""), wp.comment.c_str());
}
示例2: assert
void
SaveFlarmNameFile(TextWriter &writer, FlarmNameDatabase &db)
{
TCHAR id[16];
for (const auto &i : db) {
assert(i.id.IsDefined());
writer.FormatLine(_T("%s=%s"),
i.id.Format(id),
i.name.c_str());
}
}