Utils/VrUtils/Inc/VrCrashHandler.h

29 lines
799 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef VR_CRASH_HANDLER_H
#define VR_CRASH_HANDLER_H
#include <string>
namespace VrCrashHandler
{
// 启动阶段独立初始化,多个入口只执行一次。
void Initialize();
// 正常上下文调用,创建目录并安装进程级处理器。路径为 UTF-8。
// 首次空路径使用 VrPathUtils 的日志目录/crash;重复空路径调用保留当前目录。
bool Enable(const std::string& outputDirectory = std::string());
// 在启动/配置阶段调用;恢复安装前的处理器,不删除已保存文件。
void Disable();
bool IsEnabled();
std::string GetOutputDirectory();
class AutoInitializer
{
public:
AutoInitializer()
{
Initialize();
}
};
}
#endif