Rename file extension from .h to .hpp
authorSangwan Kwon <sangwan.kwon@samsung.com>
Thu, 7 Nov 2019 05:16:12 +0000 (14:16 +0900)
committerSangwan Kwon <sangwan.kwon@samsung.com>
Fri, 8 Nov 2019 05:40:50 +0000 (14:40 +0900)
Signed-off-by: Sangwan Kwon <sangwan.kwon@samsung.com>
60 files changed:
AUTHORS [new file with mode: 0644]
plugins/bluetooth/bluetooth.cpp
plugins/wifi/wifi.cpp
src/osquery/tables/tizen/policy.cpp
src/osquery/tables/tizen/policy_admin.cpp
src/osquery/tables/tizen/tests/policy.cpp [moved from src/osquery/tables/tizen/tests/policy_tests.cpp with 97% similarity]
src/vist/CMakeLists.txt
src/vist/client/query.cpp
src/vist/client/query.hpp [moved from src/vist/client/query.h with 100% similarity]
src/vist/client/schema/policy.hpp [moved from src/vist/client/schema/policy.h with 92% similarity]
src/vist/client/schema/processes.hpp [moved from src/vist/client/schema/processes.h with 89% similarity]
src/vist/client/schema/time.hpp [moved from src/vist/client/schema/time.h with 88% similarity]
src/vist/client/tests/client.cpp [moved from src/vist/client/tests/client-tests.cpp with 94% similarity]
src/vist/client/tests/virtual-table.cpp [moved from src/vist/client/tests/virtual-table-tests.cpp with 90% similarity]
src/vist/client/virtual-table.cpp
src/vist/client/virtual-table.hpp [moved from src/vist/client/virtual-table.h with 100% similarity]
src/vist/common/CMakeLists.txt [deleted file]
src/vist/exception.hpp [moved from src/vist/common/exception.h with 95% similarity]
src/vist/ipc/client.hpp [moved from src/vist/common/ipc/client.h with 100% similarity]
src/vist/ipc/server.hpp [moved from src/vist/common/ipc/server.h with 100% similarity]
src/vist/ipc/tests/ipc.cpp [moved from src/vist/common/ipc/tests/ipc_tests.cpp with 96% similarity]
src/vist/logger.hpp [moved from src/vist/common/audit/logger.h with 95% similarity]
src/vist/main/main.cpp
src/vist/main/tests.cpp
src/vist/notification/notification.cpp
src/vist/notification/notification.hpp [moved from src/vist/notification/notification.h with 93% similarity]
src/vist/notification/tests/notification.cpp [moved from src/vist/notification/tests/notification-tests.cpp with 90% similarity]
src/vist/policy/api.hpp [moved from src/vist/policy/api.h with 96% similarity]
src/vist/policy/core/api.cpp
src/vist/policy/core/db-schema.hpp [moved from src/vist/policy/core/db-schema.h with 99% similarity]
src/vist/policy/core/policy-loader.cpp
src/vist/policy/core/policy-loader.hpp [moved from src/vist/policy/core/policy-loader.h with 96% similarity]
src/vist/policy/core/policy-manager.cpp
src/vist/policy/core/policy-manager.hpp [moved from src/vist/policy/core/policy-manager.h with 93% similarity]
src/vist/policy/core/policy-storage.cpp
src/vist/policy/core/policy-storage.hpp [moved from src/vist/policy/core/policy-storage.h with 96% similarity]
src/vist/policy/core/tests/core.cpp [moved from src/vist/policy/core/tests/core-tests.cpp with 96% similarity]
src/vist/policy/core/tests/storage.cpp [moved from src/vist/policy/core/tests/storage-tests.cpp with 98% similarity]
src/vist/policy/sdk/policy-model.hpp [moved from src/vist/policy/sdk/policy-model.h with 97% similarity]
src/vist/policy/sdk/policy-provider.hpp [moved from src/vist/policy/sdk/policy-provider.h with 97% similarity]
src/vist/policy/sdk/policy-value.hpp [moved from src/vist/policy/sdk/policy-value.h with 100% similarity]
src/vist/policy/sdk/tests/sdk.cpp [moved from src/vist/policy/sdk/tests/sdk-tests.cpp with 96% similarity]
src/vist/query-builder.hpp [moved from src/vist/tsqb/tsqb.hxx with 69% similarity]
src/vist/query-builder/CMakeLists.txt [moved from src/vist/tsqb/CMakeLists.txt with 95% similarity]
src/vist/query-builder/column-pack.hpp [moved from src/vist/tsqb/include/column-pack.hxx with 94% similarity]
src/vist/query-builder/column.hpp [moved from src/vist/tsqb/include/column.hxx with 88% similarity]
src/vist/query-builder/condition.hpp [moved from src/vist/tsqb/include/condition.hxx with 92% similarity]
src/vist/query-builder/crud.hpp [moved from src/vist/tsqb/include/crud.hxx with 97% similarity]
src/vist/query-builder/database.hpp [moved from src/vist/tsqb/include/database.hxx with 95% similarity]
src/vist/query-builder/expression.hpp [moved from src/vist/tsqb/include/expression.hxx with 93% similarity]
src/vist/query-builder/table-pack.hpp [moved from src/vist/tsqb/include/table-pack.hxx with 95% similarity]
src/vist/query-builder/table.hpp [moved from src/vist/tsqb/include/table.hxx with 94% similarity]
src/vist/query-builder/tests/query-builder.cpp [moved from src/vist/tsqb/tests/tsqb-tests.cpp with 97% similarity]
src/vist/query-builder/tuple-helper.hpp [moved from src/vist/tsqb/include/tuple-helper.hxx with 91% similarity]
src/vist/query-builder/type.hpp [moved from src/vist/tsqb/include/type.hxx with 89% similarity]
src/vist/query-builder/util.hpp [moved from src/vist/tsqb/include/util.hxx with 93% similarity]
src/vist/service/tests/core.cpp [moved from src/vist/service/tests/core-tests.cpp with 91% similarity]
src/vist/service/vist.cpp
src/vist/service/vist.hpp [moved from src/vist/service/vist.h with 100% similarity]
src/vist/tests/exception.cpp [moved from src/vist/common/tests/exception.cpp with 96% similarity]

diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..166e74e
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,13 @@
+# This is the official list of ViST authors for copyright purposes.
+# This file is distinct from the CONTRIBUTORS files.
+# See the latter for an explanation.
+#
+# Names should be added to this file as:
+#      Name or Organization <email address>
+# The email address is not required for organizations.
+#
+# Please keep the list sorted.
+
+Jaemin Ryu <jm77.ryu@samsung.com>
+Samsung Electronics Co.
+Sangwan Kwon <sangwan.kwon@samsung.com>
index eafbc65..0caa39e 100644 (file)
@@ -18,8 +18,8 @@
 #include <bluetooth-api.h>
 #include <bluetooth_internal.h>
 
-#include <vist/policy/sdk/policy-model.h>
-#include <vist/policy/sdk/policy-provider.h>
+#include <vist/policy/sdk/policy-model.hpp>
+#include <vist/policy/sdk/policy-provider.hpp>
 
 #include <memory>
 
index b8d8aa5..95ca32e 100644 (file)
@@ -17,8 +17,8 @@
 #include <arpa/inet.h>
 #include <wifi-manager.h>
 
-#include <vist/policy/sdk/policy-model.h>
-#include <vist/policy/sdk/policy-provider.h>
+#include <vist/policy/sdk/policy-model.hpp>
+#include <vist/policy/sdk/policy-provider.hpp>
 
 #include <klay/dbus/connection.h>
 
index 5301071..313ac14 100644 (file)
@@ -21,8 +21,8 @@
 #include <osquery/sql.h>
 #include <osquery/tables.h>
 
-#include <vist/policy/api.h>
-#include <vist/common/audit/logger.h>
+#include <vist/policy/api.hpp>
+#include <vist/logger.hpp>
 
 namespace osquery {
 namespace tables {
index a831701..00d7a35 100644 (file)
@@ -21,8 +21,8 @@
 #include <osquery/sql.h>
 #include <osquery/tables.h>
 
-#include <vist/policy/api.h>
-#include <vist/common/audit/logger.h>
+#include <vist/policy/api.hpp>
+#include <vist/logger.hpp>
 
 namespace {
 
similarity index 97%
rename from src/osquery/tables/tizen/tests/policy_tests.cpp
rename to src/osquery/tables/tizen/tests/policy.cpp
index e7cb5b2..983b693 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <gtest/gtest.h>
 
-#include <vist/policy/api.h>
+#include <vist/policy/api.hpp>
 
 using namespace vist;
 
index 73f9be1..4d7cf18 100644 (file)
@@ -29,7 +29,6 @@ ADD_DEFINITIONS(-DDB_PATH="${DB_INSTALL_DIR}/.vist.db"
                                -DSCRIPT_INSTALL_DIR="${SCRIPT_INSTALL_DIR}")
 
 ADD_SUBDIRECTORY(client)
-ADD_SUBDIRECTORY(common)
 ADD_SUBDIRECTORY(notification)
 ADD_SUBDIRECTORY(policy)
 ADD_SUBDIRECTORY(service)
@@ -54,6 +53,9 @@ INSTALL(TARGETS ${TARGET_VIST_DAEMON}
                                        WORLD_READ
                                        WORLD_EXECUTE)
 
+FILE(GLOB COMMON_TESTS "tests/*.cpp")
+ADD_VIST_TEST(${COMMON_TESTS})
+
 ADD_EXECUTABLE(${TARGET_VIST_TEST} main/tests.cpp
                                                                   ${${TARGET_VIST_LIB}_TESTS})
 TARGET_LINK_LIBRARIES(${TARGET_VIST_TEST} ${TARGET_VIST_LIB}
index 81124a1..29fb8fd 100644 (file)
  *  limitations under the License
  */
 
-#include "query.h"
+#include "query.hpp"
 
-#include <vist/common/ipc/client.h>
-#include <vist/common/audit/logger.h>
+#include <vist/logger.hpp>
+#include <vist/ipc/client.hpp>
 
 namespace {
        const std::string SOCK_ADDR = "/tmp/.vist";
similarity index 92%
rename from src/vist/client/schema/policy.h
rename to src/vist/client/schema/policy.hpp
index 17d4a3e..2d33fc4 100644 (file)
  *  limitations under the License
  */
 
-
-/**
- * @file processes.h
- * @brief The scheme of policy
- */
-
-
 #pragma once
 
 #include <string>
similarity index 89%
rename from src/vist/client/schema/processes.h
rename to src/vist/client/schema/processes.hpp
index 9e9325c..764cd2d 100644 (file)
  *  limitations under the License
  */
 
-
-/**
- * @file processes.h
- * @brief The scheme of processes (sync with osquery/tables/spec/x/processes.table)
- */
-
-
 #pragma once
 
 #include <string>
similarity index 88%
rename from src/vist/client/schema/time.h
rename to src/vist/client/schema/time.hpp
index 02258df..18a655d 100644 (file)
  *  limitations under the License
  */
 
-
-/**
- * @file time.h
- * @brief The scheme of time (sync with osquery/tables/spec/time.table)
- */
-
-
 #pragma once
 
 namespace vist {
similarity index 94%
rename from src/vist/client/tests/client-tests.cpp
rename to src/vist/client/tests/client.cpp
index f7bc148..e45c60b 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <gtest/gtest.h>
 
-#include "../query.h" 
+#include <vist/client/query.hpp>
 
 #include <chrono>
 #include <thread>
@@ -25,13 +25,13 @@ using namespace vist;
 
 class ClientTests : public testing::Test {};
 
-TEST_F(ClientTests, query) {
+TEST(ClientTests, query) {
        auto rows = Query::Execute("SELECT * FROM policy");
 
        EXPECT_TRUE(rows.size() > 0);
 }
 
-TEST_F(ClientTests, admin_enrollment) {
+TEST(ClientTests, admin_enrollment) {
        auto rows = Query::Execute("INSERT INTO policy_admin (name) VALUES ('testAdmin')");
        EXPECT_EQ(rows.size(), 0);
 
similarity index 90%
rename from src/vist/client/tests/virtual-table-tests.cpp
rename to src/vist/client/tests/virtual-table.cpp
index c3aaaec..3d3133f 100644 (file)
 
 #include <gtest/gtest.h>
 
-#include "../virtual-table.h"
+#include <vist/client/virtual-table.hpp>
 
-#include "../schema/time.h"
-#include "../schema/policy.h"
-#include "../schema/processes.h"
+#include <vist/client/schema/policy.hpp>
+#include <vist/client/schema/processes.hpp>
+#include <vist/client/schema/time.hpp>
 
-#include <vist/common/audit/logger.h>
+#include <vist/logger.hpp>
 
 using namespace vist;
 using namespace vist::schema;
 
 class VirtualTableTests : public testing::Test {};
 
-TEST_F(VirtualTableTests, time_row_at) {
+TEST(VirtualTableTests, time_row_at) {
        Time result = { -1, -1, -1 };
 
        VirtualRow<Time> time;
@@ -54,7 +54,7 @@ TEST_F(VirtualTableTests, time_row_at) {
        EXPECT_NE(result.seconds, -1);
 }
 
-TEST_F(VirtualTableTests, time_row_arry_op) {
+TEST(VirtualTableTests, time_row_arry_op) {
        Time result = { -1, -1, -1 };
 
        VirtualRow<Time> time;
@@ -73,7 +73,7 @@ TEST_F(VirtualTableTests, time_row_arry_op) {
        EXPECT_NE(result.seconds, -1);
 }
 
-TEST_F(VirtualTableTests, processes_table) {
+TEST(VirtualTableTests, processes_table) {
        Processes result;
        VirtualTable<Processes> processes;
        EXPECT_TRUE(processes.size() > 0);
@@ -105,7 +105,7 @@ TEST_F(VirtualTableTests, processes_table) {
        }
 }
 
-TEST_F(VirtualTableTests, policy_table) {
+TEST(VirtualTableTests, policy_table) {
        VirtualTable<Policy> table;
        EXPECT_TRUE(table.size() > 0);
 
index 2e6f372..2b359e5 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file virtual-table.cpp
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Implementation of virtual object
- */
-
-#include "virtual-table.h"
-#include "query.h" 
 
-#include "schema/time.h"
-#include "schema/policy.h"
-#include "schema/processes.h"
+#include "virtual-table.hpp"
 
-#include <vist/common/audit/logger.h>
+#include <vist/client/query.hpp>
+#include <vist/client/schema/policy.hpp>
+#include <vist/client/schema/processes.hpp>
+#include <vist/client/schema/time.hpp>
 
-#include <tsqb.hxx>
+#include <vist/logger.hpp>
+#include <vist/query-builder.hpp>
 
 #include <boost/lexical_cast.hpp>
 
 namespace {
 
-using namespace tsqb;
+using namespace vist::tsqb;
 using namespace vist::schema;
 
 auto time = make_table("time",
diff --git a/src/vist/common/CMakeLists.txt b/src/vist/common/CMakeLists.txt
deleted file mode 100644 (file)
index 04eeb46..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#  Copyright (c) 2019 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
-
-FILE(GLOB COMMON_TESTS "tests/*.cpp")
-ADD_VIST_TEST(${COMMON_TESTS})
similarity index 95%
rename from src/vist/common/exception.h
rename to src/vist/exception.hpp
index 8236026..ba848fe 100644 (file)
@@ -14,9 +14,6 @@
  *  limitations under the License
  */
 /*
- * @file   exception.h
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief  Enum based exception handling
  * @usage
  *  enum class ErrCode {
  *    LogicError = 1,
similarity index 96%
rename from src/vist/common/ipc/tests/ipc_tests.cpp
rename to src/vist/ipc/tests/ipc.cpp
index 94c082a..1e8c0d2 100644 (file)
@@ -16,8 +16,8 @@
 
 #include <gtest/gtest.h>
 
-#include "ipc/server.h"
-#include "ipc/client.h"
+#include <vist/ipc/client.hpp>
+#include <vist/ipc/server.hpp>
 
 #include <chrono>
 #include <thread>
similarity index 95%
rename from src/vist/common/audit/logger.h
rename to src/vist/logger.hpp
index a4bf3ed..592a0ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2019 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.
@@ -16,8 +16,8 @@
 
 #pragma once
 
-#include <klay/audit/logger.h>
 #include <klay/audit/dlog-sink.h>
+#include <klay/audit/logger.h>
 
 #include <memory>
 
index 64e1c0e..eec9680 100644 (file)
  *  limitations under the License
  */
 
-#include "service/vist.h"
+#include <vist/service/vist.hpp>
 
 #include <cstdlib>
 #include <stdexcept>
 
 using namespace vist;
 
-int main() try
-{
+int main() try {
        Vist::Instance().start();
        return EXIT_SUCCESS;
-} catch(const std::exception&)
-{
+} catch(const std::exception&) {
        return EXIT_FAILURE;
 }
index e249cbe..0fcfc89 100644 (file)
@@ -1,6 +1,22 @@
+/*
+ *  Copyright (c) 2019 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 <gtest/gtest.h>
 
 int main(int argc, char* argv[]) {
-  testing::InitGoogleTest(&argc, argv);
-  return RUN_ALL_TESTS();
+       testing::InitGoogleTest(&argc, argv);
+       return RUN_ALL_TESTS();
 }
index f30285d..06e945e 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file notification.cpp
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Implementation of notification
- */
 
-#include "notification.h"
+#include "notification.hpp"
 
 #include <mutex>
 
similarity index 93%
rename from src/vist/notification/notification.h
rename to src/vist/notification/notification.hpp
index 56a5962..5d47321 100644 (file)
  *  limitations under the License
  */
 
-
-/**
- * @file notification.h
- * @brief Notify to registered stuffs when event-callback called
- */
-
-
 #pragma once
 
 #include <map>
 
 #include <gtest/gtest.h>
 
-#include "../notification.h"
+#include <vist/notification/notification.hpp>
+
 #include <osquery/logger.h>
 
 using namespace vist;
 
 class NotificationTests : public testing::Test {};
 
-TEST_F(NotificationTests, test_add_positive) {
+TEST_F(NotificationTests, test_add_positive)
+{
        auto& notifier = Notification::instance();
 
        auto callback = [](const Row& row) {
@@ -36,7 +38,8 @@ TEST_F(NotificationTests, test_add_positive) {
        EXPECT_TRUE(s.ok());
 }
 
-TEST_F(NotificationTests, test_add_negative) {
+TEST_F(NotificationTests, test_add_negative)
+{
        auto& notifier = Notification::instance();
 
        auto callback = [](const Row& row) {
@@ -49,7 +52,8 @@ TEST_F(NotificationTests, test_add_negative) {
        EXPECT_FALSE(s.ok());
 }
 
-TEST_F(NotificationTests, test_emit_positive) {
+TEST_F(NotificationTests, test_emit_positive)
+{
        auto& notifier = Notification::instance();
 
        int called = 0;
similarity index 96%
rename from src/vist/policy/api.h
rename to src/vist/policy/api.hpp
index 6fd3d06..bd8aa91 100644 (file)
@@ -16,7 +16,7 @@
 
 #pragma once
 
-#include <vist/policy/sdk/policy-value.h>
+#include <vist/policy/sdk/policy-value.hpp>
 
 #include <string>
 #include <unordered_map>
index 2277cb4..0a38eb5 100644 (file)
@@ -14,9 +14,9 @@
  *  limitations under the License
  */
 
-#include <vist/policy/api.h>
+#include <vist/policy/api.hpp>
 
-#include "policy-manager.h"
+#include "policy-manager.hpp"
 
 namespace vist {
 namespace policy {
similarity index 99%
rename from src/vist/policy/core/db-schema.h
rename to src/vist/policy/core/db-schema.hpp
index 159dc56..2bdf75b 100644 (file)
@@ -13,6 +13,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
+
 #pragma once
 
 #include <string>
index b9350fb..28c3b41 100644 (file)
@@ -14,7 +14,7 @@
  *  limitations under the License
  */
 
-#include "policy-loader.h"
+#include "policy-loader.hpp"
 
 namespace vist {
 namespace policy {
similarity index 96%
rename from src/vist/policy/core/policy-loader.h
rename to src/vist/policy/core/policy-loader.hpp
index 73dab2d..b463fd6 100644 (file)
 
 #pragma once
 
-#include <vist/policy/sdk/policy-provider.h>
+#include <vist/policy/sdk/policy-provider.hpp>
 
+#include <memory>
 #include <stdexcept>
 #include <string>
-#include <memory>
 
 #include <dlfcn.h>
 
index 2ec9ab6..d335ab0 100644 (file)
  *  limitations under the License
  */
 
-#include "policy-manager.h"
-#include "policy-loader.h"
+#include "policy-manager.hpp"
+#include "policy-loader.hpp"
 
-#include <vist/common/audit/logger.h>
+#include <vist/logger.hpp>
 
 #include <klay/filesystem.h>
 
similarity index 93%
rename from src/vist/policy/core/policy-manager.h
rename to src/vist/policy/core/policy-manager.hpp
index 7e81c18..bdc364b 100644 (file)
 
 #pragma once
 
-#include <vist/policy/sdk/policy-provider.h>
-#include <vist/policy/sdk/policy-value.h>
+#include <vist/policy/sdk/policy-provider.hpp>
+#include <vist/policy/sdk/policy-value.hpp>
 
-#include "policy-storage.h"
+#include "policy-storage.hpp"
 
 #include <exception>
 #include <memory>
index 4a1e341..9ef1f0a 100644 (file)
  *  limitations under the License
  */
 
-#include "policy-storage.h"
+#include "policy-storage.hpp"
 
-#include <vist/common/audit/logger.h>
+#include <vist/logger.hpp>
+#include <vist/query-builder.hpp>
 
 #include <klay/db/column.h>
-#include <klay/db/query-builder.h>
 #include <klay/db/statement.h>
 #include <klay/exception.h>
 
-#include <fstream>
 #include <algorithm>
+#include <fstream>
 
-using namespace query_builder;
+using namespace vist::tsqb;
 using namespace vist::policy::schema;
 
 namespace {
similarity index 96%
rename from src/vist/policy/core/policy-storage.h
rename to src/vist/policy/core/policy-storage.hpp
index b26df61..cec538d 100644 (file)
@@ -16,9 +16,9 @@
 
 #pragma once
 
-#include <vist/policy/sdk/policy-value.h>
+#include <vist/policy/sdk/policy-value.hpp>
 
-#include "db-schema.h"
+#include "db-schema.hpp"
 
 #include <memory>
 #include <unordered_map>
similarity index 96%
rename from src/vist/policy/core/tests/core-tests.cpp
rename to src/vist/policy/core/tests/core.cpp
index 4a30c19..2cf5bb8 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <gtest/gtest.h>
 
-#include "../policy-manager.h"
+#include <vist/policy/core/policy-manager.hpp>
 
 namespace vist {
 namespace policy {
similarity index 98%
rename from src/vist/policy/core/tests/storage-tests.cpp
rename to src/vist/policy/core/tests/storage.cpp
index 1fd0579..369fb00 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <memory>
 
-#include "../policy-storage.h"
+#include <vist/policy/core/policy-storage.hpp>
 
 using namespace vist::policy;
 
similarity index 97%
rename from src/vist/policy/sdk/policy-model.h
rename to src/vist/policy/sdk/policy-model.hpp
index 8dd0392..64580fc 100644 (file)
@@ -16,7 +16,7 @@
 
 #pragma once
 
-#include <vist/policy/sdk/policy-value.h>
+#include <vist/policy/sdk/policy-value.hpp>
 
 #include <string>
 #include <stdexcept>
similarity index 97%
rename from src/vist/policy/sdk/policy-provider.h
rename to src/vist/policy/sdk/policy-provider.hpp
index ff79099..c55ff26 100644 (file)
@@ -16,7 +16,7 @@
 
 #pragma once
 
-#include <vist/policy/sdk/policy-model.h>
+#include <vist/policy/sdk/policy-model.hpp>
 
 #include <cstddef>
 #include <memory>
similarity index 96%
rename from src/vist/policy/sdk/tests/sdk-tests.cpp
rename to src/vist/policy/sdk/tests/sdk.cpp
index 656e29d..4be5d8d 100644 (file)
@@ -16,8 +16,8 @@
 
 #include <gtest/gtest.h>
 
-#include "../policy-model.h"
-#include "../policy-provider.h"
+#include <vist/policy/sdk/policy-model.hpp>
+#include <vist/policy/sdk/policy-provider.hpp>
 
 #include <exception>
 
similarity index 69%
rename from src/vist/tsqb/tsqb.hxx
rename to src/vist/query-builder.hpp
index c3791f0..35a918e 100644 (file)
  *  limitations under the License
  */
 /*
- * @file tsqb.hxx
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief TSQB is type-safe query builder
+ * @brief namespace TSQB means type-safe query builder
  */
 
 #pragma once
 
-#include "include/database.hxx"
-#include "include/table.hxx"
-#include "include/column.hxx"
-#include "include/expression.hxx"
-#include "include/condition.hxx"
-#include "include/util.hxx"
+#include "query-builder/column.hpp"
+#include "query-builder/condition.hpp"
+#include "query-builder/database.hpp"
+#include "query-builder/expression.hpp"
+#include "query-builder/table.hpp"
+#include "query-builder/util.hpp"
similarity index 95%
rename from src/vist/tsqb/CMakeLists.txt
rename to src/vist/query-builder/CMakeLists.txt
index d6bf3fe..5f41c24 100644 (file)
@@ -12,5 +12,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License
 
+/// TSQB: Type Safe Query Builder
 FILE(GLOB TSQB_TESTS "tests/*.cpp")
 ADD_VIST_TEST(${TSQB_TESTS})
similarity index 94%
rename from src/vist/tsqb/include/column-pack.hxx
rename to src/vist/query-builder/column-pack.hpp
index 9688e8e..6f4e66f 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file column-pack.hxx
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Tie different types of columns
- */
 
 #pragma once
 
-#include "type.hxx"
+#include "type.hpp"
 
 #include <string>
 #include <vector>
 
+namespace vist {
 namespace tsqb {
 namespace internal {
 
@@ -95,3 +91,4 @@ std::string ColumnPack<Front, Rest...>::getName(ColumnType&& type) const noexcep
 
 } // namespace internal
 } // namespace tsqb
+} // namespace vist
similarity index 88%
rename from src/vist/tsqb/include/column.hxx
rename to src/vist/query-builder/column.hpp
index ca17415..5ec7aba 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file culumn.hxx
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Capture member pointer of struct and use it for matching with column
- */
 
 #pragma once
 
 #include <string>
 #include <tuple>
 
+namespace vist {
 namespace tsqb {
 
 template<typename Object, typename Field>
@@ -54,3 +50,4 @@ auto distinct(Args&&... args) -> decltype(Distinct<std::tuple<Args...>>())
 }
 
 } // namespace tsqb
+} // namespace vist
similarity index 92%
rename from src/vist/tsqb/include/condition.hxx
rename to src/vist/query-builder/condition.hpp
index 7ec13da..54fdcce 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file condition.hxx
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Represent the condition statement of SQL
- */
 
 #pragma once
 
-#include "type.hxx"
+#include "type.hpp"
 
+namespace vist {
 namespace tsqb {
 namespace condition {
 
@@ -99,3 +95,4 @@ inline std::string to_string(Join type)
 
 } // namespace condition
 } // namespace tsqb
+} // namespace vist
similarity index 97%
rename from src/vist/tsqb/include/crud.hxx
rename to src/vist/query-builder/crud.hpp
index be48c86..2ef2a14 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file crud.hxx
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Represent four basic functions of CRUD
- */
 
 #pragma once
 
-#include "column.hxx"
-#include "expression.hxx"
+#include "column.hpp"
+#include "expression.hpp"
 
 #include <string>
 #include <sstream>
 
+namespace vist {
 namespace tsqb {
 
 template<typename T>
@@ -276,3 +272,4 @@ std::string Crud<T>::processWhere(Expr expr)
 }
 
 } // namespace tsqb
+} // namespace vist
similarity index 95%
rename from src/vist/tsqb/include/database.hxx
rename to src/vist/query-builder/database.hpp
index 0c8bf54..ef6189b 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file database.hxx
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Represent the database scheme of SQL
- */
 
 #pragma once
 
-#include "crud.hxx"
-#include "condition.hxx"
-#include "expression.hxx"
-#include "table-pack.hxx"
-#include "tuple-helper.hxx"
-#include "util.hxx"
+#include "crud.hpp"
+#include "condition.hpp"
+#include "expression.hpp"
+#include "table-pack.hpp"
+#include "tuple-helper.hpp"
+#include "util.hpp"
 
 #include <vector>
 #include <set>
@@ -34,6 +29,7 @@
 #include <sstream>
 #include <algorithm>
 
+namespace vist {
 namespace tsqb {
 
 template<typename... Tables>
@@ -205,3 +201,4 @@ std::string Database<Tables...>::getColumnName(ColumnType&& type) const noexcept
 }
 
 } // namespace tsqb
+} // namespace vist
similarity index 93%
rename from src/vist/tsqb/include/expression.hxx
rename to src/vist/query-builder/expression.hpp
index c901ab0..a1525f5 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file expression.hxx
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Represent the expression of SQL
- */
 
 #pragma once
 
-#include "column.hxx"
-#include "type.hxx"
-#include "condition.hxx"
+#include "column.hpp"
+#include "type.hpp"
+#include "condition.hpp"
 
 #include <type_traits>
 
+namespace vist {
 namespace tsqb {
 
 template<typename Type>
@@ -138,3 +134,4 @@ condition::Or<L, R> operator||(const L& l, const R& r)
 }
 
 } // namespace tsqb
+} // namespace vist
similarity index 95%
rename from src/vist/tsqb/include/table-pack.hxx
rename to src/vist/query-builder/table-pack.hpp
index d192886..eeda955 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file table-pack.hxx
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Tie diffirent types of tables
- */
 
 #pragma once
 
@@ -25,6 +20,7 @@
 #include <set>
 #include <string>
 
+namespace vist {
 namespace tsqb {
 namespace internal {
 
@@ -98,3 +94,4 @@ std::string TablePack<Front, Rest...>::getColumnName(ColumnType&& column) const
 
 } // namespace internal
 } // namespace tsqb
+} // namespace vist
similarity index 94%
rename from src/vist/tsqb/include/table.hxx
rename to src/vist/query-builder/table.hpp
index e1ac527..9bdafad 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file table.hxx
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Represent the table of SQL
- */
 
 #pragma once
 
-#include "crud.hxx"
-#include "column.hxx"
-#include "column-pack.hxx"
-#include "tuple-helper.hxx"
-#include "util.hxx"
+#include "crud.hpp"
+#include "column.hpp"
+#include "column-pack.hpp"
+#include "tuple-helper.hpp"
+#include "util.hpp"
 
 #include <vector>
 #include <string>
 #include <sstream>
 
+namespace vist {
 namespace tsqb {
 
 template<typename... Columns>
@@ -167,3 +163,4 @@ int Table<Columns...>::size() const noexcept
 }
 
 } // namespace tsqb
+} // namespace vist
similarity index 97%
rename from src/vist/tsqb/tests/tsqb-tests.cpp
rename to src/vist/query-builder/tests/query-builder.cpp
index 7770140..ae6f75e 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file tsqb-tests.cpp
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Testcases of tsqb
- */
 
-#include "tsqb.hxx"
+#include <vist/query-builder.hpp>
 
 #include <gtest/gtest.h>
 
-using namespace tsqb;
+using namespace vist::tsqb;
 
 struct Admin {
        int id;
similarity index 91%
rename from src/vist/tsqb/include/tuple-helper.hxx
rename to src/vist/query-builder/tuple-helper.hpp
index 495946e..23e2558 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file tuple-helper.hxx
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Iterator method for tuple
- */
 
 #pragma once
 
 #include <tuple>
 
+namespace vist {
 namespace tsqb {
 namespace tuple_helper {
 namespace internal {
@@ -53,3 +49,4 @@ void for_each(const T& tuple, C&& closure)
 
 } // namspace tuple-hepler
 } // namspace tsqb
+} // namspace vist
similarity index 89%
rename from src/vist/tsqb/include/type.hxx
rename to src/vist/query-builder/type.hpp
index 939b3da..17882a5 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file type.hxx
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- * @brief Make type safety with compile time checking
- */
 
 #pragma once
 
 #include <type_traits>
 
+namespace vist {
 namespace tsqb {
 namespace type {
 
@@ -46,3 +42,4 @@ void assert_compare(L l, R r)
 
 } // namespace type
 } // namespace tsqb
+} // namespace vist
similarity index 93%
rename from src/vist/tsqb/include/util.hxx
rename to src/vist/query-builder/util.hpp
index e65583d..6156a17 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License
  */
-/*
- * @file util.hxx
- * @author Sangwan Kwon (sangwan.kwon@samsung.com)
- */
 
 #pragma once
 
@@ -24,6 +20,7 @@
 #include <algorithm>
 #include <cctype>
 
+namespace vist {
 namespace tsqb {
 namespace util {
 
@@ -37,3 +34,4 @@ inline std::string rtrim(std::string&& s)
 
 } // namespace util
 } // namespace tsqb
+} // namespace vist
similarity index 91%
rename from src/vist/service/tests/core-tests.cpp
rename to src/vist/service/tests/core.cpp
index f60e602..4153827 100644 (file)
 
 #include <gtest/gtest.h>
 
-#include "../vist.h" 
+#include <vist/service/vist.hpp>
+#include <vist/policy/core/policy-manager.hpp>
 
 #include <iostream>
 #include <chrono>
 #include <thread>
 
-#include <vist/policy/core/policy-manager.h>
-
 using namespace vist;
 
 class CoreTests : public testing::Test {};
 
-TEST_F(CoreTests, query_select) {
+TEST_F(CoreTests, query_select)
+{
        auto rows = Vist::Query("SELECT * FROM policy");
 
        EXPECT_TRUE(rows.size() > 0);
@@ -40,7 +40,8 @@ TEST_F(CoreTests, query_select) {
        EXPECT_EQ(rows[0]["name"], "bluetooth");
 }
 
-TEST_F(CoreTests, query_update) {
+TEST_F(CoreTests, query_update)
+{
        auto& manager = policy::PolicyManager::Instance();
        manager.enroll("admin");
 
index cb0ec41..88bc8ed 100644 (file)
  *  limitations under the License
  */
 
-#include "vist.h"
+#include "vist.hpp"
 
-#include <vist/common/ipc/server.h>
-#include <vist/common/audit/logger.h>
+#include <vist/ipc/server.hpp>
+#include <vist/logger.hpp>
 
 #include <stdexcept>
 
similarity index 96%
rename from src/vist/common/tests/exception.cpp
rename to src/vist/tests/exception.cpp
index 9dd4f5e..16bd539 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <gtest/gtest.h>
 
-#include "../exception.h"
+#include <vist/exception.hpp>
 
 enum class ErrCode {
        InvalidArgument = 1,
@@ -61,7 +61,7 @@ TEST_F(ExceptionTests, exception_msg)
                msg = e.what();
        }
 
-       EXPECT_TRUE(!raised) << msg;
+       EXPECT_TRUE(raised);
        EXPECT_EQ(ec, ErrCode::RuntimeError);
        EXPECT_NE(std::string::npos, msg.find("Additional"));
 }