10 #ifndef _QI_PACKAGE_PACKAGE_INFO_HPP_
11 #define _QI_PACKAGE_PACKAGE_INFO_HPP_
16 #include <qipackage/api.hpp>
17 #include <alvalue/alvalue.h>
18 #include <qipackage/language_info.hpp>
19 #include <qipackage/behavior_info.hpp>
20 #include <qipackage/dialog_info.hpp>
21 #include <qi/macro.hpp>
22 #include <qi/anyobject.hpp>
23 #include <qi/type/typeinterface.hpp>
28 class PackageInfoPrivate;
62 std::map<std::string, qi::AnyValue>
elems;
64 std::map<std::string, qi::AnyValue> contents()
const;
65 std::map<std::string, qi::AnyValue>& contents();
67 std::vector<qi::BehaviorInfo> behaviors()
const;
68 std::vector<qi::BehaviorInfo>& behaviors();
70 std::vector<qi::DialogInfo> dialogs()
const;
71 std::vector<qi::DialogInfo>& dialogs();
73 std::vector<qi::LanguageInfo> languages()
const;
74 std::vector<qi::LanguageInfo>& languages();
144 void toALValue(AL::ALValue &alvalue);
146 bool loadFromManifestFile(
const std::string& filePath);
147 bool loadFromManifestFile(QFile &file);
148 bool loadFromManifestContent(
const std::string& manifestContent);
152 void trimExtraInfo();
154 bool saveToManifestFile(
const std::string& filePath)
const;
155 bool saveToManifestFile(QFile &file)
const;
156 std::string saveToManifestContent()
const;
158 const std::string& installer()
const;
159 void setInstaller(
const std::string &installer);
161 const std::string& uuid()
const;
162 void setUuid(
const std::string &uuid);
164 const std::string& version()
const;
165 void setVersion(
const std::string &version);
167 const bool& installOnlyAtStartup()
const;
168 void setInstallOnlyAtStartup(
const bool &installOnlyAtStartup);
170 const std::string& typeVersion()
const;
171 void setTypeVersion(
const std::string &typeVersion);
173 const std::string& author()
const;
174 void setAuthor(
const std::string &author);
176 const std::string& organization()
const;
177 void setOrganization(
const std::string &organization);
179 const std::string& date()
const;
180 void setDate(
const std::string &date);
182 const std::string& channel()
const;
183 void setChannel(
const std::string &channel);
185 const std::string& path()
const;
186 void setPath(
const std::string &path);
188 const std::string& name(
const std::string &lang)
const;
189 const std::map<std::string, std::string> &names()
const;
190 void setName(
const std::string &name,
191 const std::string &lang);
194 const std::list<std::string>& supportedLanguages()
const;
195 void addSupportedLanguage(
const std::string & language);
196 void removeSupportedLanguage(
const std::string & language);
197 void clearSupportedLanguages();
199 const std::list<std::string>& descriptionLanguages()
const;
200 void addDescriptionLanguage(
const std::string & language);
201 void removeDescriptionLanguage(
const std::string & language);
202 void clearDescriptionLanguages();
204 const std::string& description(
const std::string &lang)
const;
205 const std::map<std::string, std::string> &descriptions()
const;
206 void setDescription(
const std::string description,
207 const std::string &lang);
209 std::list<RobotRequirement>& robotRequirements()
const;
211 void clearRobotRequirements();
213 std::list<NaoqiRequirement>& naoqiRequirements()
const;
215 void clearNaoqiRequirements();
217 std::list<BehaviorInfo> & behaviors();
218 const std::list<BehaviorInfo>& behaviors()
const;
219 void addBehavior(
const BehaviorInfo& behavior);
220 bool hasBehavior()
const;
221 void clearBehaviors();
223 const std::list<DialogInfo>& dialogs()
const;
224 void addDialog(
const DialogInfo& dialog);
227 const std::list<LanguageInfo>& languages()
const;
228 void addLanguage(
const LanguageInfo& language);
230 const std::list<PackageService> &services()
const;
232 void clearServices();
234 const std::list<std::string> &executableFiles()
const;
235 void addExecutableFile(
const std::string &executableFile);
237 PackageInfoPrivate *
_p;
242 QI_PACKAGE_API std::ostream&
operator<<(std::ostream& os,
251 QI_TYPE_STRUCT(::
qi::PackageInfo2, uuid, version, author, channel, organization, date, typeVersion, installer, path, elems, installOnlyAtStartup);
254 #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.
QI_TYPE_STRUCT_EXTENSION_ADDED_FIELDS(::qi::PackageInfo2,"installOnlyAtStartup")
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
bool installOnlyAtStartup
Install only at Startup.
std::vector< PackageInfo > PackageInfoList
std::string typeVersion
Type version.
std::map< std::string, std::string > envVars
The specific environement variables.
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.