# application **Repository Path**: shaoguangcn/application ## Basic Information - **Project Name**: application - **Description**: Application class for C++ application - **Primary Language**: C++ - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-03-19 - **Last Updated**: 2023-04-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # application #### 介绍 Application class for C++ application #### 测试平台 - Linux: Ubuntu20.04 GCC - Windows: Windows10 MSVC #### Example ```cpp #include #include #include #include "application.hpp" #define app Application::Instance() void atexit_handler() { std::cout << "at exit" << std::endl; } void thread_func() { std::this_thread::sleep_for(std::chrono::milliseconds(1000)); std::cout << app->GetApplicationDirPath() << std::endl; std::cout << app->GetApplicationFilePath() << std::endl; std::cout << app->GetApplicationName() << std::endl; std::cout << app->GetOriginalArguments()[0] << std::endl; app->Exit(3); std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } int main(int argc, char* argv[]) { app->Initialize(argc, argv); std::atexit(atexit_handler); std::thread th(thread_func); th.detach(); return app->Exec(); } ```