1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 14:17:34 +00:00

Everywhere: Pass AK::StringView by value

This commit is contained in:
Andreas Kling 2021-11-11 00:55:02 +01:00
parent ad5d217e76
commit 8b1108e485
392 changed files with 978 additions and 978 deletions

View file

@ -20,7 +20,7 @@
namespace Audio {
FlacLoaderPlugin::FlacLoaderPlugin(const StringView& path)
FlacLoaderPlugin::FlacLoaderPlugin(StringView path)
: m_file(Core::File::construct(path))
{
if (!m_file->open(Core::OpenMode::ReadOnly)) {

View file

@ -69,7 +69,7 @@ ALWAYS_INLINE i32 decode_unsigned_exp_golomb(u8 order, InputBitStream& bit_input
class FlacLoaderPlugin : public LoaderPlugin {
public:
FlacLoaderPlugin(const StringView& path);
FlacLoaderPlugin(StringView path);
FlacLoaderPlugin(const ByteBuffer& buffer);
~FlacLoaderPlugin()
{

View file

@ -9,7 +9,7 @@
namespace Audio {
Loader::Loader(const StringView& path)
Loader::Loader(StringView path)
{
m_plugin = make<WavLoaderPlugin>(path);
if (m_plugin->sniff())

View file

@ -51,7 +51,7 @@ public:
class Loader : public RefCounted<Loader> {
public:
static NonnullRefPtr<Loader> create(const StringView& path) { return adopt_ref(*new Loader(path)); }
static NonnullRefPtr<Loader> create(StringView path) { return adopt_ref(*new Loader(path)); }
static NonnullRefPtr<Loader> create(const ByteBuffer& buffer) { return adopt_ref(*new Loader(buffer)); }
bool has_error() const { return m_plugin ? m_plugin->has_error() : true; }
@ -78,7 +78,7 @@ public:
RefPtr<Core::File> file() const { return m_plugin ? m_plugin->file() : nullptr; }
private:
Loader(const StringView& path);
Loader(StringView path);
Loader(const ByteBuffer& buffer);
mutable OwnPtr<LoaderPlugin> m_plugin;

View file

@ -17,7 +17,7 @@ namespace Audio {
static constexpr size_t maximum_wav_size = 1 * GiB; // FIXME: is there a more appropriate size limit?
WavLoaderPlugin::WavLoaderPlugin(const StringView& path)
WavLoaderPlugin::WavLoaderPlugin(StringView path)
: m_file(Core::File::construct(path))
{
if (!m_file->open(Core::OpenMode::ReadOnly)) {

View file

@ -33,7 +33,7 @@ class Buffer;
// Parses a WAV file and produces an Audio::Buffer.
class WavLoaderPlugin : public LoaderPlugin {
public:
WavLoaderPlugin(const StringView& path);
WavLoaderPlugin(StringView path);
WavLoaderPlugin(const ByteBuffer& buffer);
virtual bool sniff() override { return valid; }

View file

@ -8,7 +8,7 @@
namespace Audio {
WavWriter::WavWriter(const StringView& path, int sample_rate, int num_channels, int bits_per_sample)
WavWriter::WavWriter(StringView path, int sample_rate, int num_channels, int bits_per_sample)
: m_sample_rate(sample_rate)
, m_num_channels(num_channels)
, m_bits_per_sample(bits_per_sample)
@ -29,7 +29,7 @@ WavWriter::~WavWriter()
finalize();
}
void WavWriter::set_file(const StringView& path)
void WavWriter::set_file(StringView path)
{
m_file = Core::File::construct(path);
if (!m_file->open(Core::OpenMode::ReadWrite)) {

View file

@ -13,7 +13,7 @@ namespace Audio {
class WavWriter {
public:
WavWriter(const StringView& path, int sample_rate = 44100, int num_channels = 2, int bits_per_sample = 16);
WavWriter(StringView path, int sample_rate = 44100, int num_channels = 2, int bits_per_sample = 16);
WavWriter(int sample_rate = 44100, int num_channels = 2, int bits_per_sample = 16);
~WavWriter();
@ -28,7 +28,7 @@ public:
u16 bits_per_sample() const { return m_bits_per_sample; }
RefPtr<Core::File> file() const { return m_file; }
void set_file(const StringView& path);
void set_file(StringView path);
void set_num_channels(int num_channels) { m_num_channels = num_channels; }
void set_sample_rate(int sample_rate) { m_sample_rate = sample_rate; }
void set_bits_per_sample(int bits_per_sample) { m_bits_per_sample = bits_per_sample; }