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

Unified Diff: src/xml/SkXMLPullParser.cpp

Issue 2163463002: Delete SkXMLPullParser (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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/xml/SkXMLParser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/xml/SkXMLPullParser.cpp
diff --git a/src/xml/SkXMLPullParser.cpp b/src/xml/SkXMLPullParser.cpp
deleted file mode 100644
index 3e831a12ee6be049797a9a5ffbe49d1777393884..0000000000000000000000000000000000000000
--- a/src/xml/SkXMLPullParser.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#include "SkXMLParser.h"
-#include "SkStream.h"
-
-static void reset(SkXMLPullParser::Curr* curr)
-{
- curr->fEventType = SkXMLPullParser::ERROR;
- curr->fName = "";
- curr->fAttrInfoCount = 0;
- curr->fIsWhitespace = false;
-}
-
-SkXMLPullParser::SkXMLPullParser() : fStream(nullptr)
-{
- fCurr.fEventType = ERROR;
- fDepth = -1;
-}
-
-SkXMLPullParser::SkXMLPullParser(SkStream* stream) : fStream(nullptr)
-{
- fCurr.fEventType = ERROR;
- fDepth = 0;
-
- this->setStream(stream);
-}
-
-SkXMLPullParser::~SkXMLPullParser()
-{
- this->setStream(nullptr);
-}
-
-SkStream* SkXMLPullParser::setStream(SkStream* stream)
-{
- if (fStream && !stream)
- this->onExit();
-
- SkRefCnt_SafeAssign(fStream, stream);
-
- if (fStream)
- {
- fCurr.fEventType = START_DOCUMENT;
- this->onInit();
- }
- else
- {
- fCurr.fEventType = ERROR;
- }
- fDepth = 0;
-
- return fStream;
-}
-
-SkXMLPullParser::EventType SkXMLPullParser::nextToken()
-{
- switch (fCurr.fEventType) {
- case ERROR:
- case END_DOCUMENT:
- break;
- case END_TAG:
- fDepth -= 1;
- // fall through
- default:
- reset(&fCurr);
- fCurr.fEventType = this->onNextToken();
- break;
- }
-
- switch (fCurr.fEventType) {
- case START_TAG:
- fDepth += 1;
- break;
- default:
- break;
- }
-
- return fCurr.fEventType;
-}
-
-const char* SkXMLPullParser::getName()
-{
- switch (fCurr.fEventType) {
- case START_TAG:
- case END_TAG:
- return fCurr.fName;
- default:
- return nullptr;
- }
-}
-
-const char* SkXMLPullParser::getText()
-{
- switch (fCurr.fEventType) {
- case TEXT:
- case IGNORABLE_WHITESPACE:
- return fCurr.fName;
- default:
- return nullptr;
- }
-}
-
-bool SkXMLPullParser::isWhitespace()
-{
- switch (fCurr.fEventType) {
- case IGNORABLE_WHITESPACE:
- return true;
- case TEXT:
- case CDSECT:
- return fCurr.fIsWhitespace;
- default:
- return false; // unknown/illegal
- }
-}
-
-int SkXMLPullParser::getAttributeCount()
-{
- return fCurr.fAttrInfoCount;
-}
-
-void SkXMLPullParser::getAttributeInfo(int index, AttrInfo* info)
-{
- SkASSERT((unsigned)index < (unsigned)fCurr.fAttrInfoCount);
-
- if (info)
- *info = fCurr.fAttrInfos[index];
-}
-
-bool SkXMLPullParser::onEntityReplacement(const char name[],
- SkString* replacement)
-{
- // TODO: std 5 entities here
- return false;
-}
« no previous file with comments | « include/xml/SkXMLParser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698