OLD | NEW |
(Empty) | |
| 1 #include "SkPdfReferenceDictionary_autogen.h" |
| 2 |
| 3 |
| 4 #include "SkPdfNativeDoc.h" |
| 5 SkPdfFileSpec SkPdfReferenceDictionary::F(SkPdfNativeDoc* doc) { |
| 6 SkPdfNativeObject* ret = get("F", ""); |
| 7 if (doc) {ret = doc->resolveReference(ret);} |
| 8 if ((ret != NULL && false) || (doc == NULL && ret != NULL && ret->isReference(
))) return ret->fileSpecValue(); |
| 9 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 10 return SkPdfFileSpec(); |
| 11 } |
| 12 |
| 13 bool SkPdfReferenceDictionary::has_F() const { |
| 14 return get("F", "") != NULL; |
| 15 } |
| 16 |
| 17 bool SkPdfReferenceDictionary::isPageAInteger(SkPdfNativeDoc* doc) { |
| 18 SkPdfNativeObject* ret = get("Page", ""); |
| 19 if (doc) {ret = doc->resolveReference(ret);} |
| 20 return ret != NULL && ret->isInteger(); |
| 21 } |
| 22 |
| 23 int64_t SkPdfReferenceDictionary::getPageAsInteger(SkPdfNativeDoc* doc) { |
| 24 SkPdfNativeObject* ret = get("Page", ""); |
| 25 if (doc) {ret = doc->resolveReference(ret);} |
| 26 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); |
| 27 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 28 return 0; |
| 29 } |
| 30 |
| 31 bool SkPdfReferenceDictionary::isPageAString(SkPdfNativeDoc* doc) { |
| 32 SkPdfNativeObject* ret = get("Page", ""); |
| 33 if (doc) {ret = doc->resolveReference(ret);} |
| 34 return ret != NULL && ret->isAnyString(); |
| 35 } |
| 36 |
| 37 SkString SkPdfReferenceDictionary::getPageAsString(SkPdfNativeDoc* doc) { |
| 38 SkPdfNativeObject* ret = get("Page", ""); |
| 39 if (doc) {ret = doc->resolveReference(ret);} |
| 40 if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret-
>isReference())) return ret->stringValue2(); |
| 41 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 42 return SkString(); |
| 43 } |
| 44 |
| 45 bool SkPdfReferenceDictionary::has_Page() const { |
| 46 return get("Page", "") != NULL; |
| 47 } |
| 48 |
| 49 SkPdfArray* SkPdfReferenceDictionary::ID(SkPdfNativeDoc* doc) { |
| 50 SkPdfNativeObject* ret = get("ID", ""); |
| 51 if (doc) {ret = doc->resolveReference(ret);} |
| 52 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; |
| 53 // TODO(edisonn): warn about missing default value for optional fields |
| 54 return NULL; |
| 55 } |
| 56 |
| 57 bool SkPdfReferenceDictionary::has_ID() const { |
| 58 return get("ID", "") != NULL; |
| 59 } |
| 60 |
OLD | NEW |