diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-01-01 21:04:17 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-01-01 21:04:17 +0100 |
commit | 14500d43760661ffc3ffb67d929088c27fe46c64 (patch) | |
tree | 75d9471a61b00eb56b7ee75b3a785a392edb0dad /music.cpp | |
parent | 0e7f2cef26bde782a5758b5e9a3dfe20f745df8f (diff) |
Implemented a simple 'ls' command for the telnet server.
Diffstat (limited to 'music.cpp')
-rw-r--r-- | music.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -7,6 +7,8 @@ #include <boost/format.hpp> #include <boost/algorithm/string/predicate.hpp> +#include <boost/algorithm/string/classification.hpp> +#include <boost/algorithm/string/split.hpp> #include <boost/filesystem/fstream.hpp> #include <soci/soci.h> @@ -49,6 +51,12 @@ MusicListing::p music::get(const std::vector<std::string>& path) { return MusicListing::p(); } +MusicListing::p music::get(const std::string& path) { + std::vector<std::string> path_vector; + boost::algorithm::split(path_vector, path, boost::algorithm::is_any_of("/\\")); + return get(path_vector); +} + std::vector<MusicListing::p> music::find_artist(const std::string artist) { soci::session sql(config::vm["audist.database"].as<std::string>()); |