Panda3D
lineStream.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file lineStream.I
10  * @author drose
11  * @date 2000-02-26
12  */
13 
14 /**
15  *
16  */
17 INLINE LineStream::
18 LineStream() : std::ostream(&_lsb) {
19 }
20 
21 /**
22  * Returns true if there is at least one line of text (or even a partial line)
23  * available in the LineStream object. If this returns true, the line may
24  * then be retrieved via get_line().
25  */
26 INLINE bool LineStream::
28  return _lsb.is_text_available();
29 }
30 
31 /**
32  * Extracts and returns the next line (or partial line) of text available in
33  * the LineStream object. Once the line has been extracted, you may call
34  * has_newline() to determine whether or not there was an explicit newline
35  * character written following this line.
36  */
37 INLINE std::string LineStream::
39  return _lsb.get_line();
40 }
41 
42 /**
43  * Returns true if the line of text most recently returned by get_line() was
44  * written out with a terminating newline, or false if a newline character has
45  * not yet been written to the LineStream.
46  */
47 INLINE bool LineStream::
48 has_newline() const {
49  return _lsb.has_newline();
50 }
std::string get_line()
Extracts and returns the next line (or partial line) of text available in the LineStream object.
Definition: lineStream.I:38
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:27
std::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:48