summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCore/File.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-04-17 00:48:31 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-17 01:27:31 +0200
commita1a6d30b54a672b84b2b3063052bcc40324a1b83 (patch)
tree6bc8f59c2ea93e3102478b8a4e50bbc5de1702a6 /Userland/Libraries/LibCore/File.h
parent510aad6515b597a74816ceb39d56f7029f400bab (diff)
downloadserenity-a1a6d30b54a672b84b2b3063052bcc40324a1b83.zip
LibCore: Make File take String instead of StringView
Diffstat (limited to 'Userland/Libraries/LibCore/File.h')
-rw-r--r--Userland/Libraries/LibCore/File.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibCore/File.h b/Userland/Libraries/LibCore/File.h
index 12b5223ed0..1e2d8d999a 100644
--- a/Userland/Libraries/LibCore/File.h
+++ b/Userland/Libraries/LibCore/File.h
@@ -39,10 +39,10 @@ class File final : public IODevice {
public:
virtual ~File() override;
- static Result<NonnullRefPtr<File>, String> open(const String& filename, IODevice::OpenMode, mode_t = 0644);
+ static Result<NonnullRefPtr<File>, String> open(String filename, IODevice::OpenMode, mode_t = 0644);
String filename() const { return m_filename; }
- void set_filename(const StringView& filename) { m_filename = filename; }
+ void set_filename(const String filename) { m_filename = move(filename); }
bool is_directory() const;
static bool is_directory(const String& filename);
@@ -78,7 +78,7 @@ public:
static Result<void, CopyError> copy_file_or_directory(const String& dst_path, const String& src_path, RecursionMode = RecursionMode::Allowed, LinkMode = LinkMode::Disallowed, AddDuplicateFileMarker = AddDuplicateFileMarker::Yes);
static String real_path_for(const String& filename);
- static String read_link(const StringView& link_path);
+ static String read_link(String const& link_path);
static Result<void, OSError> link_file(const String& dst_path, const String& src_path);
struct RemoveError {
@@ -104,7 +104,7 @@ private:
: IODevice(parent)
{
}
- explicit File(const StringView&, Object* parent = nullptr);
+ explicit File(String filename, Object* parent = nullptr);
bool open_impl(IODevice::OpenMode, mode_t);