From d5131173f6b5727a6338e54d564e9da209bfafe9 Mon Sep 17 00:00:00 2001 From: "Isaac I.Y. Saito" <130s@2000.jukuin.keio.ac.jp> Date: Sat, 31 Dec 2016 00:53:18 -0800 Subject: [PATCH] Add license field in Stackage class. --- src/rospack.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rospack.cpp b/src/rospack.cpp index 929e971..0c46da0 100644 --- a/src/rospack.cpp +++ b/src/rospack.cpp @@ -147,6 +147,8 @@ class Stackage std::string manifest_path_; // \brief filename of the stackage manifest std::string manifest_name_; + // \brief package's license with a support for multi-license. + std::vector licenses_; // \brief have we already loaded the manifest? bool manifest_loaded_; // \brief TinyXML structure, filled in during parsing @@ -182,6 +184,12 @@ class Stackage name_ = el->GetText(); break; } + // Get license texts, where there may be multiple elements for. + std::string tagname_license = "license"; + for(TiXmlElement* el = root->FirstChildElement(tagname_license); el; el = el->NextSiblingElement(tagname_license )) + { + licenses_.push_back(el->GetText()); + } // check if package is a metapackage for(TiXmlElement* el = root->FirstChildElement("export"); el; el = el->NextSiblingElement("export")) {