etk/etk-core/Stream.hpp

46 lines
1.2 KiB
C++
Raw Normal View History

2017-08-28 00:02:11 +02:00
/**
* @author Edouard DUPIN
* @copyright 2011, Edouard DUPIN, all right reserved
* @license MPL-2 (see license file)
*/
#pragma once
#include <etk/types.hpp>
namespace etk {
class String;
/**
* @brief string class ...
*/
class Stream {
private:
2017-09-14 00:59:21 +02:00
// remove dependency of etk::String and vector
2017-08-28 00:02:11 +02:00
etk::String* m_data;
public:
Stream(size_t _basicSize=0);
~Stream();
Stream& operator<< (const char* _data);
Stream& operator<< (const bool& _data);
Stream& operator<< (const int8_t& _data);
Stream& operator<< (const int16_t& _data);
Stream& operator<< (const int32_t& _data);
Stream& operator<< (const int64_t& _data);
Stream& operator<< (const uint8_t& _data);
Stream& operator<< (const uint16_t& _data);
Stream& operator<< (const uint32_t& _data);
Stream& operator<< (const uint64_t& _data);
2017-08-30 21:42:07 +02:00
#if defined(__TARGET_OS__MacOs) \
|| defined(__TARGET_OS__IOs)
Stream& operator<< (const size_t& _data);
2017-08-30 21:42:07 +02:00
#endif
Stream& operator<< (const float& _data);
Stream& operator<< (const double& _data);
Stream& operator<< (const etk::NullPtr& _data);
2017-08-28 00:02:11 +02:00
const char* c_str() const;
2017-09-07 23:38:26 +02:00
const etk::String& str() const;
2017-08-28 00:02:11 +02:00
const size_t size() const;
};
2017-09-14 00:59:21 +02:00
2017-08-28 00:02:11 +02:00
}