本文整理汇总了C++中StaticString::SetASCII方法的典型用法代码示例。如果您正苦于以下问题:C++ StaticString::SetASCII方法的具体用法?C++ StaticString::SetASCII怎么用?C++ StaticString::SetASCII使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StaticString
的用法示例。
在下文中一共展示了StaticString::SetASCII方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddReadOnly
void
ManageLX16xxWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
StaticString<64> buffer;
if (!info.product.empty()) {
buffer.SetASCII(info.product.c_str());
AddReadOnly(_("Product"), NULL, buffer.c_str());
}
if (!info.serial.empty()) {
buffer.SetASCII(info.serial.c_str());
AddReadOnly(_("Serial"), NULL, buffer.c_str());
}
if (!info.hardware_version.empty()) {
buffer.SetASCII(info.hardware_version.c_str());
AddReadOnly(_("Hardware version"), NULL, buffer.c_str());
}
if (!info.software_version.empty()) {
buffer.SetASCII(info.software_version.c_str());
AddReadOnly(_("Firmware version"), NULL, buffer.c_str());
}
}
示例2: line
bool
VegaDevice::ParseNMEA(const char *String, NMEAInfo &info)
{
NMEAInputLine line(String);
char type[16];
line.Read(type, 16);
if (memcmp(type, "$PD", 3) == 0)
detected = true;
if (StringIsEqual(type, "$PDSWC"))
return PDSWC(line, info, volatile_data);
else if (StringIsEqual(type, "$PDAAV"))
return PDAAV(line, info);
else if (StringIsEqual(type, "$PDVSC"))
return PDVSC(line, info);
else if (StringIsEqual(type, "$PDVDV"))
return PDVDV(line, info);
else if (StringIsEqual(type, "$PDVDS"))
return PDVDS(line, info);
else if (StringIsEqual(type, "$PDVVT"))
return PDVVT(line, info);
else if (StringIsEqual(type, "$PDVSD")) {
const auto message = line.Rest();
StaticString<256> buffer;
buffer.SetASCII(message.begin(), message.end());
Message::AddMessage(buffer);
return true;
} else if (StringIsEqual(type, "$PDTSM"))
return PDTSM(line, info);
else
return false;
}
示例3:
// PDTSM,duration_ms,"free text"
static bool
PDTSM(NMEAInputLine &line, gcc_unused NMEAInfo &info)
{
/*
int duration = (int)strtol(String, nullptr, 10);
*/
line.Skip();
const auto message = line.Rest();
StaticString<256> buffer;
buffer.SetASCII(message.begin(), message.end());
// todo duration handling
Message::AddMessage(_T("VEGA:"), buffer);
return true;
}