#pragma once #include #include "rbx/boost.hpp" #include "rbx/Thread.hpp" #include #include #include #include // source #ifdef _WIN32 // For mkdir #include #include #else #include #include #include "_FindFirst.h" #endif #include "errno.h" class ErrorUploader { protected: struct data { std::queue files; boost::recursive_mutex sync; // TODO: Would non-recursive be safe here? std::string url; int dmpFileCount; HANDLE hInterprocessMutex; data():dmpFileCount(0), hInterprocessMutex(NULL) {} }; shared_ptr _data; boost::scoped_ptr thread; static std::string MoveRelative(LPCTSTR fileName, std::string path); public: ErrorUploader() :_data(new data()) {} void Cancel() { boost::recursive_mutex::scoped_lock lock(_data->sync); while (!_data->files.empty()) _data->files.pop(); } bool IsUploading() { return !_data->files.empty(); } };