title: Access protocol buffers extension fields
body: <p>I am working with protocol buffers in C++. My message has only one extension range. And I want to access all the extension fields without knowing their name, using only their numbers. How can I do this??</p>
  
  <pre><code>message Base {
      optional int32 id = 1;
      extensions 1000 to 1999;     
  }
  
  extend Base{
      optional int32 id2 = 1000;
  }
  </code></pre>
  
  <p>Up till now, I have obtained ExtensionRange.</p>
  
  <pre><code>const google::protobuf::Descriptor::ExtensionRange* rng = desc-&gt;extension_range(0);
  std::cerr &lt;&lt; "rng " &lt;&lt; rng-&gt;start &lt;&lt; " " &lt;&lt; rng-&gt;end &lt;&lt; std::endl;
  </code></pre>
  
  <p>But I donot know to to get the <code>Fielddescriptor*</code> of the extensions.  </p>
  
  <p>There is one weird thing and that is <code>extension_count()</code> is returning 0.   Although I have used extension in my .proto file. Similarly FindExtensionBy[Name/number] are not working as expected? </p>