Kea  1.9.9-git
isc::dns::MasterLoader::MasterLoaderImpl Class Reference

Private implementation class for the MasterLoader. More...

Public Member Functions

 MasterLoaderImpl (const char *master_file, const Name &zone_origin, const RRClass &zone_class, const MasterLoaderCallbacks &callbacks, const AddRRCallback &add_callback, MasterLoader::Options options)
 Constructor. More...
size_t getPosition () const
 Return the line number being parsed in the pushed input sources. More...
size_t getSize () const
 Return the total size of the input sources pushed so far. More...
bool loadIncremental (size_t count_limit)
 Implementation of MasterLoader::loadIncremental() More...
void pushSource (const std::string &filename, const Name &current_origin)
 Wrapper around MasterLexer::pushSource() (file version) More...
void pushStreamSource (std::istream &stream)
 Wrapper around MasterLexer::pushSource() (stream version) More...

Public Attributes

bool complete_
size_t rr_count_
bool seen_error_
bool warn_rfc1035_ttl_

Detailed Description

Private implementation class for the MasterLoader.

This class is used internally by the MasterLoader and is not publicly visible. It is present to avoid polluting the public API with internal implementation details of the MasterLoader.

Definition at line 59 of file

Constructor & Destructor Documentation

isc::dns::MasterLoader::MasterLoaderImpl::MasterLoaderImpl ( const char *  master_file,
const Name zone_origin,
const RRClass zone_class,
const MasterLoaderCallbacks callbacks,
const AddRRCallback add_callback,
MasterLoader::Options  options 


master_filePath to the file to load.
zone_originThe origin of zone to be expected inside the master file. Currently unused, but it is expected to be used for some validation.
zone_classThe class of zone to be expected inside the master file.
callbacksThe callbacks by which it should report problems. Usually, the callback carries a filename and line number of the input where the problem happens. There's a special case of empty filename and zero line in case the opening of the top-level master file fails.
add_callbackThe callback which would be called with each loaded RR.
optionsOptions for the parsing, which is bitwise-or of the Options values or DEFAULT. If the MANY_ERRORS option is included, the parser tries to continue past errors. If it is not included, it stops at first encountered error.
std::bad_allocwhen there's not enough memory.

Definition at line 81 of file

Member Function Documentation

size_t isc::dns::MasterLoader::MasterLoaderImpl::getPosition ( ) const

Return the line number being parsed in the pushed input sources.

See MasterLexer::getPosition().

Definition at line 154 of file

References isc::dns::MasterLexer::getPosition().

Referenced by isc::dns::MasterLoader::getPosition().

+ Here is the call graph for this function:

size_t isc::dns::MasterLoader::MasterLoaderImpl::getSize ( ) const

Return the total size of the input sources pushed so far.

See MasterLexer::getTotalSourceSize().

Definition at line 150 of file

References isc::dns::MasterLexer::getTotalSourceSize().

Referenced by isc::dns::MasterLoader::getSize().

+ Here is the call graph for this function:

bool isc::dns::MasterLoader::MasterLoaderImpl::loadIncremental ( size_t  count_limit)
void isc::dns::MasterLoader::MasterLoaderImpl::pushSource ( const std::string &  filename,
const Name current_origin 

Wrapper around MasterLexer::pushSource() (file version)

This method is used as a wrapper around the lexer's pushSource() to also save the current origin and the last seen name (to be restored upon popSource()). It also calls pushSource(). See doInclude() implementation for more details.

filenamePath to the file to push as a new source.
current_originThe current origin name to save.

Definition at line 115 of file

References isc::db::error, isc_throw, and isc::dns::MasterLexer::pushSource().

+ Here is the call graph for this function:

void isc::dns::MasterLoader::MasterLoaderImpl::pushStreamSource ( std::istream &  stream)

Wrapper around MasterLexer::pushSource() (stream version)

Similar to pushSource(). This method need not save the current origin as it is not used with $INCLUDE processing.

streamThe input stream to use as a new source.

Definition at line 138 of file

References isc::dns::MasterLexer::pushSource().

Referenced by isc::dns::MasterLoader::MasterLoader().

+ Here is the call graph for this function:

Member Data Documentation

bool isc::dns::MasterLoader::MasterLoaderImpl::complete_
size_t isc::dns::MasterLoader::MasterLoaderImpl::rr_count_

Definition at line 547 of file

bool isc::dns::MasterLoader::MasterLoaderImpl::seen_error_

Definition at line 543 of file

Referenced by isc::dns::MasterLoader::loadedSuccessfully().

bool isc::dns::MasterLoader::MasterLoaderImpl::warn_rfc1035_ttl_

Definition at line 545 of file

The documentation for this class was generated from the following file: