#include "Bilder.h" #include // Inhalt der Bilder Klasse aus Bilder.h // Konstruktor Bilder::Bilder() : ReferenceCounter() { bilder = new RCArray< Bild >(); paths = new RCArray< Text >(); } // Destruktor Bilder::~Bilder() { bilder->release(); paths->release(); } // nicht constant Bild* Bilder::get( const char* path ) { c.lock(); int index = 0; for( auto i : *paths ) { if( i->istGleich( path ) ) { c.unlock(); return bilder->get( index ); } } Text p( path ); p.ersetzen( "\\", "/" ); LTDBDatei dat; dat.setDatei( p.getTeilText( 0, p.positionVon( "/", p.anzahlVon( "/" ) - 1 ) ) ); dat.leseDaten( 0 ); Bild* b = dat.laden( 0, p.getTeilText( p.positionVon( "/", p.anzahlVon( "/" ) - 1 ) + 1 ) ); if( !b ) { c.unlock(); return 0; } paths->add( new Text( path ) ); bilder->add( dynamic_cast(b->getThis()) ); c.unlock(); return b; }