Back to index

tetex-bin  3.0
Public Member Functions | Private Attributes
GDir Class Reference

#include <gfile.h>

Collaboration diagram for GDir:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GDir (char *name, GBool doStatA=gTrue)
 ~GDir ()
GDirEntrygetNextEntry ()
void rewind ()

Private Attributes

GStringpath
GBool doStat
DIRdir

Detailed Description

Definition at line 113 of file gfile.h.


Constructor & Destructor Documentation

GDir::GDir ( char *  name,
GBool  doStatA = gTrue 
)

Definition at line 605 of file gfile.cc.

                                    {
  path = new GString(name);
  doStat = doStatA;
#if defined(WIN32)
  GString *tmp;

  tmp = path->copy();
  tmp->append("/*.*");
  hnd = FindFirstFile(tmp->getCString(), &ffd);
  delete tmp;
#elif defined(ACORN)
#elif defined(MACOS)
#else
  dir = opendir(name);
#ifdef VMS
  needParent = strchr(name, '[') != NULL;
#endif
#endif
}

Here is the call graph for this function:

Definition at line 625 of file gfile.cc.

            {
  delete path;
#if defined(WIN32)
  if (hnd) {
    FindClose(hnd);
    hnd = NULL;
  }
#elif defined(ACORN)
#elif defined(MACOS)
#else
  if (dir)
    closedir(dir);
#endif
}

Member Function Documentation

Definition at line 640 of file gfile.cc.

                              {
  GDirEntry *e;

#if defined(WIN32)
  if (hnd) {
    e = new GDirEntry(path->getCString(), ffd.cFileName, doStat);
    if (hnd  && !FindNextFile(hnd, &ffd)) {
      FindClose(hnd);
      hnd = NULL;
    }
  } else {
    e = NULL;
  }
#elif defined(ACORN)
#elif defined(MACOS)
#elif defined(VMS)
  struct dirent *ent;
  e = NULL;
  if (dir) {
    if (needParent) {
      e = new GDirEntry(path->getCString(), "-", doStat);
      needParent = gFalse;
      return e;
    }
    ent = readdir(dir);
    if (ent) {
      e = new GDirEntry(path->getCString(), ent->d_name, doStat);
    }
  }
#else
  struct dirent *ent;
  e = NULL;
  if (dir) {
    ent = readdir(dir);
    if (ent && !strcmp(ent->d_name, ".")) {
      ent = readdir(dir);
    }
    if (ent) {
      e = new GDirEntry(path->getCString(), ent->d_name, doStat);
    }
  }
#endif

  return e;
}

Here is the call graph for this function:

Definition at line 686 of file gfile.cc.

                  {
#ifdef WIN32
  GString *tmp;

  if (hnd)
    FindClose(hnd);
  tmp = path->copy();
  tmp->append("/*.*");
  hnd = FindFirstFile(tmp->getCString(), &ffd);
  delete tmp;
#elif defined(ACORN)
#elif defined(MACOS)
#else
  if (dir)
    rewinddir(dir);
#ifdef VMS
  needParent = strchr(path->getCString(), '[') != NULL;
#endif
#endif
}

Here is the call graph for this function:


Member Data Documentation

DIR* GDir::dir [private]

Definition at line 131 of file gfile.h.

GBool GDir::doStat [private]

Definition at line 124 of file gfile.h.

GString* GDir::path [private]

Definition at line 123 of file gfile.h.


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