Project

General

Profile

xmlrpclib-i8-support.patch

stancon (Stas Kelvich), 04/04/2010 04:58 PM

View differences:

lib/xmlrpc/parser.rb (working copy)
170 170
      private
171 171

  
172 172
      #
173
      # remove all whitespaces but in the tags i4, int, boolean....
173
      # remove all whitespaces but in the tags i4, i8, int, boolean....
174 174
      # and all comments
175 175
      #
176 176
      def removeWhitespacesAndComments(node)
......
180 180
	  case _nodeType(nd)
181 181
	  when :TEXT
182 182
            # TODO: add nil?
183
            unless %w(i4 int boolean string double dateTime.iso8601 base64).include? node.nodeName
183
            unless %w(i4 i8 int boolean string double dateTime.iso8601 base64).include? node.nodeName
184 184

  
185 185
               if node.nodeName == "value" 
186 186
                 if not node.childNodes.to_a.detect {|n| _nodeType(n) == :ELEMENT}.nil?
......
254 254
      def integer(node)
255 255
	#TODO: check string for float because to_i returnsa
256 256
	#      0 when wrong string
257
	 nodeMustBe(node, %w(i4 int))    
257
	 nodeMustBe(node, %w(i4 i8 int))    
258 258
	hasOnlyOneChild(node)
259 259
	
260 260
	Convert.int(text(node.firstChild))
......
416 416
          text_zero_one(node)
417 417
	when :ELEMENT
418 418
	  case child.nodeName
419
	  when "i4", "int"        then integer(child)
419
	  when "i4", "i8", "int"  then integer(child)
420 420
	  when "boolean"          then boolean(child)
421 421
	  when "string"           then string(child)
422 422
	  when "double"           then double(child)
......
526 526
        case name
527 527
        when "string"
528 528
          @value = @data
529
        when "i4", "int"
529
        when "i4", "i8", "int"
530 530
          @value = Convert.int(@data)
531 531
        when "boolean"
532 532
          @value = Convert.boolean(@data)