strbuffer: fix indentation
This commit is contained in:
@@ -27,14 +27,14 @@
|
||||
|
||||
#include <list>
|
||||
|
||||
namespace NCurses
|
||||
namespace NCurses {
|
||||
|
||||
/// Buffer template class that can store text along with its
|
||||
/// format attributes. The content can be easily printed to
|
||||
/// window or taken as raw string at any time.
|
||||
///
|
||||
template <typename C> class basic_buffer
|
||||
{
|
||||
/// Buffer template class that can store text along with its
|
||||
/// format attributes. The content can be easily printed to
|
||||
/// window or taken as raw string at any time.
|
||||
///
|
||||
template <typename C> class basic_buffer
|
||||
{
|
||||
/// Struct used for storing information about
|
||||
/// one color/format flag along with its position
|
||||
///
|
||||
@@ -238,25 +238,28 @@ namespace NCurses
|
||||
/// @param value value of attribute to be loaded
|
||||
///
|
||||
void LoadAttribute(Window &w, short value) const;
|
||||
};
|
||||
};
|
||||
|
||||
/// Standard buffer that uses narrow characters
|
||||
///
|
||||
typedef basic_buffer<char> Buffer;
|
||||
/// Standard buffer that uses narrow characters
|
||||
///
|
||||
typedef basic_buffer<char> Buffer;
|
||||
|
||||
/// Standard buffer that uses wide characters
|
||||
///
|
||||
typedef basic_buffer<wchar_t> WBuffer;
|
||||
}
|
||||
/// Standard buffer that uses wide characters
|
||||
///
|
||||
typedef basic_buffer<wchar_t> WBuffer;
|
||||
|
||||
template <typename C> NCurses::basic_buffer<C>::basic_buffer(const basic_buffer &b) : itsString(b.itsString), itsFormat(b.itsFormat), itsTempString(b.itsTempString) { }
|
||||
|
||||
template <typename C> const std::basic_string<C> &NCurses::basic_buffer<C>::Str() const
|
||||
|
||||
template <typename C> basic_buffer<C>::basic_buffer(const basic_buffer &b)
|
||||
: itsString(b.itsString), itsFormat(b.itsFormat), itsTempString(b.itsTempString) { }
|
||||
|
||||
template <typename C> const std::basic_string<C> &basic_buffer<C>::Str() const
|
||||
{
|
||||
return itsString;
|
||||
}
|
||||
|
||||
template <typename C> bool NCurses::basic_buffer<C>::SetFormatting( short val_b,
|
||||
template <typename C> bool basic_buffer<C>::SetFormatting(
|
||||
short val_b,
|
||||
std::basic_string<C> s,
|
||||
short val_e,
|
||||
bool case_sensitive,
|
||||
@@ -290,7 +293,8 @@ template <typename C> bool NCurses::basic_buffer<C>::SetFormatting( short val_b,
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename C> void NCurses::basic_buffer<C>::RemoveFormatting( short val_b,
|
||||
template <typename C> void basic_buffer<C>::RemoveFormatting(
|
||||
short val_b,
|
||||
std::basic_string<C> pattern,
|
||||
short val_e,
|
||||
bool case_sensitive,
|
||||
@@ -320,17 +324,18 @@ template <typename C> void NCurses::basic_buffer<C>::RemoveFormatting( short val
|
||||
}
|
||||
}
|
||||
|
||||
template <typename C> void NCurses::basic_buffer<C>::RemoveFormatting()
|
||||
template <typename C> void basic_buffer<C>::RemoveFormatting()
|
||||
{
|
||||
itsFormat.clear();
|
||||
}
|
||||
|
||||
template <typename C> void NCurses::basic_buffer<C>::SetTemp(std::basic_string<C> *tmp)
|
||||
template <typename C> void basic_buffer<C>::SetTemp(std::basic_string<C> *tmp)
|
||||
{
|
||||
itsTempString = tmp;
|
||||
}
|
||||
|
||||
template <typename C> void NCurses::basic_buffer<C>::Write( Window &w,
|
||||
template <typename C> void basic_buffer<C>::Write(
|
||||
Window &w,
|
||||
size_t &start_pos,
|
||||
size_t width,
|
||||
const std::basic_string<C> &separator
|
||||
@@ -387,21 +392,21 @@ template <typename C> void NCurses::basic_buffer<C>::Write( Window &w,
|
||||
w << *this;
|
||||
}
|
||||
|
||||
template <typename C> void NCurses::basic_buffer<C>::Clear()
|
||||
template <typename C> void basic_buffer<C>::Clear()
|
||||
{
|
||||
itsString.clear();
|
||||
itsFormat.clear();
|
||||
}
|
||||
|
||||
template <typename C> void NCurses::basic_buffer<C>::LoadAttribute(Window &w, short value) const
|
||||
template <typename C> void basic_buffer<C>::LoadAttribute(Window &w, short value) const
|
||||
{
|
||||
if (value < NCurses::fmtNone)
|
||||
w << NCurses::Color(value);
|
||||
if (value < fmtNone)
|
||||
w << Color(value);
|
||||
else
|
||||
w << NCurses::Format(value);
|
||||
w << Format(value);
|
||||
}
|
||||
|
||||
template <typename C> NCurses::basic_buffer<C> &NCurses::basic_buffer<C>::operator<<(Color color)
|
||||
template <typename C> basic_buffer<C> &basic_buffer<C>::operator<<(Color color)
|
||||
{
|
||||
FormatPos f;
|
||||
f.Position = itsString.length();
|
||||
@@ -410,12 +415,12 @@ template <typename C> NCurses::basic_buffer<C> &NCurses::basic_buffer<C>::operat
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename C> NCurses::basic_buffer<C> &NCurses::basic_buffer<C>::operator<<(Format f)
|
||||
template <typename C> basic_buffer<C> &basic_buffer<C>::operator<<(Format f)
|
||||
{
|
||||
return operator<<(Color(f));
|
||||
}
|
||||
|
||||
template <typename C> NCurses::basic_buffer<C> &NCurses::basic_buffer<C>::operator<<(const NCurses::basic_buffer<C> &buf)
|
||||
template <typename C> basic_buffer<C> &basic_buffer<C>::operator<<(const basic_buffer<C> &buf)
|
||||
{
|
||||
size_t length = itsString.length();
|
||||
itsString += buf.itsString;
|
||||
@@ -427,4 +432,6 @@ template <typename C> NCurses::basic_buffer<C> &NCurses::basic_buffer<C>::operat
|
||||
return *this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user