refactoring: make less dependencies 24/207224/4
authorAdrian Szyndela <adrian.s@samsung.com>
Thu, 30 May 2019 09:42:34 +0000 (11:42 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Fri, 31 May 2019 09:55:07 +0000 (11:55 +0200)
Change-Id: I8ec4031716f0a089e62ca0cae6fe1bfc3f5e9529

src/internal/tslog.cpp
src/internal/tslog.hpp
src/internal/xml_parser.cpp
src/internal/xml_parser.hpp
src/kdbus.cpp
src/libdbuspolicy1-private.h
src/libdbuspolicy1.cpp

index 28a9808..9cea129 100644 (file)
@@ -17,7 +17,6 @@
  * \file
  * \ingroup Implementation
  */
-#include "libdbuspolicy1-private.h"
 #include "tslog.hpp"
 #include <cstring>
 
index f04fd16..e5ad89f 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef _TSLOG_HPP
 #define _TSLOG_HPP
 
+#define LOG_TAG "LIBDBUSPOLICY"
+#include <dlog.h>
 #include <iostream>
 #include <thread>
 #include <pthread.h>
index 98ea5cd..62d8372 100644 (file)
@@ -18,7 +18,6 @@
  * \file
  * \ingroup Implementation
  */
-#include "libdbuspolicy1-private.h"
 #include "tslog.hpp"
 #include "uid_gid_helpers.hpp"
 #include "xml_parser.hpp"
@@ -26,6 +25,7 @@
 #include <cstring>
 #include <dirent.h>
 #include <expat.h>
+#include <functional>
 #include <libgen.h>
 #include <memory>
 #include <unistd.h>
index c5d8692..0b91633 100644 (file)
@@ -69,7 +69,7 @@ namespace ldp_xml_parser
                void getIncludedFiles(const std::string& parent_dir, const std::string& incldir, std::vector<std::string>& files);
 
                ItemBuilder __builder;
-               PolicyType policy_type;
+               PolicyType policy_type{PolicyType::NONE};
                PolicyTypeValue policy_type_value;
 
                void parsePolicyTag(const char **attr);
@@ -82,12 +82,12 @@ namespace ldp_xml_parser
 
                ParseState state{IDLE};
 
-               bool ignore_always;
-               bool ignore_missing;
+               bool ignore_always{false};
+               bool ignore_missing{false};
                std::string current_text;
                std::string curr_dir;
-               int ret_code;
-               const char *main_filename;
+               int ret_code{-1};
+               const char *main_filename{nullptr};
 
                std::vector<std::string> included_files;
        };
index a045fd5..ce1f960 100644 (file)
@@ -21,7 +21,6 @@
 #include <cerrno>
 #include <cstddef>
 #include <dbuspolicy1/libdbuspolicy1.h>
-#include <dlog/dlog.h>
 #include <fcntl.h>
 #include <linux/kdbus.h>
 #include <memory>
index 78c886e..3bea979 100644 (file)
 #ifndef _LIBDBUSPOLICY1_PRIVATE_H_
 #define _LIBDBUSPOLICY1_PRIVATE_H_
 
-#include <stdint.h>
-#include <syslog.h>
-#include <sys/types.h>
-
-#include <dbuspolicy1/libdbuspolicy1.h>
-#include <linux/kdbus.h>
-
-#define DBUSPOLICY1_EXPORT __attribute__ ((visibility("default")))
-
-#define LOG_TAG "LIBDBUSPOLICY"
-#include <dlog.h>
-
 #ifdef __cplusplus
 extern "C" {
 #endif
index 222ed9a..74c8ed2 100644 (file)
 #include <cstdio>
 #include <cstdlib>
 #include <cstring>
+#include <dbuspolicy1/libdbuspolicy1.h>
 #include <fcntl.h>
 #include <grp.h>
+#include <linux/kdbus.h>
 #include <linux/limits.h>
 #include <memory>
 #include <mutex>
@@ -36,6 +38,8 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#define DBUSPOLICY1_EXPORT __attribute__ ((visibility("default")))
+
 using ldp_xml_parser::DecisionResult;
 using ldp_xml_parser::MatchItemSend;
 using ldp_xml_parser::MatchItemReceive;