]> granicus.if.org Git - pdns/commitdiff
more methods to get line number of an error from the zoneparser
authorbert hubert <bert.hubert@netherlabs.nl>
Fri, 29 Jan 2016 10:41:15 +0000 (11:41 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Fri, 29 Jan 2016 10:41:15 +0000 (11:41 +0100)
pdns/zoneparser-tng.cc
pdns/zoneparser-tng.hh

index 569aef0db468cff8a93143cf4f23abe643051bff..eedbc1c66648b9c43e457ac73457b417a256265f 100644 (file)
@@ -249,6 +249,11 @@ string ZoneParserTNG::getLineOfFile()
   return "on line "+std::to_string(d_filestates.top().d_lineno)+" of file '"+d_filestates.top().d_filename+"'";
 }
 
+pair<string,int> ZoneParserTNG::getLineNumAndFile()
+{
+  return {d_filestates.top().d_filename, d_filestates.top().d_lineno};
+}
+
 // ODD: this function never fills out the prio field! rest of pdns compensates though
 bool ZoneParserTNG::get(DNSResourceRecord& rr, std::string* comment) 
 {
index 94fea3b2e8283ba06307a2c0492f59cf8d00c98f..64d36c6d862d2256645b7f43f3c1b0406577f441 100644 (file)
@@ -40,7 +40,8 @@ public:
   typedef runtime_error exception;
   typedef deque<pair<string::size_type, string::size_type> > parts_t;
   DNSName getZoneName();
-  string getLineOfFile();
+  string getLineOfFile(); // for error reporting purposes
+  pair<string,int> getLineNumAndFile(); // idem
 private:
   bool getLine();
   bool getTemplateLine();