Added XML Parser.

This commit is contained in:
2021-09-12 11:28:39 -07:00
parent 4f705ad278
commit ecd5c0c47c
6 changed files with 276 additions and 0 deletions

View File

@ -34,6 +34,7 @@
// File / Asset Management
#include "file/asset.h"
#include "file/csv.h"
#include "file/xml.h"
// Game Logic
#include "game/game.h"

35
include/dawn/file/xml.h Normal file
View File

@ -0,0 +1,35 @@
// Copyright (c) 2021 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "../libs.h"
#define XML_DOING_NOTHING 0x00
#define XML_PARSING_TAG_NAME 0x01
#define XML_LOOKING_FOR_ATTRIBUTE 0x02
#define XML_PARSING_ATTRIBUTE_NAME 0x03
#define XML_LOOKING_FOR_ATTRIBUTE_VALUE 0x04
#define XML_PARSING_ATTRIBUTE_VALUE 0x05
#define XML_PARSING_VALUE 0x06
#define XML_PARSING_CHILD 0x07
#define XML_PARSING_CLOSE 0x08
#define XML_TEXT_BUFFER_MAX 256
#define XML_CHILD_COUNT_MAX 16
#define XML_ATTRIBUTE_MAX 16
typedef struct _xml_t xml_t;
typedef struct _xml_t {
char *node;
char *value;
char *attributeNames[XML_ATTRIBUTE_MAX];
char *attributeDatas[XML_ATTRIBUTE_MAX];
uint8_t attributeCount;
xml_t *children;
uint8_t childrenCount;
} xml_t;