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-2011 by Christian Schoenebeck * |
* Copyright (C) 2003-2013 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 * |
595 |
} |
} |
596 |
|
|
597 |
/** |
/** |
598 |
|
* Reads a null-padded string of size characters and copies it |
599 |
|
* into the string \a s. The position within the chunk will |
600 |
|
* automatically be incremented. |
601 |
|
* |
602 |
|
* @param s destination string |
603 |
|
* @param size number of characters to read |
604 |
|
* @throws RIFF::Exception if an error occured or less than |
605 |
|
* \a size characters could be read! |
606 |
|
*/ |
607 |
|
void Chunk::ReadString(String& s, int size) { |
608 |
|
char* buf = new char[size]; |
609 |
|
ReadSceptical(buf, 1, size); |
610 |
|
s.assign(buf, std::find(buf, buf + size, '\0')); |
611 |
|
delete[] buf; |
612 |
|
} |
613 |
|
|
614 |
|
/** |
615 |
* Writes \a WordCount number of 32 Bit unsigned integer words from the |
* Writes \a WordCount number of 32 Bit unsigned integer words from the |
616 |
* buffer pointed by \a pData to the chunk's body, directly to the |
* buffer pointed by \a pData to the chunk's body, directly to the |
617 |
* actual "physical" file. The position within the chunk will |
* actual "physical" file. The position within the chunk will |