mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-31 18:46:29 +03:00
45 lines
999 B
C++
45 lines
999 B
C++
#ifndef EE_SYSTEM_IOSTREAMSTRING_HPP
|
|
#define EE_SYSTEM_IOSTREAMSTRING_HPP
|
|
|
|
#include <eepp/system/iostream.hpp>
|
|
#include <cstring>
|
|
|
|
namespace EE { namespace System {
|
|
|
|
/** @brief Implementation of a memory stream file using an std::string as a container */
|
|
class EE_API IOStreamString : public IOStream {
|
|
public:
|
|
IOStreamString();
|
|
|
|
virtual ios_size read( char * data, ios_size size );
|
|
|
|
virtual ios_size write( const char * data, ios_size size );
|
|
|
|
virtual ios_size write( const std::string& string );
|
|
|
|
virtual ios_size seek( ios_size position );
|
|
|
|
virtual ios_size tell();
|
|
|
|
virtual ios_size getSize();
|
|
|
|
virtual bool isOpen();
|
|
|
|
void clear();
|
|
|
|
/** @return Pointer to the current position in the stream */
|
|
const char * getPositionPointer();
|
|
|
|
/** @return The pointer to the beggining of the stream */
|
|
const char * getStreamPointer() const;
|
|
|
|
const std::string& getStream() const;
|
|
protected:
|
|
std::string mStream;
|
|
ios_size mPos;
|
|
};
|
|
|
|
}}
|
|
|
|
#endif // EE_SYSTEM_IOSTREAMSTRING_HPP
|