aboutsummaryrefslogtreecommitdiff
path: root/pkg/classes/consoleCmd.go
blob: 47a44e068232cbed4f88e702e7d0522ddd096297 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package classes

import (
	"strings"

	"github.com/pektezol/bitreader"
	"github.com/pektezol/sdp.go/pkg/writer"
)

type ConsoleCmd struct {
	Size int32
	Data string
}

func (consoleCmd *ConsoleCmd) ParseConsoleCmd(reader *bitreader.Reader) {
	consoleCmd.Size = reader.TryReadSInt32()
	consoleCmd.Data = reader.TryReadStringLength(uint64(consoleCmd.Size))
	writer.AppendLine("\t%s", strings.TrimSpace(consoleCmd.Data))
}