https://developer.tizen.org/ko/development/tools/native-tools/manifest-text-editor?langredirect=1#profile_element
Change-Id: I21e95986109a48a1e5e49d53b6b4b7ecc8c59e25
description_handler.cc
package_handler.cc
privileges_handler.cc
+ profile_handler.cc
service_application_handler.cc
shortcut_handler.cc
tpk_config_parser.cc
const char kShortcutLabelTextKey[] = "#text";
const char kShortcutLabelLangKey[] = "@lang";
+//profile
+const char kProfileKey[] = "manifest.profile";
+
} // namespace application_keys
} // namespace tpk
extern const char kShortcutLabelTextKey[];
extern const char kShortcutLabelLangKey[];
+// profile
+extern const char kProfileKey[];
+
} // namespace application_keys
} // namespace tpk
--- /dev/null
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "tpk_manifest_handlers/profile_handler.h"
+
+#include <cassert>
+#include <map>
+#include <utility>
+
+#include "manifest_parser/manifest_util.h"
+#include "tpk_manifest_handlers/application_manifest_constants.h"
+
+namespace tpk {
+namespace parse {
+
+namespace keys = tpk::application_keys;
+
+namespace {
+
+const char kProfileNameKey[] = "@name";
+
+} // namespace
+
+bool ProfileHandler::Parse(
+ const parser::Manifest& manifest,
+ std::shared_ptr<parser::ManifestData>* output,
+ std::string* error) {
+ if (!manifest.HasPath(keys::kProfileKey))
+ return true;
+
+ std::shared_ptr<ProfileInfo> profile_info(new ProfileInfo());
+ for (auto& item : parser::GetOneOrMany(manifest.value(), keys::kProfileKey,
+ "")) {
+ std::string name;
+ if (!item->GetString(kProfileNameKey, &name)) {
+ *error = "Missing 'name' attribute in profile tag";
+ return false;
+ }
+ profile_info->AddProfile(name);
+ }
+
+ *output = std::static_pointer_cast<parser::ManifestData>(profile_info);
+ return true;
+}
+
+std::string ProfileHandler::Key() const {
+ return keys::kProfileKey;
+}
+
+} // namespace parse
+} // namespace tpk
--- /dev/null
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef TPK_MANIFEST_HANDLERS_PROFILE_HANDLER_H_
+#define TPK_MANIFEST_HANDLERS_PROFILE_HANDLER_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "manifest_parser/manifest_handler.h"
+#include "manifest_parser/values.h"
+#include "tpk_manifest_handlers/application_manifest_constants.h"
+
+namespace tpk {
+namespace parse {
+
+class ProfileInfo : public parser::ManifestData {
+ public:
+ void AddProfile(const std::string& profile) {
+ profiles_.push_back(profile);
+ }
+
+ const std::vector<std::string>& profiles() const {
+ return profiles_;
+ }
+
+ private:
+ std::vector<std::string> profiles_;
+};
+
+/**
+ * @brief The ProfileHandler class
+ *
+ * Handler of tizen-manifest.xml for xml elements:
+ * <profile>
+ */
+class ProfileHandler : public parser::ManifestHandler {
+ public:
+ bool Parse(
+ const parser::Manifest& manifest,
+ std::shared_ptr<parser::ManifestData>* output,
+ std::string* error) override;
+ std::string Key() const override;
+};
+
+} // namespace parse
+} // namespace tpk
+
+#endif // TPK_MANIFEST_HANDLERS_PROFILE_HANDLER_H_
#include "tpk_manifest_handlers/description_handler.h"
#include "tpk_manifest_handlers/package_handler.h"
#include "tpk_manifest_handlers/privileges_handler.h"
+#include "tpk_manifest_handlers/profile_handler.h"
#include "tpk_manifest_handlers/service_application_handler.h"
#include "tpk_manifest_handlers/shortcut_handler.h"
#include "tpk_manifest_handlers/ui_application_handler.h"
new DescriptionHandler,
new PackageHandler,
new PrivilegesHandler,
+ new ProfileHandler,
new ServiceApplicationHandler,
new UIApplicationHandler,
new ShortcutHandler