summaryrefslogtreecommitdiff
path: root/Userland/Services/FileOperation
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-26 22:32:37 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-26 23:27:57 +0100
commitf1cc3d0fc48af5247278101f863d6416f763733e (patch)
tree56029f2d24e02d6028e6ea45c3037865739527c9 /Userland/Services/FileOperation
parent395ba619d8b0a5ac38368991a9da445cfb0e03a9 (diff)
downloadserenity-f1cc3d0fc48af5247278101f863d6416f763733e.zip
Userland: Use Core::ArgsParser's Vector<StringView> API everywhere
...and remove the Vector<String> variant since there are no remaining users of this API.
Diffstat (limited to 'Userland/Services/FileOperation')
-rw-r--r--Userland/Services/FileOperation/main.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Services/FileOperation/main.cpp b/Userland/Services/FileOperation/main.cpp
index 5515a3569d..6e174e7471 100644
--- a/Userland/Services/FileOperation/main.cpp
+++ b/Userland/Services/FileOperation/main.cpp
@@ -28,9 +28,9 @@ struct WorkItem {
off_t size;
};
-static int perform_copy(Vector<String> const& sources, String const& destination);
-static int perform_move(Vector<String> const& sources, String const& destination);
-static int perform_delete(Vector<String> const& sources);
+static int perform_copy(Vector<StringView> const& sources, String const& destination);
+static int perform_move(Vector<StringView> const& sources, String const& destination);
+static int perform_delete(Vector<StringView> const& sources);
static int execute_work_items(Vector<WorkItem> const& items);
static void report_error(String message);
static void report_warning(String message);
@@ -40,7 +40,7 @@ static String deduplicate_destination_file_name(String const& destination);
int main(int argc, char** argv)
{
String operation;
- Vector<String> paths;
+ Vector<StringView> paths;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(operation, "Operation: either 'Copy', 'Move' or 'Delete'", "operation", Core::ArgsParser::Required::Yes);
@@ -117,7 +117,7 @@ static bool collect_copy_work_items(String const& source, String const& destinat
return true;
}
-int perform_copy(Vector<String> const& sources, String const& destination)
+int perform_copy(Vector<StringView> const& sources, String const& destination)
{
Vector<WorkItem> items;
@@ -178,7 +178,7 @@ static bool collect_move_work_items(String const& source, String const& destinat
return true;
}
-int perform_move(Vector<String> const& sources, String const& destination)
+int perform_move(Vector<StringView> const& sources, String const& destination)
{
Vector<WorkItem> items;
@@ -228,7 +228,7 @@ static bool collect_delete_work_items(String const& source, Vector<WorkItem>& it
return true;
}
-int perform_delete(Vector<String> const& sources)
+int perform_delete(Vector<StringView> const& sources)
{
Vector<WorkItem> items;