Kea 2.7.6
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.
 
size_t getPosition () const
 Return the line number being parsed in the pushed input sources.
 
size_t getSize () const
 Return the total size of the input sources pushed so far.
 
bool loadIncremental (size_t count_limit)
 Implementation of MasterLoader::loadIncremental()
 
void pushSource (const std::string &filename, const Name &current_origin)
 Wrapper around MasterLexer::pushSource() (file version)
 
void pushStreamSource (std::istream &stream)
 Wrapper around MasterLexer::pushSource() (stream version)
 

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 60 of file master_loader.cc.

Constructor & Destructor Documentation

◆ MasterLoaderImpl()

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 )
inline

Constructor.

Parameters
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.
Exceptions
std::bad_allocwhen there's not enough memory.

Definition at line 82 of file master_loader.cc.

Member Function Documentation

◆ getPosition()

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

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

See MasterLexer::getPosition().

Definition at line 157 of file master_loader.cc.

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

+ Here is the call graph for this function:

◆ getSize()

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

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

See MasterLexer::getTotalSourceSize().

Definition at line 151 of file master_loader.cc.

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

+ Here is the call graph for this function:

◆ loadIncremental()

bool isc::dns::MasterLoader::MasterLoaderImpl::loadIncremental ( size_t count_limit)

Implementation of MasterLoader::loadIncremental()

See MasterLoader::loadIncremental() for details.

Definition at line 614 of file master_loader.cc.

References isc::dns::rdata::createRdata(), isc::dns::MasterToken::END_OF_FILE, isc::dns::MasterToken::END_OF_LINE, isc::dns::MasterToken::getType(), isc_throw, isc_throw_assert, isc::dns::MasterToken::STRING, and isc::Exception::what().

+ Here is the call graph for this function:

◆ pushSource()

void isc::dns::MasterLoader::MasterLoaderImpl::pushSource ( const std::string & filename,
const Name & current_origin )
inline

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.

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

Definition at line 116 of file master_loader.cc.

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

+ Here is the call graph for this function:

◆ pushStreamSource()

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

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.

Parameters
streamThe input stream to use as a new source.

Definition at line 139 of file master_loader.cc.

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

+ Here is the call graph for this function:

Member Data Documentation

◆ complete_

bool isc::dns::MasterLoader::MasterLoaderImpl::complete_

Definition at line 529 of file master_loader.cc.

◆ rr_count_

size_t isc::dns::MasterLoader::MasterLoaderImpl::rr_count_

Definition at line 534 of file master_loader.cc.

◆ seen_error_

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

Definition at line 530 of file master_loader.cc.

◆ warn_rfc1035_ttl_

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

Definition at line 532 of file master_loader.cc.


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