Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/Utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,23 @@ namespace ignition
if (elem && elem->GetText())
meta.set_description(trimmed(elem->GetText()));

// Read the dependencies, if any.
elem = modelElement->FirstChildElement("depend");
while (elem)
{
auto modelElem = elem->FirstChildElement("model");
if (modelElem)
{
auto uriElem = modelElem->FirstChildElement("uri");
if (uriElem)
{
auto dependency = meta.add_dependencies();
dependency->set_uri(uriElem->GetText());
}
}
elem = elem->NextSiblingElement("depend");
}

// Read the authors, if any.
elem = modelElement->FirstChildElement("author");
while (elem)
Expand Down Expand Up @@ -1114,6 +1131,16 @@ namespace ignition
<< " </author>\n";
}

// Output dependency information.
for (int i = 0; i < _meta.dependencies_size(); ++i)
{
out << " <depend>\n"
<< " <model>"
<< " <uri>" << _meta.dependencies(i).uri() << "</uri>\n"
<< " </model>"
<< " </depend>\n";
}

// Output closing tag.
if (_meta.has_model())
out << " </model>\n";
Expand Down