util.h 801 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include "foundation/types.h"
  3. namespace ID3v2
  4. {
  5. namespace Util
  6. {
  7. /* pass a value you read as if it was a 32bit integer */
  8. uint32_t Int28To32(uint32_t val);
  9. uint32_t Int32To28(uint32_t val);
  10. // returns input bytes used
  11. size_t UnsynchroniseTo(void *output, const void *input, size_t output_bytes);
  12. // returns number of real bytes required to read 'bytes' data
  13. size_t UnsynchronisedInputSize(const void *input, size_t output_bytes);
  14. size_t UnsynchronisedOutputSize(const void *input, size_t input_bytes);
  15. // returns output bytes used
  16. size_t SynchroniseTo(void *output, const void *input, size_t bytes);
  17. // returns number of bytes required to store synchronized version of 'data' (bytes long)
  18. size_t SynchronisedSize(const void *data, size_t bytes);
  19. }
  20. }