mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 22:27:44 +00:00
LibFileSystem: Move TempFile
from LibCore
to LibFileSystem
As suggested in commit de18485
This commit is contained in:
parent
492e5c3c14
commit
752f06f228
6 changed files with 22 additions and 23 deletions
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020-2023, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Error.h>
|
||||
#include <AK/NonnullOwnPtr.h>
|
||||
#include <AK/String.h>
|
||||
|
||||
namespace Core {
|
||||
|
||||
class TempFile {
|
||||
|
||||
public:
|
||||
static ErrorOr<NonnullOwnPtr<TempFile>> create_temp_directory();
|
||||
static ErrorOr<NonnullOwnPtr<TempFile>> create_temp_file();
|
||||
|
||||
~TempFile();
|
||||
|
||||
String const& path() const { return m_path; }
|
||||
|
||||
private:
|
||||
enum class Type {
|
||||
Directory,
|
||||
File
|
||||
};
|
||||
|
||||
TempFile(Type type, String path)
|
||||
: m_type(type)
|
||||
, m_path(move(path))
|
||||
{
|
||||
}
|
||||
|
||||
Type m_type;
|
||||
String m_path;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue