Panda3D
 All Classes Functions Variables Enumerations
lineStream.I
00001 // Filename: lineStream.I
00002 // Created by:  drose (26Feb00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 ////////////////////////////////////////////////////////////////////
00016 //     Function: LineStream::Constructor
00017 //       Access: Public
00018 //  Description:
00019 ////////////////////////////////////////////////////////////////////
00020 INLINE LineStream::
00021 LineStream() : ostream(&_lsb) {
00022 }
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //     Function: LineStream::is_text_available
00026 //       Access: Public
00027 //  Description: Returns true if there is at least one line of text
00028 //               (or even a partial line) available in the LineStream
00029 //               object.  If this returns true, the line may then be
00030 //               retrieved via get_line().
00031 ////////////////////////////////////////////////////////////////////
00032 INLINE bool LineStream::
00033 is_text_available() const {
00034   return _lsb.is_text_available();
00035 }
00036 
00037 ////////////////////////////////////////////////////////////////////
00038 //     Function: LineStream::get_line
00039 //       Access: Public
00040 //  Description: Extracts and returns the next line (or partial line)
00041 //               of text available in the LineStream object.  Once the
00042 //               line has been extracted, you may call has_newline()
00043 //               to determine whether or not there was an explicit
00044 //               newline character written following this line.
00045 ////////////////////////////////////////////////////////////////////
00046 INLINE string LineStream::
00047 get_line() {
00048   return _lsb.get_line();
00049 }
00050 
00051 ////////////////////////////////////////////////////////////////////
00052 //     Function: LineStream::has_newline
00053 //       Access: Public
00054 //  Description: Returns true if the line of text most recently
00055 //               returned by get_line() was written out with a
00056 //               terminating newline, or false if a newline character
00057 //               has not yet been written to the LineStream.
00058 ////////////////////////////////////////////////////////////////////
00059 INLINE bool LineStream::
00060 has_newline() const {
00061   return _lsb.has_newline();
00062 }
 All Classes Functions Variables Enumerations