9#ifndef LLDB_TARGET_PATHMAPPINGLIST_H
10#define LLDB_TARGET_PATHMAPPINGLIST_H
14#include "llvm/Support/Error.h"
15#include "llvm/Support/JSON.h"
38 void Append(llvm::StringRef path, llvm::StringRef replacement,
bool notify);
44 bool AppendUnique(llvm::StringRef path, llvm::StringRef replacement,
47 void Clear(
bool notify);
52 llvm::json::Value
ToJSON();
67 void Insert(llvm::StringRef path, llvm::StringRef replacement,
68 uint32_t insert_idx,
bool notify);
70 bool Remove(
size_t index,
bool notify);
74 bool Replace(llvm::StringRef path, llvm::StringRef replacement,
bool notify);
76 bool Replace(llvm::StringRef path, llvm::StringRef replacement,
77 uint32_t index,
bool notify);
100 std::optional<FileSpec>
RemapPath(llvm::StringRef path,
101 bool only_if_exists =
false)
const;
102 bool RemapPath(
const char *, std::string &)
const =
delete;
142 typedef std::pair<ConstString, ConstString>
pair;
147 void AppendNoLock(llvm::StringRef path, llvm::StringRef replacement);
149 void Notify(
bool notify)
const;
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.
uint32_t FindIndexForPathNoLock(llvm::StringRef path) const
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)
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 AppendNoLock(llvm::StringRef path, llvm::StringRef replacement)
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()
uint32_t m_mod_id
Incremented anytime anything is added to or removed from m_pairs.
void Notify(bool notify) const
std::mutex m_callback_mutex
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.