Prepare multi cluster tag parsing

This commit is contained in:
emeric
2018-03-01 22:20:53 +01:00
parent d6f0e34b62
commit 9cf89893e0
20 changed files with 504 additions and 522 deletions
+4 -19
View File
@@ -23,16 +23,15 @@
namespace Database {
MediaDirectory::MediaDirectory(boost::filesystem::path p, Type type)
: _type(type),
_path(stringTrimEnd(p.string(), "/\\"))
MediaDirectory::MediaDirectory(boost::filesystem::path p)
: _path(stringTrimEnd(p.string(), "/\\"))
{
}
MediaDirectory::pointer
MediaDirectory::create(Wt::Dbo::Session& session, boost::filesystem::path p, Type type)
MediaDirectory::create(Wt::Dbo::Session& session, boost::filesystem::path p)
{
return session.add( new MediaDirectory( p, type ) );
return session.add( new MediaDirectory(p) );
}
void
@@ -50,20 +49,6 @@ MediaDirectory::getAll(Wt::Dbo::Session& session)
return std::vector<MediaDirectory::pointer>(res.begin(), res.end());
}
std::vector<MediaDirectory::pointer>
MediaDirectory::getByType(Wt::Dbo::Session& session, Type type)
{
Wt::Dbo::collection< MediaDirectory::pointer > res = session.find<MediaDirectory>().where("type = ?").bind (type);
return std::vector<MediaDirectory::pointer>(res.begin(), res.end());
}
MediaDirectory::pointer
MediaDirectory::get(Wt::Dbo::Session& session, boost::filesystem::path p, Type type)
{
return session.find<MediaDirectory>().where("path = ?").where("type = ?").bind( p.string()).bind(type);
}
boost::filesystem::path
MediaDirectory::getPath(void) const
{