diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 20:50:06 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 20:50:06 +0200 |
commit | 8d550c174edad68726b8e9c3cd5cd950bf1bf16a (patch) | |
tree | 2c6ed4bd36844e7df4bfc787ea6b23d71902f346 /DevTools | |
parent | 31b38ed88f3db123c498379f4615d2dce1ded406 (diff) | |
download | serenity-8d550c174edad68726b8e9c3cd5cd950bf1bf16a.zip |
LibCore: Convert CFile to ObjectPtr
Diffstat (limited to 'DevTools')
-rw-r--r-- | DevTools/FormCompiler/main.cpp | 8 | ||||
-rw-r--r-- | DevTools/IPCCompiler/main.cpp | 8 | ||||
-rw-r--r-- | DevTools/VisualBuilder/VBForm.cpp | 12 |
3 files changed, 14 insertions, 14 deletions
diff --git a/DevTools/FormCompiler/main.cpp b/DevTools/FormCompiler/main.cpp index 2e86550ff5..0b4dfafe39 100644 --- a/DevTools/FormCompiler/main.cpp +++ b/DevTools/FormCompiler/main.cpp @@ -13,13 +13,13 @@ int main(int argc, char** argv) return 0; } - CFile file(argv[1]); - if (!file.open(CIODevice::ReadOnly)) { - fprintf(stderr, "Error: Cannot open %s: %s\n", argv[1], file.error_string()); + auto file = CFile::construct(argv[1]); + if (!file->open(CIODevice::ReadOnly)) { + fprintf(stderr, "Error: Cannot open %s: %s\n", argv[1], file->error_string()); return 1; } - auto file_contents = file.read_all(); + auto file_contents = file->read_all(); auto json = JsonValue::from_string(file_contents); if (!json.is_object()) { diff --git a/DevTools/IPCCompiler/main.cpp b/DevTools/IPCCompiler/main.cpp index e1b78d93e5..87d140bba3 100644 --- a/DevTools/IPCCompiler/main.cpp +++ b/DevTools/IPCCompiler/main.cpp @@ -37,13 +37,13 @@ int main(int argc, char** argv) return 0; } - CFile file(argv[1]); - if (!file.open(CIODevice::ReadOnly)) { - fprintf(stderr, "Error: Cannot open %s: %s\n", argv[1], file.error_string()); + auto file = CFile::construct(argv[1]); + if (!file->open(CIODevice::ReadOnly)) { + fprintf(stderr, "Error: Cannot open %s: %s\n", argv[1], file->error_string()); return 1; } - auto file_contents = file.read_all(); + auto file_contents = file->read_all(); Vector<Endpoint> endpoints; diff --git a/DevTools/VisualBuilder/VBForm.cpp b/DevTools/VisualBuilder/VBForm.cpp index e885eb96ed..cd0aad11de 100644 --- a/DevTools/VisualBuilder/VBForm.cpp +++ b/DevTools/VisualBuilder/VBForm.cpp @@ -356,13 +356,13 @@ void VBForm::mousemove_event(GMouseEvent& event) void VBForm::load_from_file(const String& path) { - CFile file(path); - if (!file.open(CIODevice::ReadOnly)) { + auto file = CFile::construct(path); + if (!file->open(CIODevice::ReadOnly)) { GMessageBox::show(String::format("Could not open '%s' for reading", path.characters()), "Error", GMessageBox::Type::Error, GMessageBox::InputType::OK, window()); return; } - auto file_contents = file.read_all(); + auto file_contents = file->read_all(); auto form_json = JsonValue::from_string(file_contents); if (!form_json.is_object()) { @@ -392,8 +392,8 @@ void VBForm::load_from_file(const String& path) void VBForm::write_to_file(const String& path) { - CFile file(path); - if (!file.open(CIODevice::WriteOnly)) { + auto file = CFile::construct(path); + if (!file->open(CIODevice::WriteOnly)) { GMessageBox::show(String::format("Could not open '%s' for writing", path.characters()), "Error", GMessageBox::Type::Error, GMessageBox::InputType::OK, window()); return; } @@ -414,7 +414,7 @@ void VBForm::write_to_file(const String& path) widget_array.append(widget_object); } form_object.set("widgets", widget_array); - file.write(form_object.to_string()); + file->write(form_object.to_string()); } void VBForm::dump() |