Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: include/core/SkDataSet.h

Issue 27208002: remove SkDataSet, and just store a key/value in SkAnnotation (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkAnnotation.h ('k') | src/core/SkAnnotation.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkDataSet.h
diff --git a/include/core/SkDataSet.h b/include/core/SkDataSet.h
deleted file mode 100644
index 2e5d96e68ab23245fa99189d552dd995f0163c33..0000000000000000000000000000000000000000
--- a/include/core/SkDataSet.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkDataSet_DEFINED
-#define SkDataSet_DEFINED
-
-#include "SkData.h"
-#include "SkFlattenable.h"
-
-class SkStream;
-class SkWStream;
-
-class SkDataSet : public SkFlattenable {
-public:
- /**
- * Returns a new empty dataset. Note: since SkDataSet is immutable, this
- * "new" set may be the same one that was returned before, but each
- * returned object must have its reference-count balanced regardless.
- *
- * SkDataSet* empty = SkDataSet::NewEmpty();
- * ...
- * empty->unref();
- */
- static SkDataSet* NewEmpty();
-
- struct Pair {
- const char* fKey;
- SkData* fValue;
- };
-
- SkDataSet(const char key[], SkData* value);
- SkDataSet(const Pair[], int count);
- virtual ~SkDataSet();
-
- bool isEmpty() const { return 0 == fCount; }
- int count() const { return fCount; }
- SkData* find(const char name[]) const;
-
- class Iter {
- public:
- Iter(const SkDataSet& ds) {
- fPair = ds.fPairs;
- fStop = ds.fPairs + ds.fCount;
- }
-
- const char* key() const {
- SkASSERT(!this->done());
- return fPair->fKey;
- }
-
- SkData* value() const {
- SkASSERT(!this->done());
- return fPair->fValue;
- }
-
- bool done() const { return fPair >= fStop; }
- void next() {
- SkASSERT(!this->done());
- fPair += 1;
- }
-
- private:
- const SkDataSet::Pair* fPair;
- const SkDataSet::Pair* fStop;
- };
-
- explicit SkDataSet(SkStream*);
- void writeToStream(SkWStream*) const;
-
- SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDataSet)
-
-protected:
- SkDataSet(SkFlattenableReadBuffer&);
- virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
-
-private:
- int32_t fCount;
- uint32_t fKeySize;
- Pair* fPairs;
-
- typedef SkFlattenable INHERITED;
-};
-
-#endif
« no previous file with comments | « include/core/SkAnnotation.h ('k') | src/core/SkAnnotation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698