IHeld.cs 909 B

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