이 페이지에서

Core::BaseTextDocument Class

class Core::BaseTextDocument

BaseTextDocument 클래스는 텍스트를 다루는 문서를 위한 매우 일반적인 기본 클래스입니다. 더 보기...

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

공개 함수

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

상세 설명

이 클래스에는 인코딩 및 줄 끝 설정과 함께 텍스트 파일을 저장하고 읽기 위한 헬퍼 메서드가 포함되어 있습니다.

Utils::TextFileFormat도 참조하십시오 .

멤버 함수 설명

Utils::TextFileFormat BaseTextDocument::format() const

read() 함수를 마지막으로 호출했을 때 얻은 형식을 반환합니다.

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

파일 형식을 자동으로 감지하고 filePath 에서 지정한 텍스트 파일을 읽습니다.

작업이 성공적으로 수행되었는지 여부를 반환합니다.

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

텍스트 파일 ` filePath`의 내용(`data`)을 출력합니다. 이 파일의 마지막 ` read()` 호출에서 얻은 형식을 사용합니다.

작업이 성공했는지 여부를 반환합니다.

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

텍스트 파일 filePath 의 내용(data)을 출력합니다. 사용자 정의 형식 format 을 사용합니다.

작업이 성공했는지 여부를 반환합니다.

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.