Version: 3.0.2
wxDebugReportUpload Class Reference

#include <wx/debugrpt.h>

+ Inheritance diagram for wxDebugReportUpload:

Detailed Description

This class is used to upload a compressed file using HTTP POST request.

As this class derives from wxDebugReportCompress, before upload the report is compressed in a single ZIP file.

Library:  wxQA
Category:  Debugging

Public Member Functions

 wxDebugReportUpload (const wxString &url, const wxString &input, const wxString &action, const wxString &curl="curl")
 This class will upload the compressed file created by its base class to an HTML multipart/form-data form at the specified address.
 
- Public Member Functions inherited from wxDebugReportCompress
 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 wxStringGetCompressedFileName () 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 wxStringGetDirectory () 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.
 

Protected Member Functions

virtual bool OnServerReply (const wxArrayString &reply)
 This function may be overridden in a derived class to show the output from curl: this may be an HTML page or anything else that the server returned.
 

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...
 

Constructor & Destructor Documentation

wxDebugReportUpload::wxDebugReportUpload ( const wxString url,
const wxString input,
const wxString action,
const wxString curl = "curl" 
)

This class will upload the compressed file created by its base class to an HTML multipart/form-data form at the specified address.

The url is the upload page address, input is the name of the "type=file" control on the form used for the file name and action is the value of the form action field. The report is uploaded using the curl program which should be available, the curl parameter may be used to specify the full path to it.

Member Function Documentation

virtual bool wxDebugReportUpload::OnServerReply ( const wxArrayString reply)
protectedvirtual

This function may be overridden in a derived class to show the output from curl: this may be an HTML page or anything else that the server returned.

Value returned by this function becomes the return value of wxDebugReport::Process().