decoder/dsdlib: add class DsdUint64
Merge lots of duplicate code.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#ifndef MPD_DECODER_DSDLIB_HXX
|
||||
#define MPD_DECODER_DSDLIB_HXX
|
||||
|
||||
#include "system/ByteOrder.hxx"
|
||||
#include "Compiler.h"
|
||||
|
||||
#include <stddef.h>
|
||||
@@ -35,6 +36,17 @@ struct DsdId {
|
||||
bool Equals(const char *s) const;
|
||||
};
|
||||
|
||||
class DsdUint64 {
|
||||
uint32_t lo;
|
||||
uint32_t hi;
|
||||
|
||||
public:
|
||||
constexpr uint64_t Read() const {
|
||||
return (uint64_t(FromLE32(hi)) << 32) |
|
||||
uint64_t(FromLE32(lo));
|
||||
}
|
||||
};
|
||||
|
||||
bool
|
||||
dsdlib_read(Decoder *decoder, InputStream &is,
|
||||
void *data, size_t length);
|
||||
|
||||
Reference in New Issue
Block a user