alternative Standard Libary  0.29.8
std::outstream Klassenreferenz
+ Klassendiagramm für std::outstream:
+ Zusammengehörigkeiten von std::outstream:

Öffentliche Methoden

 outstream ()
 
virtual ofstreamwrite (const char *str)
 
virtual ofstreamwrite (std::string str)
 
virtual size_t write (const void *data, size_t offset, size_t size)
 
virtual void write (char c)
 
virtual ofstreamwriteline (const char *str)
 
virtual ofstreamwriteline (const std::string str)
 
virtual bool close ()
 
virtual size_t seek (size_t off, seek_t org)
 
virtual size_t read (void *data, size_t offset, size_t size)
 
virtual char read ()
 
virtual filestreamreopen (filemode_t mode, bool binary)
 
virtual void clear ()
 
virtual long position ()
 
virtual long size ()
 
virtual bool iseof ()
 
virtual void flush ()
 
virtual std::string filename ()
 
virtual bool isbinary ()
 
virtual filemode_t mode ()
 
 operator bool ()
 
virtual bool canRead ()
 
virtual bool canSeek ()
 
virtual bool canWrite ()
 

Öffentliche, statische Methoden

static bool isfile (std::string file)
 
static bool canread (std::string file)
 
static bool canwrite (std::string file)
 

Geschützte Attribute

filemode_t m_mode
 
auto_ptr< FILE > m_fFile
 
std::string m_strFile
 
bool m_binary
 
bool m_canRead
 
bool m_canWrite
 
bool m_canSeek
 

Ausführliche Beschreibung

Beschreibung der Konstruktoren und Destruktoren

◆ outstream()

std::outstream::outstream ( )
inline
32  : ofstream(stdout, false)
33  {
35  }
ofstream()
Definition: iofstream.hpp:73
std::string m_strFile
Definition: filestream.hpp:88
basic_string< char > string
Definition: string.hpp:44

Dokumentation der Elementfunktionen

◆ canRead()

virtual bool std::stream::canRead ( )
inlinevirtualinherited
61 { return m_canRead; }
bool m_canRead
Definition: stream.hpp:79

◆ canread()

bool std::filestream::canread ( std::string  file)
staticinherited
137  {
138  void* f = Sys::fOpen(file.c_str(), "r");
139  if(f != 0)
140  {
141  Sys::fClose(f);
142  return true;
143  }
144  return false;
145  }
const value_type * c_str() const
Definition: basic_string.hpp:199
static void * fOpen(const char *file, const char *fmt)
Definition: PLATFORM.cpp:68
static void fClose(void *file)
Definition: PLATFORM.cpp:71

◆ canSeek()

virtual bool std::stream::canSeek ( )
inlinevirtualinherited
62 { return m_canSeek; }
bool m_canSeek
Definition: stream.hpp:81

◆ canWrite()

virtual bool std::stream::canWrite ( )
inlinevirtualinherited
63 { return m_canWrite; }
bool m_canWrite
Definition: stream.hpp:80

◆ canwrite()

bool std::filestream::canwrite ( std::string  file)
staticinherited
146  {
147  void* f = Sys::fOpen(file.c_str(), "w");
148  if(f != 0)
149  {
150  Sys::fClose(f);
151  return true;
152  }
153  return false;
154  }
const value_type * c_str() const
Definition: basic_string.hpp:199
static void * fOpen(const char *file, const char *fmt)
Definition: PLATFORM.cpp:68
static void fClose(void *file)
Definition: PLATFORM.cpp:71

◆ clear()

void std::filestream::clear ( )
virtualinherited

Erneute Implementation von std::stream.

117  {
118  if(m_fFile.get() !=0) {
119  Sys::fSeek(m_fFile.get(), 0, SEEK_END);
120  }
121  }
value_type * get() const
Definition: auto_ptr.hpp:134
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87
static int fSeek(void *file, int off, int org)
Definition: PLATFORM.cpp:89

◆ close()

bool std::filestream::close ( )
virtualinherited
83  {
84  if(m_fFile.get() !=0) {
86  return true;
87  }
88  return false;
89  }
value_type * get() const
Definition: auto_ptr.hpp:134
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87
static void fClose(void *file)
Definition: PLATFORM.cpp:71

◆ filename()

virtual std::string std::filestream::filename ( )
inlinevirtualinherited
77 { return m_strFile; }
std::string m_strFile
Definition: filestream.hpp:88

◆ flush()

void std::filestream::flush ( )
virtualinherited

Erneute Implementation von std::stream.

163  {
165  }
value_type * get() const
Definition: auto_ptr.hpp:134
static int fFlush(void *file)
Definition: PLATFORM.cpp:98
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87

◆ isbinary()

virtual bool std::filestream::isbinary ( )
inlinevirtualinherited
78 { return m_binary; }
bool m_binary
Definition: filestream.hpp:89

◆ iseof()

bool std::filestream::iseof ( )
virtualinherited

Erneute Implementation von std::stream.

171  {
172  return Sys::fEOF(m_fFile.get());
173  }
static int fEOF(void *file)
Definition: PLATFORM.cpp:101
value_type * get() const
Definition: auto_ptr.hpp:134
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87

◆ isfile()

bool std::filestream::isfile ( std::string  file)
staticinherited
133  {
134  return Sys::fIsFile(file.c_str());
135 
136  }
const value_type * c_str() const
Definition: basic_string.hpp:199
static bool fIsFile(const char *file)
Definition: PLATFORM.cpp:107

◆ mode()

virtual filemode_t std::filestream::mode ( )
inlinevirtualinherited
79 { return m_mode;}
filemode_t m_mode
Definition: filestream.hpp:86

◆ operator bool()

std::filestream::operator bool ( )
inlineinherited
81 { return m_fFile.get() == 0; }
value_type * get() const
Definition: auto_ptr.hpp:134
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87

◆ position()

long std::filestream::position ( )
virtualinherited

Erneute Implementation von std::stream.

167  {
168  return Sys::fTell(m_fFile.get());
169  }
value_type * get() const
Definition: auto_ptr.hpp:134
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87
static int fTell(void *file)
Definition: PLATFORM.cpp:74

◆ read() [1/2]

size_t std::filestream::read ( void *  data,
size_t  offset,
size_t  size 
)
virtualinherited

Erneute Implementation von std::stream.

99  {
100  size_t s = EOF;
101  if(m_fFile.get() != 0 ) {
102  if(offset != 0) seek(offset, SeekOrigin::Current);
103  s = Sys::fRead (data, 1, size, m_fFile.get());
104  }
105  return s;
106  }
static int fRead(void *data, const int count, const int size, void *file)
Definition: PLATFORM.cpp:92
value_type * get() const
Definition: auto_ptr.hpp:134
virtual size_t seek(size_t off, seek_t org)
Definition: filestream.cpp:90
virtual long size()
Definition: filestream.cpp:155
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87

◆ read() [2/2]

char std::filestream::read ( )
virtualinherited

Erneute Implementation von std::stream.

127  {
128  if(m_fFile.get() == 0)
129  return EOF;
130  return Sys::fGetc(m_fFile.get());
131  }
value_type * get() const
Definition: auto_ptr.hpp:134
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87
static int fGetc(void *file)
Definition: PLATFORM.cpp:83

◆ reopen()

filestream & std::filestream::reopen ( filemode_t  mode,
bool  binary 
)
virtualinherited
175  {
176  if(mode != m_mode || m_binary != binary)
177  {
178  m_mode = mode;
179  m_binary = binary;
180  //m_fFile.reset( freopen(m_strFile,filemodetostring(mode, binary), m_fFile.get()) );
181  }
182  return *this;
183  }
virtual filemode_t mode()
Definition: filestream.hpp:79
bool m_binary
Definition: filestream.hpp:89
filemode_t m_mode
Definition: filestream.hpp:86

◆ seek()

size_t std::filestream::seek ( size_t  off,
seek_t  org 
)
virtualinherited

Erneute Implementation von std::stream.

90  {
91  size_t s = EOF;
92  if(m_fFile.get() != 0 && m_canSeek) {
93  Sys::fSeek(m_fFile.get(), off,
94  (int)org);
95  s = Sys::fTell(m_fFile.get());
96  }
97  return s;
98  }
value_type * get() const
Definition: auto_ptr.hpp:134
bool m_canSeek
Definition: stream.hpp:81
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87
static int fSeek(void *file, int off, int org)
Definition: PLATFORM.cpp:89
static int fTell(void *file)
Definition: PLATFORM.cpp:74

◆ size()

long std::filestream::size ( )
virtualinherited

Erneute Implementation von std::stream.

156  {
157  long pos = position();
158  long size = seek(0, SeekOrigin::End);
159  seek(pos, SeekOrigin::Beginn);
160  return size;
161  }
virtual long position()
Definition: filestream.cpp:166
virtual size_t seek(size_t off, seek_t org)
Definition: filestream.cpp:90
virtual long size()
Definition: filestream.cpp:155

◆ write() [1/4]

size_t std::filestream::write ( const void *  data,
size_t  offset,
size_t  size 
)
virtualinherited

Erneute Implementation von std::stream.

107  {
108  //fwrite (buffer , sizeof(char), sizeof(buffer), pFile);
109  size_t s = EOF;
110  if(m_fFile.get() != 0 && m_canWrite) {
111  if(offset != 0) seek(offset, SeekOrigin::Current);
112  s = Sys::fWrite (data, 1, size, m_fFile.get());
113  }
114  return s;
115  }
value_type * get() const
Definition: auto_ptr.hpp:134
virtual size_t seek(size_t off, seek_t org)
Definition: filestream.cpp:90
virtual long size()
Definition: filestream.cpp:155
bool m_canWrite
Definition: stream.hpp:80
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87
static int fWrite(void *data, const int count, const int size, void *file)
Definition: PLATFORM.cpp:95

◆ write() [2/4]

void std::filestream::write ( char  c)
virtualinherited

Erneute Implementation von std::stream.

122  {
123  if(m_fFile.get() !=0) {
124  Sys::fPutc (c, m_fFile.get());
125  }
126  }
value_type * get() const
Definition: auto_ptr.hpp:134
static int fPutc(int c, void *file)
Definition: PLATFORM.cpp:77
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87

◆ write() [3/4]

virtual ofstream& std::ofstream::write ( const char *  str)
inlinevirtualinherited
79  {
80  if(m_fFile.get() !=0 )
82  }
value_type * get() const
Definition: auto_ptr.hpp:134
static int fPrintf(void *file, const char *str)
Definition: PLATFORM.cpp:86
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87
std::string str(T begin, T end)
Definition: utils.hpp:39

◆ write() [4/4]

virtual ofstream& std::ofstream::write ( std::string  str)
inlinevirtualinherited
83  {
84  if(m_fFile.get() !=0 )
85  Sys::fPrintf(m_fFile.get(), str.c_str());
86  }
value_type * get() const
Definition: auto_ptr.hpp:134
const value_type * c_str() const
Definition: basic_string.hpp:199
static int fPrintf(void *file, const char *str)
Definition: PLATFORM.cpp:86
auto_ptr< FILE > m_fFile
Definition: filestream.hpp:87

◆ writeline() [1/2]

virtual ofstream& std::ofstream::writeline ( const char *  str)
inlinevirtualinherited
87  {
88  write(std::string(str) << "\n");
89  }
virtual ofstream & write(const char *str)
Definition: iofstream.hpp:79
std::string str(T begin, T end)
Definition: utils.hpp:39

◆ writeline() [2/2]

virtual ofstream& std::ofstream::writeline ( const std::string  str)
inlinevirtualinherited
90  {
91  std::string d = str;
92  write(d << ("\n"));
93  }
virtual ofstream & write(const char *str)
Definition: iofstream.hpp:79
std::string str(T begin, T end)
Definition: utils.hpp:39

Dokumentation der Datenelemente

◆ m_binary

bool std::filestream::m_binary
protectedinherited

◆ m_canRead

bool std::stream::m_canRead
protectedinherited

◆ m_canSeek

bool std::stream::m_canSeek
protectedinherited

◆ m_canWrite

bool std::stream::m_canWrite
protectedinherited

◆ m_fFile

auto_ptr<FILE> std::filestream::m_fFile
protectedinherited

◆ m_mode

filemode_t std::filestream::m_mode
protectedinherited

◆ m_strFile

std::string std::filestream::m_strFile
protectedinherited

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: