/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/external/stlplus/include/stlplus/stringio.hpp Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/external/stlplus/include/stlplus/stringio.hpp Source File
Ratpac-two
stringio.hpp
1 #ifndef STRINGIO_HPP
2 #define STRINGIO_HPP
3 /*------------------------------------------------------------------------------
4 
5  Author: Andy Rushton
6  Copyright: (c) Andy Rushton, 2004
7  License: BSD License, see ../docs/license.html
8 
9  Classes for redirecting I/O to/from a string
10 
11  ------------------------------------------------------------------------------*/
12 #include <string>
13 
14 #include "os_fixes.hpp"
15 #include "textio.hpp"
16 
18 // string Output
19 
20 class ostext : public otext {
21  public:
22  ostext(void);
23  std::string& get_string(void);
24  const std::string& get_string(void) const;
25 };
26 
27 class osbuff : public obuff {
28  protected:
29  friend class ostext;
30  std::string m_data;
31 
32  public:
33  osbuff(void);
34 
35  protected:
36  virtual unsigned put(unsigned char);
37 
38  private:
39  // make this class uncopyable
40  osbuff(const osbuff&);
41  osbuff& operator=(const osbuff&);
42 };
43 
45 // string Input
46 
47 class istext : public itext {
48  public:
49  istext(const std::string& data);
50  std::string& get_string(void);
51  const std::string& get_string(void) const;
52 };
53 
54 class isbuff : public ibuff {
55  protected:
56  friend class istext;
57  std::string m_data;
58  unsigned m_index;
59 
60  public:
61  isbuff(const std::string& data);
62 
63  protected:
64  virtual int peek(void);
65  virtual int get(void);
66 
67  private:
68  // make this class uncopyable
69  isbuff(const isbuff&);
70  isbuff& operator=(const isbuff&);
71 };
72 
74 #endif
Definition: textio.hpp:502
Definition: stringio.hpp:54
Definition: stringio.hpp:47
Definition: textio.hpp:242
Definition: textio.hpp:399
Definition: stringio.hpp:27
Definition: stringio.hpp:20
Definition: textio.hpp:37