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

Unified Diff: include/xml/SkXMLWriter.h

Issue 896363002: add length parameter to addText, to match attr values (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove legacy addText site Created 5 years, 10 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 | « experimental/svg/SkSVGDevice.cpp ('k') | src/animator/SkXMLAnimatorWriter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/xml/SkXMLWriter.h
diff --git a/include/xml/SkXMLWriter.h b/include/xml/SkXMLWriter.h
index b33ccd75d7065381672101fa5ce3ae1e62805588..6e3c7de79dc50c3697d45b6715a5247637590c2d 100644
--- a/include/xml/SkXMLWriter.h
+++ b/include/xml/SkXMLWriter.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2006 The Android Open Source Project
*
@@ -6,7 +5,6 @@
* found in the LICENSE file.
*/
-
#ifndef SkXMLWriter_DEFINED
#define SkXMLWriter_DEFINED
@@ -27,7 +25,7 @@ public:
void addAttributeLen(const char name[], const char value[], size_t length);
void addHexAttribute(const char name[], uint32_t value, int minDigits = 0);
void addScalarAttribute(const char name[], SkScalar value);
- void addText(const char text[]);
+ void addText(const char text[], size_t length);
void endElement() { this->onEndElement(); }
void startElement(const char elem[]);
void startElementLen(const char elem[], size_t length);
@@ -38,7 +36,7 @@ public:
protected:
virtual void onStartElementLen(const char elem[], size_t length) = 0;
virtual void onAddAttributeLen(const char name[], const char value[], size_t length) = 0;
- virtual void onAddText(const char text[]) = 0;
+ virtual void onAddText(const char text[], size_t length) = 0;
virtual void onEndElement() = 0;
struct Elem {
@@ -69,11 +67,12 @@ public:
virtual ~SkXMLStreamWriter();
virtual void writeHeader();
SkDEBUGCODE(static void UnitTest();)
+
protected:
- virtual void onStartElementLen(const char elem[], size_t length);
- virtual void onEndElement();
- virtual void onAddAttributeLen(const char name[], const char value[], size_t length);
- virtual void onAddText(const char text[]) SK_OVERRIDE;
+ void onStartElementLen(const char elem[], size_t length) SK_OVERRIDE;
+ void onEndElement() SK_OVERRIDE;
+ void onAddAttributeLen(const char name[], const char value[], size_t length) SK_OVERRIDE;
+ void onAddText(const char text[], size_t length) SK_OVERRIDE;
private:
SkWStream& fStream;
@@ -87,7 +86,7 @@ protected:
virtual void onStartElementLen(const char elem[], size_t length);
virtual void onEndElement();
virtual void onAddAttributeLen(const char name[], const char value[], size_t length);
- virtual void onAddText(const char text[]) SK_OVERRIDE;
+ virtual void onAddText(const char text[], size_t length) SK_OVERRIDE;
private:
SkXMLParser& fParser;
};
« no previous file with comments | « experimental/svg/SkSVGDevice.cpp ('k') | src/animator/SkXMLAnimatorWriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698