2024-02-19 23:57:44 +00:00
|
|
|
package yqlib
|
|
|
|
|
|
|
|
type PropertiesPreferences struct {
|
2024-02-24 04:14:21 +00:00
|
|
|
UnwrapScalar bool
|
2024-02-19 23:57:44 +00:00
|
|
|
KeyValueSeparator string
|
2024-02-20 00:39:56 +00:00
|
|
|
UseArrayBrackets bool
|
2024-02-19 23:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewDefaultPropertiesPreferences() PropertiesPreferences {
|
|
|
|
return PropertiesPreferences{
|
2024-02-24 04:14:21 +00:00
|
|
|
UnwrapScalar: true,
|
2024-02-19 23:57:44 +00:00
|
|
|
KeyValueSeparator: " = ",
|
2024-02-20 00:39:56 +00:00
|
|
|
UseArrayBrackets: false,
|
2024-02-19 23:57:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-24 04:14:21 +00:00
|
|
|
func (p *PropertiesPreferences) Copy() PropertiesPreferences {
|
|
|
|
return PropertiesPreferences{
|
|
|
|
UnwrapScalar: p.UnwrapScalar,
|
|
|
|
KeyValueSeparator: p.KeyValueSeparator,
|
|
|
|
UseArrayBrackets: p.UseArrayBrackets,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-19 23:57:44 +00:00
|
|
|
var ConfiguredPropertiesPreferences = NewDefaultPropertiesPreferences()
|