本文整理汇总了C++中Database::Load方法的典型用法代码示例。如果您正苦于以下问题:C++ Database::Load方法的具体用法?C++ Database::Load怎么用?C++ Database::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Database
的用法示例。
在下文中一共展示了Database::Load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
if (argc < 2)
{
cout << "Not enough parameters" << endl;
cout << "use: Dxf2Kam [dxfFile [kamFile]]" << endl;
return 0;
}
string out;
if (argc < 3)
{
out = argv[1];
size_t pos = out.find_last_of('.');
out = string(out.begin(), out.begin() + pos);
out += ".kam";
}
else
out = argv[2];
Database dxf;
try
{
dxf.Load(argv[1]);
/*for (Nodes::iterator i = dxf.Children.begin(); i != dxf.Children.end(); i++)
{
for (Attributes::iterator j = (*i)->Attributes.begin(); j != (*i)->Attributes.end(); j++)
cout << (*j)->GetValue() << ' ';
cout << endl;
for (Nodes::iterator j = (*i)->Children.begin(); j != (*i)->Children.end(); j++)
cout << ' ' << (*(*j)->Attributes.begin())->GetValue() << endl;
}*/
Convertor conv;
Program prog = conv.Convert(dxf);
if (out.substr(out.length() - 3, 3) == "kam")
prog.SaveKam(out.c_str());
else
assert(0);//prog.SaveTxt(out.c_str());
}
catch (Dxf::ParseError &ex)
{
cout << "Dxf parsing error " << ex.GetMessage() << endl;
return -1;
}
/*catch (Kamea::SaveError &ex)
{
cout << "Saving error " << ex.GetMessage() << endl;
return -1;
}*/
cout << "Done" << endl;
int x;
cin >> x;
return 0;
}