X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e18c3e02072753d45643316005bfd022a9d3d7cd..b8f0ac88a51be909c0e5b87657ea0a5dc9bbb721:/include/wx/debugrpt.h diff --git a/include/wx/debugrpt.h b/include/wx/debugrpt.h index 0ea56424ff..c57b27e458 100644 --- a/include/wx/debugrpt.h +++ b/include/wx/debugrpt.h @@ -13,9 +13,12 @@ #include "wx/defs.h" -#if wxUSE_DEBUGREPORT +#if wxUSE_DEBUGREPORT && wxUSE_XML -class WXDLLIMPEXP_XML wxXmlNode; +#include "wx/string.h" +#include "wx/arrstr.h" + +class WXDLLIMPEXP_FWD_XML wxXmlNode; // ---------------------------------------------------------------------------- // wxDebugReport: generate a debug report, processing is done in derived class @@ -48,16 +51,17 @@ public: void Reset() { m_dir.clear(); } - // add another file to the report: the file must already exist, its name is - // relative to GetDirectory() + // add another file to the report: the file must already exist, its name + // can be either absolute in which case it is copied to the debug report + // directory or relative to GetDirectory() // // description is shown to the user in the report summary - virtual void AddFile(const wxString& name, const wxString& description); + virtual void AddFile(const wxString& filename, const wxString& description); // convenience function: write the given text to a file with the given name // and then add it to the report (the difference with AddFile() is that the // file will be created by this function and doesn't have to already exist) - bool AddText(const wxString& name, + bool AddText(const wxString& filename, const wxString& text, const wxString& description); @@ -130,6 +134,15 @@ class WXDLLIMPEXP_QA wxDebugReportCompress : public wxDebugReport public: wxDebugReportCompress() { } + // you can optionally specify the directory and/or name of the file where + // the debug report should be generated, a default location under the + // directory containing temporary files will be used if you don't + // + // both of these functions should be called before Process()ing the report + // if they're called at all + void SetCompressedFileDirectory(const wxString& dir); + void SetCompressedFileBaseName(const wxString& name); + // returns the full path of the compressed file (empty if creation failed) const wxString& GetCompressedFileName() const { return m_zipfile; } @@ -137,6 +150,10 @@ protected: virtual bool DoProcess(); private: + // user-specified file directory/base name, use defaults if empty + wxString m_zipDir, + m_zipName; + // full path to the ZIP file we created wxString m_zipfile; }; @@ -157,7 +174,7 @@ public: wxDebugReportUpload(const wxString& url, const wxString& input, const wxString& action, - const wxString& curl = _T("curl")); + const wxString& curl = wxT("curl")); protected: virtual bool DoProcess(); @@ -226,7 +243,6 @@ public: #endif // wxUSE_GUI -#endif // wxUSE_DEBUGREPORT +#endif // wxUSE_DEBUGREPORT && wxUSE_XML #endif // _WX_DEBUGRPT_H_ -