home *** CD-ROM | disk | FTP | other *** search
- #ifndef __DirArray_h
- #define __DirArray_h
- //=============================================================================
- //
- // Copyright (C) 1995,1996 by Paul S. McCarthy and Eric Sunshine.
- // Written by Paul S. McCarthy and Eric Sunshine.
- // All Rights Reserved.
- //
- // This notice may not be removed from this source code.
- //
- // This object is included in the MiscKit by permission from the authors
- // and its use is governed by the MiscKit license, found in the file
- // "License.rtf" in the MiscKit distribution. Please refer to that file
- // for a list of all applicable permissions and restrictions.
- //
- //=============================================================================
- //-----------------------------------------------------------------------------
- // DirArray.h
- //
- // An extensible array of directory entries.
- //
- //-----------------------------------------------------------------------------
- //-----------------------------------------------------------------------------
- // $Id$
- // $Log$
- //-----------------------------------------------------------------------------
-
- #import <objc/Object.h>
- #import <sys/dir.h>
- #import <sys/stat.h>
-
- @class DirArray;
- @class NXImage;
-
- typedef struct DirEntryStruct
- {
- DirArray* dir;
- char* name;
- char* soft_link;
- NXImage* image;
- int err;
- struct stat st;
- } DirEntry;
-
-
- @interface DirArray : Object
- {
- char* name;
- size_t total_bytes;
- int num_entries;
- int max_entries;
- DirEntry* entries;
- };
-
- - init;
- - free;
- - (void) empty;
- - (int) count;
- - (int) totalBytes;
- - (DirEntry const*) entryAt:(int)n;
- - (void) addName:(char const*)name path:(char const*)fullpath;
- - (void) remove:(int)n;
-
- // Returns: 0 = success, else could not open directory and returns errno value.
- - (int) loadPath:(char const*)path showHidden:(BOOL)flag;
-
- - (BOOL) isDir:(DirEntry const*)entry;
- - (BOOL) isDirAt:(int)n;
- - (NXImage*) getImage:(DirEntry const*)entry;
- - (NXImage*) getImageAt:(int)n;
-
- @end
-
- #endif // __DirArray_h
-