LibCore: Convert CFile to ObjectPtr

This commit is contained in:
Andreas Kling 2019-09-21 20:50:06 +02:00
commit 8d550c174e
Notes: sideshowbarker 2024-07-19 12:00:53 +09:00
30 changed files with 135 additions and 134 deletions

View file

@ -8,12 +8,12 @@ int main(int argc, char** argv)
{
(void)argc;
(void)argv;
CFile f("/proc/dmesg");
if (!f.open(CIODevice::ReadOnly)) {
fprintf(stderr, "open: failed to open /proc/dmesg: %s", f.error_string());
auto f = CFile::construct("/proc/dmesg");
if (!f->open(CIODevice::ReadOnly)) {
fprintf(stderr, "open: failed to open /proc/dmesg: %s", f->error_string());
return 1;
}
const auto& b = f.read_all();
const auto& b = f->read_all();
for (auto i = 0; i < b.size(); ++i)
putchar(b[i]);
return 0;