package jsoniter

import 

// ReadNil reads a json object as nil and
// returns whether it's a nil or not
func ( *Iterator) () ( bool) {
	 := .nextToken()
	if  == 'n' {
		.skipThreeBytes('u', 'l', 'l') // null
		return true
	}
	.unreadByte()
	return false
}

// ReadBool reads a json object as BoolValue
func ( *Iterator) () ( bool) {
	 := .nextToken()
	if  == 't' {
		.skipThreeBytes('r', 'u', 'e')
		return true
	}
	if  == 'f' {
		.skipFourBytes('a', 'l', 's', 'e')
		return false
	}
	.ReportError("ReadBool", "expect t or f, but found "+string([]byte{}))
	return
}

// SkipAndReturnBytes skip next JSON element, and return its content as []byte.
// The []byte can be kept, it is a copy of data.
func ( *Iterator) () []byte {
	.startCapture(.head)
	.Skip()
	return .stopCapture()
}

// SkipAndAppendBytes skips next JSON element and appends its content to
// buffer, returning the result.
func ( *Iterator) ( []byte) []byte {
	.startCaptureTo(, .head)
	.Skip()
	return .stopCapture()
}

func ( *Iterator) ( []byte,  int) {
	if .captured != nil {
		panic("already in capture mode")
	}
	.captureStartedAt = 
	.captured = 
}

func ( *Iterator) ( int) {
	.startCaptureTo(make([]byte, 0, 32), )
}

func ( *Iterator) () []byte {
	if .captured == nil {
		panic("not in capture mode")
	}
	 := .captured
	 := .buf[.captureStartedAt:.head]
	.captureStartedAt = -1
	.captured = nil
	return append(, ...)
}

// Skip skips a json object and positions to relatively the next json object
func ( *Iterator) () {
	 := .nextToken()
	switch  {
	case '"':
		.skipString()
	case 'n':
		.skipThreeBytes('u', 'l', 'l') // null
	case 't':
		.skipThreeBytes('r', 'u', 'e') // true
	case 'f':
		.skipFourBytes('a', 'l', 's', 'e') // false
	case '0':
		.unreadByte()
		.ReadFloat32()
	case '-', '1', '2', '3', '4', '5', '6', '7', '8', '9':
		.skipNumber()
	case '[':
		.skipArray()
	case '{':
		.skipObject()
	default:
		.ReportError("Skip", fmt.Sprintf("do not know how to skip: %v", ))
		return
	}
}

func ( *Iterator) (, , ,  byte) {
	if .readByte() !=  {
		.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{, , , })))
		return
	}
	if .readByte() !=  {
		.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{, , , })))
		return
	}
	if .readByte() !=  {
		.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{, , , })))
		return
	}
	if .readByte() !=  {
		.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{, , , })))
		return
	}
}

func ( *Iterator) (, ,  byte) {
	if .readByte() !=  {
		.ReportError("skipThreeBytes", fmt.Sprintf("expect %s", string([]byte{, , })))
		return
	}
	if .readByte() !=  {
		.ReportError("skipThreeBytes", fmt.Sprintf("expect %s", string([]byte{, , })))
		return
	}
	if .readByte() !=  {
		.ReportError("skipThreeBytes", fmt.Sprintf("expect %s", string([]byte{, , })))
		return
	}
}