-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(MSVC, C++11) Add Network information(interface index, MAC, IPv4, Description) #65
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution. All in all good work! Please address the issues stated in the comments so that I can merge your pull-request.
Also make sure that all files are in line with the coding style (.clang-format)
include/hwinfo/bios.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add dummy implementations for Linux (and OSX) for this classes member functions? They can just return "" but they need to be implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I will try
include/hwinfo/cpu.h
Outdated
@@ -36,6 +36,7 @@ class CPU { | |||
~CPU() = default; | |||
|
|||
int id() const; | |||
const std::string& processorId() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this information is useful at all. Maybe just remove it for the time being
include/hwinfo/network.h
Outdated
@@ -0,0 +1,35 @@ | |||
// Copyright MRsoymilk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot accept copyrighted content for this project
include/hwinfo/network.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add Linux (and maybe OSX) dummy implementations for this classes member functions too?
include/hwinfo/network.h
Outdated
Network() = default; | ||
std::string _interfaceIndex{}; | ||
std::string _mac{}; | ||
std::string _ipv4{}, _ipv6{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please write them in separate statements for readability
src/CMakeLists.txt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once you have added the dummy implementations, you can add the linux and OSX cpp files here too
src/network.cpp
Outdated
@@ -0,0 +1,24 @@ | |||
// Copyright MRsoymilk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot accept Copyright code for this project
src/windows/cpu.cpp
Outdated
@@ -91,7 +91,7 @@ std::vector<double> CPU::threadsUtilisation() const { | |||
std::vector<CPU> getAllCPUs() { | |||
utils::WMI::_WMI wmi; | |||
const std::wstring query_string( | |||
L"SELECT Name, Manufacturer, NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed, L2CacheSize, L3CacheSize " | |||
L"SELECT Name, Manufacturer, NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed, ProcessorId " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove ProcessorId
src/windows/network.cpp
Outdated
@@ -0,0 +1,80 @@ | |||
// Copyright (c) MRsoymilk <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i cannot accept copyright code for this project
src/windows/utils/wmi_wrapper.cpp
Outdated
@@ -11,9 +11,10 @@ namespace utils { | |||
namespace WMI { | |||
|
|||
_WMI::_WMI() { | |||
auto res = CoInitializeSecurity(nullptr, -1, nullptr, nullptr, RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, | |||
HRESULT res{-1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better initialize res with the return value of the first statement
it seems a lot of things that need to be modified and it will take me some time to do |
I am a time traveler from 3023. The spacecraft malfunction makes it impossible to modify... |
The information shows below: