Panda3D
Loading...
Searching...
No Matches
lineStream.h
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.h
10 * @author drose
11 * @date 2000-02-26
12 */
13
14#ifndef LINESTREAM_H
15#define LINESTREAM_H
16
17#include "dtoolbase.h"
18
19#include "lineStreamBuf.h"
20
21/**
22 * This is a special ostream that writes to a memory buffer, like ostrstream.
23 * However, its contents can be continuously extracted as a sequence of lines
24 * of text.
25 *
26 * Unlike ostrstream, which can only be extracted from once (and then the
27 * buffer freezes and it can no longer be written to), the LineStream is not
28 * otherwise affected when a line of text is extracted. More text can still
29 * be written to it and continuously extracted.
30 */
31class EXPCL_DTOOL_DTOOLUTIL LineStream : public std::ostream {
32PUBLISHED:
33 INLINE LineStream();
34
35#if _MSC_VER >= 1800
36 INLINE LineStream(const LineStream &copy) = delete;
37#endif
38
39 INLINE bool is_text_available() const;
40 INLINE std::string get_line();
41 INLINE bool has_newline() const;
42
43private:
44 LineStreamBuf _lsb;
45};
46
47#include "lineStream.I"
48
49#endif
Used by LineStream to implement an ostream that writes to a memory buffer, whose contents can be cont...
This is a special ostream that writes to a memory buffer, like ostrstream.
Definition lineStream.h:31
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.