Core::BaseTextDocument Class
class Core::BaseTextDocumentKlasa `BaseTextDocument` jest bardzo ogólną klasą bazową dla dokumentów obsługujących tekst. Więcej...
| Header: | #include <coreplugin/textdocument.h> |
| Inherits: | Core::IDocument |
Funkcje publiczne
| 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 |
Szczegółowy opis
Ta klasa zawiera metody pomocnicze służące do zapisywania i odczytywania plików tekstowych z ustawieniami kodowania i znaków końca linii.
Zobacz także Utils::TextFileFormat.
Dokumentacja funkcji składowych
Utils::TextFileFormat BaseTextDocument::format() const
Zwraca format uzyskany w wyniku ostatniego wywołania funkcji ` read()`.
Core::BaseTextDocument::ReadResult BaseTextDocument::read(const Utils::FilePath &filePath)
Automatycznie wykrywa format pliku i odczytuje plik tekstowy wskazany przez parametr ` filePath`.
Zwraca informację, czy operacja zakończyła się powodzeniem.
Utils::Result<> BaseTextDocument::write(const Utils::FilePath &filePath, const QString &data) const
Wyświetla zawartość (data) pliku tekstowego filePath. Wykorzystuje format uzyskany z ostatniego wywołania funkcji read() dla tego pliku.
Zwraca informację, czy operacja zakończyła się powodzeniem.
Utils::Result<> BaseTextDocument::write(const Utils::FilePath &filePath, const Utils::TextFileFormat &format, const QString &data) const
Wyświetla zawartość (data) pliku tekstowego filePath. Wykorzystuje format niestandardowy format.
Zwraca informację, czy operacja zakończyła się powodzeniem.
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.