1/* 2 * Copyright 2003-2007 Marcus Overhagen 3 * Copyright 2007 Haiku Inc. All rights reserved. 4 * Distributed under the terms of the MIT License. 5 */ 6#ifndef _BYTE_SWAP_H 7#define _BYTE_SWAP_H 8 9 10#include <SupportDefs.h> 11 12 13class ByteSwap { 14public: 15 ByteSwap(uint32 format); 16 ~ByteSwap(); 17 18 void Swap(void *buffer, size_t bytecount); 19 20private: 21 void (*fFunc)(void *, size_t); 22}; 23 24 25inline void 26ByteSwap::Swap(void *buffer, size_t bytecount) 27{ 28 (*fFunc)(buffer, bytecount); 29} 30 31#endif // _BYTE_SWAP_H 32