b74bdf0249
git-svn-id: http://skia.googlecode.com/svn/trunk@10842 2bbb7eff-a529-9590-31e7-b0007b416f81
52 lines
1.9 KiB
C++
52 lines
1.9 KiB
C++
#include "SkPdfPageTreeNodeDictionary_autogen.h"
|
|
|
|
|
|
#include "SkPdfNativeDoc.h"
|
|
SkString SkPdfPageTreeNodeDictionary::Type(SkPdfNativeDoc* doc) {
|
|
SkPdfNativeObject* ret = get("Type", "");
|
|
if (doc) {ret = doc->resolveReference(ret);}
|
|
if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->nameValue2();
|
|
// TODO(edisonn): warn about missing required field, assert for known good pdfs
|
|
return SkString();
|
|
}
|
|
|
|
bool SkPdfPageTreeNodeDictionary::has_Type() const {
|
|
return get("Type", "") != NULL;
|
|
}
|
|
|
|
SkPdfDictionary* SkPdfPageTreeNodeDictionary::Parent(SkPdfNativeDoc* doc) {
|
|
SkPdfNativeObject* ret = get("Parent", "");
|
|
if (doc) {ret = doc->resolveReference(ret);}
|
|
if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret;
|
|
// TODO(edisonn): warn about missing default value for optional fields
|
|
return NULL;
|
|
}
|
|
|
|
bool SkPdfPageTreeNodeDictionary::has_Parent() const {
|
|
return get("Parent", "") != NULL;
|
|
}
|
|
|
|
SkPdfArray* SkPdfPageTreeNodeDictionary::Kids(SkPdfNativeDoc* doc) {
|
|
SkPdfNativeObject* ret = get("Kids", "");
|
|
if (doc) {ret = doc->resolveReference(ret);}
|
|
if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfArray*)ret;
|
|
// TODO(edisonn): warn about missing required field, assert for known good pdfs
|
|
return NULL;
|
|
}
|
|
|
|
bool SkPdfPageTreeNodeDictionary::has_Kids() const {
|
|
return get("Kids", "") != NULL;
|
|
}
|
|
|
|
int64_t SkPdfPageTreeNodeDictionary::Count(SkPdfNativeDoc* doc) {
|
|
SkPdfNativeObject* ret = get("Count", "");
|
|
if (doc) {ret = doc->resolveReference(ret);}
|
|
if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->intValue();
|
|
// TODO(edisonn): warn about missing required field, assert for known good pdfs
|
|
return 0;
|
|
}
|
|
|
|
bool SkPdfPageTreeNodeDictionary::has_Count() const {
|
|
return get("Count", "") != NULL;
|
|
}
|