libsaria: Move more LibraryPath() code to the subdirectory

This commit is contained in:
Bryan Schumaker 2011-12-29 21:02:24 -05:00
parent df7e677bf2
commit ad989fdcd7
2 changed files with 41 additions and 36 deletions

View File

@ -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
{

View File

@ -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;
}