00001 // Filename: datagramOutputFile.I 00002 // Created by: drose (27Oct00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: DatagramOutputFile::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE DatagramOutputFile:: 00026 DatagramOutputFile() { 00027 _error = true; 00028 _wrote_first_datagram = false; 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: DatagramOutputFile::open 00033 // Access: Public 00034 // Description: Opens the indicated filename for reading. Returns 00035 // true if successful, false on failure. 00036 //////////////////////////////////////////////////////////////////// 00037 INLINE bool DatagramOutputFile:: 00038 open(Filename filename) { 00039 // DatagramOutputFiles are always binary. 00040 _wrote_first_datagram = false; 00041 _error = false; 00042 filename.set_binary(); 00043 return filename.open_write(_out); 00044 } 00045 00046 //////////////////////////////////////////////////////////////////// 00047 // Function: DatagramOutputFile::close 00048 // Access: Public 00049 // Description: Closes the file. This is also implicitly done when 00050 // the DatagramOutputFile destructs. 00051 //////////////////////////////////////////////////////////////////// 00052 INLINE void DatagramOutputFile:: 00053 close() { 00054 _out.close(); 00055 }