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 
12 
13 #include <vector>
14 struct XML_ParserStruct;
15 typedef struct XML_ParserStruct *XML_Parser;
16 
17 #include "XMLTagHandler.h"
18 #include "Internat.h" // for TranslatableString
19 
20 class AUDACITY_DLL_API XMLFileReader final {
21  public:
22  XMLFileReader();
23  ~XMLFileReader();
24 
25  bool Parse(XMLTagHandler *baseHandler,
26  const FilePath &fname);
27  bool ParseString(XMLTagHandler *baseHandler,
28  const wxString &xmldata);
29 
30  const TranslatableString &GetErrorStr() const;
31  const TranslatableString &GetLibraryErrorStr() const;
32 
33  // Callback functions for expat
34 
35  static void startElement(void *userData, const char *name,
36  const char **atts);
37 
38  static void endElement(void *userData, const char *name);
39 
40  static void charHandler(void *userData, const char *s, int len);
41 
42  private:
45  using Handlers = std::vector<XMLTagHandler*>;
49 };
FilePath
wxString FilePath
Definition: Identifier.h:227
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
XMLFileReader::mHandler
Handlers mHandler
Definition: XMLFileReader.h:46
XMLTagHandler.h
XMLFileReader::Handlers
std::vector< XMLTagHandler * > Handlers
Definition: XMLFileReader.h:45
XML_Parser
struct XML_ParserStruct * XML_Parser
Definition: XMLFileReader.h:15
XMLFileReader::mErrorStr
TranslatableString mErrorStr
Definition: XMLFileReader.h:47
name
const TranslatableString name
Definition: Distortion.cpp:98
XMLFileReader::mBaseHandler
XMLTagHandler * mBaseHandler
Definition: XMLFileReader.h:44
XMLTagHandler
This class is an interface which should be implemented by classes which wish to be able to load and s...
Definition: XMLTagHandler.h:80
Internat.h
XMLFileReader
Reads a file and passes the results through an XMLTagHandler.
Definition: XMLFileReader.h:20
XMLFileReader::mParser
XML_Parser mParser
Definition: XMLFileReader.h:43
XMLFileReader::mLibraryErrorStr
TranslatableString mLibraryErrorStr
Definition: XMLFileReader.h:48