Skip to content
lriki edited this page Jul 6, 2022 · 2 revisions

ファイルシステム (ln::FileSystem)

ln::FileSystem は、ファイルの読み書きや存在チェック、ディレクトリ走査などを行うためのユーティリティクラスです。

テキストファイルから文字列をすべて読み込む

auto result = ln::FileSystem::readAllText(U"file.txt");
if (!result) {
    // Access error.
    return;
}
ln::String str = *result;

文字列をテキストファイルへすべて書き込む

ln::String str = U"Contents.";

auto result = ln::FileSystem::writeAllText(U"file.txt", str);
if (!result) {
    // Access error.
    return;
}

Clone this wiki locally