Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for formatNumeric (0.09 sec)

  1. src/archive/tar/strconv_test.go

    		var f formatter
    		got := make([]byte, len(v.want))
    		f.formatNumeric(got, v.in)
    		ok := (f.err == nil)
    		if ok != v.ok {
    			if v.ok {
    				t.Errorf("formatNumeric(%d): got formatting failure, want success", v.in)
    			} else {
    				t.Errorf("formatNumeric(%d): got formatting success, want failure", v.in)
    			}
    		}
    		if string(got) != v.want {
    			t.Errorf("formatNumeric(%d): got %q, want %q", v.in, got, v.want)
    		}
    	}
    }
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Tue Feb 09 05:28:50 UTC 2021
    - 14K bytes
    - Viewed (0)
  2. src/archive/tar/writer.go

    	var spd sparseDatas
    	var spb []byte
    	blk := tw.templateV7Plus(hdr, f.formatString, f.formatNumeric)
    	if !hdr.AccessTime.IsZero() {
    		f.formatNumeric(blk.toGNU().accessTime(), hdr.AccessTime.Unix())
    	}
    	if !hdr.ChangeTime.IsZero() {
    		f.formatNumeric(blk.toGNU().changeTime(), hdr.ChangeTime.Unix())
    	}
    	// TODO(dsnet): Re-enable this when adding sparse support.
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Oct 02 14:22:59 UTC 2024
    - 19.6K bytes
    - Viewed (0)
  3. src/archive/tar/strconv.go

    		}
    		return int64(x)
    	}
    
    	// Normal case is base-8 (octal) format.
    	return p.parseOctal(b)
    }
    
    // formatNumeric encodes x into b using base-8 (octal) encoding if possible.
    // Otherwise it will attempt to use base-256 (binary) encoding.
    func (f *formatter) formatNumeric(b []byte, x int64) {
    	if fitsInOctal(len(b), x) {
    		f.formatOctal(b, x)
    		return
    	}
    
    	if fitsInBase256(len(b), x) {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Tue Aug 01 14:28:42 UTC 2023
    - 9K bytes
    - Viewed (0)
  4. src/archive/tar/reader_test.go

    		}
    		return out
    	}
    
    	makeSparseStrings := func(sp []sparseEntry) (out []string) {
    		var f formatter
    		for _, s := range sp {
    			var b [24]byte
    			f.formatNumeric(b[:12], s.Offset)
    			f.formatNumeric(b[12:], s.Length)
    			out = append(out, string(b[:]))
    		}
    		return out
    	}
    
    	vectors := []struct {
    		input    []byte
    		wantMap  sparseDatas
    		wantSize int64
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Thu Oct 03 15:48:09 UTC 2024
    - 46.9K bytes
    - Viewed (0)
Back to top