Auf dieser Seite

Core::BaseTextDocument Class

class Core::BaseTextDocument

Die Klasse „BaseTextDocument“ ist eine sehr allgemeine Basisklasse für Dokumente, die mit Text arbeiten. Mehr...

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

Öffentliche Funktionen

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

Ausführliche Beschreibung

Diese Klasse enthält Hilfsmethoden zum Speichern und Lesen von Textdateien mit Einstellungen für Kodierung und Zeilenenden.

Siehe auch „ Utils::TextFileFormat “.

Dokumentation der Mitgliedsfunktionen

Utils::TextFileFormat BaseTextDocument::format() const

Gibt das Format zurück, das beim letzten Aufruf von „ read()“ ermittelt wurde.

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

Erkennt das Dateiformat automatisch und liest die unter filePath angegebene Textdatei ein.

Gibt zurück, ob der Vorgang erfolgreich war.

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

Gibt den Inhalt (data) der Textdatei „ filePath “ aus. Verwendet dabei das Format, das beim letzten Aufruf von „ read()“ für diese Datei ermittelt wurde.

Gibt zurück, ob der Vorgang erfolgreich war.

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

Gibt den Inhalt (data) der Textdatei „ filePath “ aus. Verwendet das benutzerdefinierte Format „ format “.

Gibt zurück, ob der Vorgang erfolgreich war.

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.