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

Unified Diff: skia/xml/SkXMLPullParser.cpp

Issue 113827: Remove the remainder of the skia source code from the Chromium repo.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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 | « skia/xml/SkXMLParser.cpp ('k') | skia/xml/SkXMLWriter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/xml/SkXMLPullParser.cpp
===================================================================
--- skia/xml/SkXMLPullParser.cpp (revision 16859)
+++ skia/xml/SkXMLPullParser.cpp (working copy)
@@ -1,132 +0,0 @@
-#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(NULL)
-{
- fCurr.fEventType = ERROR;
- fDepth = -1;
-}
-
-SkXMLPullParser::SkXMLPullParser(SkStream* stream) : fStream(NULL)
-{
- fCurr.fEventType = ERROR;
- fDepth = 0;
-
- this->setStream(stream);
-}
-
-SkXMLPullParser::~SkXMLPullParser()
-{
- this->setStream(NULL);
-}
-
-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 NULL;
- }
-}
-
-const char* SkXMLPullParser::getText()
-{
- switch (fCurr.fEventType) {
- case TEXT:
- case IGNORABLE_WHITESPACE:
- return fCurr.fName;
- default:
- return NULL;
- }
-}
-
-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 | « skia/xml/SkXMLParser.cpp ('k') | skia/xml/SkXMLWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698