blob: fe5db2056752ebbc0fb46bab4e06a24fa429ba55 (
plain)
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
|
#include "KingSystem/Utils/Byaml/ByamlArrayIter.h"
#include "KingSystem/Utils/Byaml/Byaml.h"
#include "KingSystem/Utils/Byaml/ByamlData.h"
#include "KingSystem/Utils/Byaml/ByamlLocal.h"
namespace al {
ByamlArrayIter::ByamlArrayIter(const u8* data) {
mData = data;
}
const u32* ByamlArrayIter::getDataTable() const {
return reinterpret_cast<const u32*>(&mData[TypeTableOffset + getDataOffset()]);
}
bool ByamlArrayIter::getDataByIndex(ByamlData* data, s32 index) {
if (index < 0) {
return false;
}
if (index >= ByamlLocalUtil::getContainerSize(mData)) {
return false;
}
data->setType(ByamlType(mData[TypeTableOffset + index]));
data->setValue(getDataTable()[index]);
return true;
}
} // namespace al
|