Panda3D
lineStream.I
1 // Filename: lineStream.I
2 // Created by: drose (26Feb00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 ////////////////////////////////////////////////////////////////////
16 // Function: LineStream::Constructor
17 // Access: Public
18 // Description:
19 ////////////////////////////////////////////////////////////////////
20 INLINE LineStream::
21 LineStream() : ostream(&_lsb) {
22 }
23 
24 ////////////////////////////////////////////////////////////////////
25 // Function: LineStream::is_text_available
26 // Access: Public
27 // Description: Returns true if there is at least one line of text
28 // (or even a partial line) available in the LineStream
29 // object. If this returns true, the line may then be
30 // retrieved via get_line().
31 ////////////////////////////////////////////////////////////////////
32 INLINE bool LineStream::
34  return _lsb.is_text_available();
35 }
36 
37 ////////////////////////////////////////////////////////////////////
38 // Function: LineStream::get_line
39 // Access: Public
40 // Description: Extracts and returns the next line (or partial line)
41 // of text available in the LineStream object. Once the
42 // line has been extracted, you may call has_newline()
43 // to determine whether or not there was an explicit
44 // newline character written following this line.
45 ////////////////////////////////////////////////////////////////////
46 INLINE string LineStream::
48  return _lsb.get_line();
49 }
50 
51 ////////////////////////////////////////////////////////////////////
52 // Function: LineStream::has_newline
53 // Access: Public
54 // Description: Returns true if the line of text most recently
55 // returned by get_line() was written out with a
56 // terminating newline, or false if a newline character
57 // has not yet been written to the LineStream.
58 ////////////////////////////////////////////////////////////////////
59 INLINE bool LineStream::
60 has_newline() const {
61  return _lsb.has_newline();
62 }
bool is_text_available() const
Returns true if there is at least one line of text (or even a partial line) available in the LineStre...
Definition: lineStream.I:33
string get_line()
Extracts and returns the next line (or partial line) of text available in the LineStream object...
Definition: lineStream.I:47
string get_line()
Extracts the next line of text from the LineStreamBuf, and sets the has_newline() flag according to w...
bool has_newline() const
Returns true if the line of text most recently returned by get_line() was written out with a terminat...
Definition: lineStream.I:60