-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUKXattrMetadataStore.h
61 lines (47 loc) · 2.08 KB
/
UKXattrMetadataStore.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// UKXattrMetadataStore.h
// BubbleBrowser
// LICENSE: MIT License
//
// Created by Uli Kusterer on 12.03.06.
// Copyright 2006 Uli Kusterer. All rights reserved.
//
// -----------------------------------------------------------------------------
// Headers:
// -----------------------------------------------------------------------------
#import <Cocoa/Cocoa.h>
/*
This is a wrapper around The Mac OS X 10.4 and later xattr API that lets
you attach arbitrary metadata to a file. Currently it allows querying and
changing the attributes of a file, as well as retrieving a list of attribute
names.
It also includes some conveniences for storing/retrieving UTF8 strings,
and objects as XML property lists in addition to the raw data.
NOTE: keys (i.e. xattr names) are strings of 127 characters or less and
should be made like bundle identifiers, e.g. @"de.zathras.myattribute".
*/
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
// -----------------------------------------------------------------------------
// Class declaration:
// -----------------------------------------------------------------------------
@interface UKXattrMetadataStore : NSObject
{
}
+(NSArray*) allKeysAtPath: (NSString*)path traverseLink:(BOOL)travLnk;
// Store UTF8 strings:
+(void) setString: (NSString*)str forKey: (NSString*)key
atPath: (NSString*)path traverseLink:(BOOL)travLnk;
+(id) stringForKey: (NSString*)key atPath: (NSString*)path
traverseLink:(BOOL)travLnk;
// Store raw data:
+(void) setData: (NSData*)data forKey: (NSString*)key
atPath: (NSString*)path traverseLink:(BOOL)travLnk;
+(NSMutableData*) dataForKey: (NSString*)key atPath: (NSString*)path
traverseLink:(BOOL)travLnk;
// Store objects: (Only can get/set plist-type objects for now)�
+(void) setObject: (id)obj forKey: (NSString*)key atPath: (NSString*)path
traverseLink:(BOOL)travLnk;
+(id) objectForKey: (NSString*)key atPath: (NSString*)path
traverseLink:(BOOL)travLnk;
@end
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4*/