-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathlibxml-syntax-error.h
More file actions
36 lines (28 loc) · 849 Bytes
/
libxml-syntax-error.h
File metadata and controls
36 lines (28 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef LIBXML_SYNTAX_ERROR
#define LIBXML_SYNTAX_ERROR
#include <libxml/xmlerror.h>
#include "libxml.h"
class XmlSyntaxError
{
static uint32_t maxError;
public:
static Napi::Env* env;
static void ChangeMaxNumberOfError(int max);
static uint32_t GetMaxNumberOfError();
// push xmlError onto Napi::Array
static void PushToArray(void *errs, xmlError *error);
static void PushToArray(Napi::Array& errs, const char* errorMessage);
// create a Napi object for the syntax eror
static Napi::Value BuildSyntaxError(xmlError *error, Napi::Env env);
};
class MaxErrorNumberRestorer {
public:
MaxErrorNumberRestorer();
~MaxErrorNumberRestorer();
private:
uint32_t max;
MaxErrorNumberRestorer(MaxErrorNumberRestorer const &) = delete;
void operator=(MaxErrorNumberRestorer const &) = delete;
};
// LIBXML_SYNTAX_ERROR
#endif