1 #ifndef __STL_PORT_H__
2 #define __STK_PORT_H__
5 #include <list>
6 #include <glib/glist.h>
7 #include <glib/gslist.h>
9 template <typename T>
10 class StlConv {
11 public :
12 static void slist(std::list<T> &stlList, const GSList *slist) {
13 for (const GSList *l = slist; l != NULL; l = l->next) {
14 T item = reinterpret_cast<T>(l->data);
15 stlList.push_back(item);
16 }
17 }
18 static void list(std::list<T> &stlList, const GList *list) {
19 for (const GList *l = list; l != NULL; l = l->next) {
20 T item = reinterpret_cast<T>(l->data);
21 stlList.push_back(item);
22 }
23 }
24 };
26 #endif