Add Application
This commit is contained in:
parent
0f83170c43
commit
ba68c396d2
@ -90,8 +90,12 @@
|
|||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\Application.cpp" />
|
||||||
<ClCompile Include="src\main.cpp" />
|
<ClCompile Include="src\main.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="src\Application.h" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
@ -18,5 +18,13 @@
|
|||||||
<ClCompile Include="src\main.cpp">
|
<ClCompile Include="src\main.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Application.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="src\Application.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
14
WinChat/src/Application.cpp
Normal file
14
WinChat/src/Application.cpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include "Application.h"
|
||||||
|
|
||||||
|
namespace wc {
|
||||||
|
Application::Application(std::string& appName, std::string& appVersion)
|
||||||
|
: m_appName(appName)
|
||||||
|
, m_appVersion(appVersion)
|
||||||
|
{
|
||||||
|
std::printf("%s %s\n", m_appName.c_str(), m_appVersion.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
Application::~Application() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
14
WinChat/src/Application.h
Normal file
14
WinChat/src/Application.h
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace wc {
|
||||||
|
class Application {
|
||||||
|
public:
|
||||||
|
Application(std::string& appName, std::string& appVersion);
|
||||||
|
|
||||||
|
~Application();
|
||||||
|
private:
|
||||||
|
const std::string m_appName;
|
||||||
|
const std::string m_appVersion;
|
||||||
|
};
|
||||||
|
}
|
@ -1,11 +1,17 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
#include "Application.h"
|
||||||
|
|
||||||
#define APPNAME "WinChat"
|
#define APPNAME "WinChat"
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
std::printf(APPNAME " " APPVERSION "\n");
|
std::string appName = APPNAME;
|
||||||
|
std::string appVer = APPVERSION;
|
||||||
|
|
||||||
|
{
|
||||||
|
wc::Application app(appName, appVer);
|
||||||
|
}
|
||||||
|
|
||||||
std::cin.get();
|
std::cin.get();
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user