00001 // Filename: lineStream.I 00002 // Created by: drose (26Feb00) 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 // Function: LineStream::Constructor 00021 // Access: Public 00022 // Description: 00023 //////////////////////////////////////////////////////////////////// 00024 INLINE LineStream:: 00025 LineStream() : ostream(&_lsb) { 00026 } 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Function: LineStream::is_text_available 00030 // Access: Public 00031 // Description: Returns true if there is at least one line of text 00032 // (or even a partial line) available in the LineStream 00033 // object. If this returns true, the line may then be 00034 // retrieved via get_line(). 00035 //////////////////////////////////////////////////////////////////// 00036 INLINE bool LineStream:: 00037 is_text_available() const { 00038 return _lsb.is_text_available(); 00039 } 00040 00041 //////////////////////////////////////////////////////////////////// 00042 // Function: LineStream::get_line 00043 // Access: Public 00044 // Description: Extracts and returns the next line (or partial line) 00045 // of text available in the LineStream object. Once the 00046 // line has been extracted, you may call has_newline() 00047 // to determine whether or not there was an explicit 00048 // newline character written following this line. 00049 //////////////////////////////////////////////////////////////////// 00050 INLINE string LineStream:: 00051 get_line() { 00052 return _lsb.get_line(); 00053 } 00054 00055 //////////////////////////////////////////////////////////////////// 00056 // Function: LineStream::has_newline 00057 // Access: Public 00058 // Description: Returns true if the line of text most recently 00059 // returned by get_line() was written out with a 00060 // terminating newline, or false if a newline character 00061 // has not yet been written to the LineStream. 00062 //////////////////////////////////////////////////////////////////// 00063 INLINE bool LineStream:: 00064 has_newline() const { 00065 return _lsb.has_newline(); 00066 }