btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / debugger / files / LocatableFile.h
blob8e4777e62aa71a30302df22a6488fe2c7d281bcd
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef LOCATABLE_FILE_H
6 #define LOCATABLE_FILE_H
8 #include <ObjectList.h>
10 #include "LocatableEntry.h"
13 class LocatableFile : public LocatableEntry {
14 public:
15 class Listener;
17 public:
18 LocatableFile(LocatableEntryOwner* owner,
19 LocatableDirectory* directory,
20 const BString& name);
21 ~LocatableFile();
23 virtual const char* Name() const;
24 void GetPath(BString& _path) const;
26 // mutable (requires/does locking)
27 virtual bool GetLocatedPath(BString& _path) const;
28 virtual void SetLocatedPath(const BString& path,
29 bool implicit);
31 bool AddListener(Listener* listener);
32 void RemoveListener(Listener* listener);
34 private:
35 typedef BObjectList<Listener> ListenerList;
37 private:
38 void _NotifyListeners();
40 private:
41 BString fName;
42 BString fLocatedPath;
43 ListenerList fListeners;
47 class LocatableFile::Listener {
48 public:
49 virtual ~Listener();
51 virtual void LocatableFileChanged(LocatableFile* file) = 0;
52 // called with lock held
56 #endif // LOCATABLE_FILE_H