aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/plugins/simple/Directory.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-26 19:48:37 +0100
committerMax Kellermann <max@duempel.org>2014-02-26 19:50:46 +0100
commit69a42fc901d06af2f90d7046e153dc1273f19beb (patch)
tree672f869bd68f193343b98c10f5b946c031731410 /src/db/plugins/simple/Directory.hxx
parent525789cd36c0dcf5a9b8a9fe25944197e9fc19cf (diff)
downloadmpd-69a42fc901d06af2f90d7046e153dc1273f19beb.tar.gz
mpd-69a42fc901d06af2f90d7046e153dc1273f19beb.tar.xz
mpd-69a42fc901d06af2f90d7046e153dc1273f19beb.zip
db/simple/Directory: LookupDirectory() return remaining URI
Code can now be reused in LookupSong().
Diffstat (limited to 'src/db/plugins/simple/Directory.hxx')
-rw-r--r--src/db/plugins/simple/Directory.hxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/db/plugins/simple/Directory.hxx b/src/db/plugins/simple/Directory.hxx
index 716afecea..ab03092f7 100644
--- a/src/db/plugins/simple/Directory.hxx
+++ b/src/db/plugins/simple/Directory.hxx
@@ -149,6 +149,21 @@ public:
return child;
}
+ struct LookupResult {
+ /**
+ * The last directory that was found. If the given
+ * URI could not be resolved at all, then this is the
+ * root directory.
+ */
+ Directory *directory;
+
+ /**
+ * The remaining URI part (without leading slash) or
+ * nullptr if the given URI was consumed completely.
+ */
+ const char *uri;
+ };
+
/**
* Looks up a directory by its relative URI.
*
@@ -156,7 +171,7 @@ public:
* @return the Directory, or nullptr if none was found
*/
gcc_pure
- Directory *LookupDirectory(const char *uri);
+ LookupResult LookupDirectory(const char *uri);
gcc_pure
bool IsEmpty() const {