本文整理汇总了C++中Bundle::GetVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ Bundle::GetVersion方法的具体用法?C++ Bundle::GetVersion怎么用?C++ Bundle::GetVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bundle
的用法示例。
在下文中一共展示了Bundle::GetVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: us_bundle_info
pointer us_bundle_info(scheme* sc, pointer args)
{
if(args == sc->NIL)
{
std::cerr << "Empty argument list" << std::endl;
return sc->NIL;
}
if (sc->vptr->list_length(sc, args) != 1)
{
return sc->NIL;
}
const char delimChar = '-';
char delim[50];
memset(delim, delimChar, 50);
pointer arg = pair_car(args);
Bundle bundle;
if (is_string(arg))
{
std::string name = sc->vptr->string_value(arg);
if (name == "_header_")
{
pointer result = sc->NIL;
pointer infoList = sc->NIL;
for (int fi = numFields-1; fi >= 0; --fi)
{
delim[fieldWidth[fi]] = '\0';
infoList = immutable_cons(sc, sc_string(sc, delim), infoList);
delim[fieldWidth[fi]] = delimChar;
}
result = immutable_cons(sc, infoList, result);
infoList = sc->NIL;
infoList = immutable_cons(sc, sc_string(sc, "Location"), infoList);
infoList = immutable_cons(sc, sc_string(sc, "State"), infoList);
infoList = immutable_cons(sc, sc_string(sc, "Version"), infoList);
infoList = immutable_cons(sc, sc_string(sc, "Symbolic Name"), infoList);
infoList = immutable_cons(sc, sc_string(sc, "Id"), infoList);
return immutable_cons(sc, infoList, result);
}
else
{
bundle = get_bundle(name);
}
}
else if (is_integer(arg))
{
bundle = GetBundleContext().GetBundle(ivalue(arg));
}
else
{
return sc->NIL;
}
if (!bundle)
{
return sc->NIL;
}
pointer id = sc_int(sc, bundle.GetBundleId());
pointer name = sc_string(sc, bundle.GetSymbolicName().c_str());
pointer location = sc_string(sc, bundle.GetLocation().c_str());
pointer version = sc_string(sc, bundle.GetVersion().ToString().c_str());
std::stringstream strState;
strState << bundle.GetState();
pointer state = sc_string(sc, strState.str().c_str());
pointer result = sc->NIL;
result = immutable_cons(sc, location, result);
result = immutable_cons(sc, state, result);
result = immutable_cons(sc, version, result);
result = immutable_cons(sc, name, result);
result = immutable_cons(sc, id, result);
// (id, name, version, state, location)
return result;
}