Expose DatagramOutputFile to Python, add props to DatagramSink

This commit is contained in:
rdb 2017-09-17 01:38:59 +02:00
parent b8cb517152
commit 35349b6224
2 changed files with 11 additions and 2 deletions

View File

@ -40,6 +40,10 @@ PUBLISHED:
virtual const Filename &get_filename();
virtual const FileReference *get_file();
virtual streampos get_file_pos();
MAKE_PROPERTY(filename, get_filename);
MAKE_PROPERTY(file, get_file);
MAKE_PROPERTY(file_pos, get_file_pos);
};
#include "datagramSink.I"

View File

@ -28,14 +28,13 @@
* header followed by a number of datagrams.
*/
class EXPCL_PANDA_PUTIL DatagramOutputFile : public DatagramSink {
public:
PUBLISHED:
INLINE DatagramOutputFile();
INLINE ~DatagramOutputFile();
bool open(const FileReference *file);
INLINE bool open(const Filename &filename);
bool open(ostream &out, const Filename &filename = Filename());
INLINE ostream &get_stream();
void close();
@ -46,10 +45,16 @@ public:
virtual bool is_error();
virtual void flush();
public:
virtual const Filename &get_filename();
virtual const FileReference *get_file();
virtual streampos get_file_pos();
INLINE ostream &get_stream();
PUBLISHED:
MAKE_PROPERTY(stream, get_stream);
private:
bool _wrote_first_datagram;
bool _error;