/***************************************************************************

    supportware
    Copyright (C) 2001-2008 by c.holzheuer
    c.holzheuer@sourceworx.org

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

***************************************************************************/


#ifndef DDIOINFO_H
#define DDIOINFO_H


#include <ddioobject.h>
#include <ddmapptr.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

using namespace std;


/// ddioinfo provides information about files and direcories using ::stat
/**

*/

class ddioinfo;

typedef ddmapptr<ddioinfo> ddioinforow;

class ddioinfo : public ddioobject
{

public:

	ddioinfo();
	ddioinfo( const ddstring& path );
	
	virtual ~ddioinfo();
	
	virtual size_t size();

	// Verzeichnis Aspekt
	virtual int index_of( const ddstring& filename );
	virtual ddioinfo& operator[]( size_t index );
	virtual ddioinfo& operator[]( const ddstring& key );


  virtual void init_entries( const ddstring& path, const ddstring& filter="", bool do_append=true );   
  virtual void load_files( const ddstring& path, const ddstring& filter="", bool do_append=true ); 
  
	virtual bool init_path( const ddstring& path );
	virtual void dump() const;   
     
protected:

	ddioinforow* _entries;

private:

	ddioinfo( const ddioinfo& src );
	ddioinfo& operator=( const ddioinfo& src );

};


#endif
