Code:
/*
Copyright (c) 2002 Tobias Kortkamp

Permission is hereby granted, free of charge, to any person obtaining a copy of this 
software and associated documentation files (the "Software"), to deal in the Software 
without restriction, including without limitation the rights to use, copy, modify, merge, 
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons 
to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or 
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE SOFTWARE.
*/

#include <dirent.h>
#include <iostream>
#include <string>
#include <vector>

namespace std {
class dir
{
public:
	dir(const char *dir)
	{
		directory = opendir(dir);
	}

	std::vector<std::string> getEntries()
	{
		struct dirent *dirEntry;
		std::vector<std::string> retVal;
		if(directory == 0)
		{
			return retVal;
		}

		while((dirEntry=readdir(directory)))
		{
			curDirEntry = dirEntry;
			if(selectDirEntry())
			{
				std::string str(dirEntry->d_name);
				retVal.push_back(str);
			}
			
		}
		return retVal;
	}

	virtual ~dir()
	{
		closedir(directory);
	}

	virtual bool selectDirEntry()
	{
		//Check wheter we want this particular directory entry.
		//all informations are in the struct curDirEntry
		return true;
	}

protected:
	struct dirent* curDirEntry;
	DIR *directory;
};	
}

class customDir : public std::dir
{
public:
	customDir(const char *dir) : std::dir(dir)
	{
	}
	~customDir()
	{
	}

	bool selectDirEntry()
	{
		std::string filename = curDirEntry->d_name;
		if(filename == "." || filename == "..")
			return false;
		return true;
	}
};

int main(void)
{
	std::dir dir("./");
	customDir dir2("./");
	
	std::vector<std::string> ret = dir.getEntries();
	std::vector<std::string> ret2 = dir2.getEntries();

	std::cout << "Alle Einträge: \n";
	for(unsigned int i=0; i < ret.size(); i++)
	{
		std::cout << ret[i] << std::endl;
	}
	std::cout << "Alle Einträge außer . und ..:\n";
	for(unsigned int i=0; i < ret2.size(); i++)
	{
		std::cout << ret2[i] << std::endl;
	}
}
In der Klasse customDir filtert er die Einträge . und .. raus. Kompilier das mal und teste mal, du wirst sehen, dass das funktioniert. Aber jetzt nimm mal virtual bei selectDirEntry in std::dir weg. Du wirst sehen das, dass jetzt nicht mehr funktioniert, da wir ja die Funktion getEntries() nicht in customDir mit überladen haben. Somit ruft er die selectDirEntry()-Funktion von std::dir auf und nicht die von customDir, das virtual keyword hilft hier.
Nähere Infos dazu findest du z.B. in Thinking in C++ (http://www.mindview.net )

c ya,
Tobias