mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 13:47:46 +00:00
Everywhere: Pass AK::StringView by value
This commit is contained in:
parent
ad5d217e76
commit
8b1108e485
392 changed files with 978 additions and 978 deletions
|
@ -14,18 +14,18 @@
|
|||
|
||||
namespace Desktop {
|
||||
|
||||
NonnullRefPtr<AppFile> AppFile::get_for_app(const StringView& app_name)
|
||||
NonnullRefPtr<AppFile> AppFile::get_for_app(StringView app_name)
|
||||
{
|
||||
auto path = String::formatted("{}/{}.af", APP_FILES_DIRECTORY, app_name);
|
||||
return open(path);
|
||||
}
|
||||
|
||||
NonnullRefPtr<AppFile> AppFile::open(const StringView& path)
|
||||
NonnullRefPtr<AppFile> AppFile::open(StringView path)
|
||||
{
|
||||
return adopt_ref(*new AppFile(path));
|
||||
}
|
||||
|
||||
void AppFile::for_each(Function<void(NonnullRefPtr<AppFile>)> callback, const StringView& directory)
|
||||
void AppFile::for_each(Function<void(NonnullRefPtr<AppFile>)> callback, StringView directory)
|
||||
{
|
||||
Core::DirIterator di(directory, Core::DirIterator::SkipDots);
|
||||
if (di.has_error())
|
||||
|
@ -42,7 +42,7 @@ void AppFile::for_each(Function<void(NonnullRefPtr<AppFile>)> callback, const St
|
|||
}
|
||||
}
|
||||
|
||||
AppFile::AppFile(const StringView& path)
|
||||
AppFile::AppFile(StringView path)
|
||||
: m_config(Core::ConfigFile::open(path))
|
||||
, m_valid(validate())
|
||||
{
|
||||
|
|
|
@ -15,9 +15,9 @@ namespace Desktop {
|
|||
class AppFile : public RefCounted<AppFile> {
|
||||
public:
|
||||
static constexpr const char* APP_FILES_DIRECTORY = "/res/apps";
|
||||
static NonnullRefPtr<AppFile> get_for_app(const StringView& app_name);
|
||||
static NonnullRefPtr<AppFile> open(const StringView& path);
|
||||
static void for_each(Function<void(NonnullRefPtr<AppFile>)>, const StringView& directory = APP_FILES_DIRECTORY);
|
||||
static NonnullRefPtr<AppFile> get_for_app(StringView app_name);
|
||||
static NonnullRefPtr<AppFile> open(StringView path);
|
||||
static void for_each(Function<void(NonnullRefPtr<AppFile>)>, StringView directory = APP_FILES_DIRECTORY);
|
||||
~AppFile();
|
||||
|
||||
bool is_valid() const { return m_valid; }
|
||||
|
@ -35,7 +35,7 @@ public:
|
|||
bool spawn() const;
|
||||
|
||||
private:
|
||||
explicit AppFile(const StringView& path);
|
||||
explicit AppFile(StringView path);
|
||||
|
||||
bool validate() const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue