添加导出文件头
This commit is contained in:
parent
2e4e55b4d3
commit
29c109aeee
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
enum AudioDeviceType
|
||||
enum WINDEVICE_API AudioDeviceType
|
||||
{
|
||||
Render,
|
||||
Capture
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <Mmdeviceapi.h>
|
||||
|
||||
class AudioManager
|
||||
class WINDEVICE_API AudioManager
|
||||
{
|
||||
public:
|
||||
AudioManager();
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <vector>
|
||||
|
||||
namespace WinDevice {
|
||||
struct OsInfo {
|
||||
struct WINDEVICE_API OsInfo {
|
||||
// 操作系统名称
|
||||
std::string name;
|
||||
unsigned long majorVersion;
|
||||
@ -14,12 +14,12 @@ namespace WinDevice {
|
||||
int64_t totalMemory;
|
||||
};
|
||||
|
||||
struct CpuInfo {
|
||||
struct WINDEVICE_API CpuInfo {
|
||||
std::string name;
|
||||
int coreCout;
|
||||
};
|
||||
|
||||
struct GpuInfo {
|
||||
struct WINDEVICE_API GpuInfo {
|
||||
std::string name;
|
||||
/**
|
||||
* \brief 厂商Id
|
||||
@ -34,14 +34,14 @@ namespace WinDevice {
|
||||
size_t vram;
|
||||
};
|
||||
|
||||
struct DisplayMonitorInfo {
|
||||
struct WINDEVICE_API DisplayMonitorInfo {
|
||||
std::shared_ptr<HMONITOR> monitor;
|
||||
std::string name;
|
||||
long width;
|
||||
long height;
|
||||
};
|
||||
|
||||
struct UserDeviceInfo {
|
||||
struct WINDEVICE_API UserDeviceInfo {
|
||||
std::shared_ptr<CpuInfo> cpu;
|
||||
std::shared_ptr<OsInfo> os;
|
||||
std::shared_ptr<std::vector<GpuInfo>> gpu;
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
namespace WinDevice
|
||||
{
|
||||
class WinDeviceManager {
|
||||
class WINDEVICE_API WinDeviceManager {
|
||||
public:
|
||||
WinDeviceManager();
|
||||
~WinDeviceManager();
|
||||
|
7
WinDevice/Export.h
Normal file
7
WinDevice/Export.h
Normal file
@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef WINDEVICE_EXPORTS
|
||||
#define WINDEVICE_API __declspec(dllexport)
|
||||
#else
|
||||
#define WINDEVICE_API __declspec(dllimport)
|
||||
#endif
|
@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
#include "Export.h"
|
||||
#include <string>
|
||||
|
||||
class CmdUtil
|
||||
class WINDEVICE_API CmdUtil
|
||||
{
|
||||
public:
|
||||
static std::string ExecuteCommand(const std::string& command);
|
||||
|
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include "Export.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
enum LogLevel : int
|
||||
|
@ -1,21 +1,21 @@
|
||||
#ifndef STRING_UTIL_H
|
||||
#define STRING_UTIL_H
|
||||
|
||||
#include "Export.h"
|
||||
#include <string>
|
||||
#include <locale>
|
||||
#include <codecvt>
|
||||
|
||||
template<typename To, typename From>
|
||||
To Convert(const From& input) {
|
||||
WINDEVICE_API To Convert(const From& input) {
|
||||
std::wstring_convert<std::codecvt_utf8<typename From::value_type>, typename From::value_type> converter;
|
||||
return converter.to_bytes(input);
|
||||
}
|
||||
|
||||
inline std::string Wstring2String(const std::wstring& input) {
|
||||
WINDEVICE_API inline std::string Wstring2String(const std::wstring& input) {
|
||||
return Convert<std::string>(input);
|
||||
}
|
||||
|
||||
inline std::string Wchar2String(const WCHAR* input) {
|
||||
WINDEVICE_API inline std::string Wchar2String(const WCHAR* input) {
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
|
||||
return converter.to_bytes(input);
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "Export.h"
|
||||
#pragma comment(lib, "IPHLPAPI.lib")
|
||||
#pragma comment(lib, "wbemuuid.lib")
|
||||
|
||||
class SysInfoUtil
|
||||
class WINDEVICE_API SysInfoUtil
|
||||
{
|
||||
public:
|
||||
void GetMacByGetAdaptersInfo(char* outMAC) const;
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "TimeUtil.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
|
||||
template <typename Func>
|
||||
void TimeUtil<Func>::CalExecuteTime(Func func)
|
||||
{
|
||||
|
@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
#include "Export.h"
|
||||
template <typename Func>
|
||||
|
||||
class TimeUtil
|
||||
class WINDEVICE_API TimeUtil
|
||||
{
|
||||
public:
|
||||
static void CalExecuteTime(Func func);
|
||||
|
@ -1,10 +1,11 @@
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include <Mmdeviceapi.h>
|
||||
|
||||
class ScreenManager
|
||||
class WINDEVICE_API ScreenManager
|
||||
{
|
||||
public:
|
||||
ScreenManager();
|
||||
|
@ -1,5 +1,6 @@
|
||||
// WinDevice.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
|
||||
//
|
||||
#ifdef _DEBUG
|
||||
#include <stdafx.h>
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
@ -28,14 +29,4 @@ int main()
|
||||
getchar();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单
|
||||
// 调试程序: F5 或调试 >“开始调试”菜单
|
||||
|
||||
// 入门使用技巧:
|
||||
// 1. 使用解决方案资源管理器窗口添加/管理文件
|
||||
// 2. 使用团队资源管理器窗口连接到源代码管理
|
||||
// 3. 使用输出窗口查看生成输出和其他消息
|
||||
// 4. 使用错误列表窗口查看错误
|
||||
// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目
|
||||
// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件
|
||||
#endif
|
@ -1 +1 @@
|
||||
LIBRARY
|
||||
LIBRARY WinDevice
|
||||
|
@ -33,7 +33,7 @@
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
@ -46,7 +46,7 @@
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
@ -109,7 +109,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WINDEVICE_EXPORTS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)include\third_lib\;.</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
@ -143,7 +143,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WINDEVICE_EXPORTS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)include\third_lib\;.</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
@ -171,6 +171,7 @@
|
||||
<ClInclude Include="Audio\AudioManager.h" />
|
||||
<ClInclude Include="Device\UserDeviceInfo.h" />
|
||||
<ClInclude Include="Device\WinDeviceManager.h" />
|
||||
<ClInclude Include="Export.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="Utils\CmdUtil.h" />
|
||||
<ClInclude Include="Utils\Log.h" />
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Export.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <winerror.h>
|
||||
@ -24,4 +24,3 @@
|
||||
|
||||
#include "sysinfoapi.h"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user