summaryrefslogtreecommitdiff
path: root/music.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'music.cpp')
-rw-r--r--music.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/music.cpp b/music.cpp
index 3faca9c..eb16226 100644
--- a/music.cpp
+++ b/music.cpp
@@ -24,6 +24,10 @@ void music::init(std::string root) {
root_directory = root;
}
+/** Fetches a MusicListing object from the given path.
+ * Prefixes the given path with the music root directory.
+ * This can be either a track (file) or a directory.
+ */
MusicListing::p music::get(const HTTP::Connection::PathList& path) {
// prefix path with our root_directory
fs::path p = root_directory;
@@ -48,12 +52,18 @@ MusicListing::p music::get(const HTTP::Connection::PathList& path) {
return MusicListing::p();
}
+/** Fetches a MusicListing object from the given path.
+ * Splits the given string and calls the above function.
+ */
MusicListing::p music::get(const std::string& path) {
HTTP::Connection::PathList path_vector;
boost::algorithm::split(path_vector, path, boost::algorithm::is_any_of("/\\"));
return get(path_vector);
}
+/** Fetches a directory.
+ * This is a helper function which returns a null pointer if the fetched MusicListing isn't a directory.
+ */
MusicDirectory::p music::get_directory(const std::string& path) {
MusicListing::p ml = get(path);
if(!ml || !fs::is_directory(ml->path)) {