Sur cette page

Core::BaseTextDocument Class

class Core::BaseTextDocument

La classe `BaseTextDocument` est une classe de base très générale destinée aux documents traitant du texte. En savoir plus…

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

Fonctions publiques

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

Description détaillée

Cette classe contient des méthodes d'aide permettant d'enregistrer et de lire des fichiers texte avec des paramètres d'encodage et de fin de ligne.

Voir aussi Utils::TextFileFormat.

Documentation des fonctions membres

Utils::TextFileFormat BaseTextDocument::format() const

Renvoie le format obtenu lors du dernier appel à la fonction ` read()`.

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

Détecte automatiquement le format du fichier et lit le fichier texte spécifié par filePath.

Indique si l'opération a réussi.

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

Affiche le contenu (data) du fichier texte filePath. Utilise le format obtenu lors de la dernière fonction read() du fichier.

Indique si l'opération a réussi.

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

Affiche le contenu (data) du fichier texte filePath. Utilise le format personnalisé format.

Indique si l'opération a réussi.

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.