コード例 #1
0
/*
 *  if tag == "" returns pElem and all decendents
 */
bool XmlDocument::find(const std::string& tag, sPtr pElem, bool findall)
{
  if (pElem->tag() == tag || tag == "")
  {
    found_.push_back(pElem);
    if (!findall)
      return true;
  }
  for (auto pChild : pElem->children())
    find(tag, pChild);
  return (found_.size() > 0);
}
コード例 #2
0
//Convert pointer to package information
PackageDetails Repository::convertsPtrToPackageDetails(sPtr result, string packageName) {
	PackageDetails package;
	if (result != nullptr) {
		if (result->tag() == "Version") {
			package.package() = packageName;
			package.version() = result->getAttrib("Name");
			package.path() = result->getAttrib("Directory");
			package.status() = result->getAttrib("Status");
			return package;
		}
	}
	return package;
}