Core::BaseTextDocument Class
class Core::BaseTextDocumentКласс `BaseTextDocument` — это очень универсальный базовый класс для документов, работающих с текстом. Подробнее...
| Header: | #include <coreplugin/textdocument.h> |
| Inherits: | Core::IDocument |
Общедоступные функции
| Utils::TextFileFormat | format() const |
| Core::BaseTextDocument::ReadResult | read(const Utils::FilePath &filePath) |
| Utils::Result<> | write(const Utils::FilePath &filePath, const QString &data) const |
| Utils::Result<> | write(const Utils::FilePath &filePath, const Utils::TextFileFormat &format, const QString &data) const |
Подробное описание
Этот класс содержит вспомогательные методы для сохранения и чтения текстовых файлов с настройками кодировки и окончаний строк.
См. также « Utils::TextFileFormat ».
Документация по функциям-членам
Utils::TextFileFormat BaseTextDocument::format() const
Возвращает формат, полученный в результате последнего вызова функции ` read()`.
Core::BaseTextDocument::ReadResult BaseTextDocument::read(const Utils::FilePath &filePath)
Автоматически определяет формат файла и считывает текстовый файл, указанный в параметре ` filePath`.
Возвращает значение, указывающее, удалась ли операция.
Utils::Result<> BaseTextDocument::write(const Utils::FilePath &filePath, const QString &data) const
Выводит содержимое (data) текстового файла filePath. Использует формат, полученный при последнем вызове функции read() для данного файла.
Возвращает значение, указывающее, удалась ли операция.
Utils::Result<> BaseTextDocument::write(const Utils::FilePath &filePath, const Utils::TextFileFormat &format, const QString &data) const
Выводит содержимое (data) текстового файла filePath. Используется пользовательский формат format.
Возвращает значение, указывающее, была ли операция выполнена успешно.
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.