2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
6 #include "LocatableDirectory.h"
9 LocatableDirectory::LocatableDirectory(LocatableEntryOwner
* owner
,
10 LocatableDirectory
* parent
, const BString
& path
)
12 LocatableEntry(owner
, parent
),
19 LocatableDirectory::~LocatableDirectory()
25 LocatableDirectory::Name() const
27 int32 lastSlash
= fPath
.FindLast('/');
28 // return -1, if not found
29 return fPath
.String() + (lastSlash
+ 1);
34 LocatableDirectory::Path() const
36 return fPath
.String();
41 LocatableDirectory::GetPath(BString
& _path
) const
48 LocatableDirectory::GetLocatedPath(BString
& _path
) const
50 if (fLocatedPath
.Length() == 0)
58 LocatableDirectory::SetLocatedPath(const BString
& path
, bool implicit
)
62 ? LOCATABLE_ENTRY_LOCATED_IMPLICITLY
63 : LOCATABLE_ENTRY_LOCATED_EXPLICITLY
;
68 LocatableDirectory::AddEntry(LocatableEntry
* entry
)
75 LocatableDirectory::RemoveEntry(LocatableEntry
* entry
)
77 fEntries
.Remove(entry
);