news download themes documentation links










FbTk::Directory Class Reference

Wrapper class for DIR * routines. More...

#include <Directory.hh>

Inheritance diagram for FbTk::Directory:

FbTk::NotCopyable List of all members.

Public Member Functions

 Directory (const char *dir=0)
void rewind ()
 go to start of filelist

dirent * read ()
std::string readFilename ()
 reads next filename in directory

void close ()
 close directory

bool open (const char *dir)
size_t entries () const
 number of entries in the directory


Static Public Member Functions

bool isDirectory (const std::string &filename)
 true if file is a directory

bool isRegularFile (const std::string &filename)
 true if a file is a regular file


Detailed Description

Wrapper class for DIR * routines.

Definition at line 36 of file Directory.hh.


Member Function Documentation

bool FbTk::Directory::open const char *  dir  ) 
 

open directory

Parameters:
dir the directory name

Definition at line 69 of file Directory.cc.

References close(), read(), and rewind().

00069                                     {
00070     if (dir == 0)
00071         return false;
00072 
00073     if (m_dir != 0)
00074         close();
00075 
00076     m_dir = opendir(dir);
00077     if (m_dir == 0) // successfull loading?
00078         return false;
00079 
00080     // get number of entries
00081     while (read())
00082         m_num_entries++;
00083 
00084     rewind(); // go back to start
00085 
00086     return true;
00087 }

struct dirent * FbTk::Directory::read  ) 
 

gets next dirent info struct in directory and jumps to next directory entry

Definition at line 46 of file Directory.cc.

Referenced by open(), and readFilename().

00046                                {
00047     if (m_dir == 0)
00048         return 0;
00049 
00050     return readdir(m_dir);
00051 }


The documentation for this class was generated from the following files:

Fluxbox CVS-Jan-2003




      



Got comments about the page? Send them to webmaster.
If you have general Fluxbox related questions ask them on our irc channel or mailing lists.

Show Source








Designed by aLEczapKA