Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for needsQuoting (0.41 sec)

  1. platforms/core-runtime/base-services/src/main/java/org/gradle/internal/process/ArgWriter.java

                    writer.print("\"\"");
                } else if (needsQuoting(str)) {
                    writer.print('\"');
                    writer.print(str);
                    writer.print('\"');
                } else {
                    writer.print(str);
                }
            }
            writer.println();
            return this;
        }
    
        private boolean needsQuoting(String str) {
            return quotablePattern.matcher(str).find();
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed May 29 10:14:33 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  2. src/log/slog/text_handler_test.go

    	}{
    		{"", true},
    		{"ab", false},
    		{"a=b", true},
    		{`"ab"`, true},
    		{"\a\b", true},
    		{"a\tb", true},
    		{"µåπ", false},
    		{"a b", true},
    		{"badutf8\xF6", true},
    	} {
    		got := needsQuoting(test.in)
    		if got != test.want {
    			t.Errorf("%q: got %t, want %t", test.in, got, test.want)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 22 19:05:59 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  3. src/log/slog/text_handler.go

    	t := reflect.TypeOf(a)
    	if t != nil && t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8 {
    		return reflect.ValueOf(a).Bytes(), true
    	}
    	return nil, false
    }
    
    func needsQuoting(s string) bool {
    	if len(s) == 0 {
    		return true
    	}
    	for i := 0; i < len(s); {
    		b := s[i]
    		if b < utf8.RuneSelf {
    			// Quote anything except a backslash that would need quoting in a
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 23 22:56:07 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  4. src/log/slog/handler.go

    }
    
    func (s *handleState) appendString(str string) {
    	if s.h.json {
    		s.buf.WriteByte('"')
    		*s.buf = appendEscapedJSONString(*s.buf, str)
    		s.buf.WriteByte('"')
    	} else {
    		// text
    		if needsQuoting(str) {
    			*s.buf = strconv.AppendQuote(*s.buf, str)
    		} else {
    			s.buf.WriteString(str)
    		}
    	}
    }
    
    func (s *handleState) appendValue(v Value) {
    	defer func() {
    		if r := recover(); r != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 18:18:13 UTC 2023
    - 17.5K bytes
    - Viewed (0)
Back to top