Browse Source

*** empty log message ***

David Rose 25 years ago
parent
commit
024d774ccd
2 changed files with 14 additions and 0 deletions
  1. 13 0
      dtool/src/dconfig/notify.cxx
  2. 1 0
      dtool/src/dconfig/notify.h

+ 13 - 0
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

+ 1 - 0
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();