Oolite 1.91.0.7604-240417-a536cbe
Loading...
Searching...
No Matches
Functions
OOTCPStreamDecoderAbstractionLayer.m File Reference
import "OOTCPStreamDecoderAbstractionLayer.h"
import "OOCocoa.h"
+ Include dependency graph for OOTCPStreamDecoderAbstractionLayer.m:

Go to the source code of this file.

Functions

OOALStringRef OOALGetConstantString (const char *string)
 
void OOALRelease (OOALObjectRef object)
 
OOALStringRef OOTypeDescription (OOALObjectRef object)
 
bool OOALIsString (OOALObjectRef object)
 
OOALStringRef OOALStringCreateWithFormatAndArguments (OOALStringRef format, va_list args)
 
bool OOALIsDictionary (OOALObjectRef object)
 
OOALObjectRef OOALDictionaryGetValue (OOALDictionaryRef dictionary, OOALObjectRef key)
 
bool OOALIsData (OOALObjectRef object)
 
OOALMutableDataRef OOALDataCreateMutable (size_t capacity)
 
void OOALMutableDataAppendBytes (OOALMutableDataRef data, const void *bytes, size_t length)
 
const void * OOALDataGetBytePtr (OOALDataRef data)
 
size_t OOALDataGetLength (OOALDataRef data)
 
OOALAutoreleasePoolRef OOALCreateAutoreleasePool (void)
 
OOALObjectRef OOALPropertyListFromData (OOALMutableDataRef data, OOALStringRef *errStr)
 

Function Documentation

◆ OOALCreateAutoreleasePool()

OOALAutoreleasePoolRef OOALCreateAutoreleasePool ( void )

Definition at line 106 of file OOTCPStreamDecoderAbstractionLayer.m.

107{
108 return [[NSAutoreleasePool alloc] init];
109}

Referenced by OOTCPStreamDecoderReceiveBytes().

+ Here is the caller graph for this function:

◆ OOALDataCreateMutable()

OOALMutableDataRef OOALDataCreateMutable ( size_t capacity)

Definition at line 82 of file OOTCPStreamDecoderAbstractionLayer.m.

83{
84 return [[NSMutableData alloc] initWithCapacity:capacity];
85}

Referenced by OOTCPStreamDecoderReceiveBytes().

+ Here is the caller graph for this function:

◆ OOALDataGetBytePtr()

const void * OOALDataGetBytePtr ( OOALDataRef data)

Definition at line 94 of file OOTCPStreamDecoderAbstractionLayer.m.

95{
96 return [data bytes];
97}

Referenced by OOTCPStreamDecoderReceiveData().

+ Here is the caller graph for this function:

◆ OOALDataGetLength()

size_t OOALDataGetLength ( OOALDataRef data)

Definition at line 100 of file OOTCPStreamDecoderAbstractionLayer.m.

101{
102 return [data length];
103}

Referenced by OOTCPStreamDecoderReceiveData().

+ Here is the caller graph for this function:

◆ OOALDictionaryGetValue()

OOALObjectRef OOALDictionaryGetValue ( OOALDictionaryRef dictionary,
OOALObjectRef key )

Definition at line 70 of file OOTCPStreamDecoderAbstractionLayer.m.

71{
72 return [dictionary objectForKey:key];
73}

Referenced by PacketReady().

+ Here is the caller graph for this function:

◆ OOALGetConstantString()

OOALStringRef OOALGetConstantString ( const char * string)

Definition at line 16 of file OOTCPStreamDecoderAbstractionLayer.m.

17{
18 static NSMutableDictionary *sStrings = nil;
19 NSValue *key = nil;
20 NSString *value = nil;
21
22 if (sStrings == nil)
23 {
24 sStrings = [[NSMutableDictionary alloc] init];
25 }
26
27 key = [NSValue valueWithPointer:string];
28 value = [sStrings objectForKey:key];
29 if (value == nil)
30 {
31 // Note: non-ASCII strings are not permitted, but we don't bother to detect them.
32 value = [NSString stringWithUTF8String:string];
33 if (value != nil) [sStrings setObject:value forKey:key];
34 }
35
36 return value;
37}
return nil

References nil.

◆ OOALIsData()

bool OOALIsData ( OOALObjectRef object)

Definition at line 76 of file OOTCPStreamDecoderAbstractionLayer.m.

77{
78 return [object isKindOfClass:[NSData class]];
79}

◆ OOALIsDictionary()

bool OOALIsDictionary ( OOALObjectRef object)

Definition at line 64 of file OOTCPStreamDecoderAbstractionLayer.m.

65{
66 return [object isKindOfClass:[NSDictionary class]];
67}

Referenced by PacketReady().

+ Here is the caller graph for this function:

◆ OOALIsString()

bool OOALIsString ( OOALObjectRef object)

Definition at line 52 of file OOTCPStreamDecoderAbstractionLayer.m.

53{
54 return [object isKindOfClass:[NSString class]];
55}

Referenced by PacketReady().

+ Here is the caller graph for this function:

◆ OOALMutableDataAppendBytes()

void OOALMutableDataAppendBytes ( OOALMutableDataRef data,
const void * bytes,
size_t length )

Definition at line 88 of file OOTCPStreamDecoderAbstractionLayer.m.

89{
90 [data appendBytes:bytes length:length];
91}

Referenced by OOTCPStreamDecoderReceiveBytes().

+ Here is the caller graph for this function:

◆ OOALPropertyListFromData()

OOALObjectRef OOALPropertyListFromData ( OOALMutableDataRef data,
OOALStringRef * errStr )

Definition at line 112 of file OOTCPStreamDecoderAbstractionLayer.m.

113{
114 id result = [NSPropertyListSerialization propertyListFromData:data
115 mutabilityOption:NSPropertyListImmutable
116 format:NULL
117 errorDescription:errStr];
118 [result retain];
119
120#if !OOLITE_RELEASE_PLIST_ERROR_STRINGS
121 [*errStr retain];
122#endif
123
124 return result;
125}

Referenced by PacketReady().

+ Here is the caller graph for this function:

◆ OOALRelease()

void OOALRelease ( OOALObjectRef object)

Definition at line 40 of file OOTCPStreamDecoderAbstractionLayer.m.

41{
42 [object release];
43}

Referenced by Error(), OOTCPStreamDecoderDestroy(), OOTCPStreamDecoderReceiveBytes(), and PacketReady().

+ Here is the caller graph for this function:

◆ OOALStringCreateWithFormatAndArguments()

OOALStringRef OOALStringCreateWithFormatAndArguments ( OOALStringRef format,
va_list args )

Definition at line 58 of file OOTCPStreamDecoderAbstractionLayer.m.

59{
60 return [[NSString alloc] initWithFormat:format arguments:args];
61}

Referenced by Error().

+ Here is the caller graph for this function:

◆ OOTypeDescription()

OOALStringRef OOTypeDescription ( OOALObjectRef object)

Definition at line 46 of file OOTCPStreamDecoderAbstractionLayer.m.

47{
48 return [[object class] description];
49}

Referenced by PacketReady().

+ Here is the caller graph for this function: