mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-08-03 14:49:02 +00:00
fs: preserve ReleaseBuffer return type
This commit is contained in:
parent
8adf410b1c
commit
df031e5280
1 changed files with 9 additions and 3 deletions
|
@ -62,6 +62,12 @@ namespace ams::fs {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<char[], ::ams::fs::impl::Deleter> ReleaseBuffer() {
|
||||||
|
auto released = std::unique_ptr<char[], ::ams::fs::impl::Deleter>(m_buffer, ::ams::fs::impl::Deleter(this->GetLength()));
|
||||||
|
this->ResetBuffer();
|
||||||
|
return released;
|
||||||
|
}
|
||||||
|
|
||||||
constexpr ALWAYS_INLINE void ResetBuffer() {
|
constexpr ALWAYS_INLINE void ResetBuffer() {
|
||||||
m_buffer = nullptr;
|
m_buffer = nullptr;
|
||||||
this->SetLength(0);
|
this->SetLength(0);
|
||||||
|
@ -118,15 +124,15 @@ namespace ams::fs {
|
||||||
|
|
||||||
constexpr ~Path() { /* ... */ }
|
constexpr ~Path() { /* ... */ }
|
||||||
|
|
||||||
WriteBuffer ReleaseBuffer() {
|
std::unique_ptr<char[], ::ams::fs::impl::Deleter> ReleaseBuffer() {
|
||||||
/* Check pre-conditions. */
|
/* Check pre-conditions. */
|
||||||
AMS_ASSERT(m_write_buffer.Get() != nullptr);
|
AMS_ASSERT(m_write_buffer.Get() != nullptr);
|
||||||
|
|
||||||
/* Reset. */
|
/* Reset. */
|
||||||
m_str = EmptyPath;
|
m_str = EmptyPath;
|
||||||
|
|
||||||
/* Return our write buffer. */
|
/* Release our write buffer. */
|
||||||
return std::move(m_write_buffer);
|
return m_write_buffer.ReleaseBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr Result SetShallowBuffer(const char *buffer) {
|
constexpr Result SetShallowBuffer(const char *buffer) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue