10 #ifndef _QI_PACKAGE_PACKAGE_INFO_HPP_
11 #define _QI_PACKAGE_PACKAGE_INFO_HPP_
15 #include <qipackage/api.hpp>
16 #include <alvalue/alvalue.h>
17 #include <qipackage/language_info.hpp>
18 #include <qipackage/behavior_info.hpp>
19 #include <qipackage/dialog_info.hpp>
20 #include <qi/macro.hpp>
21 #include <qi/anyobject.hpp>
22 #include <qi/type/typeinterface.hpp>
27 class PackageInfoPrivate;
60 std::map<std::string, qi::AnyValue>
elems;
62 std::map<std::string, qi::AnyValue> contents()
const;
63 std::map<std::string, qi::AnyValue>& contents();
65 std::vector<qi::BehaviorInfo> behaviors()
const;
66 std::vector<qi::BehaviorInfo>& behaviors();
68 std::vector<qi::DialogInfo> dialogs()
const;
69 std::vector<qi::DialogInfo>& dialogs();
71 std::vector<qi::LanguageInfo> languages()
const;
72 std::vector<qi::LanguageInfo>& languages();
141 void toALValue(AL::ALValue &alvalue);
143 bool loadFromManifestFile(
const std::string& filePath);
144 bool loadFromManifestFile(QFile &file);
145 bool loadFromManifestContent(
const std::string& manifestContent);
149 void trimExtraInfo();
151 bool saveToManifestFile(
const std::string& filePath)
const;
152 bool saveToManifestFile(QFile &file)
const;
153 std::string saveToManifestContent()
const;
155 const std::string& installer()
const;
156 void setInstaller(
const std::string &installer);
158 const std::string& uuid()
const;
159 void setUuid(
const std::string &uuid);
161 const std::string& version()
const;
162 void setVersion(
const std::string &version);
164 const std::string& typeVersion()
const;
165 void setTypeVersion(
const std::string &typeVersion);
167 const std::string& author()
const;
168 void setAuthor(
const std::string &author);
170 const std::string& organization()
const;
171 void setOrganization(
const std::string &organization);
173 const std::string& date()
const;
174 void setDate(
const std::string &date);
176 const std::string& channel()
const;
177 void setChannel(
const std::string &channel);
179 const std::string& path()
const;
180 void setPath(
const std::string &path);
182 const std::string& name(
const std::string &lang)
const;
183 const std::map<std::string, std::string> &names()
const;
184 void setName(
const std::string &name,
185 const std::string &lang);
188 const std::list<std::string>& supportedLanguages()
const;
189 void addSupportedLanguage(
const std::string & language);
190 void removeSupportedLanguage(
const std::string & language);
191 void clearSupportedLanguages();
193 const std::list<std::string>& descriptionLanguages()
const;
194 void addDescriptionLanguage(
const std::string & language);
195 void removeDescriptionLanguage(
const std::string & language);
196 void clearDescriptionLanguages();
198 const std::string& description(
const std::string &lang)
const;
199 const std::map<std::string, std::string> &descriptions()
const;
200 void setDescription(
const std::string description,
201 const std::string &lang);
203 std::list<RobotRequirement>& robotRequirements()
const;
205 void clearRobotRequirements();
207 std::list<NaoqiRequirement>& naoqiRequirements()
const;
209 void clearNaoqiRequirements();
211 std::list<BehaviorInfo> & behaviors();
212 const std::list<BehaviorInfo>& behaviors()
const;
213 void addBehavior(
const BehaviorInfo& behavior);
214 bool hasBehavior()
const;
215 void clearBehaviors();
217 const std::list<DialogInfo>& dialogs()
const;
218 void addDialog(
const DialogInfo& dialog);
221 const std::list<LanguageInfo>& languages()
const;
222 void addLanguage(
const LanguageInfo& language);
224 const std::list<PackageService> &services()
const;
226 void clearServices();
228 const std::list<std::string> &executableFiles()
const;
229 void addExecutableFile(
const std::string &executableFile);
231 PackageInfoPrivate *
_p;
236 QI_PACKAGE_API std::ostream&
operator<<(std::ostream& os,
244 QI_TYPE_STRUCT(::
qi::PackageInfo2, uuid, version, author, channel, organization, date, typeVersion, installer, path, elems);
247 #endif // _QI_PACKAGE_PACKAGE_INFO_HPP_
QI_PACKAGE_API qi::PackageInfo2 loadManifest(const std::string &manifestPath)
Returns a qi::PackageInfo2 from a manifest path.
std::string minBodyVersion
The minimum version for the body to be compatible with this package.
This structure defines robot requirements for this package.
std::string maxBodyVersion
The maximum version for the body to be compatible with this package.
std::string minHeadVersion
The minimum needed version for the head to be compatible with this package.
A dynamic struct for managing packages information.
std::string installer
Source of the package.
QI_TYPE_STRUCT(::qi::RobotRequirement, model, minHeadVersion, maxHeadVersion, minBodyVersion, maxBodyVersion)
Structure matching a service.
std::string path
The path to web pages.
A structure defining web pages location.
std::string maxVersion
The maximum version of naoqi compatible with this package.
std::string minVersion
The minimum version of naoqi compatible with this package.
Requirement on naoqi version.
std::string uuid
Unique ID to identify the package.
std::string version
Version of the package.
std::string model
Model of the robot (ROBOT_TYPE_NAO, ROBOT_TYPE_JULIETTE, ROBOT_TYPE_ROMEO, ...)
std::string path
Path to the files. Should not be used.
std::string date
Data of the package.
std::string organization
Organization.
std::string maxHeadVersion
The maximum version of the head to be compatible with this package.
std::string author
Author of the package.
bool autoRun
If this service should be started automatically at start-up.
std::string name
The name of the service.
std::map< std::string, qi::AnyValue > elems
std::vector< PackageInfo > PackageInfoList
std::string typeVersion
Type version.
QI_PACKAGE_API std::ostream & operator<<(std::ostream &os, const PackageInfo &package)
A class that represents a package.
std::string channel
Channel.
std::string execStart
The command line with arguments.