title: How to parse a tar file in C++
body: <p>What I want to do is download a .tar file with multiple directories with 2 files each. The problem is I can't find a way to read the tar file without actually extracting the files (using <code>tar</code>).</p>
  
  <p>The perfect solution would be something like:</p>
  
  <pre><code>#include &lt;easytar&gt;
  
  Tarfile tar("somefile.tar");
  std::string currentFile, currentFileName;
  for(int i=0; i&lt;tar.size(); i++){
    file = tar.getFileText(i);
    currentFileName = tar.getFileName(i);
    // do stuff with it
  }
  </code></pre>
  
  <p>I'm probably going to have to write this myself, but any ideas would be appreciated..</p>