void SegmentedString::prepend(const SegmentedString& s, PrependType type) { if (s.isComposite()) { Deque<SegmentedSubstring>::const_reverse_iterator it = s.m_substrings.rbegin(); Deque<SegmentedSubstring>::const_reverse_iterator e = s.m_substrings.rend(); for (; it != e; ++it) prepend(*it, type); } prepend(s.m_currentString, type); m_currentChar = m_currentString.length() ? m_currentString.getCurrentChar() : 0; }
void SegmentedString::prepend(const SegmentedString& s) { ASSERT(!escaped()); ASSERT(!s.escaped()); if (s.isComposite()) { Deque<SegmentedSubstring>::const_reverse_iterator it = s.m_substrings.rbegin(); Deque<SegmentedSubstring>::const_reverse_iterator e = s.m_substrings.rend(); for (; it != e; ++it) prepend(*it); } prepend(s.m_currentString); m_currentChar = m_pushedChar1 ? m_pushedChar1 : (m_currentString.m_length ? m_currentString.getCurrentChar() : 0); }
void SegmentedString::append(const SegmentedString& s) { ASSERT(!m_closed); append(s.m_currentString); if (s.isComposite()) { Deque<SegmentedSubstring>::const_iterator it = s.m_substrings.begin(); Deque<SegmentedSubstring>::const_iterator e = s.m_substrings.end(); for (; it != e; ++it) append(*it); } m_currentChar = m_currentString.length() ? m_currentString.getCurrentChar() : 0; }
void SegmentedString::append(const SegmentedString& s) { ASSERT(!m_closed); if (s.m_pushedChar1) { Vector<UChar, 2> unconsumedData; unconsumedData.append(s.m_pushedChar1); if (s.m_pushedChar2) unconsumedData.append(s.m_pushedChar2); append(SegmentedSubstring(String(unconsumedData))); } append(s.m_currentString); if (s.isComposite()) { Deque<SegmentedSubstring>::const_iterator it = s.m_substrings.begin(); Deque<SegmentedSubstring>::const_iterator e = s.m_substrings.end(); for (; it != e; ++it) append(*it); } m_currentChar = m_pushedChar1 ? m_pushedChar1 : (m_currentString.m_length ? m_currentString.getCurrentChar() : 0); }