diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Wasabi/api/xml/xmlwrite.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Wasabi/api/xml/xmlwrite.h')
-rw-r--r-- | Src/Wasabi/api/xml/xmlwrite.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Src/Wasabi/api/xml/xmlwrite.h b/Src/Wasabi/api/xml/xmlwrite.h new file mode 100644 index 00000000..b4c55868 --- /dev/null +++ b/Src/Wasabi/api/xml/xmlwrite.h @@ -0,0 +1,45 @@ +#ifndef _XML_H +#define _XML_H + +#include <bfc/wasabi_std.h> +#include <bfc/stack.h> +#include <bfc/string/StringW.h> + +class XMLWrite +{ +public: + XMLWrite(const wchar_t *filename, const wchar_t *doctype, const wchar_t *dtddoctype = NULL, int no_hi_chars_conversion = 0); + XMLWrite(FILE *file, const wchar_t *doctype, const wchar_t *dtddoctype = NULL, int no_hi_chars_conversion = 0); + ~XMLWrite(); + + void Init(FILE *file, const wchar_t *doctype, const wchar_t *dtddoctype); + + void comment(const wchar_t *comment); + + void pushCategory(const wchar_t *title, int wantcr = 1, int wantindent = 1); + + void pushCategoryAttrib(const wchar_t *title, int nodata = FALSE); + void writeCategoryAttrib(const wchar_t *title, const int val); + void writeCategoryAttrib(const wchar_t *title, const wchar_t *val); + void closeCategoryAttrib(int wantcr = 1); + + void writeAttribEmpty(const wchar_t *title, int wantcr = 1, int wantindent = 1); + void writeAttrib(const wchar_t *title, const wchar_t *text, int wantcr = 1, int wantindent = 1); + void writeAttrib(const wchar_t *title, int val, int wantcr = 1, int wantindent = 1); + int popCategory(int wantcr = 1, int wantindent = 1); // returns nonzero if more categories are open + + static int efprintf(FILE *fp, const wchar_t *format, ...); + static int utf8fprintf(FILE *fp, const wchar_t *format, ...); + static int eutf8fprintf(FILE *fp, const wchar_t *format, ...); + +private: + FILE *fp; + StringW indenter; +// int indent; + Stack<wchar_t *>titles; + int nohicharconversion; +}; + + + +#endif |