10#ifndef __AUDACITY_XML_XML_FILE_WRITER__
11#define __AUDACITY_XML_XML_FILE_WRITER__
17#include "MemoryStream.h"
32 virtual void StartTag(
const wxString &
name);
33 virtual void EndTag(
const wxString &
name);
39 { WriteAttr(
name, value.
GET() ); }
41 virtual void WriteAttr(
const wxString &
name,
const wxString &value);
42 virtual void WriteAttr(
const wxString &
name,
const wxChar *value);
44 virtual void WriteAttr(
const wxString &
name,
int value);
45 virtual void WriteAttr(
const wxString &
name,
bool value);
46 virtual void WriteAttr(
const wxString &
name,
long value);
47 virtual void WriteAttr(
const wxString &
name,
long long value);
48 virtual void WriteAttr(
const wxString &
name,
size_t value);
49 virtual void WriteAttr(
const wxString &
name,
float value,
int digits = -1);
50 virtual void WriteAttr(
const wxString &
name,
double value,
int digits = -1);
52 virtual void WriteData(
const wxString &value);
54 virtual void WriteSubTree(
const wxString &value);
56 virtual void Write(
const wxString &data) = 0;
61 static wxString XMLEsc(
const wxString & s);
92 bool keepBackup =
false );
110 void Write(
const wxString &data)
override;
124 void CloseWithoutEndingTags();
133 bool mCommitted{
false };
146 void Write(
const wxString &data)
override;
155 void StartTag(
const std::string_view&
name);
156 void EndTag(
const std::string_view&
name);
158 void WriteAttr(
const std::string_view&
name,
const Identifier& value);
162 void WriteAttr(
const std::string_view&
name,
const std::string_view& value);
164 void WriteAttr(
const std::string_view&
name,
int value);
165 void WriteAttr(
const std::string_view&
name,
bool value);
166 void WriteAttr(
const std::string_view&
name,
long value);
167 void WriteAttr(
const std::string_view&
name,
long long value);
168 void WriteAttr(
const std::string_view&
name,
size_t value);
169 void WriteAttr(
const std::string_view&
name,
float value,
int digits = -1);
170 void WriteAttr(
const std::string_view&
name,
double value,
int digits = -1);
172 void WriteData(
const std::string_view& value);
174 void WriteSubTree(
const std::string_view& value);
176 void Write(
const std::string_view& value);
180 void WriteEscaped(
const std::string_view& value);
184 bool mInTag {
false };
MessageBoxException for failures of file operations.
Thrown for failure of file or database operations in deeply nested places.
@ Write
most important to detect when storage space is exhausted
An explicitly nonlocalized string, not meant for the user to see.
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
A low overhead memory stream with O(1) append, low heap fragmentation and a linear memory view.
Holds a msgid for the translation catalog; may also bind format arguments.
Wrapper to output XML data to files.
const TranslatableString mCaption
FilePath GetBackupName() const
void ThrowException(const wxFileName &fileName, const TranslatableString &caption)
const FilePath mOutputPath
Wrapper to output XML data to strings.
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
std::vector< int > mHasKids
void WriteAttr(const wxString &name, const Identifier &value)
virtual void Write(const wxString &data)=0