From 4c8b499a51f2f49719ae76dc0ebff04509b3ed31 Mon Sep 17 00:00:00 2001 From: ahsouza Date: Thu, 9 Mar 2023 19:57:10 -0300 Subject: [PATCH 1/9] update --- binding.gyp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/binding.gyp b/binding.gyp index e7416ca..fea22e6 100644 --- a/binding.gyp +++ b/binding.gyp @@ -38,6 +38,8 @@ "./src/libs/info/windows/scan_mainboard.cpp", "./src/libs/info/windows/scan_os.cpp", "./src/libs/info/windows/scan_ram.cpp", + # index bscan + "./src/libs/info/bscan.cpp", ], # localizando node-api "include_dirs": [ From 013c4899947e6488581445f1758e9e1859db6821 Mon Sep 17 00:00:00 2001 From: ahsouza Date: Thu, 9 Mar 2023 19:57:26 -0300 Subject: [PATCH 2/9] index bscan --- src/libs/info/bscan.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/libs/info/bscan.cpp diff --git a/src/libs/info/bscan.cpp b/src/libs/info/bscan.cpp new file mode 100644 index 0000000..cd5aefb --- /dev/null +++ b/src/libs/info/bscan.cpp @@ -0,0 +1,25 @@ +#include +#include +#include "bscan.h" + +Napi::String cpu(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + bscan::CPU cpu; + + std::string result = cpu.vendor(); + + return Napi::String::New(env, result); +} + +// callback of function when module is registered with Node.js +Napi::Object Init(Napi::Env env, Napi::Object exports) { + // set a key on `exports`object + exports.Set( + Napi::String::New(env, "cpu"), + Napi::Function::New(env, cpu) + ); + + return exports; +} + +NODE_API_MODULE(bscan, Init) \ No newline at end of file From 83b8c4e04584dd4f2d57c26c6b5d48efaf54f773 Mon Sep 17 00:00:00 2001 From: ahsouza Date: Thu, 9 Mar 2023 20:10:04 -0300 Subject: [PATCH 3/9] update --- .gitignore | 2 ++ package.json | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 279cd25..ee7fc01 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /**/.vscode/** /**/build/** +node_modules/ +package-lock.json \ No newline at end of file diff --git a/package.json b/package.json index 507b074..61632d6 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,21 @@ "name": "bscan", "version": "0.0.1", "description": "A Node.js library to capture important information from the Computing Device Hardwares & Softwares", - "keywords": ["node-api", "cplsplus", "modules", "hardware", "software", "scan-dev", "scan-tool"], + "keywords": [ + "node-api", + "cplsplus", + "modules", + "hardware", + "software", + "scan-dev", + "scan-tool" + ], "author": "BWC @BarcaWebCloud ", "license": "ISC", "dependencies": { "node-addon-api": "^6.0.0" + }, + "devDependencies": { + "node-gyp": "^9.3.1" } } From 787a7eef4da464f322f95dca94447235479790cf Mon Sep 17 00:00:00 2001 From: ahsouza Date: Fri, 10 Mar 2023 21:51:42 -0300 Subject: [PATCH 4/9] refactor --- include/{bscan.h => hwares/hwares.h} | 1 - include/swares/swares.h | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) rename include/{bscan.h => hwares/hwares.h} (87%) create mode 100644 include/swares/swares.h diff --git a/include/bscan.h b/include/hwares/hwares.h similarity index 87% rename from include/bscan.h rename to include/hwares/hwares.h index 24ce509..098313b 100644 --- a/include/bscan.h +++ b/include/hwares/hwares.h @@ -5,5 +5,4 @@ #include "hwares/scan_disk.h" #include "hwares/scan_gpu.h" #include "hwares/scan_mainboard.h" -#include "swares/scan_os.h" #include "hwares/scan_ram.h" diff --git a/include/swares/swares.h b/include/swares/swares.h new file mode 100644 index 0000000..21d7ebd --- /dev/null +++ b/include/swares/swares.h @@ -0,0 +1,4 @@ +#pragma once + +#include "swares/scan_system.h" +#include "swares/scan_os.h" From b484b3e952f332f851135385b69990c09b643f1f Mon Sep 17 00:00:00 2001 From: ahsouza Date: Fri, 10 Mar 2023 22:15:20 -0300 Subject: [PATCH 5/9] alter path --- README.md | 9 +++++++++ include/hwares/scan_battery.h | 2 +- include/hwares/scan_cpuid.h | 2 +- include/hwares/scan_mainboard.h | 2 +- src/libs/info/apple/scan_battery.cpp | 2 +- src/libs/info/apple/scan_cpu.cpp | 8 ++++---- src/libs/info/apple/scan_disk.cpp | 6 +++--- src/libs/info/apple/scan_gpu.cpp | 4 ++-- src/libs/info/apple/scan_mainboard.cpp | 4 ++-- src/libs/info/apple/scan_os.cpp | 4 ++-- src/libs/info/apple/scan_ram.cpp | 4 ++-- src/libs/info/bscan.cpp | 3 ++- src/libs/info/linux/scan_battery.cpp | 4 ++-- src/libs/info/linux/scan_cpu.cpp | 6 +++--- src/libs/info/linux/scan_disk.cpp | 6 +++--- src/libs/info/linux/scan_gpu.cpp | 6 +++--- src/libs/info/linux/scan_mainboard.cpp | 4 ++-- src/libs/info/linux/scan_os.cpp | 6 +++--- src/libs/info/linux/scan_ram.cpp | 4 ++-- src/libs/info/scan_battery.cpp | 2 +- src/libs/info/scan_cpu.cpp | 6 +++--- src/libs/info/scan_disk.cpp | 4 ++-- src/libs/info/scan_gpu.cpp | 4 ++-- src/libs/info/scan_mainboard.cpp | 4 ++-- src/libs/info/scan_os.cpp | 2 +- src/libs/info/scan_ram.cpp | 4 ++-- src/libs/info/scan_system.cpp | 2 +- src/libs/info/windows/scan_battery.cpp | 6 +++--- src/libs/info/windows/scan_cpu.cpp | 8 ++++---- src/libs/info/windows/scan_disk.cpp | 8 ++++---- src/libs/info/windows/scan_gpu.cpp | 6 +++--- src/libs/info/windows/scan_mainboard.cpp | 6 +++--- src/libs/info/windows/scan_os.cpp | 4 ++-- src/libs/info/windows/scan_ram.cpp | 8 ++++---- 34 files changed, 85 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index fb3c14c..fd51b7b 100644 --- a/README.md +++ b/README.md @@ -1 +1,10 @@ # bscan + + +Configure boilerplate to module + +`node-gyp configure` + +Run command to building the module + +`node-gyp build` \ No newline at end of file diff --git a/include/hwares/scan_battery.h b/include/hwares/scan_battery.h index 91ecdb7..26ac281 100644 --- a/include/hwares/scan_battery.h +++ b/include/hwares/scan_battery.h @@ -3,7 +3,7 @@ #include #include -#include "platform.h" +#include "../platform.h" namespace bscan { diff --git a/include/hwares/scan_cpuid.h b/include/hwares/scan_cpuid.h index bee29d4..7b10a7f 100644 --- a/include/hwares/scan_cpuid.h +++ b/include/hwares/scan_cpuid.h @@ -1,6 +1,6 @@ #pragma once -#include "platform.h" +#include "../platform.h" #if defined(BSCAN_X86) diff --git a/include/hwares/scan_mainboard.h b/include/hwares/scan_mainboard.h index bf6fa11..d94c079 100644 --- a/include/hwares/scan_mainboard.h +++ b/include/hwares/scan_mainboard.h @@ -3,7 +3,7 @@ #include #include -#include "platform.h" +#include "../platform.h" namespace bscan { diff --git a/src/libs/info/apple/scan_battery.cpp b/src/libs/info/apple/scan_battery.cpp index 0fb52e1..072912e 100644 --- a/src/libs/info/apple/scan_battery.cpp +++ b/src/libs/info/apple/scan_battery.cpp @@ -1,6 +1,6 @@ #include "platform.h" #ifdef BSCAN_APPLE -#include "hwares/scan_battery.h" +#include "../../../include/hwares/scan_battery.h" namespace bscan { diff --git a/src/libs/info/apple/scan_cpu.cpp b/src/libs/info/apple/scan_cpu.cpp index b934efd..1b3cf81 100644 --- a/src/libs/info/apple/scan_cpu.cpp +++ b/src/libs/info/apple/scan_cpu.cpp @@ -1,4 +1,4 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_APPLE #include #include @@ -8,9 +8,9 @@ #include #include #include -#include "hwares/scan_cpu.h" -#include "hwares/scan_cpuid.h" -#include "utils/stringutils.h" +#include "../../../include/hwares/scan_cpu.h" +#include "../../../include/hwares/scan_cpuid.h" +#include "../../../include/utils/stringutils.h" namespace bscan { diff --git a/src/libs/info/apple/scan_disk.cpp b/src/libs/info/apple/scan_disk.cpp index ee33f33..517c74a 100644 --- a/src/libs/info/apple/scan_disk.cpp +++ b/src/libs/info/apple/scan_disk.cpp @@ -1,9 +1,9 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_APPLE #include #include -#include "hwares/scan_disk.h" -#include "utils/stringutils.h" +#include "../../../include/hwares/scan_disk.h" +#include "../../../include/utils/stringutils.h" namespace bscan { diff --git a/src/libs/info/apple/scan_gpu.cpp b/src/libs/info/apple/scan_gpu.cpp index 3b454f4..bd17836 100644 --- a/src/libs/info/apple/scan_gpu.cpp +++ b/src/libs/info/apple/scan_gpu.cpp @@ -1,10 +1,10 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_APPLE #include #include #include -#include "hwares/scan_gpu.h" +#include "../../../include/hwares/scan_gpu.h" namespace bscan { diff --git a/src/libs/info/apple/scan_mainboard.cpp b/src/libs/info/apple/scan_mainboard.cpp index a978bf9..26275bb 100644 --- a/src/libs/info/apple/scan_mainboard.cpp +++ b/src/libs/info/apple/scan_mainboard.cpp @@ -1,6 +1,6 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_APPLE -#include "hwares/scan_mainboard.h" +#include "../../../include/hwares/scan_mainboard.h" namespace bscan { diff --git a/src/libs/info/apple/scan_os.cpp b/src/libs/info/apple/scan_os.cpp index ff39add..18d8e89 100644 --- a/src/libs/info/apple/scan_os.cpp +++ b/src/libs/info/apple/scan_os.cpp @@ -1,9 +1,9 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_APPLE #include #include #include -#include "hwares/scan_os.h" +#include "../../../include/hwares/scan_os.h" namespace bscan { diff --git a/src/libs/info/apple/scan_ram.cpp b/src/libs/info/apple/scan_ram.cpp index 737041e..0e7d126 100644 --- a/src/libs/info/apple/scan_ram.cpp +++ b/src/libs/info/apple/scan_ram.cpp @@ -1,9 +1,9 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_APPLE #include #include #include -#include "hwares/scan_ram.h" +#include "../../../include/hwares/scan_ram.h" namespace bscan { diff --git a/src/libs/info/bscan.cpp b/src/libs/info/bscan.cpp index cd5aefb..72dc6f6 100644 --- a/src/libs/info/bscan.cpp +++ b/src/libs/info/bscan.cpp @@ -1,6 +1,7 @@ #include #include -#include "bscan.h" +#include "../../../include/hwares/hwares.h" +#include "../../../include/swares/swares.h" Napi::String cpu(const Napi::CallbackInfo& info) { Napi::Env env = info.Env(); diff --git a/src/libs/info/linux/scan_battery.cpp b/src/libs/info/linux/scan_battery.cpp index c759017..d7d4e2d 100644 --- a/src/libs/info/linux/scan_battery.cpp +++ b/src/libs/info/linux/scan_battery.cpp @@ -1,8 +1,8 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_UNIX #include #include -#include "hwares/scan_battery.h" +#include "../../../include/hwares/scan_battery.h" namespace bscan { diff --git a/src/libs/info/linux/scan_cpu.cpp b/src/libs/info/linux/scan_cpu.cpp index c381b90..12db02d 100644 --- a/src/libs/info/linux/scan_cpu.cpp +++ b/src/libs/info/linux/scan_cpu.cpp @@ -1,4 +1,4 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_UNIX #include #include @@ -7,8 +7,8 @@ #include #include -#include "hwares/scan_cpu.h" -#include "utils/stringutils.h" +#include "../../../include/hwares/scan_cpu.h" +#include "../../../include/utils/stringutils.h" #if defined(BSCAN_X86) #include "hwares/scan_cpuid.h" diff --git a/src/libs/info/linux/scan_disk.cpp b/src/libs/info/linux/scan_disk.cpp index ad24104..c9bf788 100644 --- a/src/libs/info/linux/scan_disk.cpp +++ b/src/libs/info/linux/scan_disk.cpp @@ -1,9 +1,9 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_UNIX #include #include -#include "hwares/scan_disk.h" -#include "utils/stringutils.h" +#include "../../../include/hwares/scan_disk.h" +#include "../../../include/utils/stringutils.h" namespace bscan { diff --git a/src/libs/info/linux/scan_gpu.cpp b/src/libs/info/linux/scan_gpu.cpp index e5daec7..c19ff8d 100644 --- a/src/libs/info/linux/scan_gpu.cpp +++ b/src/libs/info/linux/scan_gpu.cpp @@ -1,4 +1,4 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_UNIX @@ -6,8 +6,8 @@ #include #include -#include "hwares/scan_gpu.h" -#include "utils/subprocess.h" +#include "../../../include/hwares/scan_gpu.h" +#include "../../../include/utils/subprocess.h" namespace bscan { diff --git a/src/libs/info/linux/scan_mainboard.cpp b/src/libs/info/linux/scan_mainboard.cpp index f92ec90..b17a2fa 100644 --- a/src/libs/info/linux/scan_mainboard.cpp +++ b/src/libs/info/linux/scan_mainboard.cpp @@ -1,7 +1,7 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_UNIX #include -#include "hwares/scan_mainboard.h" +#include "../../../include/hwares/scan_mainboard.h" namespace bscan { diff --git a/src/libs/info/linux/scan_os.cpp b/src/libs/info/linux/scan_os.cpp index 5b8173b..afd038e 100644 --- a/src/libs/info/linux/scan_os.cpp +++ b/src/libs/info/linux/scan_os.cpp @@ -1,4 +1,4 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_UNIX @@ -7,8 +7,8 @@ #include #include #include -#include "swares/scan_os.h" -#include "utils/stringutils.h" +#include "../../../include/swares/scan_os.h" +#include "../../../include/utils/stringutils.h" namespace bscan { diff --git a/src/libs/info/linux/scan_ram.cpp b/src/libs/info/linux/scan_ram.cpp index 576f918..63877fe 100644 --- a/src/libs/info/linux/scan_ram.cpp +++ b/src/libs/info/linux/scan_ram.cpp @@ -1,9 +1,9 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_UNIX #include #include #include -#include "hwares/scan_ram.h" +#include "../../../include/hwares/scan_ram.h" namespace bscan { diff --git a/src/libs/info/scan_battery.cpp b/src/libs/info/scan_battery.cpp index ae873de..c761c11 100644 --- a/src/libs/info/scan_battery.cpp +++ b/src/libs/info/scan_battery.cpp @@ -1,4 +1,4 @@ -#include "hwares/scan_battery.h" +#include "../../../include/hwares/scan_battery.h" namespace bscan { diff --git a/src/libs/info/scan_cpu.cpp b/src/libs/info/scan_cpu.cpp index 9d0590b..10d8419 100644 --- a/src/libs/info/scan_cpu.cpp +++ b/src/libs/info/scan_cpu.cpp @@ -1,8 +1,8 @@ -#include "hwares/scan_cpu.h" -#include "hwares/scan_cpuid.h" +#include "../../../include/hwares/scan_cpu.h" +#include "../../../include/hwares/scan_cpuid.h" #include #include -#include "platform.h" +#include "../../../include/platform.h" namespace bscan { diff --git a/src/libs/info/scan_disk.cpp b/src/libs/info/scan_disk.cpp index d878244..a56d747 100644 --- a/src/libs/info/scan_disk.cpp +++ b/src/libs/info/scan_disk.cpp @@ -1,5 +1,5 @@ -#include "hwares/scan_disk.h" -#include "utils/stringutils.h" +#include "../../../include/hwares/scan_disk.h" +#include "../../../include/utils/stringutils.h" namespace bscan { diff --git a/src/libs/info/scan_gpu.cpp b/src/libs/info/scan_gpu.cpp index 3dd2ef9..374ed66 100644 --- a/src/libs/info/scan_gpu.cpp +++ b/src/libs/info/scan_gpu.cpp @@ -3,14 +3,14 @@ #include #if defined(unix) || defined(__unix) || defined(__unix__) -#include "utils/subprocess.h" +#include "../../../include/utils/subprocess.h" #elif defined(__APPLE__) #elif defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) #include "WMIwrapper.h" #pragma comment(lib, "wbemuuid.lib") #endif -#include "hwares/scan_gpu.h" +#include "../../../include/hwares/scan_gpu.h" namespace bscan { diff --git a/src/libs/info/scan_mainboard.cpp b/src/libs/info/scan_mainboard.cpp index 326e9ba..ed1ddb3 100644 --- a/src/libs/info/scan_mainboard.cpp +++ b/src/libs/info/scan_mainboard.cpp @@ -1,7 +1,7 @@ -#include "hwares/scan_mainboard.h" +#include "../../../include/hwares/scan_mainboard.h" #include #include -#include "WMIwrapper.h" +#include "../../../include/WMIwrapper.h" namespace bscan { diff --git a/src/libs/info/scan_os.cpp b/src/libs/info/scan_os.cpp index 5c23a97..dc86a3c 100644 --- a/src/libs/info/scan_os.cpp +++ b/src/libs/info/scan_os.cpp @@ -1,4 +1,4 @@ -#include "swares/scan_os.h" +#include "../../../include/swares/scan_os.h" #include namespace bscan { diff --git a/src/libs/info/scan_ram.cpp b/src/libs/info/scan_ram.cpp index a9198fc..fa01b62 100644 --- a/src/libs/info/scan_ram.cpp +++ b/src/libs/info/scan_ram.cpp @@ -8,9 +8,9 @@ #elif defined(_WIN32) || defined(_WIN64) #include -#include "WMIwrapper.h" +#include "../../../include/WMIwrapper.h" #endif -#include "hwares/scan_ram.h" +#include "../../../include/hwares/scan_ram.h" namespace bscan { diff --git a/src/libs/info/scan_system.cpp b/src/libs/info/scan_system.cpp index e6f4059..8ba1f7b 100644 --- a/src/libs/info/scan_system.cpp +++ b/src/libs/info/scan_system.cpp @@ -1 +1 @@ -#include "swares/scan_system.h" +#include "../../../include/swares/scan_system.h" diff --git a/src/libs/info/windows/scan_battery.cpp b/src/libs/info/windows/scan_battery.cpp index 5d2e546..f5f6627 100644 --- a/src/libs/info/windows/scan_battery.cpp +++ b/src/libs/info/windows/scan_battery.cpp @@ -1,10 +1,10 @@ #include -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_WINDOWS -#include "WMIwrapper.h" -#include "hwares/scan_battery.h" +#include "../../../include/WMIwrapper.h" +#include "../../../include/hwares/scan_battery.h" namespace bscan { diff --git a/src/libs/info/windows/scan_cpu.cpp b/src/libs/info/windows/scan_cpu.cpp index fa15343..151a858 100644 --- a/src/libs/info/windows/scan_cpu.cpp +++ b/src/libs/info/windows/scan_cpu.cpp @@ -1,12 +1,12 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_WINDOWS #include #include #include -#include "WMIwrapper.h" -#include "hwares/scan_cpu.h" -#include "hwares/scan_cpuid.h" +#include "../../../include/WMIwrapper.h" +#include "../../../include/hwares/scan_cpu.h" +#include "../../../include/hwares/scan_cpuid.h" namespace bscan { diff --git a/src/libs/info/windows/scan_disk.cpp b/src/libs/info/windows/scan_disk.cpp index 2cc7330..22707c4 100644 --- a/src/libs/info/windows/scan_disk.cpp +++ b/src/libs/info/windows/scan_disk.cpp @@ -1,9 +1,9 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_WINDOWS #include -#include "WMIwrapper.h" -#include "hwares/disk.h" -#include "utils/stringutils.h" +#include "../../../include/WMIwrapper.h" +#include "../../../include/hwares/disk.h" +#include "../../../include/utils/stringutils.h" namespace bscan { diff --git a/src/libs/info/windows/scan_gpu.cpp b/src/libs/info/windows/scan_gpu.cpp index a9124d7..8e7d3c6 100644 --- a/src/libs/info/windows/scan_gpu.cpp +++ b/src/libs/info/windows/scan_gpu.cpp @@ -1,10 +1,10 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_WINDOWS #include #include -#include "WMIwrapper.h" +#include "../../../include/WMIwrapper.h" #pragma comment(lib, "wbemuuid.lib") -#include "hwares/scan_gpu.h" +#include "../../../include/hwares/scan_gpu.h" namespace bscan { diff --git a/src/libs/info/windows/scan_mainboard.cpp b/src/libs/info/windows/scan_mainboard.cpp index f4bfb8d..33433c8 100644 --- a/src/libs/info/windows/scan_mainboard.cpp +++ b/src/libs/info/windows/scan_mainboard.cpp @@ -1,8 +1,8 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_WINDOWS #include -#include "WMIwrapper.h" -#include "hwares/scan_mainboard.h" +#include "../../../include/WMIwrapper.h" +#include "../../../include/hwares/scan_mainboard.h" namespace bscan { diff --git a/src/libs/info/windows/scan_os.cpp b/src/libs/info/windows/scan_os.cpp index adab4bc..e626604 100644 --- a/src/libs/info/windows/scan_os.cpp +++ b/src/libs/info/windows/scan_os.cpp @@ -1,4 +1,4 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_WINDOWS @@ -9,7 +9,7 @@ #include #define STATUS_SUCCESS 0x00000000 -#include "swares/scan_os.h" +#include "../../../include/swares/scan_os.h" namespace bscan { diff --git a/src/libs/info/windows/scan_ram.cpp b/src/libs/info/windows/scan_ram.cpp index 0472881..ec40cad 100644 --- a/src/libs/info/windows/scan_ram.cpp +++ b/src/libs/info/windows/scan_ram.cpp @@ -1,11 +1,11 @@ -#include "platform.h" +#include "../../../include/platform.h" #ifdef BSCAN_WINDOWS #include #include #include -#include "WMIwrapper.h" -#include "hwares/scan_ram.h" -#include "utils/stringutils.h" +#include "../../../include/WMIwrapper.h" +#include "../../../include/hwares/scan_ram.h" +#include "../../../include/utils/stringutils.h" namespace bscan { From 234d9e2f0380941a2ad6f8a130866eb935158dbc Mon Sep 17 00:00:00 2001 From: ahsouza Date: Sat, 11 Mar 2023 14:59:50 -0300 Subject: [PATCH 6/9] feat: add compiler c++17 to win, mac and linux --- binding.gyp | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index fea22e6..52ec56c 100644 --- a/binding.gyp +++ b/binding.gyp @@ -3,7 +3,7 @@ { "target_name": "bscan", "cflags!": [ "-fno-exceptions" ], - "cflags_cc!": [ "-fno-exceptions" ], + "cflags_cc!": [ "-fno-exceptions", "-std=c++17" ], # sources: arquivoc C/C++ a ser compilados "sources": [ "./src/libs/info/scan_battery.cpp", @@ -41,11 +41,68 @@ # index bscan "./src/libs/info/bscan.cpp", ], - # localizando node-api + # localizando include "include_dirs": [ + "include", " Date: Sat, 11 Mar 2023 16:11:10 -0300 Subject: [PATCH 7/9] alter path --- src/libs/info/apple/scan_battery.cpp | 2 +- src/libs/info/apple/scan_cpu.cpp | 8 ++++---- src/libs/info/apple/scan_disk.cpp | 6 +++--- src/libs/info/apple/scan_gpu.cpp | 4 ++-- src/libs/info/apple/scan_mainboard.cpp | 4 ++-- src/libs/info/apple/scan_os.cpp | 4 ++-- src/libs/info/apple/scan_ram.cpp | 4 ++-- src/libs/info/linux/scan_battery.cpp | 4 ++-- src/libs/info/linux/scan_cpu.cpp | 6 +++--- src/libs/info/linux/scan_disk.cpp | 6 +++--- src/libs/info/linux/scan_gpu.cpp | 6 +++--- src/libs/info/linux/scan_mainboard.cpp | 4 ++-- src/libs/info/linux/scan_os.cpp | 6 +++--- src/libs/info/linux/scan_ram.cpp | 4 ++-- src/libs/info/scan_battery.cpp | 2 +- src/libs/info/scan_cpu.cpp | 2 +- src/libs/info/scan_gpu.cpp | 4 ++-- src/libs/info/scan_mainboard.cpp | 4 ++-- src/libs/info/scan_os.cpp | 2 +- src/libs/info/scan_ram.cpp | 4 ++-- src/libs/info/scan_system.cpp | 2 +- src/libs/info/windows/scan_battery.cpp | 6 +++--- src/libs/info/windows/scan_cpu.cpp | 8 ++++---- src/libs/info/windows/scan_disk.cpp | 8 ++++---- src/libs/info/windows/scan_gpu.cpp | 6 +++--- src/libs/info/windows/scan_mainboard.cpp | 6 +++--- src/libs/info/windows/scan_os.cpp | 4 ++-- src/libs/info/windows/scan_ram.cpp | 8 ++++---- 28 files changed, 67 insertions(+), 67 deletions(-) diff --git a/src/libs/info/apple/scan_battery.cpp b/src/libs/info/apple/scan_battery.cpp index 072912e..0fb52e1 100644 --- a/src/libs/info/apple/scan_battery.cpp +++ b/src/libs/info/apple/scan_battery.cpp @@ -1,6 +1,6 @@ #include "platform.h" #ifdef BSCAN_APPLE -#include "../../../include/hwares/scan_battery.h" +#include "hwares/scan_battery.h" namespace bscan { diff --git a/src/libs/info/apple/scan_cpu.cpp b/src/libs/info/apple/scan_cpu.cpp index 1b3cf81..d39313c 100644 --- a/src/libs/info/apple/scan_cpu.cpp +++ b/src/libs/info/apple/scan_cpu.cpp @@ -1,4 +1,4 @@ -#include "../../../include/platform.h" +#include "include/platform.h" #ifdef BSCAN_APPLE #include #include @@ -8,9 +8,9 @@ #include #include #include -#include "../../../include/hwares/scan_cpu.h" -#include "../../../include/hwares/scan_cpuid.h" -#include "../../../include/utils/stringutils.h" +#include "hwares/scan_cpu.h" +#include "hwares/scan_cpuid.h" +#include "utils/stringutils.h" namespace bscan { diff --git a/src/libs/info/apple/scan_disk.cpp b/src/libs/info/apple/scan_disk.cpp index 517c74a..71194e0 100644 --- a/src/libs/info/apple/scan_disk.cpp +++ b/src/libs/info/apple/scan_disk.cpp @@ -1,9 +1,9 @@ -#include "../../../include/platform.h" +#include "include/platform.h" #ifdef BSCAN_APPLE #include #include -#include "../../../include/hwares/scan_disk.h" -#include "../../../include/utils/stringutils.h" +#include "hwares/scan_disk.h" +#include "utils/stringutils.h" namespace bscan { diff --git a/src/libs/info/apple/scan_gpu.cpp b/src/libs/info/apple/scan_gpu.cpp index bd17836..3b454f4 100644 --- a/src/libs/info/apple/scan_gpu.cpp +++ b/src/libs/info/apple/scan_gpu.cpp @@ -1,10 +1,10 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_APPLE #include #include #include -#include "../../../include/hwares/scan_gpu.h" +#include "hwares/scan_gpu.h" namespace bscan { diff --git a/src/libs/info/apple/scan_mainboard.cpp b/src/libs/info/apple/scan_mainboard.cpp index 26275bb..a978bf9 100644 --- a/src/libs/info/apple/scan_mainboard.cpp +++ b/src/libs/info/apple/scan_mainboard.cpp @@ -1,6 +1,6 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_APPLE -#include "../../../include/hwares/scan_mainboard.h" +#include "hwares/scan_mainboard.h" namespace bscan { diff --git a/src/libs/info/apple/scan_os.cpp b/src/libs/info/apple/scan_os.cpp index 18d8e89..ff39add 100644 --- a/src/libs/info/apple/scan_os.cpp +++ b/src/libs/info/apple/scan_os.cpp @@ -1,9 +1,9 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_APPLE #include #include #include -#include "../../../include/hwares/scan_os.h" +#include "hwares/scan_os.h" namespace bscan { diff --git a/src/libs/info/apple/scan_ram.cpp b/src/libs/info/apple/scan_ram.cpp index 0e7d126..737041e 100644 --- a/src/libs/info/apple/scan_ram.cpp +++ b/src/libs/info/apple/scan_ram.cpp @@ -1,9 +1,9 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_APPLE #include #include #include -#include "../../../include/hwares/scan_ram.h" +#include "hwares/scan_ram.h" namespace bscan { diff --git a/src/libs/info/linux/scan_battery.cpp b/src/libs/info/linux/scan_battery.cpp index d7d4e2d..c759017 100644 --- a/src/libs/info/linux/scan_battery.cpp +++ b/src/libs/info/linux/scan_battery.cpp @@ -1,8 +1,8 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_UNIX #include #include -#include "../../../include/hwares/scan_battery.h" +#include "hwares/scan_battery.h" namespace bscan { diff --git a/src/libs/info/linux/scan_cpu.cpp b/src/libs/info/linux/scan_cpu.cpp index 12db02d..c381b90 100644 --- a/src/libs/info/linux/scan_cpu.cpp +++ b/src/libs/info/linux/scan_cpu.cpp @@ -1,4 +1,4 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_UNIX #include #include @@ -7,8 +7,8 @@ #include #include -#include "../../../include/hwares/scan_cpu.h" -#include "../../../include/utils/stringutils.h" +#include "hwares/scan_cpu.h" +#include "utils/stringutils.h" #if defined(BSCAN_X86) #include "hwares/scan_cpuid.h" diff --git a/src/libs/info/linux/scan_disk.cpp b/src/libs/info/linux/scan_disk.cpp index c9bf788..ad24104 100644 --- a/src/libs/info/linux/scan_disk.cpp +++ b/src/libs/info/linux/scan_disk.cpp @@ -1,9 +1,9 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_UNIX #include #include -#include "../../../include/hwares/scan_disk.h" -#include "../../../include/utils/stringutils.h" +#include "hwares/scan_disk.h" +#include "utils/stringutils.h" namespace bscan { diff --git a/src/libs/info/linux/scan_gpu.cpp b/src/libs/info/linux/scan_gpu.cpp index c19ff8d..e5daec7 100644 --- a/src/libs/info/linux/scan_gpu.cpp +++ b/src/libs/info/linux/scan_gpu.cpp @@ -1,4 +1,4 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_UNIX @@ -6,8 +6,8 @@ #include #include -#include "../../../include/hwares/scan_gpu.h" -#include "../../../include/utils/subprocess.h" +#include "hwares/scan_gpu.h" +#include "utils/subprocess.h" namespace bscan { diff --git a/src/libs/info/linux/scan_mainboard.cpp b/src/libs/info/linux/scan_mainboard.cpp index b17a2fa..f92ec90 100644 --- a/src/libs/info/linux/scan_mainboard.cpp +++ b/src/libs/info/linux/scan_mainboard.cpp @@ -1,7 +1,7 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_UNIX #include -#include "../../../include/hwares/scan_mainboard.h" +#include "hwares/scan_mainboard.h" namespace bscan { diff --git a/src/libs/info/linux/scan_os.cpp b/src/libs/info/linux/scan_os.cpp index afd038e..5b8173b 100644 --- a/src/libs/info/linux/scan_os.cpp +++ b/src/libs/info/linux/scan_os.cpp @@ -1,4 +1,4 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_UNIX @@ -7,8 +7,8 @@ #include #include #include -#include "../../../include/swares/scan_os.h" -#include "../../../include/utils/stringutils.h" +#include "swares/scan_os.h" +#include "utils/stringutils.h" namespace bscan { diff --git a/src/libs/info/linux/scan_ram.cpp b/src/libs/info/linux/scan_ram.cpp index 63877fe..576f918 100644 --- a/src/libs/info/linux/scan_ram.cpp +++ b/src/libs/info/linux/scan_ram.cpp @@ -1,9 +1,9 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_UNIX #include #include #include -#include "../../../include/hwares/scan_ram.h" +#include "hwares/scan_ram.h" namespace bscan { diff --git a/src/libs/info/scan_battery.cpp b/src/libs/info/scan_battery.cpp index c761c11..ae873de 100644 --- a/src/libs/info/scan_battery.cpp +++ b/src/libs/info/scan_battery.cpp @@ -1,4 +1,4 @@ -#include "../../../include/hwares/scan_battery.h" +#include "hwares/scan_battery.h" namespace bscan { diff --git a/src/libs/info/scan_cpu.cpp b/src/libs/info/scan_cpu.cpp index 10d8419..594e1f6 100644 --- a/src/libs/info/scan_cpu.cpp +++ b/src/libs/info/scan_cpu.cpp @@ -2,7 +2,7 @@ #include "../../../include/hwares/scan_cpuid.h" #include #include -#include "../../../include/platform.h" +#include "platform.h" namespace bscan { diff --git a/src/libs/info/scan_gpu.cpp b/src/libs/info/scan_gpu.cpp index 374ed66..3dd2ef9 100644 --- a/src/libs/info/scan_gpu.cpp +++ b/src/libs/info/scan_gpu.cpp @@ -3,14 +3,14 @@ #include #if defined(unix) || defined(__unix) || defined(__unix__) -#include "../../../include/utils/subprocess.h" +#include "utils/subprocess.h" #elif defined(__APPLE__) #elif defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) #include "WMIwrapper.h" #pragma comment(lib, "wbemuuid.lib") #endif -#include "../../../include/hwares/scan_gpu.h" +#include "hwares/scan_gpu.h" namespace bscan { diff --git a/src/libs/info/scan_mainboard.cpp b/src/libs/info/scan_mainboard.cpp index ed1ddb3..326e9ba 100644 --- a/src/libs/info/scan_mainboard.cpp +++ b/src/libs/info/scan_mainboard.cpp @@ -1,7 +1,7 @@ -#include "../../../include/hwares/scan_mainboard.h" +#include "hwares/scan_mainboard.h" #include #include -#include "../../../include/WMIwrapper.h" +#include "WMIwrapper.h" namespace bscan { diff --git a/src/libs/info/scan_os.cpp b/src/libs/info/scan_os.cpp index dc86a3c..5c23a97 100644 --- a/src/libs/info/scan_os.cpp +++ b/src/libs/info/scan_os.cpp @@ -1,4 +1,4 @@ -#include "../../../include/swares/scan_os.h" +#include "swares/scan_os.h" #include namespace bscan { diff --git a/src/libs/info/scan_ram.cpp b/src/libs/info/scan_ram.cpp index fa01b62..a9198fc 100644 --- a/src/libs/info/scan_ram.cpp +++ b/src/libs/info/scan_ram.cpp @@ -8,9 +8,9 @@ #elif defined(_WIN32) || defined(_WIN64) #include -#include "../../../include/WMIwrapper.h" +#include "WMIwrapper.h" #endif -#include "../../../include/hwares/scan_ram.h" +#include "hwares/scan_ram.h" namespace bscan { diff --git a/src/libs/info/scan_system.cpp b/src/libs/info/scan_system.cpp index 8ba1f7b..e6f4059 100644 --- a/src/libs/info/scan_system.cpp +++ b/src/libs/info/scan_system.cpp @@ -1 +1 @@ -#include "../../../include/swares/scan_system.h" +#include "swares/scan_system.h" diff --git a/src/libs/info/windows/scan_battery.cpp b/src/libs/info/windows/scan_battery.cpp index f5f6627..5d2e546 100644 --- a/src/libs/info/windows/scan_battery.cpp +++ b/src/libs/info/windows/scan_battery.cpp @@ -1,10 +1,10 @@ #include -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_WINDOWS -#include "../../../include/WMIwrapper.h" -#include "../../../include/hwares/scan_battery.h" +#include "WMIwrapper.h" +#include "hwares/scan_battery.h" namespace bscan { diff --git a/src/libs/info/windows/scan_cpu.cpp b/src/libs/info/windows/scan_cpu.cpp index 151a858..fa15343 100644 --- a/src/libs/info/windows/scan_cpu.cpp +++ b/src/libs/info/windows/scan_cpu.cpp @@ -1,12 +1,12 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_WINDOWS #include #include #include -#include "../../../include/WMIwrapper.h" -#include "../../../include/hwares/scan_cpu.h" -#include "../../../include/hwares/scan_cpuid.h" +#include "WMIwrapper.h" +#include "hwares/scan_cpu.h" +#include "hwares/scan_cpuid.h" namespace bscan { diff --git a/src/libs/info/windows/scan_disk.cpp b/src/libs/info/windows/scan_disk.cpp index 22707c4..2cc7330 100644 --- a/src/libs/info/windows/scan_disk.cpp +++ b/src/libs/info/windows/scan_disk.cpp @@ -1,9 +1,9 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_WINDOWS #include -#include "../../../include/WMIwrapper.h" -#include "../../../include/hwares/disk.h" -#include "../../../include/utils/stringutils.h" +#include "WMIwrapper.h" +#include "hwares/disk.h" +#include "utils/stringutils.h" namespace bscan { diff --git a/src/libs/info/windows/scan_gpu.cpp b/src/libs/info/windows/scan_gpu.cpp index 8e7d3c6..a9124d7 100644 --- a/src/libs/info/windows/scan_gpu.cpp +++ b/src/libs/info/windows/scan_gpu.cpp @@ -1,10 +1,10 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_WINDOWS #include #include -#include "../../../include/WMIwrapper.h" +#include "WMIwrapper.h" #pragma comment(lib, "wbemuuid.lib") -#include "../../../include/hwares/scan_gpu.h" +#include "hwares/scan_gpu.h" namespace bscan { diff --git a/src/libs/info/windows/scan_mainboard.cpp b/src/libs/info/windows/scan_mainboard.cpp index 33433c8..f4bfb8d 100644 --- a/src/libs/info/windows/scan_mainboard.cpp +++ b/src/libs/info/windows/scan_mainboard.cpp @@ -1,8 +1,8 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_WINDOWS #include -#include "../../../include/WMIwrapper.h" -#include "../../../include/hwares/scan_mainboard.h" +#include "WMIwrapper.h" +#include "hwares/scan_mainboard.h" namespace bscan { diff --git a/src/libs/info/windows/scan_os.cpp b/src/libs/info/windows/scan_os.cpp index e626604..adab4bc 100644 --- a/src/libs/info/windows/scan_os.cpp +++ b/src/libs/info/windows/scan_os.cpp @@ -1,4 +1,4 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_WINDOWS @@ -9,7 +9,7 @@ #include #define STATUS_SUCCESS 0x00000000 -#include "../../../include/swares/scan_os.h" +#include "swares/scan_os.h" namespace bscan { diff --git a/src/libs/info/windows/scan_ram.cpp b/src/libs/info/windows/scan_ram.cpp index ec40cad..0472881 100644 --- a/src/libs/info/windows/scan_ram.cpp +++ b/src/libs/info/windows/scan_ram.cpp @@ -1,11 +1,11 @@ -#include "../../../include/platform.h" +#include "platform.h" #ifdef BSCAN_WINDOWS #include #include #include -#include "../../../include/WMIwrapper.h" -#include "../../../include/hwares/scan_ram.h" -#include "../../../include/utils/stringutils.h" +#include "WMIwrapper.h" +#include "hwares/scan_ram.h" +#include "utils/stringutils.h" namespace bscan { From fc5751ffdd42deaf60f6a93cfcf1551ad13cebe4 Mon Sep 17 00:00:00 2001 From: ahsouza Date: Sat, 11 Mar 2023 16:14:06 -0300 Subject: [PATCH 8/9] fix --- binding.gyp | 1 + 1 file changed, 1 insertion(+) diff --git a/binding.gyp b/binding.gyp index 52ec56c..3f64b31 100644 --- a/binding.gyp +++ b/binding.gyp @@ -4,6 +4,7 @@ "target_name": "bscan", "cflags!": [ "-fno-exceptions" ], "cflags_cc!": [ "-fno-exceptions", "-std=c++17" ], + "cflags_cc": [ "-std=c++17" ], # sources: arquivoc C/C++ a ser compilados "sources": [ "./src/libs/info/scan_battery.cpp", From f156408e2d77294fa9e6966c1c720cec0cfc1b9e Mon Sep 17 00:00:00 2001 From: ahsouza Date: Sat, 11 Mar 2023 16:19:12 -0300 Subject: [PATCH 9/9] fix bug --- binding.gyp | 2 +- src/libs/info/apple/scan_cpu.cpp | 2 +- src/libs/info/apple/scan_disk.cpp | 2 +- src/libs/info/scan_disk.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/binding.gyp b/binding.gyp index 3f64b31..adfb6eb 100644 --- a/binding.gyp +++ b/binding.gyp @@ -3,7 +3,7 @@ { "target_name": "bscan", "cflags!": [ "-fno-exceptions" ], - "cflags_cc!": [ "-fno-exceptions", "-std=c++17" ], + "cflags_cc!": [ "-fno-exceptions" ], "cflags_cc": [ "-std=c++17" ], # sources: arquivoc C/C++ a ser compilados "sources": [ diff --git a/src/libs/info/apple/scan_cpu.cpp b/src/libs/info/apple/scan_cpu.cpp index d39313c..b934efd 100644 --- a/src/libs/info/apple/scan_cpu.cpp +++ b/src/libs/info/apple/scan_cpu.cpp @@ -1,4 +1,4 @@ -#include "include/platform.h" +#include "platform.h" #ifdef BSCAN_APPLE #include #include diff --git a/src/libs/info/apple/scan_disk.cpp b/src/libs/info/apple/scan_disk.cpp index 71194e0..ee33f33 100644 --- a/src/libs/info/apple/scan_disk.cpp +++ b/src/libs/info/apple/scan_disk.cpp @@ -1,4 +1,4 @@ -#include "include/platform.h" +#include "platform.h" #ifdef BSCAN_APPLE #include #include diff --git a/src/libs/info/scan_disk.cpp b/src/libs/info/scan_disk.cpp index a56d747..d878244 100644 --- a/src/libs/info/scan_disk.cpp +++ b/src/libs/info/scan_disk.cpp @@ -1,5 +1,5 @@ -#include "../../../include/hwares/scan_disk.h" -#include "../../../include/utils/stringutils.h" +#include "hwares/scan_disk.h" +#include "utils/stringutils.h" namespace bscan {