[VFS] Make ResolvePath argument a const reference.
This commit is contained in:
parent
7c7d80103e
commit
e72cacc986
|
@ -31,7 +31,7 @@ class Device {
|
||||||
virtual bool is_read_only() const { return true; }
|
virtual bool is_read_only() const { return true; }
|
||||||
|
|
||||||
virtual void Dump(StringBuffer* string_buffer) = 0;
|
virtual void Dump(StringBuffer* string_buffer) = 0;
|
||||||
virtual Entry* ResolvePath(std::string path) = 0;
|
virtual Entry* ResolvePath(const std::string& path) = 0;
|
||||||
|
|
||||||
virtual uint32_t total_allocation_units() const = 0;
|
virtual uint32_t total_allocation_units() const = 0;
|
||||||
virtual uint32_t available_allocation_units() const = 0;
|
virtual uint32_t available_allocation_units() const = 0;
|
||||||
|
|
|
@ -54,7 +54,7 @@ void DiscImageDevice::Dump(StringBuffer* string_buffer) {
|
||||||
root_entry_->Dump(string_buffer, 0);
|
root_entry_->Dump(string_buffer, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry* DiscImageDevice::ResolvePath(std::string path) {
|
Entry* DiscImageDevice::ResolvePath(const std::string& path) {
|
||||||
// The filesystem will have stripped our prefix off already, so the path will
|
// The filesystem will have stripped our prefix off already, so the path will
|
||||||
// be in the form:
|
// be in the form:
|
||||||
// some\PATH.foo
|
// some\PATH.foo
|
||||||
|
|
|
@ -29,7 +29,7 @@ class DiscImageDevice : public Device {
|
||||||
|
|
||||||
bool Initialize() override;
|
bool Initialize() override;
|
||||||
void Dump(StringBuffer* string_buffer) override;
|
void Dump(StringBuffer* string_buffer) override;
|
||||||
Entry* ResolvePath(std::string path) override;
|
Entry* ResolvePath(const std::string& path) override;
|
||||||
|
|
||||||
uint32_t total_allocation_units() const override {
|
uint32_t total_allocation_units() const override {
|
||||||
return uint32_t(mmap_->size() / sectors_per_allocation_unit() /
|
return uint32_t(mmap_->size() / sectors_per_allocation_unit() /
|
||||||
|
|
|
@ -48,7 +48,7 @@ void HostPathDevice::Dump(StringBuffer* string_buffer) {
|
||||||
root_entry_->Dump(string_buffer, 0);
|
root_entry_->Dump(string_buffer, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry* HostPathDevice::ResolvePath(std::string path) {
|
Entry* HostPathDevice::ResolvePath(const std::string& path) {
|
||||||
// The filesystem will have stripped our prefix off already, so the path will
|
// The filesystem will have stripped our prefix off already, so the path will
|
||||||
// be in the form:
|
// be in the form:
|
||||||
// some\PATH.foo
|
// some\PATH.foo
|
||||||
|
|
|
@ -27,7 +27,7 @@ class HostPathDevice : public Device {
|
||||||
|
|
||||||
bool Initialize() override;
|
bool Initialize() override;
|
||||||
void Dump(StringBuffer* string_buffer) override;
|
void Dump(StringBuffer* string_buffer) override;
|
||||||
Entry* ResolvePath(std::string path) override;
|
Entry* ResolvePath(const std::string& path) override;
|
||||||
|
|
||||||
bool is_read_only() const override { return read_only_; }
|
bool is_read_only() const override { return read_only_; }
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ void StfsContainerDevice::Dump(StringBuffer* string_buffer) {
|
||||||
root_entry_->Dump(string_buffer, 0);
|
root_entry_->Dump(string_buffer, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry* StfsContainerDevice::ResolvePath(std::string path) {
|
Entry* StfsContainerDevice::ResolvePath(const std::string& path) {
|
||||||
// The filesystem will have stripped our prefix off already, so the path will
|
// The filesystem will have stripped our prefix off already, so the path will
|
||||||
// be in the form:
|
// be in the form:
|
||||||
// some\PATH.foo
|
// some\PATH.foo
|
||||||
|
|
|
@ -171,7 +171,7 @@ class StfsContainerDevice : public Device {
|
||||||
|
|
||||||
bool Initialize() override;
|
bool Initialize() override;
|
||||||
void Dump(StringBuffer* string_buffer) override;
|
void Dump(StringBuffer* string_buffer) override;
|
||||||
Entry* ResolvePath(std::string path) override;
|
Entry* ResolvePath(const std::string& path) override;
|
||||||
|
|
||||||
uint32_t total_allocation_units() const override {
|
uint32_t total_allocation_units() const override {
|
||||||
return uint32_t(mmap_total_size_ / sectors_per_allocation_unit() /
|
return uint32_t(mmap_total_size_ / sectors_per_allocation_unit() /
|
||||||
|
|
Loading…
Reference in New Issue