Audacity  3.0.3
XMLFileReader.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  XMLFileReader.h
6 
7  Dominic Mazzoni
8 
9 **********************************************************************/
10 
11 #include <vector>
12 struct XML_ParserStruct;
13 typedef struct XML_ParserStruct *XML_Parser;
14 
15 #include "XMLTagHandler.h"
16 #include "Internat.h" // for TranslatableString
17 
18 class XML_API XMLFileReader final {
19  public:
20  XMLFileReader();
21  ~XMLFileReader();
22 
23  bool Parse(XMLTagHandler *baseHandler,
24  const FilePath &fname);
25  bool ParseString(XMLTagHandler *baseHandler,
26  const wxString &xmldata);
27 
28  const TranslatableString &GetErrorStr() const;
29  const TranslatableString &GetLibraryErrorStr() const;
30 
31  // Callback functions for expat
32 
33  static void startElement(void *userData, const char *name,
34  const char **atts);
35 
36  static void endElement(void *userData, const char *name);
37 
38  static void charHandler(void *userData, const char *s, int len);
39 
40  private:
43  using Handlers = std::vector<XMLTagHandler*>;
47 };
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
XMLFileReader::mHandler
Handlers mHandler
Definition: XMLFileReader.h:44
XMLTagHandler.h
FilePath
wxString FilePath
Definition: Project.h:20
XMLFileReader::Handlers
std::vector< XMLTagHandler * > Handlers
Definition: XMLFileReader.h:43
XML_Parser
struct XML_ParserStruct * XML_Parser
Definition: XMLFileReader.h:13
XMLFileReader::mErrorStr
TranslatableString mErrorStr
Definition: XMLFileReader.h:45
name
const TranslatableString name
Definition: Distortion.cpp:98
XMLFileReader::mBaseHandler
XMLTagHandler * mBaseHandler
Definition: XMLFileReader.h:42
XMLTagHandler
This class is an interface which should be implemented by classes which wish to be able to load and s...
Definition: XMLTagHandler.h:62
Internat.h
XMLFileReader
Reads a file and passes the results through an XMLTagHandler.
Definition: XMLFileReader.h:18
XMLFileReader::mParser
XML_Parser mParser
Definition: XMLFileReader.h:41
XMLFileReader::mLibraryErrorStr
TranslatableString mLibraryErrorStr
Definition: XMLFileReader.h:46