PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/google-toolbox-for-mac/Foundation/GTMFourCharCode.h

http://macfuse.googlecode.com/
C++ Header | 51 lines | 13 code | 10 blank | 28 comment | 0 complexity | 07cbb2489ef6093ad83205bcf0eee3e2 MD5 | raw file
 1//
 2//  GTMFourCharCode
 3//  Wrapper for FourCharCodes
 4//
 5//  Copyright 2008 Google Inc.
 6//
 7//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
 8//  use this file except in compliance with the License.  You may obtain a copy
 9//  of the License at
10// 
11//  http://www.apache.org/licenses/LICENSE-2.0
12// 
13//  Unless required by applicable law or agreed to in writing, software
14//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
16//  License for the specific language governing permissions and limitations under
17//  the License.
18//
19
20#import <Foundation/Foundation.h>
21
22// FourCharCodes are OSTypes, ResTypes etc. This class wraps them if
23// you need to store them in dictionaries etc.
24@interface GTMFourCharCode : NSObject <NSCopying, NSCoding> {
25  FourCharCode code_;
26}
27
28// returns a string for a FourCharCode
29+ (id)stringWithFourCharCode:(FourCharCode)code;
30
31// String must be 4 chars or less, or you will get nil back.
32+ (id)fourCharCodeWithString:(NSString*)string;
33+ (id)fourCharCodeWithFourCharCode:(FourCharCode)code;
34
35// String must be 4 chars or less, or you will get nil back.
36- (id)initWithString:(NSString*)string;
37
38// Designated Initializer
39- (id)initWithFourCharCode:(FourCharCode)code;
40
41// Returns 'APPL' for "APPL"
42- (FourCharCode)fourCharCode;
43
44// For FourCharCode of 'APPL' returns "APPL". For 1 returns "\0\0\0\1"
45- (NSString*)stringValue;
46
47// For FourCharCode of "APPL" returns an NSNumber with 1095782476 (0x4150504C).
48// For 1 returns 1.
49- (NSNumber*)numberValue;
50
51@end