summaryrefslogtreecommitdiff
path: root/music.cpp
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-01-04 03:17:45 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2011-01-04 03:17:45 +0100
commitf0db6a4e4e6b3059c6553b819ac8788b62486103 (patch)
treec449ef54f745c4a4994d815579c69c0790bc26b1 /music.cpp
parent2b03b8ef2b5002f00960d17c8f1f634eb3a3a70f (diff)
Added Doxyfile and documentation comments in various places.
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)) {