Debian Codegraph @

text_tables.go

raw symbols SCIP
1 package plist
2
3 type characterSet [4]uint64
4
5 func (s *characterSet) Map(ch rune) rune {
6 if s.Contains(ch) {
7 return ch
8 } else {
9 return -1
10 }
11 }
12
13 func (s *characterSet) Contains(ch rune) bool {
14 return ch >= 0 && ch <= 255 && s.ContainsByte(byte(ch))
15 }
16
17 func (s *characterSet) ContainsByte(ch byte) bool {
18 return (s[ch/64]&(1<<(ch%64)) > 0)
19 }
20
21 // Bitmap of characters that must be inside a quoted string
22 // when written to an old-style property list
23 // Low bits represent lower characters, and each uint64 represents 64 characters.
24 var gsQuotable = characterSet{
25 0x78001385ffffffff,
26 0xa800000138000000,
27 0xffffffffffffffff,
28 0xffffffffffffffff,
29 }
30
31 // 7f instead of 3f in the top line: CFOldStylePlist.c says . is valid, but they quote it.
32 // ef instead og 6f in the top line: ' will be quoted
33 var osQuotable = characterSet{
34 0xf4007fefffffffff,
35 0xf8000001f8000001,
36 0xffffffffffffffff,
37 0xffffffffffffffff,
38 }
39
40 var whitespace = characterSet{
41 0x0000000100003f00,
42 0x0000000000000000,
43 0x0000000000000000,
44 0x0000000000000000,
45 }
46
47 var newlineCharacterSet = characterSet{
48 0x0000000000002400,
49 0x0000000000000000,
50 0x0000000000000000,
51 0x0000000000000000,
52 }
53
54 // Bitmap of characters that are valid in base64-encoded strings.
55 // Used to filter out non-b64 characters to emulate NSDataBase64DecodingIgnoreUnknownCharacters
56 var base64ValidChars = characterSet{
57 0x23ff880000000000,
58 0x07fffffe07fffffe,
59 0x0000000000000000,
60 0x0000000000000000,
61 }