#include <wx/debugrpt.h>
wxDebugReportCompress is a wxDebugReport which compresses all the files in this debug report into a single ZIP file in its wxDebugReport::Process() function.
Public Member Functions | |
wxDebugReportCompress () | |
Default constructor does nothing special. | |
void | SetCompressedFileDirectory (const wxString &dir) |
Set the directory where the debug report should be generated. | |
void | SetCompressedFileBaseName (const wxString &name) |
Set the base name of the generated debug report file. | |
const wxString & | GetCompressedFileName () const |
Returns the full path of the compressed file (empty if creation failed). | |
Public Member Functions inherited from wxDebugReport | |
wxDebugReport () | |
The constructor creates a temporary directory where the files that will be included in the report are created. | |
virtual | ~wxDebugReport () |
The destructor normally destroys the temporary directory created in the constructor with all the files it contains. | |
void | AddAll (Context context=Context_Exception) |
Adds all available information to the report. | |
virtual bool | AddContext (Context ctx) |
Add an XML file containing the current or exception context and the stack trace. | |
bool | AddCurrentContext () |
The same as calling AddContext(Context_Current). | |
bool | AddCurrentDump () |
The same as calling AddDump(Context_Current). | |
virtual bool | AddDump (Context ctx) |
Adds the minidump file to the debug report. | |
bool | AddExceptionContext () |
The same as calling AddContext(Context_Exception). | |
bool | AddExceptionDump () |
The same as calling AddDump(Context_Exception). | |
virtual void | AddFile (const wxString &filename, const wxString &description) |
Add another file to the report. | |
bool | AddText (const wxString &filename, const wxString &text, const wxString &description) |
This is a convenient wrapper around AddFile(). | |
const wxString & | GetDirectory () const |
This method should be used to construct the full name of the files which you wish to add to the report using AddFile(). | |
bool | GetFile (size_t n, wxString *name, wxString *desc) const |
Retrieves the name (relative to GetDirectory()) and the description of the file with the given index. | |
size_t | GetFilesCount () const |
Gets the current number files in this report. | |
virtual wxString | GetReportName () const |
Gets the name used as a base name for various files, by default wxApp::GetAppName() is used. | |
bool | IsOk () const |
Returns true if the object was successfully initialized. | |
bool | Process () |
Processes this report: the base class simply notifies the user that the report has been generated. | |
void | RemoveFile (const wxString &name) |
Removes the file from report: this is used by wxDebugReportPreview to allow the user to remove files potentially containing private information from the report. | |
void | Reset () |
Resets the directory name we use. | |
Additional Inherited Members | |
Public Types inherited from wxDebugReport | |
enum | Context { Context_Current, Context_Exception } |
This enum is used for functions that report either the current state or the state during the last (fatal) exception. More... | |
Protected Member Functions inherited from wxDebugReport | |
virtual void | DoAddCustomContext (wxXmlNode *nodeRoot) |
This function may be overridden to add arbitrary custom context to the XML context file created by AddContext(). | |
virtual bool | DoAddExceptionInfo (wxXmlNode *nodeContext) |
This function may be overridden to modify the contents of the exception tag in the XML context file. | |
virtual bool | DoAddLoadedModules (wxXmlNode *nodeModules) |
This function may be overridden to modify the contents of the modules tag in the XML context file. | |
virtual bool | DoAddSystemInfo (wxXmlNode *nodeSystemInfo) |
This function may be overridden to modify the contents of the system tag in the XML context file. | |
wxDebugReportCompress::wxDebugReportCompress | ( | ) |
Default constructor does nothing special.
const wxString& wxDebugReportCompress::GetCompressedFileName | ( | ) | const |
Returns the full path of the compressed file (empty if creation failed).
void wxDebugReportCompress::SetCompressedFileBaseName | ( | const wxString & | name | ) |
Set the base name of the generated debug report file.
This function is similar to SetCompressedFileDirectory() but allows to change the base name of the file. Notice that the file extension will always be .zip.
By default, a unique name constructed from wxApp::GetAppName(), the current process id and the current date and time is used.
name | The base name (i.e. without extension) of the file. |
void wxDebugReportCompress::SetCompressedFileDirectory | ( | const wxString & | dir | ) |
Set the directory where the debug report should be generated.
By default, the debug report is generated under user temporary files directory. This is usually fine if it is meant to be processed in some way (e.g. automatically uploaded to a remote server) but if the user is asked to manually upload or send the report, it may be more convenient to generate it in e.g. the users home directory and this function allows to do this.
Notice that it should be called before wxDebugReport::Process() or it has no effect.
dir | The full path to an existing directory where the debug report file should be generated. |