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 62 of file XMLTagHandler.h.

Constructor & Destructor Documentation

◆ XMLTagHandler()

XMLTagHandler::XMLTagHandler ( )
inline

Definition at line 64 of file XMLTagHandler.h.

64 {};

◆ ~XMLTagHandler()

virtual XMLTagHandler::~XMLTagHandler ( )
inlinevirtual

Definition at line 65 of file XMLTagHandler.h.

65 {};

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 84 of file XMLTagHandler.h.

84 {}

Referenced by ReadXMLContent().

Here is the caller graph for this function:

◆ HandleXMLEndTag()

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

Definition at line 79 of file XMLTagHandler.h.

79 {}

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 203 of file XMLTagHandler.cpp.

204 {
205  return HandleXMLChild(UTF8CTOWX(tag));
206 }

References HandleXMLChild(), and UTF8CTOWX.

Here is the call graph for this function:

◆ ReadXMLContent()

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

Definition at line 198 of file XMLTagHandler.cpp.

199 {
200  HandleXMLContent(wxString(s, wxConvUTF8, len));
201 }

References HandleXMLContent().

Here is the call graph for this function:

◆ ReadXMLEndTag()

void XMLTagHandler::ReadXMLEndTag ( const char *  tag)

Definition at line 193 of file XMLTagHandler.cpp.

194 {
196 }

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 169 of file XMLTagHandler.cpp.

170 {
171  wxArrayString tmp_attrs;
172 
173  while (*attrs) {
174  const char *s = *attrs++;
175  tmp_attrs.push_back(UTF8CTOWX(s));
176  }
177 
178 // JKC: Previously the next line was:
179 // const char **out_attrs = NEW char (const char *)[tmp_attrs.size()+1];
180 // however MSVC doesn't like the constness in this position, so this is now
181 // added by a cast after creating the array of pointers-to-non-const chars.
182  auto out_attrs = std::make_unique<const wxChar *[]>(tmp_attrs.size() + 1);
183  for (size_t i=0; i<tmp_attrs.size(); i++) {
184  out_attrs[i] = tmp_attrs[i];
185  }
186  out_attrs[tmp_attrs.size()] = 0;
187 
188  bool result = HandleXMLTag(UTF8CTOWX(tag), out_attrs.get());
189 
190  return result;
191 }

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:79
XMLTagHandler::HandleXMLContent
virtual void HandleXMLContent(const wxString &WXUNUSED(content))
Definition: XMLTagHandler.h:84
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