Core::BaseTextDocument Class
class Core::BaseTextDocumentTřída BaseTextDocument je velmi obecná základní třída pro dokumenty, které pracují s textem. Více...
| Header: | #include <coreplugin/textdocument.h> |
| Inherits: | Core::IDocument |
Veřejné funkce
| 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 |
Podrobný popis
Tato třída obsahuje pomocné metody pro ukládání a čtení textových souborů s nastavením kódování a ukončení řádků.
Viz také Utils::TextFileFormat.
Dokumentace členských funkcí
Utils::TextFileFormat BaseTextDocument::format() const
Vrací formát získaný z posledního volání funkce ` read()`.
Core::BaseTextDocument::ReadResult BaseTextDocument::read(const Utils::FilePath &filePath)
Automaticky rozpozná formát souboru a načte textový soubor zadaný pomocí parametru ` filePath`.
Vrací, zda byla operace úspěšná.
Utils::Result<> BaseTextDocument::write(const Utils::FilePath &filePath, const QString &data) const
Zápis obsahu (data) textového souboru filePath. Použije se formát získaný z posledního volání funkce read() pro daný soubor.
Vrátí, zda byla operace úspěšná.
Utils::Result<> BaseTextDocument::write(const Utils::FilePath &filePath, const Utils::TextFileFormat &format, const QString &data) const
Zápis obsahu (data) textového souboru filePath. Používá vlastní formát format.
Vrátí, zda byla operace úspěšná.
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.