-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathAxmlParser.h
67 lines (49 loc) · 1.55 KB
/
AxmlParser.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* AXML Parser
* https://github.com/claudxiao/AndTools
* Claud Xiao <[email protected]>
*/
#ifndef AXMLPARSER_H
#define AXMLPARSER_H
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
extern uint32_t g_styleDataOff; //style数据块的起始地址
extern uint32_t g_appTag_nameOff; //保存application tag中的tagname成员较文件头的偏移值,tagname成员的值为一个字符串索引。
//我们可以根据该偏移值进行attribution插入和相关修改操作。
extern uint32_t g_curStringCount; //保存当前stringChunk总共含有的string个数
extern uint32_t g_appURIindex; //保存application所属命名空间的uri索引值
extern uint32_t g_res_ChunkSizeOffset; //保存resourcesChunk的chunksize偏移值
typedef enum{
AE_STARTDOC = 0,
AE_ENDDOC,
AE_STARTTAG,
AE_ENDTAG,
AE_TEXT,
AE_ERROR,
} AxmlEvent_t;
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
void *AxmlOpen(char *buffer, size_t size);
AxmlEvent_t AxmlNext(void *axml);
char *AxmlGetTagPrefix(void *axml);
char *AxmlGetTagName(void *axml);
int AxmlNewNamespace(void *axml);
char *AxmlGetNsPrefix(void *axml);
char *AxmlGetNsUri(void *axml);
uint32_t AxmlGetAttrCount(void *axml);
char *AxmlGetAttrPrefix(void *axml, uint32_t i);
char *AxmlGetAttrName(void *axml, uint32_t i);
char *AxmlGetAttrValue(void *axml, uint32_t i);
char *AxmlGetText(void *axml);
int AxmlClose(void *axml);
int AxmlToXml(char **outbuf, size_t *outsize, char *inbuf, size_t insize);
#ifdef __cplusplus
#if __cplusplus
};
#endif
#endif
#endif