utf8_iterators: rename underlying_iterator to base

This commit is contained in:
Maxime Coste 2013-06-05 19:19:35 +02:00
parent 70bf71e51f
commit 245e68e26e
5 changed files with 9 additions and 9 deletions

View File

@ -660,7 +660,7 @@ static String assist(String message, CharCount maxWidth)
col = 0;
}
if (*word_begin != '\n')
line += String(word_begin.underlying_iterator(), word_end.underlying_iterator());
line += String{word_begin.base(), word_end.base()};
word_begin = word_end;
}
if (not line.empty())

View File

@ -320,10 +320,10 @@ void expand_unprintable(const Window& window, DisplayBuffer& display_buffer)
std::ostringstream oss;
oss << "U+" << std::hex << cp;
String str = oss.str();
if (it.underlying_iterator().coord() != atom_it->content.begin())
atom_it = ++line.split(atom_it, it.underlying_iterator().coord());
if ((it+1).underlying_iterator().coord() != atom_it->content.end())
atom_it = line.split(atom_it, (it+1).underlying_iterator().coord());
if (it.base().coord() != atom_it->content.begin())
atom_it = ++line.split(atom_it, it.base().coord());
if ((it+1).base().coord() != atom_it->content.end())
atom_it = line.split(atom_it, (it+1).base().coord());
atom_it->content.replace(str);
atom_it->colors = { Colors::Red, Colors::Black };
break;

View File

@ -185,7 +185,7 @@ using Utf8Policy = utf8::InvalidBytePolicy::Pass;
using Utf8Iterator = utf8::utf8_iterator<String::const_iterator, Utf8Policy>;
void addutf8str(WINDOW* win, Utf8Iterator begin, Utf8Iterator end)
{
waddstr(win, std::string(begin.underlying_iterator(), end.underlying_iterator()).c_str());
waddstr(win, std::string(begin.base(), end.base()).c_str());
}
static DisplayCoord window_size(WINDOW* win)

View File

@ -69,7 +69,7 @@ void skip_while_reverse(Iterator& it, const BeginIterator& begin, T condition)
Range utf8_range(const Utf8Iterator& first, const Utf8Iterator& last)
{
return {first.underlying_iterator().coord(), last.underlying_iterator().coord()};
return {first.base().coord(), last.base().coord()};
}
}

View File

@ -117,8 +117,8 @@ public:
return get_value();
}
const Iterator& underlying_iterator() const { return m_it; }
Iterator& underlying_iterator() { return m_it; }
const Iterator& base() const { return m_it; }
Iterator& base() { return m_it; }
protected:
void check_invariant() const