stlport.h revision c0537dcfe264414d52ad86579d57cb0cb2183dcb
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#ifndef __STL_PORT_H__
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#define __STK_PORT_H__
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#include <list>
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#include <glib.h>
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettitemplate <typename T>
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetticlass StlConv {
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettipublic :
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti static void slist(std::list<T> &stlList, const GSList *slist) {
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti for (const GSList *l = slist; l != NULL; l = l->next) {
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti T item = reinterpret_cast<T>(l->data);
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti stlList.push_back(item);
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti }
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti }
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti static void list(std::list<T> &stlList, const GList *list) {
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti for (const GList *l = list; l != NULL; l = l->next) {
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti T item = reinterpret_cast<T>(l->data);
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti stlList.push_back(item);
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti }
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti }
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti};
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#endif
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti