diff --git a/qse/include/qse/sed/Sed.hpp b/qse/include/qse/sed/Sed.hpp index 34098537..0d176cd4 100644 --- a/qse/include/qse/sed/Sed.hpp +++ b/qse/include/qse/sed/Sed.hpp @@ -1,5 +1,5 @@ /* - * $Id: Sed.hpp 558 2011-09-02 15:27:44Z hyunghwan.chung $ + * $Id: Sed.hpp 571 2011-09-20 14:04:48Z hyunghwan.chung $ * Copyright 2006-2011 Chung, Hyung-Hwan. This file is part of QSE. @@ -202,6 +202,20 @@ public: /// int execute (Stream& iostream); + + /// + /// The stop() function makes a request to break a running loop + /// inside execute(). Note that this does not affect blocking + /// operations in user-defined stream handlers. + /// + void stop (); + + /// + /// The isStop() function returns true if stop() has been called + /// since the last call to execute(), false otherwise. + /// + bool isStop () const; + /// /// The getOption() function gets the current options. /// @return 0 or current options ORed of #option_t enumerators. diff --git a/qse/lib/sed/Sed.cpp b/qse/lib/sed/Sed.cpp index d6270bef..6ce89cd6 100644 --- a/qse/lib/sed/Sed.cpp +++ b/qse/lib/sed/Sed.cpp @@ -1,5 +1,5 @@ /* - * $Id: Sed.cpp 558 2011-09-02 15:27:44Z hyunghwan.chung $ + * $Id: Sed.cpp 571 2011-09-20 14:04:48Z hyunghwan.chung $ * Copyright 2006-2011 Chung, Hyung-Hwan. This file is part of QSE. @@ -68,6 +68,18 @@ int Sed::execute (Stream& iostream) return qse_sed_exec (sed, xin, xout); } +void Sed::stop () +{ + QSE_ASSERT (sed != QSE_NULL); + return qse_sed_stop (sed); +} + +bool Sed::isStop () const +{ + QSE_ASSERT (sed != QSE_NULL); + return qse_sed_isstop (sed); +} + int Sed::getOption() const { QSE_ASSERT (sed != QSE_NULL);