forked from johndbritton/teleport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TPMessage.h
40 lines (30 loc) · 1.08 KB
/
TPMessage.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
//
// TPMessage.h
// Teleport
//
// Created by JuL on Wed Dec 03 2003.
// Copyright (c) 2003-2005 abyssoft. All rights reserved.
//
#import <Foundation/Foundation.h>
extern const unsigned TPMessageHeaderLength;
@interface TPMessage : NSObject
{
TPDataLength _dataLength;
TPMsgType _msgType;
NSData * _additionalData;
}
- (instancetype) initWithRawData:(NSData*)rawData;
/* Protocol messages */
+ (instancetype) messageWithType:(TPMsgType)type;
+ (instancetype) messageWithType:(TPMsgType)type andData:(NSData*)data;
+ (instancetype) messageWithType:(TPMsgType)type andString:(NSString*)string;
+ (instancetype) messageWithType:(TPMsgType)type andInfoDict:(NSDictionary*)infoDict;
/* Accessors */
@property (nonatomic, readonly, copy) NSData *rawData;
@property (nonatomic, readonly) TPMsgType msgType;
@property (nonatomic, readonly) TPDataLength msgLength;
@property (nonatomic, readonly) TPDataLength dataLength;
@property (nonatomic, readonly, copy) NSData *data;
@property (nonatomic, readonly, copy) NSString *string;
@property (nonatomic, readonly, copy) NSDictionary *infoDict;
@end