diff --git a/dtool/src/dconfig/notify.cxx b/dtool/src/dconfig/notify.cxx index 1d349a9a9b..942baa01a4 100644 --- a/dtool/src/dconfig/notify.cxx +++ b/dtool/src/dconfig/notify.cxx @@ -332,6 +332,19 @@ null() { return *(ptr()->_null_ostream_ptr); } +//////////////////////////////////////////////////////////////////// +// Function: Notify::write_string +// Access: Public, Static +// Description: A convenient way for scripting languages, which may +// know nothing about ostreams, to write to Notify. +// This writes a single string, followed by an implicit +// newline, to the Notify output stream. +//////////////////////////////////////////////////////////////////// +void Notify:: +write_string(const string &str) { + out() << str << "\n"; +} + //////////////////////////////////////////////////////////////////// // Function: Notify::ptr // Access: Public, Static diff --git a/dtool/src/dconfig/notify.h b/dtool/src/dconfig/notify.h index ccfd9e1e3c..5147ea4c37 100644 --- a/dtool/src/dconfig/notify.h +++ b/dtool/src/dconfig/notify.h @@ -58,6 +58,7 @@ PUBLISHED: static ostream &out(); static ostream &null(); + static void write_string(const string &str); static Notify *ptr(); static long get_literal_flag();