move FormatPos struct to basic_buffer class, it should be private
This commit is contained in:
@@ -26,8 +26,10 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
struct FormatPos
|
template <class C> class basic_buffer
|
||||||
{
|
{
|
||||||
|
struct FormatPos
|
||||||
|
{
|
||||||
size_t Position;
|
size_t Position;
|
||||||
short Value;
|
short Value;
|
||||||
|
|
||||||
@@ -35,10 +37,8 @@ struct FormatPos
|
|||||||
{
|
{
|
||||||
return Position < f.Position;
|
return Position < f.Position;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class C> class basic_buffer
|
|
||||||
{
|
|
||||||
std::basic_ostringstream<C> itsString;
|
std::basic_ostringstream<C> itsString;
|
||||||
std::list<FormatPos> itsFormat;
|
std::list<FormatPos> itsFormat;
|
||||||
std::basic_string<C> *itsTempString;
|
std::basic_string<C> *itsTempString;
|
||||||
@@ -129,7 +129,7 @@ template <class C> basic_buffer<C> &basic_buffer<C>::operator<<(const basic_buff
|
|||||||
itsString << buf.itsString.str();
|
itsString << buf.itsString.str();
|
||||||
std::list<FormatPos> tmp = buf.itsFormat;
|
std::list<FormatPos> tmp = buf.itsFormat;
|
||||||
if (len)
|
if (len)
|
||||||
for (std::list<FormatPos>::iterator it = tmp.begin(); it != tmp.end(); it++)
|
for (typename std::list<typename basic_buffer<C>::FormatPos>::iterator it = tmp.begin(); it != tmp.end(); it++)
|
||||||
it->Position += len;
|
it->Position += len;
|
||||||
itsFormat.merge(tmp);
|
itsFormat.merge(tmp);
|
||||||
return *this;
|
return *this;
|
||||||
@@ -145,7 +145,8 @@ template <class C> Window &operator<<(Window &w, const basic_buffer<C> &buf)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::basic_string<C> tmp;
|
std::basic_string<C> tmp;
|
||||||
std::list<FormatPos>::const_iterator b = buf.itsFormat.begin(), e = buf.itsFormat.end();
|
typename std::list<typename basic_buffer<C>::FormatPos>::const_iterator b = buf.itsFormat.begin();
|
||||||
|
typename std::list<typename basic_buffer<C>::FormatPos>::const_iterator e = buf.itsFormat.end();
|
||||||
for (size_t i = 0; i < s.length() || b != e; i++)
|
for (size_t i = 0; i < s.length() || b != e; i++)
|
||||||
{
|
{
|
||||||
while (b != e && i == b->Position)
|
while (b != e && i == b->Position)
|
||||||
|
|||||||
Reference in New Issue
Block a user