本文整理汇总了C++中StaticString::set方法的典型用法代码示例。如果您正苦于以下问题:C++ StaticString::set方法的具体用法?C++ StaticString::set怎么用?C++ StaticString::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StaticString
的用法示例。
在下文中一共展示了StaticString::set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
//.........这里部分代码省略.........
if (CheckTitle(line, title_length, _T("Dew Point"))) {
StaticString<256> buffer;
if (!parsed.temperatures_available) {
buffer.Format(_T("%s: "), _("Dew Point"));
buffer.append(value, value_length);
} else {
TCHAR temperature_buffer[16];
FormatUserTemperature(parsed.dew_point, temperature_buffer,
ARRAY_SIZE(temperature_buffer));
buffer.Format(_T("%s: %s"), _("Dew Point"), temperature_buffer);
}
output += buffer;
output += '\n';
return true;
}
if (CheckTitle(line, title_length, _T("Pressure (altimeter)"))) {
StaticString<256> buffer;
if (!parsed.qnh_available) {
buffer.Format(_T("%s: "), _("Pressure"));
buffer.append(value, value_length);
} else {
TCHAR qnh_buffer[16];
FormatUserPressure(parsed.qnh, qnh_buffer, ARRAY_SIZE(qnh_buffer));
buffer.Format(_T("%s: %s"), _("Pressure"), qnh_buffer);
}
output += buffer;
output += '\n';
return true;
}
if (CheckTitle(line, title_length, _T("Visibility"))) {
StaticString<256> buffer;
buffer.Format(_T("%s: "), _("Visibility"));
if (!parsed.qnh_available) {
buffer.append(value, value_length);
} else {
TCHAR vis_buffer[32];
if (parsed.visibility >= 9999) {
FormatUserDistanceSmart(fixed(10000),
vis_buffer, ARRAY_SIZE(vis_buffer));
buffer.AppendFormat(_("more than %s"), vis_buffer);
} else {
FormatUserDistanceSmart(fixed(parsed.visibility),
vis_buffer, ARRAY_SIZE(vis_buffer));
buffer += vis_buffer;
}
}
output += buffer;
output += '\n';
return true;
}
if (CheckTitle(line, title_length, _T("Sky conditions"))) {
StaticString<256> buffer;
buffer.Format(_T("%s: "), _("Sky Conditions"));
StaticString<64> _value;
_value.set(value, value_length);
buffer += gettext(_value);
output += buffer;
output += '\n';
return true;
}
if (CheckTitle(line, title_length, _T("Weather"))) {
StaticString<256> buffer;
buffer.Format(_T("%s: "), _("Weather"));
StaticString<64> _value;
_value.set(value, value_length);
buffer += gettext(_value);
output += buffer;
output += '\n';
return true;
}
StaticString<64> title;
title.set(line, title_length);
StaticString<256> buffer;
buffer.Format(_T("%s: "), gettext(title.c_str()));
buffer.append(value, value_length);
output += buffer;
output += '\n';
return true;
}