blob: 45c0b7e00a1952b6e4a9eb7e9f24c94ed0c49aa1 [file] [log] [blame]
{{/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/}}
{{define "StringDef"}}
§{{$.Copyright}}§
package {{$.Package}}¶
import (Ȧ
"android.googlesource.com/platform/tools/gpu/framework/binary"
"android.googlesource.com/platform/tools/gpu/framework/stringtable/msg"
«)¶
{{range $.Entries}}
{{$name := ToCamel .Key}}
// {{$name}} returns a {{.Key}} message with the provided arguments.¶
func {{$name}}(
{{if .Parameters}}
{{range $i, $p := .Parameters}}
{{if $i}},•{{end}}{{$p}}
{{end}}
interface{}
{{end}}) *msg.Msg {Ȧ
return &msg.Msg{Ȧ
Identifier: "{{.Key}}"
{{if eq (len .Parameters) 0}}
Arguments: map[string]binary.Object{},¶
{{else}}
Arguments: map[string]binary.Object{Ȧ
{{range $i, $p := .Parameters}}
"{{$p}}":║msg.BoxOrPanic({{$p}}),¶
{{end}}
«},¶
{{end}}
«}¶
«}¶
{{end}}
{{end}}