b8aac3c9bc
Add secondary_cursors field to Editor with insert_char_multi, delete_back_multi, delete_forward_multi methods. Right-to-left processing ensures position shifts don't corrupt earlier insertions. 7 new tests: add/clear, all_positions, insert, delete_back, delete_forward, unicode, duplicate-add.
65 lines
1007 B
C++
65 lines
1007 B
C++
#include <QString>
|
|
#include <QObject>
|
|
#include <memory>
|
|
#include "sycoca/kmemfile_p.h"
|
|
|
|
class KMemFile::Private
|
|
{
|
|
public:
|
|
Private() = default;
|
|
};
|
|
|
|
KMemFile::KMemFile(const QString &filename, QObject *parent)
|
|
: QIODevice(parent)
|
|
, d(std::make_unique<Private>())
|
|
{
|
|
Q_UNUSED(filename);
|
|
setOpenMode(QIODevice::ReadOnly);
|
|
}
|
|
|
|
KMemFile::~KMemFile() = default;
|
|
|
|
void KMemFile::fileContentsChanged(const QString &filename)
|
|
{
|
|
Q_UNUSED(filename);
|
|
}
|
|
|
|
qint64 KMemFile::readData(char *data, qint64 maxSize)
|
|
{
|
|
Q_UNUSED(data);
|
|
Q_UNUSED(maxSize);
|
|
return -1;
|
|
}
|
|
|
|
qint64 KMemFile::writeData(const char *data, qint64 maxSize)
|
|
{
|
|
Q_UNUSED(data);
|
|
Q_UNUSED(maxSize);
|
|
return -1;
|
|
}
|
|
|
|
void KMemFile::close()
|
|
{
|
|
QIODevice::close();
|
|
}
|
|
|
|
bool KMemFile::isSequential() const
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool KMemFile::open(OpenMode mode)
|
|
{
|
|
return QIODevice::open(mode);
|
|
}
|
|
|
|
bool KMemFile::seek(qint64 pos)
|
|
{
|
|
return QIODevice::seek(pos);
|
|
}
|
|
|
|
qint64 KMemFile::size() const
|
|
{
|
|
return 0;
|
|
}
|