På den här sidan

Core::BaseTextDocument Class

class Core::BaseTextDocument

Klassen BaseTextDocument är en mycket allmän basklass för dokument som hanterar text. Mer...

Header: #include <coreplugin/textdocument.h>
Inherits: Core::IDocument

Offentliga funktioner

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

Detaljerad beskrivning

Denna klass innehåller hjälpfunktioner för att spara och läsa textfiler med inställningar för kodning och radavslut.

Se även Utils::TextFileFormat.

Dokumentation för medlemsfunktioner

Utils::TextFileFormat BaseTextDocument::format() const

Returnerar det format som erhölls vid det senaste anropet till read().

Core::BaseTextDocument::ReadResult BaseTextDocument::read(const Utils::FilePath &filePath)

Känner automatiskt av filformatet och läser in den textfil som anges av filePath.

Returnerar om operationen lyckades.

Utils::Result<> BaseTextDocument::write(const Utils::FilePath &filePath, const QString &data) const

Skriver ut innehållet (data) i textfilen filePath. Använder det format som hämtades från filens senaste read().

Returnerar om operationen lyckades.

Utils::Result<> BaseTextDocument::write(const Utils::FilePath &filePath, const Utils::TextFileFormat &format, const QString &data) const

Skriver ut innehållet (data) i textfilen filePath. Använder det anpassade formatet format.

Returnerar om operationen lyckades.

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.