diff options
Diffstat (limited to 'src/pdf/SkPDFTypes.h')
-rw-r--r-- | src/pdf/SkPDFTypes.h | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/pdf/SkPDFTypes.h b/src/pdf/SkPDFTypes.h index 1f06c4c5fe..004c767843 100644 --- a/src/pdf/SkPDFTypes.h +++ b/src/pdf/SkPDFTypes.h @@ -369,7 +369,7 @@ public: /** The size of the dictionary. */ - int size() { return fValue.count(); } + int size() const; /** Add the value to the dictionary with the given key. Refs value. * @param key The key for this dictionary entry. @@ -424,28 +424,30 @@ public: */ void clear(); +protected: + /** Use to remove a single key from the dictionary. + */ + void remove(const char key[]); + + /** Insert references to all of the key-value pairs from the other + * dictionary into this one. + */ + void mergeFrom(const SkPDFDict& other); + private: struct Rec { - SkPDFName* key; - SkPDFObject* value; + SkPDFName* key; + SkPDFObject* value; + Rec(SkPDFName* k, SkPDFObject* v) : key(k), value(v) {} }; -public: - class Iter { - public: - explicit Iter(const SkPDFDict& dict); - SkPDFName* next(SkPDFObject** value); - - private: - const Rec* fIter; - const Rec* fStop; - }; - -private: static const int kMaxLen = 4095; + mutable SkMutex fMutex; // protects modifications to fValue SkTDArray<struct Rec> fValue; + SkPDFObject* append(SkPDFName* key, SkPDFObject* value); + typedef SkPDFObject INHERITED; }; |