/[svn]/libgig/trunk/src/RIFF.cpp
ViewVC logotype

Diff of /libgig/trunk/src/RIFF.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2155 by persson, Thu Jan 6 11:33:40 2011 UTC revision 2450 by persson, Wed May 8 17:53:07 2013 UTC
# Line 2  Line 2 
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  *
# Line 595  namespace RIFF { Line 595  namespace RIFF {
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

Legend:
Removed from v.2155  
changed lines
  Added in v.2450

  ViewVC Help
Powered by ViewVC