X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/478cde3220641d49cfbd492e799107d13ccdfeb3..3bc2d7aeda2999126184c298f26b93ffd59be500:/include/wx/debugrpt.h

diff --git a/include/wx/debugrpt.h b/include/wx/debugrpt.h
index 80f4e06782..befd84d6f8 100644
--- a/include/wx/debugrpt.h
+++ b/include/wx/debugrpt.h
@@ -13,7 +13,10 @@
 
 #include "wx/defs.h"
 
-#if wxUSE_DEBUGREPORT
+#if wxUSE_DEBUGREPORT && wxUSE_XML
+
+#include "wx/string.h"
+#include "wx/arrstr.h"
 
 class WXDLLIMPEXP_XML wxXmlNode;
 
@@ -48,17 +51,27 @@ 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& filename,
+                 const wxString& text,
+                 const wxString& description);
 
+#if wxUSE_STACKWALKER
     // add an XML file containing the current or exception context and the
     // stack trace
     bool AddCurrentContext() { return AddContext(Context_Current); }
     bool AddExceptionContext() { return AddContext(Context_Exception); }
     virtual bool AddContext(Context ctx);
+#endif
 
 #if wxUSE_CRASHREPORT
     // add a file with crash report
@@ -90,11 +103,13 @@ public:
     void RemoveFile(const wxString& name);
 
 protected:
+#if wxUSE_STACKWALKER
     // used by AddContext()
     virtual bool DoAddSystemInfo(wxXmlNode *nodeSystemInfo);
     virtual bool DoAddLoadedModules(wxXmlNode *nodeModules);
     virtual bool DoAddExceptionInfo(wxXmlNode *nodeContext);
     virtual void DoAddCustomContext(wxXmlNode * WXUNUSED(nodeRoot)) { }
+#endif
 
     // used by Process()
     virtual bool DoProcess();
@@ -215,7 +230,6 @@ public:
 
 #endif // wxUSE_GUI
 
-#endif // wxUSE_DEBUGREPORT
+#endif // wxUSE_DEBUGREPORT && wxUSE_XML
 
 #endif // _WX_DEBUGRPT_H_
-