IHeld.cs 921 B

1234567891011121314151617181920212223242526272829303132333435
  1. #nullable enable
  2. namespace Terminal.Gui;
  3. /// <summary>
  4. /// Describes a sequence of chars (and optionally T metadata) accumulated
  5. /// by an <see cref="IAnsiResponseParser"/>
  6. /// </summary>
  7. internal interface IHeld
  8. {
  9. /// <summary>
  10. /// Clears all held objects
  11. /// </summary>
  12. void ClearHeld ();
  13. /// <summary>
  14. /// Returns string representation of the held objects
  15. /// </summary>
  16. /// <returns></returns>
  17. string? HeldToString ();
  18. /// <summary>
  19. /// Returns the collection objects directly e.g. <see langword="char"/>
  20. /// or <see cref="Tuple"/> <see langword="char"/> + metadata T
  21. /// </summary>
  22. /// <returns></returns>
  23. IEnumerable<object> HeldToObjects ();
  24. /// <summary>
  25. /// Adds the given object to the collection.
  26. /// </summary>
  27. /// <param name="o"></param>
  28. void AddToHeld (object o);
  29. int Length { get; }
  30. }