| 1 | #pragma once |
| 2 | |
| 3 | #include <basis/seadTypes.h> |
| 4 | #include <stream/seadStream.h> |
| 5 | |
| 6 | namespace al { |
| 7 | class { |
| 8 | public: |
| 9 | u16 () const; |
| 10 | bool () const; |
| 11 | u16 () const; |
| 12 | u32 () const; |
| 13 | u32 () const; |
| 14 | u32 () const; |
| 15 | |
| 16 | private: |
| 17 | union { |
| 18 | s32 ; |
| 19 | u16 , ; // unusable due to different loading mechanisms |
| 20 | }; |
| 21 | |
| 22 | s32 ; |
| 23 | s32 ; |
| 24 | s32 ; |
| 25 | }; |
| 26 | |
| 27 | class ByamlStringTableIter { |
| 28 | public: |
| 29 | ByamlStringTableIter(); |
| 30 | ByamlStringTableIter(const u8* data, bool isRev); |
| 31 | |
| 32 | s32 getSize() const; |
| 33 | const u32* getAddressTable() const; |
| 34 | u32 getStringAddress(s32 index) const; |
| 35 | u32 getEndAddress() const; |
| 36 | const char* getString(s32 index) const; |
| 37 | s32 getStringSize(s32 index) const; |
| 38 | s32 findStringIndex(const char* str) const; |
| 39 | bool isValidate() const; |
| 40 | |
| 41 | private: |
| 42 | const u8* mData = nullptr; |
| 43 | bool mIsRev = false; |
| 44 | }; |
| 45 | } // namespace al |
| 46 | |
| 47 | namespace alByamlLocalUtil { |
| 48 | |
| 49 | const char* getDataTypeString(s32 type); |
| 50 | al::ByamlStringTableIter getHashKeyTable(const u8* data); |
| 51 | al::ByamlStringTableIter getStringTable(const u8* data); |
| 52 | u64 getData64Bit(const u8* data, u32 off, bool isRev); |
| 53 | void writeU24(sead::WriteStream* stream, s32 val); |
| 54 | bool verifiByaml(const u8* data); |
| 55 | bool (const u8* data); |
| 56 | bool verifiByamlStringTable(const u8* data, bool isRev); |
| 57 | |
| 58 | } // namespace alByamlLocalUtil |
| 59 | |