00001 00020 #ifndef ARXX_BUFFERWRITER_H 00021 #define ARXX_BUFFERWRITER_H 00022 00023 #include "Buffer.h" 00024 00031 namespace Arxx 00032 { 00036 class BufferWriter 00037 { 00038 public: 00043 BufferWriter(Arxx::Buffer & Buffer, Arxx::Buffer::size_type stPosition = Arxx::Buffer::Marker::END); 00044 00050 void vWrite(Arxx::Buffer::size_type stDataLength, Arxx::Buffer::const_pointer Data = 0); 00051 00056 Arxx::Buffer & GetBuffer(void); 00057 00062 const Arxx::Buffer & GetBuffer(void) const; 00063 00067 Arxx::Buffer::size_type stGetPosition(void) const; 00068 00072 void vSetPosition(Arxx::Buffer::size_type stPosition); 00073 private: 00074 Arxx::Buffer & m_Buffer; 00075 Arxx::Buffer::Marker m_Marker; 00076 }; 00077 00088 Arxx::BufferWriter & operator<<(Arxx::BufferWriter & BufferWriter, const std::string & sString); 00089 00102 Arxx::BufferWriter & operator<<(Arxx::BufferWriter & BufferWriter, const char * pcString); 00103 00112 Arxx::BufferWriter & operator<<(Arxx::BufferWriter & BufferWriter, const float & fValue); 00113 00122 Arxx::BufferWriter & operator<<(Arxx::BufferWriter & BufferWriter, const Arxx::u4byte & u4Value); 00123 00132 Arxx::BufferWriter & operator<<(Arxx::BufferWriter & BufferWriter, const bool & bValue); 00133 00142 Arxx::BufferWriter & operator<<(Arxx::BufferWriter & BufferWriter, const char & cValue); 00143 00152 Arxx::BufferWriter & operator<<(Arxx::BufferWriter & BufferWriter, const std::pair< Arxx::Buffer::size_type, std::istream * > & Stream); 00153 } 00154 00155 #endif