På denne side

Core::BaseTextDocument Class

class Core::BaseTextDocument

Klassen `BaseTextDocument` er en meget generel basisklasse for dokumenter, der arbejder med tekst. Mere...

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

Offentlige 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

Detaljeret beskrivelse

Denne klasse indeholder hjælpermetoder til at gemme og læse tekstfiler med indstillinger for kodning og linjeafslutning.

Se også Utils::TextFileFormat.

Dokumentation til medlemsfunktioner

Utils::TextFileFormat BaseTextDocument::format() const

Returnerer det format, der blev hentet ved det seneste kald til read().

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

Genkender automatisk filformatet og læser den tekstfil, der er angivet ved hjælp af ` filePath`.

Returnerer, om handlingen lykkedes.

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

Skriver indholdet (data) af tekstfilen filePath ud. Bruger det format, der blev hentet fra filens seneste read().

Returnerer, om operationen lykkedes.

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

Skriver indholdet (data) af tekstfilen filePath ud. Bruger det brugerdefinerede format format.

Returnerer, om operationen lykkedes.

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.