title: how to use boost::iostreams::mapped_file_source with a gzipped input file
body: <p>I am using boost::iostreams::mapped_file_source to read a text file from a specific position to a specific position and to manipulate each line (compiled using g++ -Wall -O3 -lboost_iostreams -o test main.cpp):</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;boost/iostreams/device/mapped_file.hpp&gt;
  
  int main() {
      boost::iostreams::mapped_file_source f_read;
      f_read.open("in.txt");
  
      long long int alignment_offset(0);
  
      // set the start point
      const char* pt_current(f_read.data() + alignment_offset);
      // set the end point
      const char* pt_last(f_read.data() + f_read.size());
      const char* pt_current_line_start(pt_current);
  
      std::string buffer;
  
      while (pt_current &amp;&amp; (pt_current != pt_last)) {
          if ((pt_current = static_cast&lt;const char*&gt;(memchr(pt_current, '\n', pt_last - pt_current)))) {
              buffer.assign(pt_current_line_start, pt_current - pt_current_line_start + 1);
              // do something with buffer
  
              pt_current++;
              pt_current_line_start = pt_current;
          }
      }
  
      return 0;
  }
  </code></pre>
  
  <p>Currently, I would like to make this code handle gzip files as well and modify the code like this:</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;boost/iostreams/device/mapped_file.hpp&gt;
  #include&lt;boost/iostreams/filter/gzip.hpp&gt;
  #include&lt;boost/iostreams/filtering_streambuf.hpp&gt;
  #include&lt;boost/iostreams/filtering_stream.hpp&gt;
  #include&lt;boost/iostreams/stream.hpp&gt;
  
  int main() {
      boost::iostreams::stream&lt;boost::iostreams::mapped_file_source&gt; file;
      file.open(boost::iostreams::mapped_file_source("in.txt.gz"));
  
      boost::iostreams::filtering_streambuf&lt; boost::iostreams::input &gt; in; 
      in.push(boost::iostreams::gzip_decompressor());
      in.push(file);
  
      std::istream std_str(&amp;in);
      std::string buffer;
      while(1) {
          std::getline(std_str, buffer);
          if (std_str.eof()) break;
          // do something with buffer
      }   
  }   
  </code></pre>
  
  <p>This code also work well but I don't know how can set the start point (pt_current) and the end point (pt_last) like the first code. Could you let me know how I can set the two values in the second code?</p>