Пример #1
0
func (dict *Dictionary) Values() []string {
	count := dict.Count()
	if count <= 0 {
		return nil
	}
	values := make([]string, 0, count)
	var entry *C.AVDictionaryEntry
	for {
		entry = C.go_av_dict_next(dict.CAVDictionary, entry)
		if entry == nil {
			break
		}
		values = append(values, C.GoString(entry.value))
	}
	return values
}
Пример #2
0
func (dict *Dictionary) Map() map[string]string {
	count := dict.Count()
	if count <= 0 {
		return nil
	}
	m := make(map[string]string, count)
	var entry *C.AVDictionaryEntry
	for {
		entry = C.go_av_dict_next(dict.CAVDictionary, entry)
		if entry == nil {
			break
		}
		m[C.GoString(entry.key)] = C.GoString(entry.value)
	}
	return m
}
Пример #3
0
func (dict *Dictionary) Keys() []string {
	count := dict.Count()
	if count <= 0 {
		return nil
	}
	keys := make([]string, 0, count)
	var entry *C.AVDictionaryEntry
	for {
		entry = C.go_av_dict_next(dict.CAVDictionary, entry)
		if entry == nil {
			break
		}
		keys = append(keys, C.GoString(entry.key))
	}
	return keys
}