summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCore/Account.h
diff options
context:
space:
mode:
authorLucas CHOLLET <lucas.chollet@free.fr>2022-06-10 20:06:06 +0200
committerSam Atkins <atkinssj@gmail.com>2022-09-27 21:29:44 +0100
commit507cb411c26c5e4199f7130cee0ea50a4985dc51 (patch)
tree4075a73e7120872fe8f248c0bef616bd7babca60 /Userland/Libraries/LibCore/Account.h
parent0396b6da82c34dc94dd9dc8248df536e8b3792c4 (diff)
downloadserenity-507cb411c26c5e4199f7130cee0ea50a4985dc51.zip
LibCore: Use `StringView` instead of `char *` in Account
Diffstat (limited to 'Userland/Libraries/LibCore/Account.h')
-rw-r--r--Userland/Libraries/LibCore/Account.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/Userland/Libraries/LibCore/Account.h b/Userland/Libraries/LibCore/Account.h
index e75de6f71a..f34a698ba0 100644
--- a/Userland/Libraries/LibCore/Account.h
+++ b/Userland/Libraries/LibCore/Account.h
@@ -32,11 +32,9 @@ public:
PasswdOnly
};
- // FIXME: Convert the methods below to take StringViews instead.
-
static String parse_path_with_uid(StringView general_path, Optional<uid_t> force_uid = {});
static ErrorOr<Account> self(Read options = Read::All);
- static ErrorOr<Account> from_name(char const* username, Read options = Read::All);
+ static ErrorOr<Account> from_name(StringView username, Read options = Read::All);
static ErrorOr<Account> from_uid(uid_t uid, Read options = Read::All);
bool authenticate(SecretString const& password) const;
@@ -51,11 +49,11 @@ public:
// You must call sync to apply changes.
void set_password(SecretString const& password);
void set_password_enabled(bool enabled);
- void set_home_directory(char const* home_directory) { m_home_directory = home_directory; }
+ void set_home_directory(StringView home_directory) { m_home_directory = home_directory; }
void set_uid(uid_t uid) { m_uid = uid; }
void set_gid(gid_t gid) { m_gid = gid; }
- void set_shell(char const* shell) { m_shell = shell; }
- void set_gecos(char const* gecos) { m_gecos = gecos; }
+ void set_shell(StringView shell) { m_shell = shell; }
+ void set_gecos(StringView gecos) { m_gecos = gecos; }
void delete_password();
// A null password means that this account was missing from /etc/shadow.