Debian Codegraph @

libraries/lib-breakpad-configurer/internal/unix/CrashReportContext.h

raw
1 /*!********************************************************************
2 *
3 Audacity: A Digital Audio Editor
4
5 CrashReportContext.h
6
7 Vitaly Sverchinsky
8
9 **********************************************************************/
10
11 #pragma once
12
13 #include <string>
14 #include <map>
15
16 //!This object is for internal usage.
17 /*! Simple POD type, holds user data required to start handler.
18 * Fields are initialized with Set* methods,
19 * which may return false if internal buffer isn't large enough
20 * to store value passed as an argument.
21 * After initialization call StartHandler providing path to the
22 * database, where minidumps will be stored.
23 */
24 class CrashReportContext
25 {
26 static constexpr size_t MaxBufferLength{ 2048 };
27
28 char mSenderPath[MaxBufferLength]{};
29 char mReportURL[MaxBufferLength]{};
30 char mParameters[MaxBufferLength]{};
31
32 public:
33
34 bool SetSenderPathUTF8(const std::string& path);
35 bool SetReportURL(const std::string& url);
36 bool SetParameters(const std::map<std::string, std::string>& p);
37
38 void StartHandler(const std::string& databasePath);
39
40 private:
41 //helper function which need access to a private data, but should not be exposed to a public class interface
42 friend bool SendReport(CrashReportContext* ctx, const char* minidumpPath);
43 };