本文整理汇总了C++中TStringList::ToFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ TStringList::ToFloat方法的具体用法?C++ TStringList::ToFloat怎么用?C++ TStringList::ToFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TStringList
的用法示例。
在下文中一共展示了TStringList::ToFloat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: factory
/*-------------------------------------------------------------------*/
zonebase* zonebase::factory (std::string settings)
{
TStringList argv;
//# rect
if (settings.substr (0,5)=="rect=") {
argv = helper::tokenizer (settings.substr (5),",");
if (argv.size() != 4) {
throw ("rect= is invalid");
}
return new zoneRect (argv.ToFloat(0),argv.ToFloat(1),argv.ToFloat(2),argv.ToFloat(3));
}
//# point
else if (settings.substr (0,6) == "point=") {
argv = helper::tokenizer (settings.substr (6),",");
if (argv.size() != 2) {
throw ("point= is invalid");
}
return new zonePoint (argv.ToFloat(0),argv.ToFloat(1));
}
//# circle
else if (settings.substr (0,7) == "circle=") {
argv = helper::tokenizer (settings.substr (7),",");
if (argv.size() != 3) {
throw ("circle= is invalid");
}
return new zoneCircle(argv.ToFloat(0),argv.ToFloat(1),argv.ToFloat(2));
}
//# bitmap
else if (settings.substr (0,7) == "bitmap=") {
argv = helper::tokenizer (settings.substr (7),",");
if (argv.size()==1) {
return new zoneBitmap (argv[0].c_str());
}
else if (argv.size()==3) {
return new zoneBitmap (argv[0].c_str(), argv.ToFloat(1),argv.ToFloat(2));
}
else {
throw ("bitmap= is invalid");
}
}
throw helper::errormessage("unknown zone command: %s",settings.c_str());
return NULL;
}