Core::BaseTextDocument Class
class Core::BaseTextDocumentLa classe `BaseTextDocument` è una classe base molto generica per i documenti che gestiscono il testo. Per saperne di più...
| Header: | #include <coreplugin/textdocument.h> |
| Inherits: | Core::IDocument |
Funzioni pubbliche
| 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 |
Descrizione dettagliata
Questa classe contiene metodi di supporto per il salvataggio e la lettura di file di testo con impostazioni relative alla codifica e ai caratteri di fine riga.
Vedi anche Utils::TextFileFormat.
Documentazione delle funzioni membro
Utils::TextFileFormat BaseTextDocument::format() const
Restituisce il formato ottenuto dall'ultima chiamata alla funzione ` read()`.
Core::BaseTextDocument::ReadResult BaseTextDocument::read(const Utils::FilePath &filePath)
Rileva automaticamente il formato del file e legge il file di testo specificato dall'filePath.
Restituisce se l'operazione è andata a buon fine.
Utils::Result<> BaseTextDocument::write(const Utils::FilePath &filePath, const QString &data) const
Scrive il contenuto (data) del file di testo filePath. Utilizza il formato ottenuto dall'ultima chiamata a read() sul file.
Restituisce se l'operazione è andata a buon fine.
Utils::Result<> BaseTextDocument::write(const Utils::FilePath &filePath, const Utils::TextFileFormat &format, const QString &data) const
Scrive il contenuto (data) del file di testo filePath. Utilizza il formato personalizzato format.
Restituisce se l'operazione è andata a buon fine.
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.