Audacity  3.0.3
Public Member Functions | List of all members
XMLTagHandler Class Referenceabstract

This class is an interface which should be implemented by classes which wish to be able to load and save themselves using XML files. More...

#include <XMLTagHandler.h>

Inheritance diagram for XMLTagHandler:
[legend]

Public Member Functions

 XMLTagHandler ()
 
virtual ~XMLTagHandler ()
 
virtual bool HandleXMLTag (const wxChar *tag, const wxChar **attrs)=0
 
virtual void HandleXMLEndTag (const wxChar *WXUNUSED(tag))
 
virtual void HandleXMLContent (const wxString &WXUNUSED(content))
 
virtual XMLTagHandlerHandleXMLChild (const wxChar *tag)=0
 
bool ReadXMLTag (const char *tag, const char **attrs)
 
void ReadXMLEndTag (const char *tag)
 
void ReadXMLContent (const char *s, int len)
 
XMLTagHandlerReadXMLChild (const char *tag)
 

Detailed Description

This class is an interface which should be implemented by classes which wish to be able to load and save themselves using XML files.

Definition at line 80 of file XMLTagHandler.h.

Constructor & Destructor Documentation

◆ XMLTagHandler()

XMLTagHandler::XMLTagHandler ( )
inline

Definition at line 82 of file XMLTagHandler.h.

82 {};

◆ ~XMLTagHandler()

virtual XMLTagHandler::~XMLTagHandler ( )
inlinevirtual

Definition at line 83 of file XMLTagHandler.h.

83 {};

Member Function Documentation

◆ HandleXMLChild()

virtual XMLTagHandler* XMLTagHandler::HandleXMLChild ( const wxChar *  tag)
pure virtual

Implemented in WaveTrack, WaveClip, UpdateDataParser, TimeTrack, Tags, Sequence, ProjectFileIO, NoteTrack, LabelTrack, AUPImportFileHandle, FFmpegPresets, Envelope, VSTEffect, EffectEqualization, and CommandManager.

Referenced by ReadXMLChild().

Here is the caller graph for this function:

◆ HandleXMLContent()

virtual void XMLTagHandler::HandleXMLContent ( const wxString &  WXUNUSEDcontent)
inlinevirtual

Definition at line 102 of file XMLTagHandler.h.

102 {}

Referenced by ReadXMLContent().

Here is the caller graph for this function:

◆ HandleXMLEndTag()

virtual void XMLTagHandler::HandleXMLEndTag ( const wxChar *  WXUNUSEDtag)
inlinevirtual

Definition at line 97 of file XMLTagHandler.h.

97 {}

Referenced by AUPImportFileHandle::HandleXMLEndTag(), and ReadXMLEndTag().

Here is the caller graph for this function:

◆ HandleXMLTag()

virtual bool XMLTagHandler::HandleXMLTag ( const wxChar *  tag,
const wxChar **  attrs 
)
pure virtual

Implemented in WaveTrack, WaveClip, UpdateDataParser, TimeTrack, Tags, Sequence, ProjectFileIO, NoteTrack, LabelTrack, AUPImportFileHandle, FFmpegPresets, Envelope, EnvPoint, VSTEffect, EffectEqualization, and CommandManager.

Referenced by AUPImportFileHandle::HandleXMLTag(), and ReadXMLTag().

Here is the caller graph for this function:

◆ ReadXMLChild()

XMLTagHandler * XMLTagHandler::ReadXMLChild ( const char *  tag)

Definition at line 221 of file XMLTagHandler.cpp.

222 {
223  return HandleXMLChild(UTF8CTOWX(tag));
224 }

References HandleXMLChild(), and UTF8CTOWX.

Here is the call graph for this function:

◆ ReadXMLContent()

void XMLTagHandler::ReadXMLContent ( const char *  s,
int  len 
)

Definition at line 216 of file XMLTagHandler.cpp.

217 {
218  HandleXMLContent(wxString(s, wxConvUTF8, len));
219 }

References HandleXMLContent().

Here is the call graph for this function:

◆ ReadXMLEndTag()

void XMLTagHandler::ReadXMLEndTag ( const char *  tag)

Definition at line 211 of file XMLTagHandler.cpp.

212 {
214 }

References HandleXMLEndTag(), and UTF8CTOWX.

Here is the call graph for this function:

◆ ReadXMLTag()

bool XMLTagHandler::ReadXMLTag ( const char *  tag,
const char **  attrs 
)

Definition at line 187 of file XMLTagHandler.cpp.

188 {
189  wxArrayString tmp_attrs;
190 
191  while (*attrs) {
192  const char *s = *attrs++;
193  tmp_attrs.push_back(UTF8CTOWX(s));
194  }
195 
196 // JKC: Previously the next line was:
197 // const char **out_attrs = NEW char (const char *)[tmp_attrs.size()+1];
198 // however MSVC doesn't like the constness in this position, so this is now
199 // added by a cast after creating the array of pointers-to-non-const chars.
200  auto out_attrs = std::make_unique<const wxChar *[]>(tmp_attrs.size() + 1);
201  for (size_t i=0; i<tmp_attrs.size(); i++) {
202  out_attrs[i] = tmp_attrs[i];
203  }
204  out_attrs[tmp_attrs.size()] = 0;
205 
206  bool result = HandleXMLTag(UTF8CTOWX(tag), out_attrs.get());
207 
208  return result;
209 }

References HandleXMLTag(), and UTF8CTOWX.

Here is the call graph for this function:

The documentation for this class was generated from the following files:
XMLTagHandler::HandleXMLEndTag
virtual void HandleXMLEndTag(const wxChar *WXUNUSED(tag))
Definition: XMLTagHandler.h:97
XMLTagHandler::HandleXMLContent
virtual void HandleXMLContent(const wxString &WXUNUSED(content))
Definition: XMLTagHandler.h:102
UTF8CTOWX
#define UTF8CTOWX(X)
Definition: Internat.h:159
XMLTagHandler::HandleXMLTag
virtual bool HandleXMLTag(const wxChar *tag, const wxChar **attrs)=0
XMLTagHandler::HandleXMLChild
virtual XMLTagHandler * HandleXMLChild(const wxChar *tag)=0