51 lines
977 B
C++
51 lines
977 B
C++
|
|
#include <list>
|
|
#include <string>
|
|
using namespace std;
|
|
|
|
#include <libsaria/model.h>
|
|
#include <libsaria/callback.h>
|
|
#include <libsaria/library.h>
|
|
#include "library.h"
|
|
|
|
static list<LibraryPath> path_list;
|
|
|
|
namespace libsaria
|
|
{
|
|
list<LibraryPath> *library::get_path_list()
|
|
{
|
|
return &path_list;
|
|
}
|
|
|
|
LibraryPath *library::get_path(string dir)
|
|
{
|
|
list<LibraryPath>::iterator it;
|
|
for (it = path_list.begin(); it != path_list.end(); it++) {
|
|
if (it->get_path() == dir)
|
|
return &(*it);
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
void library::for_each_path(void (*info_func)(struct library::PathInfo &))
|
|
{
|
|
list<LibraryPath>::iterator it;
|
|
for (it = path_list.begin(); it != path_list.end(); it++)
|
|
it->get_info(info_func);
|
|
}
|
|
|
|
void library::update()
|
|
{
|
|
list<LibraryPath>::iterator it;
|
|
for (it = path_list.begin(); it != path_list.end(); it++)
|
|
it->update();
|
|
}
|
|
|
|
void library::refresh()
|
|
{
|
|
rebuild_list();
|
|
trigger_callback(LIBRARY_REFRESH);
|
|
}
|
|
|
|
}; /* namespace: libsaria */
|