mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
Work on d_a_title (#2215)
This commit is contained in:
@@ -62,6 +62,7 @@ struct TParse_header_block {
|
||||
|
||||
template <typename T>
|
||||
struct TParseValue_raw_ {
|
||||
typedef T ParseType;
|
||||
static T parse(const void* data) { return *(T*)data; }
|
||||
};
|
||||
|
||||
@@ -83,6 +84,24 @@ struct TParseValue : public Parser<T> {
|
||||
}
|
||||
};
|
||||
|
||||
template<class Parser, int size>
|
||||
struct TValueIterator {
|
||||
TValueIterator(const void* begin) {
|
||||
mBegin = begin;
|
||||
}
|
||||
|
||||
typename Parser::ParseType operator*() {
|
||||
return *(typename Parser::ParseType*)mBegin;
|
||||
}
|
||||
|
||||
const void* mBegin;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct TValueIterator_raw : public TValueIterator<TParseValue_raw_<u8>, 1> {
|
||||
TValueIterator_raw(const void* begin) : TValueIterator<TParseValue_raw_<u8>, 1>(begin) {}
|
||||
};
|
||||
|
||||
} // namespace binary
|
||||
} // namespace JGadget
|
||||
|
||||
|
||||
Reference in New Issue
Block a user