libsaria: Move more LibraryPath() code to the subdirectory
This commit is contained in:
parent
df7e677bf2
commit
ad989fdcd7
|
@ -5,42 +5,6 @@ using namespace std;
|
|||
#include <libsaria/library.h>
|
||||
#include "library.h"
|
||||
|
||||
LibraryPath::LibraryPath()
|
||||
{
|
||||
}
|
||||
|
||||
LibraryPath::LibraryPath(string dir)
|
||||
{
|
||||
path = dir;
|
||||
}
|
||||
|
||||
LibraryPath::~LibraryPath()
|
||||
{
|
||||
}
|
||||
|
||||
string LibraryPath::get_path()
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
void LibraryPath::get_info(void (*info_func)(struct libsaria::library::PathInfo &))
|
||||
{
|
||||
struct libsaria::library::PathInfo info;
|
||||
info.path = path;
|
||||
info.size = file_list.size();
|
||||
info_func(info);
|
||||
}
|
||||
|
||||
list<libsaria::Track>::iterator LibraryPath::find_id(sid_t &id)
|
||||
{
|
||||
list<libsaria::Track>::iterator it;
|
||||
for (it = file_list.begin(); it != file_list.end(); it++) {
|
||||
if (it->get_songid() == id)
|
||||
break;
|
||||
}
|
||||
return it;
|
||||
}
|
||||
|
||||
namespace libsaria
|
||||
{
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
#include "path.h"
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
LibraryPath::LibraryPath()
|
||||
{
|
||||
}
|
||||
|
||||
LibraryPath::LibraryPath(string dir)
|
||||
{
|
||||
path = dir;
|
||||
}
|
||||
|
||||
LibraryPath::~LibraryPath()
|
||||
{
|
||||
}
|
||||
|
||||
string LibraryPath::get_path()
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
void LibraryPath::get_info(void (*info_func)(struct libsaria::library::PathInfo &))
|
||||
{
|
||||
struct libsaria::library::PathInfo info;
|
||||
info.path = path;
|
||||
info.size = file_list.size();
|
||||
info_func(info);
|
||||
}
|
||||
|
||||
list<libsaria::Track>::iterator LibraryPath::find_id(sid_t &id)
|
||||
{
|
||||
list<libsaria::Track>::iterator it;
|
||||
for (it = file_list.begin(); it != file_list.end(); it++) {
|
||||
if (it->get_songid() == id)
|
||||
break;
|
||||
}
|
||||
return it;
|
||||
}
|
Loading…
Reference in New Issue