Categories
木有技术

Qt文件打开方式

枚举值 描述
QIODevice::NotOpen 未打开
QIODevice::ReadOnly 以只读方式打开
QIODevice::WriteOnly 以只写方式打开
QIODevice::ReadWrite 以读写方式打开
QIODevice::Append 以追加的方式打开,新增加的内容将被追加到文件末尾
QIODevice::Truncate 以重写的方式打开,在写入新的数据时会将游标设置在文件开头
QIODevice::Text 在读取时,将行结束符转换成 n;在写入时,将行结束符转换成本地格式,例如 Win32 平台上是 rn
QIODevice::Unbuffered 忽略缓存

摘自http://www.devbean.net/2013/01/qt-study-road-2-text-file-io/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.