File: BreakpadConfigurer.h

package info (click to toggle)
audacity 3.2.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 106,704 kB
  • sloc: cpp: 277,038; ansic: 73,623; lisp: 7,761; python: 3,305; sh: 2,715; perl: 821; xml: 275; makefile: 119
file content (45 lines) | stat: -rw-r--r-- 1,827 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*!********************************************************************
*
 Audacity: A Digital Audio Editor

 BreakpadConfigurer.h

 Vitaly Sverchinsky

 **********************************************************************/

#pragma once

#include <string>
#include <map>

//! This class is used to configure Breakpad's handler before start.
/*! Typically handler should be started as early as possible. 
* BreakpadConfigurer may be a short living object, it is used to configure
* Breakpad handler, and run it with BreakpadConfigurer::Start() method,
* It's expected that Start() will be called once during application
* lifetime, any calls to Set* methods after handler is started will be ignored.
* The handler itself simply starts crash sender program, passing all the details
* (path crash dump, report url, parameters...) as a command-line arguments to it.
* Please read official documentation for details:
* https://chromium.googlesource.com/breakpad/breakpad
*/
class BreakpadConfigurer final
{
	std::string mDatabasePathUTF8;
	std::string mSenderPathUTF8;
	std::string mReportURL;
	std::map<std::string, std::string> mParameters;
public:
	//! Sets the directory where crashreports will be stored (should have rw permission)
	BreakpadConfigurer& SetDatabasePathUTF8(const std::string& pathUTF8);
	//! Sets report URL to the crash reporting server (URL-Encoded, optional)
	BreakpadConfigurer& SetReportURL(const std::string& reportURL);
	//! Sets an additional parameters that should be sent to a crash reporting server (ASCII encoded)
	BreakpadConfigurer& SetParameters(const std::map<std::string, std::string>& parameters);
	//! Sets a path to a directory where crash reporter sending program is located
	BreakpadConfigurer& SetSenderPathUTF8(const std::string& pathUTF8);

	//! Starts the handler
	void Start();
};