This is DirArray.h in view mode; [Download] [Up]
#ifndef __DirArray_h
#define __DirArray_h
//=============================================================================
//
// Copyright (C) 1995-1997 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: DirArray.h,v 1.2 97/06/10 04:53:08 sunshine Exp $
// $Log: DirArray.h,v $
// Revision 1.2 97/06/10 04:53:08 sunshine
// v15: Upgraded naming. Fixed bug: Wasn't taking sticky-bit into account
// when computing canToggleLock.
//
// Revision 1.1 97/02/05 08:22:31 sunshine
// v13: Synchronized with ScrollDir (v29). Added unscaledImage. Added
// isLocked & canToggleLock. Added manipulation methods. Supports file
// renaming.
//-----------------------------------------------------------------------------
#import <objc/Object.h>
#import <sys/dir.h>
#import <sys/stat.h>
@class DirArray;
@class NXImage;
typedef struct DirEntryStruct
{
DirArray* dir;
char* name;
char* softLink;
struct stat status;
BOOL isDirectory;
BOOL isLocked;
BOOL canToggleLock;
NXImage* scaledImage;
NXImage* unscaledImage;
} DirEntry;
@interface DirArray : Object
{
char* name;
size_t totalBytes;
int numEntries;
int maxEntries;
DirEntry* entries;
BOOL writable;
BOOL sticky;
uid_t effectiveUid;
};
- (id)init;
- (id)free;
- (void)empty;
- (int)count;
- (size_t)totalBytes;
- (BOOL)dirWritable;
- (BOOL)dirSticky;
- (DirEntry const*)entryAt:(int)n;
- (void)remove:(int)n;
// Returns: 0 for success, else errno if could not open directory.
- (int)loadPath:(char const*)path showHidden:(BOOL)flag;
- (BOOL)isDir:(DirEntry const*)entry;
- (BOOL)isDirAt:(int)n;
- (NXImage*)getImage:(DirEntry const*)entry scaled:(BOOL)flag;
- (NXImage*)getImageAt:(int)n scaled:(BOOL)flag;
- (BOOL)canToggleLock:(DirEntry const*)entry;
- (BOOL)canToggleLockAt:(int)n;
- (BOOL)isLocked:(DirEntry const*)entry;
- (BOOL)isLockedAt:(int)n;
- (void)setLocked:(BOOL)flag at:(int)n;
- (void)setName:(char const*)name at:(int)n;
@end
#endif // __DirArray_h
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.