/[dgee]/dgee/cslib/DotGNU/XmlRpc/XmlRpcReader.cs
ViewVC logotype

Diff of /dgee/cslib/DotGNU/XmlRpc/XmlRpcReader.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.9.2.2 by npg, Mon Jul 21 19:51:46 2003 UTC revision 1.1.2.9.2.3 by npg, Tue Jul 22 18:56:20 2003 UTC
# Line 23  Line 23 
23   * Authors:   * Authors:
24   *   Nicolai P Guba   *   Nicolai P Guba
25   */   */
26    using System.Globalization;
27    using System.IO;
28    using System.Xml;
29    
30  namespace DotGNU.XmlRpc  namespace DotGNU.XmlRpc
31  {  {
   using System.Xml;  
   using System.IO;  
   
32    public class XmlRpcReader    public class XmlRpcReader
33    {    {
34      private String request;          private String request;    
# Line 35  namespace DotGNU.XmlRpc Line 36  namespace DotGNU.XmlRpc
36      private XmlTextReader xmlReader;      private XmlTextReader xmlReader;
37      private XmlRpcStruct structure;      private XmlRpcStruct structure;
38      private XmlRpcArray array;      private XmlRpcArray array;
39        private DateTimeFormatInfo dateFormat;
40    
41      public XmlRpcReader( String buffer )      public XmlRpcReader( String buffer )
42        : this( new StringReader( buffer ) ){        : this( new StringReader( buffer ) ){
# Line 42  namespace DotGNU.XmlRpc Line 44  namespace DotGNU.XmlRpc
44    
45      public XmlRpcReader( StringReader reader )      public XmlRpcReader( StringReader reader )
46      {      {
47        structure = null;        structure  = null;
48        array     = null;        array      = null;
49        method    = new XmlRpcMethod();        method     = new XmlRpcMethod();
50        xmlReader = new XmlTextReader( reader );        xmlReader  = new XmlTextReader( reader );
51                dateFormat = new DateTimeFormatInfo();
52          dateFormat.FullDateTimePattern = dateFormat.RFC1123Pattern;
53    
54        // Itereate through the tree and construct an n-ary tree with        // Itereate through the tree and construct an n-ary tree with
55        // XmlRpcNodes so we can detect protocol errors and the current        // XmlRpcNodes so we can detect protocol errors and the current
56        // scope/context of a value parameter.        // scope/context of a value parameter.
# Line 166  namespace DotGNU.XmlRpc Line 170  namespace DotGNU.XmlRpc
170              Add( dval );              Add( dval );
171              break;              break;
172            case "dateTime.iso8601":            case "dateTime.iso8601":
             /*  
173              try {              try {
174                DateTime dtval = Convert.ToDateTime( xmlReader.Value );                DateTime dtval = DateTime.ParseExact( xmlReader.Value, "s", dateFormat );
175                Add( dtval );                Add( dtval );
176              }              }
177              catch( FormatException e ){              catch( FormatException e ){
178                throw new XmlRpcBadFormatException( 100, "Cannot parse DateTime value: " +                string str =
179                                                    xmlReader.Value, xmlReader );                  String.Format( "Cannot parse DateTime value: {0}, expected format is: {1}",
180                                   xmlReader.Value, dateFormat.UniversalSortableDateTimePattern );
181                  
182                  throw new XmlRpcBadFormatException( 100, str , xmlReader );
183              }              }
             */  
184              break;              break;
185            case "string":            case "string":
186              Add( xmlReader.Value );              Add( xmlReader.Value );

Legend:
Removed from v.1.1.2.9.2.2  
changed lines
  Added in v.1.1.2.9.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26