audacia/src
Paul Licameli 3bb04245c5 Strong exception safety in all uses of XMLFileWriter...
... Strong, meaning that the file at the specified path is created or modified
only if all write operations complete without exceptions, barring one very
unlikely possibility that a final file rename fails, but even in that case the
output is successfully written to some path.

This commit does not add throws, but changes the type thrown to a subclass of
AudacityException, so that GuardedCall will cause the user to see an error
dialog in all cases.

Duplicated logic for making temporary files and backups is now all in one
place, the class XMLWriter.

There may be more new GuardedCalls than necessary -- the catch-all for the
event loop, AudacityApp::OnExceptionInMainLoop, might be trusted instead in
some cases --  but they are sufficient.
2017-03-18 11:45:33 -04:00
..
blockfile Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
commands Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
effects Strong exception safety in all uses of XMLFileWriter... 2017-03-18 11:45:33 -04:00
export Strong exception safety in all uses of XMLFileWriter... 2017-03-18 11:45:33 -04:00
import Translate exceptions to error codes in callback functions... 2017-03-17 17:53:01 -04:00
ondemand Rewrite one try-catch with GuardedCall so we can show the user errors 2017-03-17 17:53:01 -04:00
prefs Strong exception safety in all uses of XMLFileWriter... 2017-03-18 11:45:33 -04:00
toolbars Remove naked new[] in: ondemand, toolbars, widgets 2017-03-17 17:52:45 -04:00
tracks/ui Fewer inclusions of AudacityApp.h 2017-03-17 17:52:24 -04:00
widgets Use SafelyProcessEvent 2017-03-17 17:53:03 -04:00
xml Strong exception safety in all uses of XMLFileWriter... 2017-03-18 11:45:33 -04:00
AboutDialog.cpp Bug 1597 - Tweak: make version check on welcome user-initiated. 2017-02-28 19:05:06 +00:00
AboutDialog.h Bug 1597 - Tweak: make version check on welcome user-initiated. 2017-02-28 19:05:06 +00:00
AColor.cpp Regularize casts as (int), so they are easier to find and review 2016-09-20 08:42:11 -04:00
AColor.h OpenMP TrackArtist::DrawSpectrum (#165) 2016-09-20 07:15:18 -04:00
AllThemeResources.h Change ScrubBar to ScrubRuler 2016-08-22 12:25:36 +01:00
audacity.desktop.in Update Catalan translation 2016-08-25 14:09:58 +02:00
Audacity.h Fewer inclusions of AudacityApp.h 2017-03-17 17:52:24 -04:00
audacity.xml
AudacityApp.cpp more guarded calls 2017-03-17 17:53:02 -04:00
AudacityApp.h more guarded calls 2017-03-17 17:53:02 -04:00
AudacityException.cpp Exception framework: define AudacityException and GuardedCall... 2017-03-17 17:52:57 -04:00
AudacityException.h Exception framework: define AudacityException and GuardedCall... 2017-03-17 17:52:57 -04:00
AudacityHeaders.cpp
AudacityHeaders.h Rewrite Resample::Process to take and return size_t values 2016-09-06 12:39:58 -04:00
AudacityLogger.cpp Make Audacity source more like DarkAudacity source. 2016-09-11 13:03:37 +01:00
AudacityLogger.h Remove a naked new in AudacityLogger.cpp 2016-08-13 10:37:52 -04:00
AudioIO.cpp Gracefully handle disk exhaustion exceptions during recording 2017-03-17 17:53:00 -04:00
AudioIO.h Gracefully handle disk exhaustion exceptions during recording 2017-03-17 17:53:00 -04:00
AudioIOListener.h Show Actual Rate in status only if playing, recording, or monitoring 2016-05-22 10:44:18 -04:00
AutoRecovery.cpp Strong exception safety in all uses of XMLFileWriter... 2017-03-18 11:45:33 -04:00
AutoRecovery.h Strong exception safety in all uses of XMLFileWriter... 2017-03-18 11:45:33 -04:00
BatchCommandDialog.cpp Fix TAB key navigation on Mac for all dialogs (not only for panels) 2016-07-10 17:12:27 -04:00
BatchCommandDialog.h Fix TAB key navigation on Mac for all dialogs (not only for panels) 2016-07-10 17:12:27 -04:00
BatchCommands.cpp Fewer inclusions of AudacityApp.h 2017-03-17 17:52:24 -04:00
BatchCommands.h Harmlessly qualify classes as final (or explicitly comment not)... 2016-02-24 20:58:30 -05:00
BatchProcessDialog.cpp Guarded calls in batch processing 2017-03-17 17:53:00 -04:00
BatchProcessDialog.h Remove unnecessary semicolons 2016-09-18 10:36:53 -04:00
Benchmark.cpp Remove naked new[] in: Benchmark 2017-03-17 17:52:47 -04:00
Benchmark.h
BlockFile.cpp Remove naked new[] in: blockfile and commands 2017-03-17 17:52:46 -04:00
BlockFile.h Allow exceptions from BlockFile::Recover, handle them in ProjectFSCK 2017-03-17 17:53:02 -04:00
configtemplate.h
CrossFade.cpp Change sampleCount arguments, variables, return values to size_t... 2016-09-15 21:03:17 -04:00
CrossFade.h Change sampleCount arguments, variables, return values to size_t... 2016-09-15 21:03:17 -04:00
Dependencies.cpp Use enum class ProgressResult, don't interconvert with int or bool 2017-03-17 17:52:24 -04:00
Dependencies.h Redo AliasedFile using wxFileNameWrapper. 2016-04-17 03:31:16 -04:00
DeviceChange.cpp Remove some naked new amd delete in: various 2016-08-08 07:51:24 -04:00
DeviceChange.h Remove some naked new amd delete in: various 2016-08-08 07:51:24 -04:00
DeviceManager.cpp Remove the naked new in allocation of AudacityProject 2016-08-14 15:24:59 -04:00
DeviceManager.h Make static "Destroy" methods for certain singletons unnecessary. 2016-04-06 16:24:46 -04:00
Diags.cpp ThomasFeher - Unused parameters clean up. 2016-09-11 20:31:49 +01:00
Diags.h
DirManager.cpp Allow exceptions from BlockFile::Recover, handle them in ProjectFSCK 2017-03-17 17:53:02 -04:00
DirManager.h More const and override 2017-03-17 17:52:20 -04:00
Dither.cpp "new"->"NEW" in comments, easier to find remaining naked operator new 2016-02-14 18:52:41 -05:00
Dither.h
Envelope.cpp Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
Envelope.h Move many fields out of Envelope that are needed only during editing 2017-03-17 17:52:31 -04:00
Experimental.h Revert unintended changes in Experimental.h, sorry 2016-08-23 14:27:35 -04:00
FFmpeg.cpp Remove naked malloc (or similar) and free in: FFmpeg 2017-03-17 17:52:51 -04:00
FFmpeg.h Remove naked malloc (or similar) and free in: FFmpeg 2017-03-17 17:52:51 -04:00
FFT.cpp Redo type HFFT as a smart pointer, remove malloc and free 2017-03-17 17:52:51 -04:00
FFT.h pixel column counts and sample window sizes use unsigned types 2016-09-11 20:28:13 -04:00
FileException.cpp Define an AudacityException subclass for file errors 2017-03-17 17:52:58 -04:00
FileException.h Define an AudacityException subclass for file errors 2017-03-17 17:52:58 -04:00
FileFormats.cpp Remove naked malloc (or similar) and free in: various 2017-03-17 17:52:54 -04:00
FileFormats.h build fix 2016-04-17 15:02:28 -04:00
FileIO.cpp Remove some naked new amd delete in: various 2016-08-08 07:51:24 -04:00
FileIO.h Remove some naked new amd delete in: various 2016-08-08 07:51:24 -04:00
FileNames.cpp Bug 1577 - Application configuration file location incorrect on Linux/case-sensitive Macs 2017-01-25 22:15:03 +00:00
FileNames.h Bug 1577 - Application configuration file location incorrect on Linux/case-sensitive Macs 2017-01-25 22:15:03 +00:00
float_cast.h
FreqWindow.cpp Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
FreqWindow.h Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
HelpText.cpp Alpha welcome screen help hyperlinks to alpha manual. 2017-03-02 16:33:19 +00:00
HelpText.h
HistoryWindow.cpp Fewer inclusions of AudacityApp.h 2017-03-17 17:52:24 -04:00
HistoryWindow.h Add button to History dialog to clear the clipboard & space calc 2016-11-07 11:25:27 -05:00
ImageManipulation.cpp Remove unnecessary std::move in return statements... 2016-09-15 07:39:46 -04:00
ImageManipulation.h Image manipulation functions return smart pointers 2016-04-06 16:06:34 -04:00
InconsistencyException.cpp Define an AudacityException subclass for assertion violations 2017-03-17 17:52:57 -04:00
InconsistencyException.h Define an AudacityException subclass for assertion violations 2017-03-17 17:52:57 -04:00
Internat.cpp Bug119: Export Multiple /, *, ? handled incorrectly 2016-06-20 22:32:23 -04:00
Internat.h Bug119: Export Multiple /, *, ? handled incorrectly 2016-06-20 22:32:23 -04:00
InterpolateAudio.cpp Remove naked new[] in: linear algebra functions for Repair 2017-03-17 17:52:49 -04:00
InterpolateAudio.h Remove naked new[] in: linear algebra functions for Repair 2017-03-17 17:52:49 -04:00
LabelDialog.cpp Some more const, some stl idioms, remove unused declaration 2016-09-13 22:03:58 -04:00
LabelDialog.h Remove unnecessary semicolons 2016-09-18 10:36:53 -04:00
LabelTrack.cpp Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
LabelTrack.h Don't create placeholder clips in Duplicate command ... 2017-03-17 17:52:39 -04:00
LangChoice.cpp Fix TAB key navigation on Mac for all dialogs (not only for panels) 2016-07-10 17:12:27 -04:00
LangChoice.h
Languages.cpp "new"->"NEW" in comments, easier to find remaining naked operator new 2016-02-14 18:52:41 -05:00
Languages.h
Legacy.cpp Strong exception safety in all uses of XMLFileWriter... 2017-03-18 11:45:33 -04:00
Legacy.h Sweep for filename copying: various 2016-04-10 22:26:28 -04:00
LoadModules.cpp
LoadModules.h
Lyrics.cpp Use DBL_MAX, not arbitrary 1000000000.0, as "infinite" time interval 2016-09-19 10:38:42 -04:00
Lyrics.h Don't cause assertion violations when showing Lyrics window 2016-06-27 21:25:03 -04:00
LyricsWindow.cpp Stack-allocate where possible! ... 2016-02-17 18:15:57 -05:00
LyricsWindow.h Harmlessly qualify classes as final (or explicitly comment not)... 2016-02-24 20:58:30 -05:00
MacroMagic.h
Makefile.am Define an AudacityException subclass for unready on-demand data 2017-03-17 17:52:58 -04:00
Makefile.in Update for Sample Data Import 2016-11-23 17:49:53 +00:00
Matrix.cpp Remove naked new[] in: linear algebra functions for Repair 2017-03-17 17:52:49 -04:00
Matrix.h Remove naked new[] in: linear algebra functions for Repair 2017-03-17 17:52:49 -04:00
MemoryX.h define freer 2017-03-17 17:52:44 -04:00
Menus.cpp Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
Menus.h Utility for track editing leaves fewer direct calls to GetLinked() 2017-03-17 17:52:28 -04:00
MenusMac.cpp Fewer inclusions of AudacityApp.h 2017-03-17 17:52:24 -04:00
Mix.cpp Remove naked new[] in: mixer 2017-03-17 17:52:45 -04:00
Mix.h Remove naked new[] in: mixer 2017-03-17 17:52:45 -04:00
MixerBoard.cpp Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
MixerBoard.h Remove some naked new amd delete in: Mixer Board 2016-08-08 07:51:24 -04:00
ModuleManager.cpp Bug 1587 - Mac: Ghost duplicate Nyquist effects after upgrade 2017-02-05 20:27:56 +00:00
ModuleManager.h Bug 1587 - Mac: Ghost duplicate Nyquist effects after upgrade 2017-02-05 20:27:56 +00:00
NoteTrack.cpp Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
NoteTrack.h Don't create placeholder clips in Duplicate command ... 2017-03-17 17:52:39 -04:00
NumberScale.h simplify SpectrogramSettings::GetScale; abstract frequency-to-bin... 2017-03-17 17:52:27 -04:00
PitchName.cpp
PitchName.h
PlatformCompatibility.cpp Fewer inclusions of AudacityApp.h 2017-03-17 17:52:24 -04:00
PlatformCompatibility.h Sweep for filename copying: various 2016-04-10 22:26:28 -04:00
PluginManager.cpp Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
PluginManager.h Bug 1587 - Mac: Ghost duplicate Nyquist effects after upgrade 2017-02-05 20:27:56 +00:00
Prefs.cpp Bug 1577 - Application configuration file location incorrect on Linux/case-sensitive Macs 2017-01-25 22:15:03 +00:00
Prefs.h
Printing.cpp Make EXPERIMENTAL_OUTPUT_DISPLAY compile 2017-03-17 17:52:18 -04:00
Printing.h Sweep unnecessary wxString copies: rest 2016-02-23 02:15:56 -05:00
Profiler.cpp Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
Profiler.h Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
Project.cpp Strong exception safety in all uses of XMLFileWriter... 2017-03-18 11:45:33 -04:00
Project.h Fewer inclusions of AudacityApp.h 2017-03-17 17:52:24 -04:00
RealFFTf.cpp Redo type HFFT as a smart pointer, remove malloc and free 2017-03-17 17:52:51 -04:00
RealFFTf.h Redo type HFFT as a smart pointer, remove malloc and free 2017-03-17 17:52:51 -04:00
RealFFTf48x.cpp Remove naked malloc (or similar) and free in: various 2017-03-17 17:52:54 -04:00
RealFFTf48x.h Redo type HFFT as a smart pointer, remove malloc and free 2017-03-17 17:52:51 -04:00
Resample.cpp Remove naked malloc (or similar) and free in: various 2017-03-17 17:52:54 -04:00
Resample.h Remove naked malloc (or similar) and free in: various 2017-03-17 17:52:54 -04:00
RevisionIdent.h Bug 1597 - Enh: Greater clarity over status of versions needed 2017-02-25 23:00:39 +00:00
RingBuffer.cpp Change sampleCount arguments, variables, return values to size_t... 2016-09-15 21:03:17 -04:00
RingBuffer.h Rewrite RingBuffer methods with size_t arguments and returns 2016-09-06 12:39:58 -04:00
SampleFormat.cpp Remove naked malloc (or similar) and free in: various 2017-03-17 17:52:54 -04:00
SampleFormat.h Remove naked malloc (or similar) and free in: various 2017-03-17 17:52:54 -04:00
Screenshot.cpp Some uses of Destroy_ptr let us remove some naked news 2016-08-10 11:05:51 -04:00
Screenshot.h
SelectedRegion.cpp Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
SelectedRegion.h Improve responsiveness of drag seek during click-scrub... 2016-05-23 18:37:42 -04:00
Sequence.cpp Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
Sequence.h Changes in WaveClip construction... 2017-03-17 17:52:39 -04:00
Shuttle.cpp
Shuttle.h Replace virtual with override wherever possible; eliminate needless virtual... 2016-02-26 12:35:38 -05:00
ShuttleGui.cpp Fix for bug 1480 2016-08-17 10:35:40 +01:00
ShuttleGui.h Remove some naked new amd delete in: various 2016-08-08 07:51:24 -04:00
ShuttlePrefs.cpp
ShuttlePrefs.h Replace virtual with override wherever possible; eliminate needless virtual... 2016-02-26 12:35:38 -05:00
Snap.cpp Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
Snap.h Fewer C-style pointer casts of tracks; comments justify static_cast 2016-09-15 12:12:43 -04:00
SoundActivatedRecord.cpp Fix TAB key navigation on Mac for all dialogs (not only for panels) 2016-07-10 17:12:27 -04:00
SoundActivatedRecord.h Remove unnecessary semicolons 2016-09-18 10:36:53 -04:00
Spectrum.cpp Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
Spectrum.h pixel column counts and sample window sizes use unsigned types 2016-09-11 20:28:13 -04:00
SplashDialog.cpp Regularize casts as (int), so they are easier to find and review 2016-09-20 08:42:11 -04:00
SplashDialog.h Remove some naked new amd delete in: various 2016-08-08 07:51:24 -04:00
SseMathFuncs.cpp
SseMathFuncs.h
Tags.cpp Strong exception safety in all uses of XMLFileWriter... 2017-03-18 11:45:33 -04:00
Tags.h More const and override 2017-03-17 17:52:20 -04:00
Theme.cpp Remove naked malloc (or similar) and free in: various 2017-03-17 17:52:54 -04:00
Theme.h Make Audacity source more like DarkAudacity source. 2016-09-11 13:03:37 +01:00
ThemeAsCeeCode.h Make Audacity source more like DarkAudacity source. 2016-09-11 13:03:37 +01:00
TimeDialog.cpp Fix TAB key navigation on Mac for all dialogs (not only for panels) 2016-07-10 17:12:27 -04:00
TimeDialog.h Remove unnecessary semicolons 2016-09-18 10:36:53 -04:00
TimerRecordDialog.cpp Use enum class ProgressResult, don't interconvert with int or bool 2017-03-17 17:52:24 -04:00
TimerRecordDialog.h Use enum class ProgressResult, don't interconvert with int or bool 2017-03-17 17:52:24 -04:00
TimeTrack.cpp Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
TimeTrack.h More const and override 2017-03-17 17:52:20 -04:00
Track.cpp Remove TrackList::GetLink 2017-03-17 17:52:29 -04:00
Track.h Don't create placeholder clips in Duplicate command ... 2017-03-17 17:52:39 -04:00
TrackArtist.cpp Remove naked new[] in: tracks 2017-03-17 17:52:47 -04:00
TrackArtist.h Restore change of Waveform dB scale with change of magnification... 2016-10-28 12:36:26 -04:00
TrackPanel.cpp TrackPanel aborts any dragging action when an exception escapes 2017-03-17 17:53:03 -04:00
TrackPanel.h Move many fields out of Envelope that are needed only during editing 2017-03-17 17:52:31 -04:00
TrackPanelAx.cpp Add two commands to move the cursor/selection to next/prev label 2016-10-24 14:24:20 +01:00
TrackPanelAx.h Add two commands to move the cursor/selection to next/prev label 2016-10-24 14:24:20 +01:00
TrackPanelCell.h new -> NEW in comments, so text search for naked new excludes them 2016-08-08 10:07:37 -04:00
TrackPanelCellIterator.h Define TrackPanelOverlay, use it to reimplement play indicator and cursor... 2016-04-18 14:31:36 -04:00
TrackPanelListener.h Control scrub with motion, click, drag, wheel almost anywhere in main window... 2016-04-26 12:12:06 -04:00
TranslatableStringArray.h Harmlessly qualify classes as final (or explicitly comment not)... 2016-02-24 20:58:30 -05:00
UndoManager.cpp More new -> NEW, delete -> DELETE in comments 2017-03-17 17:52:41 -04:00
UndoManager.h Add button to History dialog to clear the clipboard & space calc 2016-11-07 11:25:27 -05:00
UserException.cpp Define an AudacityException subclass for user cancellation of progress 2017-03-17 17:52:58 -04:00
UserException.h Define an AudacityException subclass for user cancellation of progress 2017-03-17 17:52:58 -04:00
ViewInfo.cpp Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
ViewInfo.h More const and override 2017-03-17 17:52:20 -04:00
VoiceKey.cpp Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
VoiceKey.h EXPERIMENTAL_VOICE_DETECTION: compile, use const, more careful casts 2017-03-17 17:52:17 -04:00
WaveClip.cpp Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
WaveClip.h Remove naked new[] in: tracks 2017-03-17 17:52:47 -04:00
WaveTrack.cpp Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
WaveTrack.h Remove naked new[] in: tracks 2017-03-17 17:52:47 -04:00
WaveTrackLocation.h Use std::vector for wave track locations 2016-02-27 12:08:03 -05:00
WrappedType.cpp
WrappedType.h
wxFileNameWrapper.h Define a wxFileNameWrapper that does not crash GCC 5.0. Thanks, Max Kellermann. 2016-04-28 13:17:07 -04:00