--- /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 GLIST_RANGE_H_
+#define GLIST_RANGE_H_
+
+#include <glib.h>
+
+#include <cstddef>
+#include <iterator>
+
+// Range with mutable forward iterator based on GList
+// supporting language foreach construct
+template<typename T>
+class GListRange {
+ public:
+ class Iterator {
+ public:
+ typedef T value_type;
+ typedef T& reference;
+ typedef T* pointer;
+ typedef const T* const_pointer;
+ typedef std::size_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ explicit Iterator(std::nullptr_t ptr = nullptr) : ptr_(ptr) { }
+ explicit Iterator(GList* ptr) : ptr_(ptr) { }
+ explicit operator bool() const {
+ return ptr_;
+ }
+ const reference& operator*() const {
+ return reinterpret_cast<const T&>(ptr_->data);
+ }
+ reference& operator*() {
+ return reinterpret_cast<T&>(ptr_->data);
+ }
+ const_pointer operator->() const {
+ return reinterpret_cast<pointer>(&ptr_->data);
+ }
+ pointer operator->() {
+ return reinterpret_cast<pointer>(&ptr_->data);
+ }
+ Iterator& operator++() {
+ ptr_ = g_list_next(ptr_);
+ return *this;
+ }
+ Iterator operator++(int) {
+ Iterator iter(ptr_);
+ ptr_ = g_list_next(ptr_);
+ return iter;
+ }
+ bool operator==(const Iterator& other) const {
+ return ptr_ == other.ptr_;
+ }
+ bool operator!=(const Iterator& other) const {
+ return !this->operator==(other);
+ }
+
+ private:
+ GList* ptr_;
+ };
+
+ explicit GListRange(GList* list) : list_(list) { }
+ Iterator begin() {
+ return Iterator(list_);
+ }
+ Iterator end() {
+ return Iterator();
+ }
+
+ bool Empty() const noexcept {
+ return !list_;
+ }
+
+ guint Size() const {
+ return g_list_length(list_);
+ }
+
+ private:
+ GList* list_;
+};
+
+#endif // GLIST_RANGE_H_
ADD_LIBRARY(${TARGET_TIZEN_ACTION_PLUGIN} SHARED ${ACTION_PLUGIN_SRCS})
TARGET_LINK_LIBRARIES(${TARGET_TIZEN_ACTION_PLUGIN} PRIVATE ${TARGET_TIZEN_THEME} ${TARGET_TIZEN_ACTION_PROVIDER})
-TARGET_INCLUDE_DIRECTORIES(${TARGET_TIZEN_ACTION_PLUGIN} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}../)
+TARGET_INCLUDE_DIRECTORIES(${TARGET_TIZEN_ACTION_PLUGIN} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../)
APPLY_PKG_CONFIG(${TARGET_TIZEN_ACTION_PLUGIN} PUBLIC
DLOG_DEPS
--- /dev/null
+/*
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef PKGMGR_PLUGIN_PARSER_ACTION_REGISTRY_HH_
+#define PKGMGR_PLUGIN_PARSER_ACTION_REGISTRY_HH_
+
+namespace parser {
+
+class IActionRegistry {
+ public:
+ virtual ~IActionRegistry() = default;
+ virtual bool Install() = 0;
+ virtual bool Uninstall() = 0;
+ virtual bool Update() = 0;
+};
+
+} // namespace parser
+
+#endif // PKGMGR_PLUGIN_PARSER_ACTION_REGISTRY_HH_
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef PLGMGR_PLUGIN_PARSER_ACTION_SCHEMA_PARSER_HH_
+#define PLGMGR_PLUGIN_PARSER_ACTION_SCHEMA_PARSER_HH_
+
+#include <string>
+
+namespace parser {
+
+class IActionSchemaParser {
+ public:
+ virtual ~IActionSchemaParser() = default;
+ virtual bool Parse(const std::string& path) = 0;
+};
+
+} // namespace parser
+
+#endif // PLGMGR_PLUGIN_PARSER_ACTION_SCHEMA_PARSER_HH_
+++ /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 GLIST_RANGE_H_
-#define GLIST_RANGE_H_
-
-#include <glib.h>
-
-#include <cstddef>
-#include <iterator>
-
-// Range with mutable forward iterator based on GList
-// supporting language foreach construct
-template<typename T>
-class GListRange {
- public:
- class Iterator {
- public:
- typedef T value_type;
- typedef T& reference;
- typedef T* pointer;
- typedef const T* const_pointer;
- typedef std::size_t difference_type;
- typedef std::forward_iterator_tag iterator_category;
-
- explicit Iterator(std::nullptr_t ptr = nullptr) : ptr_(ptr) { }
- explicit Iterator(GList* ptr) : ptr_(ptr) { }
- explicit operator bool() const {
- return ptr_;
- }
- const reference& operator*() const {
- return reinterpret_cast<const T&>(ptr_->data);
- }
- reference& operator*() {
- return reinterpret_cast<T&>(ptr_->data);
- }
- const_pointer operator->() const {
- return reinterpret_cast<pointer>(&ptr_->data);
- }
- pointer operator->() {
- return reinterpret_cast<pointer>(&ptr_->data);
- }
- Iterator& operator++() {
- ptr_ = g_list_next(ptr_);
- return *this;
- }
- Iterator operator++(int) {
- Iterator iter(ptr_);
- ptr_ = g_list_next(ptr_);
- return iter;
- }
- bool operator==(const Iterator& other) const {
- return ptr_ == other.ptr_;
- }
- bool operator!=(const Iterator& other) const {
- return !this->operator==(other);
- }
-
- private:
- GList* ptr_;
- };
-
- explicit GListRange(GList* list) : list_(list) { }
- Iterator begin() {
- return Iterator(list_);
- }
- Iterator end() {
- return Iterator();
- }
-
- bool Empty() const noexcept {
- return !list_;
- }
-
- guint Size() const {
- return g_list_length(list_);
- }
-
- private:
- GList* list_;
-};
-
-#endif // GLIST_RANGE_H_
+++ /dev/null
-/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string>
-
-namespace tas {
-
-class IActionParser {
- public:
- virtual ~IActionParser() = default;
- virtual bool Parse(const std::string& json_string) = 0;
-};
-
-} // namespace tas
+++ /dev/null
-/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string>
-
-#include "json_action_parser.h"
-
-namespace tas {
-
-JsonActionParser::JsonActionParser() {
-}
-
-JsonActionParser::~JsonActionParser() {
-}
-
-bool JsonActionParser::Parse(const std::string& json_str) {
- return true;
-}
-
-} // namespace tas
+++ /dev/null
-/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string>
-
-#include "iaction_parser.h"
-
-namespace tas {
-
-class JsonActionParser : public IActionParser {
- public:
- JsonActionParser();
- ~JsonActionParser();
- bool Parse(const std::string& json_string) override;
-};
-
-} // namespace tas
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "pkgmgr_plugin_parser/json_action_schema_parser.hh"
+
+#include <json/json.h>
+
+#include <fstream>
+#include <string>
+
+namespace parser {
+
+bool JsonActionSchemaParser::Parse(const std::string& path) {
+ Json::CharReaderBuilder rbuilder;
+ rbuilder["collectComments"] = false;
+
+ std::ifstream ifs(path);
+ Json::Value root;
+ std::string error;
+ if (!Json::parseFromStream(rbuilder, ifs, &root, &error)) {
+ // LOG(ERROR) << "Failed to read json file: " << error;
+ return false;
+ }
+
+ return true;
+}
+
+} // namespace parser
--- /dev/null
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef PKGMGR_PLUGIN_PARSER_JSON_ACTION_SCHEMA_PARSER_HH_
+#define PKGMGR_PLUGIN_PARSER_JSON_ACTION_SCHEMA_PARSER_HH_
+
+#include <string>
+
+#include "pkgmgr_plugin_parser/action_schema_parser.hh"
+
+namespace parser {
+
+class JsonActionSchemaParser : public IActionSchemaParser {
+ public:
+ JsonActionSchemaParser() = default;
+ ~JsonActionSchemaParser() = default;
+ bool Parse(const std::string& path) override;
+};
+
+} // namespace parser
+
+#endif // PKGMGR_PLUGIN_PARSER_JSON_ACTION_SCHEMA_PARSER_HH_
\ No newline at end of file
#include <cstring>
#include <string>
-#include "glist_range.h"
+#include "common/utils/glist_range.h"
namespace {