summaryrefslogtreecommitdiffstats
path: root/src/helper/stlport.h
blob: c9389e8147771a081fb66683db7ca94996756121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef __STL_PORT_H__
#define __STK_PORT_H__


#include <list>
#include <glib/glist.h>
#include <glib/gslist.h>

template <typename T>
class StlConv {
public :
    static void slist(std::list<T> &stlList, const GSList *slist) {
        for (const GSList *l = slist; l != NULL; l = l->next) {
            T item = reinterpret_cast<T>(l->data);
            stlList.push_back(item);
        }
    }
    static void list(std::list<T> &stlList, const GList *list) {
        for (const GList *l = list; l != NULL; l = l->next) {
            T item = reinterpret_cast<T>(l->data);
            stlList.push_back(item);
        }
    }
};

#endif