summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-04-24 13:56:36 +0200
committerMaxime Coste <frrrwww@gmail.com>2013-04-24 13:56:36 +0200
commitf8c3b6c9ef6c8a6ae66c95800a2a92eee094ea1b (patch)
treedb144cdd6982bd0627ff9936fd6743b277b68d8d /src
parent7c4e79ef98a727dfeb94a7c30d9aa9975ed37b0b (diff)
Buffer: rename character_count method to byte_count
Diffstat (limited to 'src')
-rw-r--r--src/buffer.cc4
-rw-r--r--src/buffer.hh2
-rw-r--r--src/buffer_iterator.inl.hh6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/buffer.cc b/src/buffer.cc
index 93360b74..807f8f62 100644
--- a/src/buffer.cc
+++ b/src/buffer.cc
@@ -96,7 +96,7 @@ ByteCount Buffer::line_length(LineCount line) const
{
kak_assert(line < line_count());
ByteCount end = (line < line_count() - 1) ?
- m_lines[line + 1].start : character_count();
+ m_lines[line + 1].start : byte_count();
return end - m_lines[line].start;
}
@@ -149,7 +149,7 @@ BufferIterator Buffer::end() const
return BufferIterator(*this, { line_count()-1, m_lines.back().length() });
}
-ByteCount Buffer::character_count() const
+ByteCount Buffer::byte_count() const
{
if (m_lines.empty())
return 0;
diff --git a/src/buffer.hh b/src/buffer.hh
index bca30078..05453ae0 100644
--- a/src/buffer.hh
+++ b/src/buffer.hh
@@ -127,7 +127,7 @@ public:
BufferIterator begin() const;
BufferIterator end() const;
- ByteCount character_count() const;
+ ByteCount byte_count() const;
LineCount line_count() const;
ByteCount line_length(LineCount line) const;
const String& line_content(LineCount line) const
diff --git a/src/buffer_iterator.inl.hh b/src/buffer_iterator.inl.hh
index ac455482..194a293f 100644
--- a/src/buffer_iterator.inl.hh
+++ b/src/buffer_iterator.inl.hh
@@ -72,7 +72,7 @@ inline ByteCount BufferIterator::offset() const
{
kak_assert(m_buffer);
return line() >= m_buffer->line_count() ?
- m_buffer->character_count() : m_buffer->m_lines[line()].start + column();
+ m_buffer->byte_count() : m_buffer->m_lines[line()].start + column();
}
inline size_t BufferIterator::operator-(const BufferIterator& iterator) const
@@ -86,7 +86,7 @@ inline BufferIterator BufferIterator::operator+(ByteCount size) const
kak_assert(m_buffer);
if (size >= 0)
{
- ByteCount o = std::min(m_buffer->character_count(), offset() + size);
+ ByteCount o = std::min(m_buffer->byte_count(), offset() + size);
for (LineCount i = line() + 1; i < m_buffer->line_count(); ++i)
{
if (m_buffer->m_lines[i].start > o)
@@ -188,7 +188,7 @@ inline bool BufferIterator::is_end() const
kak_assert(m_coord.column == 0);
return true;
}
- return offset() == m_buffer->character_count();
+ return offset() == m_buffer->byte_count();
}
}