Remove unused files
authorSangyoon Jang <jeremy.jang@samsung.com>
Wed, 12 Mar 2025 07:10:03 +0000 (16:10 +0900)
committer장상윤/Tizen Platform Lab(SR)/삼성전자 <jeremy.jang@samsung.com>
Thu, 13 Mar 2025 01:15:47 +0000 (10:15 +0900)
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/action/service.cc
src/action/utils/json_parser.cc [deleted file]
src/action/utils/json_parser.hh [deleted file]

index bdb6aaf317d427040eee2f5c51781900a7e994f1..f87270ff11cb8c9930e6ab4c4a3a0fa9f9c23933 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "action/request_handler.hh"
 #include "action/sqlite_db.hh"
-#include "action/utils/json_parser.hh"
 #include "common/utils/logging.hh"
 #include "common/action_model.h"
 
diff --git a/src/action/utils/json_parser.cc b/src/action/utils/json_parser.cc
deleted file mode 100644 (file)
index 6f6ee03..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * 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.
- */
-
-#include <stdexcept>
-
-#include "action/utils/json_parser.hh"
-#include "common/utils/logging.hh"
-
-namespace action {
-namespace utils {
-
-JsonParser::JsonParser(std::string json_str)
-    : json_str_(json_str) {
-  LOG(DEBUG) << "ParseStr const";
-
-  std::size_t pos = 0;
-  std::size_t lpos = 0;
-  std::string params;
-
-  // remove {}
-  pos = json_str_.find("{");
-  lpos = json_str_.rfind("}");
-  json_str_ = json_str_.substr(pos + 1, lpos - pos - 1);
-
-  // seperate params
-  pos = json_str_.find("{");
-  lpos = json_str_.rfind("}");
-  params = json_str_.substr(pos + 1, lpos - pos - 1);
-  json_str_.replace(pos + 1, lpos - pos - 1, " ");
-
-  // make nodes
-  while(true) {
-    pos = json_str_.find(",");
-
-    if (pos == std::string::npos)
-      break;
-
-    std::string sub_ = json_str_.substr(0, pos);
-    std::size_t spos = sub_.find(":");
-    std::string key = sub_.substr(1, spos - 2);
-    sub_ = sub_.substr(spos + 1);
-    std::string value = sub_.substr(1, sub_.length() - 2);
-
-    nodes_[key] = value;
-
-    // LOG(DEBUG) << key << " : " << value;
-
-    json_str_ = json_str_.substr(pos + 1);
-  }
-
-//   LOG(DEBUG) << params;
-
-  std::size_t compos = 0;
-
-  // make params
-  while(true) {
-    pos = params.find("{");
-    lpos = params.find("}");
-
-    std::string key = params.substr(1, pos - 3);
-    std::string value = params.substr(pos + 1, lpos - pos - 1);
-
-    // LOG(DEBUG) << key << " : " << value;
-
-
-    std::size_t subpos = 0;
-    std::size_t nextpos = 0;
-    std::size_t compos_ = 0;
-    std::map<std::string, std::string> mvalue;
-
-    // make param value
-    while(true) {
-    //   LOG(DEBUG) << value;
-
-      subpos = value.find("\"");
-      nextpos = value.find("\"", subpos + 1);
-
-      std::string subkey = value.substr(1, nextpos - 1);
-
-      subpos = value.find("\"", nextpos + 1);
-      nextpos = value.find("\"", subpos + 1);
-
-      std::string subval = value.substr(subpos + 1, nextpos - subpos - 1);
-
-      mvalue[subkey] = subval;
-
-      compos_ = value.find(",", nextpos);
-      if (compos_ == std::string::npos)
-        break;
-
-      value = value.substr(compos_ + 1);
-    }
-    params_[key] = mvalue;
-
-    compos = params.find(",", lpos);
-    if (compos == std::string::npos)
-      break;
-
-    params = params.substr(lpos + 2);
-  }
-
-  LOG(DEBUG) << "ParseStr const end";
-}
-
-std::string JsonParser::GetAppId() {
-  return nodes_["appId"];
-}
-
-std::string JsonParser::GetName() {
-  return nodes_["name"];
-}
-
-std::string JsonParser::GetDescription() {
-  return nodes_["desc"];
-}
-
-std::string JsonParser::GetType() {
-  return nodes_["type"];
-}
-
-std::string JsonParser::GetVersion() {
-  return nodes_["version"];
-}
-
-std::string JsonParser::GetRequiredPrivilege() {
-  return nodes_["required-privileges"];
-}
-
-std::string JsonParser::GetReturns() {
-  return nodes_["required-privileges"];
-}
-
-std::map<std::string, std::map<std::string, std::string>> JsonParser::GetParameters() {
-  return params_;
-}
-
-}  // namespace utils
-}  // namespace action
diff --git a/src/action/utils/json_parser.hh b/src/action/utils/json_parser.hh
deleted file mode 100644 (file)
index c5b97d8..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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 JSON_PARSER_H_
-#define JSON_PARSER_H_
-
-// #include <json/json.h>
-
-#include <string>
-#include <map>
-
-namespace action {
-namespace utils {
-
-/* temporary parser */
-/* need to be changed to use json */
-
-class JsonParser {
- public:
-  JsonParser(std::string json_str);
-  ~JsonParser() = default;
-
-  std::string GetAppId();
-  std::string GetName();
-  std::string GetDescription();
-  std::string GetType();
-  std::string GetVersion();
-  std::string GetRequiredPrivilege();
-  std::string GetReturns();
-  std::map<std::string, std::map<std::string, std::string>> GetParameters();
-
- private:
-  std::string json_str_;
-  std::map<std::string, std::string> nodes_;
-  std::map<std::string, std::map<std::string, std::string>> params_;
-};
-
-}  // namespace action
-}  // namespace utils
-
-#endif  //