MCPcopy Index your code
hub / github.com/XmirrorSecurity/OpenSCA-cli / getc

Method getc

opensca/sca/java/xml/xml.go:900–922  ·  view source on GitHub ↗

Read a single byte. If there is no byte to read, return ok==false and leave the error in d.err. Maintain line number.

()

Source from the content-addressed store, hash-verified

898// and leave the error in d.err.
899// Maintain line number.
900func (d *Decoder) getc() (b byte, ok bool) {
901 if d.err != nil {
902 return 0, false
903 }
904 if d.nextByte >= 0 {
905 b = byte(d.nextByte)
906 d.nextByte = -1
907 } else {
908 b, d.err = d.r.ReadByte()
909 if d.err != nil {
910 return 0, false
911 }
912 if d.saved != nil {
913 d.saved.WriteByte(b)
914 }
915 }
916 if b == '\n' {
917 d.line++
918 d.linestart = d.offset + 1
919 }
920 d.offset++
921 return b, true
922}
923
924// InputOffset returns the input stream byte offset of the current decoder position.
925// The offset gives the location of the end of the most recently returned token

Callers 4

rawTokenMethod · 0.95
spaceMethod · 0.95
mustgetcMethod · 0.95
textMethod · 0.95

Calls 1

WriteByteMethod · 0.80

Tested by

no test coverage detected