2007-02-13 03:41:55 +00:00
|
|
|
/* Copyright (c) 2007 Christopher J. W. Lloyd
|
|
|
|
|
2020-05-11 15:52:05 +00:00
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
|
this software and associated documentation files (the "Software"), to deal in
|
|
|
|
the Software without restriction, including without limitation the rights to
|
|
|
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
|
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
|
|
subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
|
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
|
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
2007-02-13 03:41:55 +00:00
|
|
|
|
|
|
|
#import <Foundation/NSString.h>
|
2020-05-11 15:52:05 +00:00
|
|
|
#import <Onyx2D/O2PDFObject_const.h>
|
2007-02-13 03:41:55 +00:00
|
|
|
|
2009-10-06 16:02:46 +00:00
|
|
|
@implementation O2PDFObject_const
|
2007-02-13 03:41:55 +00:00
|
|
|
|
2020-05-11 15:52:05 +00:00
|
|
|
- initWithObjectType: (O2PDFObjectType) type {
|
|
|
|
_objectType = type;
|
|
|
|
return self;
|
2007-02-13 03:41:55 +00:00
|
|
|
}
|
|
|
|
|
2020-05-11 15:52:05 +00:00
|
|
|
+ pdfObjectArrayMark {
|
|
|
|
return [[[self alloc] initWithObjectType: O2PDFObjectTypeMark_array_open]
|
2020-05-12 18:51:39 +00:00
|
|
|
autorelease];
|
2007-02-13 03:41:55 +00:00
|
|
|
}
|
|
|
|
|
2020-05-11 15:52:05 +00:00
|
|
|
+ pdfObjectArrayMarkEnd {
|
|
|
|
return [[[self alloc] initWithObjectType: O2PDFObjectTypeMark_array_close]
|
2020-05-12 18:51:39 +00:00
|
|
|
autorelease];
|
2007-02-13 03:41:55 +00:00
|
|
|
}
|
|
|
|
|
2020-05-11 15:52:05 +00:00
|
|
|
+ pdfObjectDictionaryMark {
|
|
|
|
return [[[self alloc]
|
2020-05-12 18:51:39 +00:00
|
|
|
initWithObjectType: O2PDFObjectTypeMark_dictionary_open]
|
|
|
|
autorelease];
|
2007-02-13 03:41:55 +00:00
|
|
|
}
|
|
|
|
|
2020-05-11 15:52:05 +00:00
|
|
|
+ pdfObjectDictionaryMarkEnd {
|
|
|
|
return [[[self alloc]
|
2020-05-12 18:51:39 +00:00
|
|
|
initWithObjectType: O2PDFObjectTypeMark_dictionary_close]
|
|
|
|
autorelease];
|
2007-02-13 03:41:55 +00:00
|
|
|
}
|
|
|
|
|
2020-05-11 15:52:05 +00:00
|
|
|
+ pdfObjectWithNull {
|
2020-05-12 18:51:39 +00:00
|
|
|
return [[[self alloc] initWithObjectType: kO2PDFObjectTypeNull]
|
|
|
|
autorelease];
|
2007-02-13 03:41:55 +00:00
|
|
|
}
|
|
|
|
|
2020-05-11 15:52:05 +00:00
|
|
|
+ pdfObjectProcMark {
|
|
|
|
return [[[self alloc] initWithObjectType: O2PDFObjectTypeMark_proc_open]
|
2020-05-12 18:51:39 +00:00
|
|
|
autorelease];
|
2010-10-22 15:57:22 +00:00
|
|
|
}
|
|
|
|
|
2020-05-11 15:52:05 +00:00
|
|
|
+ pdfObjectProcMarkEnd {
|
|
|
|
return [[[self alloc] initWithObjectType: O2PDFObjectTypeMark_proc_close]
|
2020-05-12 18:51:39 +00:00
|
|
|
autorelease];
|
2010-10-22 15:57:22 +00:00
|
|
|
}
|
2007-02-13 03:41:55 +00:00
|
|
|
|
2020-05-11 15:52:05 +00:00
|
|
|
- (O2PDFObjectType) objectType {
|
|
|
|
return _objectType;
|
2007-02-13 03:41:55 +00:00
|
|
|
}
|
|
|
|
|
2020-05-11 15:52:05 +00:00
|
|
|
- (BOOL) checkForType: (O2PDFObjectType) type value: (void *) value {
|
|
|
|
if (type != _objectType)
|
|
|
|
return NO;
|
|
|
|
|
|
|
|
return YES;
|
2007-02-13 03:41:55 +00:00
|
|
|
}
|
|
|
|
|
2020-05-11 15:52:05 +00:00
|
|
|
- (NSString *) description {
|
|
|
|
return [NSString stringWithFormat: @"<%@ %d>", [self class], _objectType];
|
2007-02-13 03:41:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|