Skip to content

Commit 26aa0ea

Browse files
author
Josh Peterson
committed
Implement a ReadString overload (case 1106236)
In the `XmlSerializationReader` class, the `ReadString(string, bool)` overload was not implemented in the Mono class library implementation used for the unityaot profile. The implementation used for the unityjit profile from the reference source implements this method. I've copied the implementation from the reference source code here into the code used for the unityaot profile.
1 parent b808f84 commit 26aa0ea

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1193,10 +1193,15 @@ protected Exception CreateMissingIXmlSerializableType (string name, string ns, s
11931193
throw new NotImplementedException ();
11941194
}
11951195

1196-
[MonoTODO]
11971196
protected string ReadString (string value, bool trim)
11981197
{
1199-
throw new NotImplementedException ();
1198+
readCount++;
1199+
string str = reader.ReadString ();
1200+
if (str != null && trim)
1201+
str = str.Trim();
1202+
if (value == null || value.Length == 0)
1203+
return str;
1204+
return value + str;
12001205
}
12011206

12021207
[MonoTODO]

0 commit comments

Comments
 (0)