Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Molaro <lupus@oddwiz.org>2002-07-24 15:18:06 +0400
committerPaolo Molaro <lupus@oddwiz.org>2002-07-24 15:18:06 +0400
commit4056a14ba1e94de3c5bef0e823ee8823f50daf0d (patch)
treef1921a671492ac1534b457c3bb38a72672973118 /mcs/class/System.XML/System.Xml
parent1e52fe68eb35ed9c2c29761c855419493fc96062 (diff)
Wed Jul 24 13:16:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
* XmlTextReader.cs: rough line/column support. svn path=/trunk/mcs/; revision=6126
Diffstat (limited to 'mcs/class/System.XML/System.Xml')
-rw-r--r--mcs/class/System.XML/System.Xml/ChangeLog5
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextReader.cs14
2 files changed, 15 insertions, 4 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog
index 661fcb3cbdc..eefc584c3e4 100644
--- a/mcs/class/System.XML/System.Xml/ChangeLog
+++ b/mcs/class/System.XML/System.Xml/ChangeLog
@@ -1,3 +1,8 @@
+
+Wed Jul 24 13:16:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * XmlTextReader.cs: rough line/column support.
+
2002-07-23 Duncan Mak <duncan@ximian.com>
* XmlConvert.cs: Implement the ToDateTime method. ToDateTime
diff --git a/mcs/class/System.XML/System.Xml/XmlTextReader.cs b/mcs/class/System.XML/System.Xml/XmlTextReader.cs
index 91611af2ee9..178d9a06d3c 100644
--- a/mcs/class/System.XML/System.Xml/XmlTextReader.cs
+++ b/mcs/class/System.XML/System.Xml/XmlTextReader.cs
@@ -210,16 +210,14 @@ namespace System.Xml
get { return GetAttribute (localName, namespaceName); }
}
- [MonoTODO]
public int LineNumber
{
- get { throw new NotImplementedException (); }
+ get { return line; }
}
- [MonoTODO]
public int LinePosition
{
- get { throw new NotImplementedException (); }
+ get { return column; }
}
public override string LocalName
@@ -613,6 +611,8 @@ namespace System.Xml
private StringBuilder xmlBuffer; // This is for Read(Inner|Outer)Xml
private StringBuilder currentTag; // A buffer for ReadContent for ReadOuterXml
private bool saveToXmlBuffer;
+ private int line;
+ private int column;
private void Init ()
{
@@ -728,6 +728,12 @@ namespace System.Xml
private int ReadChar ()
{
int ch = reader.Read ();
+ if (ch == '\n') {
+ line++;
+ column = 1;
+ } else {
+ column++;
+ }
if (saveToXmlBuffer) {
xmlBuffer.Append ((char) ch);
}