2 |
* * |
* * |
3 |
* libgig - C++ cross-platform Gigasampler format file access library * |
* libgig - C++ cross-platform Gigasampler format file access library * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003-2019 by Christian Schoenebeck * |
* Copyright (C) 2003-2020 by Christian Schoenebeck * |
6 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
150 |
} |
} |
151 |
|
|
152 |
/** |
/** |
153 |
|
* Stores a 64 bit integer in memory using little-endian format. |
154 |
|
* |
155 |
|
* @param pData - memory pointer |
156 |
|
* @param data - integer to be stored |
157 |
|
*/ |
158 |
|
inline void store64(uint8_t* pData, uint64_t data) { |
159 |
|
pData[0] = data; |
160 |
|
pData[1] = data >> 8; |
161 |
|
pData[2] = data >> 16; |
162 |
|
pData[3] = data >> 24; |
163 |
|
pData[4] = data >> 32; |
164 |
|
pData[5] = data >> 40; |
165 |
|
pData[6] = data >> 48; |
166 |
|
pData[7] = data >> 56; |
167 |
|
} |
168 |
|
|
169 |
|
/** |
170 |
* Loads a 16 bit integer in memory using little-endian format. |
* Loads a 16 bit integer in memory using little-endian format. |
171 |
* |
* |
172 |
* @param pData - memory pointer |
* @param pData - memory pointer |
434 |
: path1 + path2; |
: path1 + path2; |
435 |
} |
} |
436 |
|
|
437 |
|
/** |
438 |
|
* Returns a hex string representation of the binary data being passed. |
439 |
|
*/ |
440 |
|
inline std::string binToHexStr(const void* pData, size_t sz) { |
441 |
|
std::string s; |
442 |
|
for (size_t i = 0; i < sz; ++i) { |
443 |
|
s += strPrint("%02x", ((const char*)pData)[i]); |
444 |
|
} |
445 |
|
return s; |
446 |
|
} |
447 |
|
|
448 |
#endif // __LIBGIG_HELPER_H__ |
#endif // __LIBGIG_HELPER_H__ |