added the Awk::onDemise() callback

This commit is contained in:
2015-03-12 02:08:51 +00:00
parent a212a8ebf2
commit 47a7baeb7d
4 changed files with 62 additions and 6 deletions

View File

@ -967,6 +967,13 @@ public:
///
void close ();
///
/// The uponClose() function is called back after Awk::close()
/// has cleared most of the internal data but before destroying
/// the underlying awk object.
///
virtual void uponDemise () {}
///
/// The parse() function parses the source code read from the input
/// stream \a in and writes the parse tree to the output stream \a out.

View File

@ -88,12 +88,15 @@ public:
const char_t* ptr;
};
StdAwk (Mmgr* mmgr = QSE_NULL): Awk(mmgr), console_cmgr(QSE_NULL)
StdAwk (Mmgr* mmgr = QSE_NULL): Awk(mmgr), stdmod_up(false), console_cmgr(QSE_NULL)
{
}
int open ();
void close ();
void uponDemise ();
Run* parse (Source& in, Source& out);
/// The setConsoleCmgr() function sets the encoding type of
@ -164,6 +167,7 @@ protected:
protected:
qse_htb_t cmgrtab;
bool cmgrtab_inited;
bool stdmod_up;
qse_cmgr_t* console_cmgr;