|
@@ -35,8 +35,8 @@ namespace dns {
|
|
|
///
|
|
|
/// In order to support the $INCLUDE notation, this class is designed to be
|
|
|
/// able to operate on multiple files or input streams in the nested way.
|
|
|
-/// The \c open() and \c close() methods correspond to the push and pop
|
|
|
-/// operations.
|
|
|
+/// The \c pushSource() and \c popSource() methods correspond to the push
|
|
|
+/// and pop operations.
|
|
|
///
|
|
|
/// While this class is public, it is less likely to be used by normal
|
|
|
/// applications; it's mainly expected to be used within this library,
|
|
@@ -58,14 +58,14 @@ public:
|
|
|
|
|
|
/// \brief Open a file and make it the current input source of MasterLexer.
|
|
|
///
|
|
|
- /// The opened file can be explicitly closed by the \c close() method;
|
|
|
- /// if \c close() is not called within the lifetime of the \c MasterLexer,
|
|
|
- /// it will be closed in the destructor.
|
|
|
+ /// The opened file can be explicitly closed by the \c popSource() method;
|
|
|
+ /// if \c popSource() is not called within the lifetime of the
|
|
|
+ /// \c MasterLexer, it will be closed in the destructor.
|
|
|
///
|
|
|
/// \throw InvalidParameter filename is NULL
|
|
|
/// \throw some_other The specified cannot be opened
|
|
|
/// \param filename A non NULL string specifying a master file
|
|
|
- void open(const char* filename);
|
|
|
+ void pushSource(const char* filename);
|
|
|
|
|
|
/// \brief Make the given stream the current input source of MasterLexer.
|
|
|
///
|
|
@@ -73,29 +73,30 @@ public:
|
|
|
/// caller's responsibility to keep it valid as long as it's used in
|
|
|
/// \c MasterLexer or to release any resource for the stream after that.
|
|
|
/// The caller can explicitly tell \c MasterLexer to stop using the
|
|
|
- /// stream by calling the \c close() method.
|
|
|
+ /// stream by calling the \c popSource() method.
|
|
|
///
|
|
|
/// \param input An input stream object that produces textual
|
|
|
/// representation of DNS RRs.
|
|
|
- void open(std::istream& input);
|
|
|
+ void pushSource(std::istream& input);
|
|
|
|
|
|
- /// \brief Close the most recently opened input source (file or stream).
|
|
|
+ /// \brief Stop using the most recently opened input source (file or
|
|
|
+ /// stream).
|
|
|
///
|
|
|
- /// If it's a file, the opened file will be literally closed.
|
|
|
+ /// If it's a file, the previously opened file will be closed internally.
|
|
|
/// If it's a stream, \c MasterLexer will simply stop using
|
|
|
/// the stream; the caller can assume it will be never used in
|
|
|
/// \c MasterLexer thereafter.
|
|
|
///
|
|
|
- /// This method must not be called when there is no opened source for
|
|
|
+ /// This method must not be called when there is no source pushed for
|
|
|
/// \c MasterLexer. This method is otherwise exception free.
|
|
|
///
|
|
|
- /// \throw isc::InvalidOperation Called with no opened source.
|
|
|
- void close();
|
|
|
+ /// \throw isc::InvalidOperation Called with no pushed source.
|
|
|
+ void popSource();
|
|
|
|
|
|
/// \brief Return the name of the current input source name.
|
|
|
///
|
|
|
/// If it's a file, it will be the C string given at the corresponding
|
|
|
- /// \c open() call, that is, its filename. If it's a stream, it will
|
|
|
+ /// \c pushSource() call, that is, its filename. If it's a stream, it will
|
|
|
/// be formatted as \c "stream-%p" where \c %p is hex representation
|
|
|
/// of the address of the stream object.
|
|
|
///
|