tomlpub.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package toml
  2. // PubTOMLValue wrapping tomlValue in order to access all properties from outside.
  3. type PubTOMLValue = tomlValue
  4. func (ptv *PubTOMLValue) Value() interface{} {
  5. return ptv.value
  6. }
  7. func (ptv *PubTOMLValue) Comment() string {
  8. return ptv.comment
  9. }
  10. func (ptv *PubTOMLValue) Commented() bool {
  11. return ptv.commented
  12. }
  13. func (ptv *PubTOMLValue) Multiline() bool {
  14. return ptv.multiline
  15. }
  16. func (ptv *PubTOMLValue) Position() Position {
  17. return ptv.position
  18. }
  19. func (ptv *PubTOMLValue) SetValue(v interface{}) {
  20. ptv.value = v
  21. }
  22. func (ptv *PubTOMLValue) SetComment(s string) {
  23. ptv.comment = s
  24. }
  25. func (ptv *PubTOMLValue) SetCommented(c bool) {
  26. ptv.commented = c
  27. }
  28. func (ptv *PubTOMLValue) SetMultiline(m bool) {
  29. ptv.multiline = m
  30. }
  31. func (ptv *PubTOMLValue) SetPosition(p Position) {
  32. ptv.position = p
  33. }
  34. // PubTree wrapping Tree in order to access all properties from outside.
  35. type PubTree = Tree
  36. func (pt *PubTree) Values() map[string]interface{} {
  37. return pt.values
  38. }
  39. func (pt *PubTree) Comment() string {
  40. return pt.comment
  41. }
  42. func (pt *PubTree) Commented() bool {
  43. return pt.commented
  44. }
  45. func (pt *PubTree) Inline() bool {
  46. return pt.inline
  47. }
  48. func (pt *PubTree) SetValues(v map[string]interface{}) {
  49. pt.values = v
  50. }
  51. func (pt *PubTree) SetComment(c string) {
  52. pt.comment = c
  53. }
  54. func (pt *PubTree) SetCommented(c bool) {
  55. pt.commented = c
  56. }
  57. func (pt *PubTree) SetInline(i bool) {
  58. pt.inline = i
  59. }