haiku/src/apps/debugger/files/LocatableFile.h
Ingo Weinhold 3c5dbb462d * Moved Array.h to new directory "types".
* Added StringUtils with string hash functions.
* Added Locatable{Entry,File,Directory} and FileManager classes to manage the
  mapping from debug info/target file names to local file names.
* Image does now have a LocatableFile referring to the image's shared object
  file. Added listening to location changes of these files to TeamDebugger. No
  action is taken yet (should trigger reloading the debug info).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31368 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-01 22:09:33 +00:00

57 lines
1.2 KiB
C++

/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Distributed under the terms of the MIT License.
*/
#ifndef LOCATABLE_FILE_H
#define LOCATABLE_FILE_H
#include <ObjectList.h>
#include "LocatableEntry.h"
class LocatableFile : public LocatableEntry {
public:
class Listener;
public:
LocatableFile(LocatableEntryOwner* owner,
LocatableDirectory* directory,
const BString& name);
~LocatableFile();
virtual const char* Name() const;
void GetPath(BString& _path) const;
// mutable (requires/does locking)
virtual bool GetLocatedPath(BString& _path) const;
virtual void SetLocatedPath(const BString& path,
bool implicit);
bool AddListener(Listener* listener);
void RemoveListener(Listener* listener);
private:
typedef BObjectList<Listener> ListenerList;
private:
void _NotifyListeners();
private:
BString fName;
BString fLocatedPath;
ListenerList fListeners;
};
class LocatableFile::Listener {
public:
virtual ~Listener();
virtual void LocatableFileChanged(LocatableFile* file) = 0;
// called with lock held
};
#endif // LOCATABLE_FILE_H