aboutsummaryrefslogtreecommitdiff
path: root/lldb/tools/lldb-fuzzer/utils/TempFile.h
blob: 27453b0c62d2051387a523ea7524cffac1d211c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//===-- TempFile.h ----------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"

namespace lldb_fuzzer {

class TempFile {
public:
  TempFile() = default;
  ~TempFile();

  static std::unique_ptr<TempFile> Create(uint8_t *data, size_t size);
  llvm::StringRef GetPath() { return m_path.str(); }

private:
  llvm::SmallString<128> m_path;
};

} // namespace lldb_fuzzer