9#ifndef LLDB_TARGET_PATHMAPPINGLIST_H
10#define LLDB_TARGET_PATHMAPPINGLIST_H
14#include "llvm/Support/Error.h"
15#include "llvm/Support/JSON.h"
39 void Append(llvm::StringRef path, llvm::StringRef replacement,
bool notify);
45 bool AppendUnique(llvm::StringRef path, llvm::StringRef replacement,
48 void Clear(
bool notify);
53 llvm::json::Value
ToJSON();
56 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
61 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
68 void Insert(llvm::StringRef path, llvm::StringRef replacement,
69 uint32_t insert_idx,
bool notify);
71 bool Remove(
size_t index,
bool notify);
75 bool Replace(llvm::StringRef path, llvm::StringRef replacement,
bool notify);
77 bool Replace(llvm::StringRef path, llvm::StringRef replacement,
78 uint32_t index,
bool notify);
101 std::optional<FileSpec>
RemapPath(llvm::StringRef path,
102 bool only_if_exists =
false)
const;
103 bool RemapPath(
const char *, std::string &)
const =
delete;
140 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
146 typedef std::pair<ConstString, ConstString>
pair;
A uniqued constant string class.
bool Remove(size_t index, bool notify)
std::vector< pair > collection
bool RemapPath(const char *, std::string &) const =delete
bool AppendUnique(llvm::StringRef path, llvm::StringRef replacement, bool notify)
Append <path, replacement> pair without duplication.
iterator FindIteratorForPath(ConstString path)
std::optional< FileSpec > FindFile(const FileSpec &orig_spec) const
Finds a source file given a file spec using the path remappings.
bool Replace(llvm::StringRef path, llvm::StringRef replacement, bool notify)
std::recursive_mutex m_mutex
uint32_t FindIndexForPath(llvm::StringRef path) const
void(* ChangedCallback)(const PathMappingList &path_list, void *baton)
void Insert(llvm::StringRef path, llvm::StringRef replacement, uint32_t insert_idx, bool notify)
uint32_t GetModificationID() const
collection::const_iterator const_iterator
ChangedCallback m_callback
const PathMappingList & operator=(const PathMappingList &rhs)
void Append(llvm::StringRef path, llvm::StringRef replacement, bool notify)
bool RemapPath(ConstString path, ConstString &new_path) const
bool GetPathsAtIndex(uint32_t idx, ConstString &path, ConstString &new_path) const
collection::iterator iterator
std::pair< ConstString, ConstString > pair
llvm::json::Value ToJSON()
std::optional< llvm::StringRef > ReverseRemapPath(const FileSpec &file, FileSpec &fixed) const
Perform reverse source path remap for input file.
void Dump(Stream *s, int pair_index=-1)
A stream class that can stream formatted output to a file.
A class that represents a running process on the host machine.