#ifndef liblldb_PathMappingList_h_
#define liblldb_PathMappingList_h_
#include <map>
#include <vector>
#include "lldb/Core/ConstString.h"
#include "lldb/Core/Error.h"
namespace lldb_private {
class PathMappingList
{
public:
typedef void (*ChangedCallback) (const PathMappingList &path_list,
void *baton);
PathMappingList (ChangedCallback callback,
void *callback_baton);
PathMappingList (const PathMappingList &rhs);
virtual
~PathMappingList ();
const PathMappingList &
operator =(const PathMappingList &rhs);
void
Append (const ConstString &path, const ConstString &replacement, bool notify);
void
Clear (bool notify);
void
Dump (Stream *s);
size_t
GetSize ();
bool
GetPathsAtIndex (uint32_t idx, ConstString &path, ConstString &new_path) const;
void
Insert (const ConstString &path,
const ConstString &replacement,
uint32_t insert_idx,
bool notify);
bool
Remove (off_t index, bool notify);
bool
Remove (const ConstString &path, bool notify);
bool
Replace (const ConstString &path,
const ConstString &new_path,
bool notify);
bool
RemapPath (const ConstString &path, ConstString &new_path);
uint32_t
FindIndexForPath (const ConstString &path) const;
protected:
typedef std::pair <ConstString, ConstString> pair;
typedef std::vector <pair> collection;
typedef collection::iterator iterator;
typedef collection::const_iterator const_iterator;
iterator
FindIteratorForPath (const ConstString &path);
const_iterator
FindIteratorForPath (const ConstString &path) const;
collection m_pairs;
ChangedCallback m_callback;
void * m_callback_baton;
};
}
#endif // liblldb_PathMappingList_h_