terminal/src/buffer/out/textBufferTextIterator.cpp
Dustin Howett d4d59fa339 Initial release of the Windows Terminal source code
This commit introduces all of the Windows Terminal and Console Host source,
under the MIT license.
2019-05-02 15:29:04 -07:00

42 lines
1 KiB
C++

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "precomp.h"
#include "textBufferTextIterator.hpp"
#include "CharRow.hpp"
#include "Row.hpp"
#pragma hdrstop
using namespace Microsoft::Console::Types;
// Routine Description:
// - Narrows the view of a cell iterator into a text only iterator.
// Arguments:
// - A cell iterator
TextBufferTextIterator::TextBufferTextIterator(const TextBufferCellIterator& cellIt) :
TextBufferCellIterator(cellIt)
{
}
// Routine Description:
// - Returns the text information from the text buffer position addressed by this iterator.
// Return Value:
// - Read only UTF-16 text data
const std::wstring_view TextBufferTextIterator::operator*() const
{
return _view.Chars();
}
// Routine Description:
// - Returns the text information from the text buffer position addressed by this iterator.
// Return Value:
// - Read only UTF-16 text data
const std::wstring_view* TextBufferTextIterator::operator->() const
{
return &_view.Chars();
}