SkPdfSourceInformationDictionary_autogen.cpp revision b74bdf024930e71ca1be8f874ed49dd0b31449b1
1#include "SkPdfSourceInformationDictionary_autogen.h"
2
3
4#include "SkPdfNativeDoc.h"
5bool SkPdfSourceInformationDictionary::isAUAString(SkPdfNativeDoc* doc) {
6  SkPdfNativeObject* ret = get("AU", "");
7  if (doc) {ret = doc->resolveReference(ret);}
8  return ret != NULL && ret->isAnyString();
9}
10
11SkString SkPdfSourceInformationDictionary::getAUAsString(SkPdfNativeDoc* doc) {
12  SkPdfNativeObject* ret = get("AU", "");
13  if (doc) {ret = doc->resolveReference(ret);}
14  if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->stringValue2();
15  // TODO(edisonn): warn about missing required field, assert for known good pdfs
16  return SkString();
17}
18
19bool SkPdfSourceInformationDictionary::isAUADictionary(SkPdfNativeDoc* doc) {
20  SkPdfNativeObject* ret = get("AU", "");
21  if (doc) {ret = doc->resolveReference(ret);}
22  return ret != NULL && ret->isDictionary();
23}
24
25SkPdfDictionary* SkPdfSourceInformationDictionary::getAUAsDictionary(SkPdfNativeDoc* doc) {
26  SkPdfNativeObject* ret = get("AU", "");
27  if (doc) {ret = doc->resolveReference(ret);}
28  if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret;
29  // TODO(edisonn): warn about missing required field, assert for known good pdfs
30  return NULL;
31}
32
33bool SkPdfSourceInformationDictionary::has_AU() const {
34  return get("AU", "") != NULL;
35}
36
37SkPdfDate SkPdfSourceInformationDictionary::TS(SkPdfNativeDoc* doc) {
38  SkPdfNativeObject* ret = get("TS", "");
39  if (doc) {ret = doc->resolveReference(ret);}
40  if ((ret != NULL && ret->isDate()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->dateValue();
41  // TODO(edisonn): warn about missing default value for optional fields
42  return SkPdfDate();
43}
44
45bool SkPdfSourceInformationDictionary::has_TS() const {
46  return get("TS", "") != NULL;
47}
48
49SkPdfDate SkPdfSourceInformationDictionary::E(SkPdfNativeDoc* doc) {
50  SkPdfNativeObject* ret = get("E", "");
51  if (doc) {ret = doc->resolveReference(ret);}
52  if ((ret != NULL && ret->isDate()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->dateValue();
53  // TODO(edisonn): warn about missing default value for optional fields
54  return SkPdfDate();
55}
56
57bool SkPdfSourceInformationDictionary::has_E() const {
58  return get("E", "") != NULL;
59}
60
61int64_t SkPdfSourceInformationDictionary::S(SkPdfNativeDoc* doc) {
62  SkPdfNativeObject* ret = get("S", "");
63  if (doc) {ret = doc->resolveReference(ret);}
64  if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->intValue();
65  // TODO(edisonn): warn about missing default value for optional fields
66  return 0;
67}
68
69bool SkPdfSourceInformationDictionary::has_S() const {
70  return get("S", "") != NULL;
71}
72
73SkPdfDictionary* SkPdfSourceInformationDictionary::C(SkPdfNativeDoc* doc) {
74  SkPdfNativeObject* ret = get("C", "");
75  if (doc) {ret = doc->resolveReference(ret);}
76  if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret;
77  // TODO(edisonn): warn about missing default value for optional fields
78  return NULL;
79}
80
81bool SkPdfSourceInformationDictionary::has_C() const {
82  return get("C", "") != NULL;
83}
84