XmlWriter.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
  2. //
  3. // System.Xml.XmlWriter
  4. //
  5. // Author:
  6. // Daniel Weber ([email protected])
  7. //
  8. // (C) 2001 Daniel Weber
  9. using System;
  10. namespace System.Xml
  11. {
  12. /// <summary>
  13. /// Abstract class XmlWriter
  14. /// </summary>
  15. public abstract class XmlWriter
  16. {
  17. // Private data members
  18. //===========================================================================
  19. // public properties
  20. //===========================================================================
  21. /// <summary>
  22. /// Get the state of the writer.
  23. /// </summary>
  24. public abstract WriteState WriteState {get;}
  25. /// <summary>
  26. /// Get the current xml:lang scope, or null if not defined.
  27. /// </summary>
  28. public abstract string XmlLang {get;}
  29. /// <summary>
  30. /// get an XmlSpace representing the current xml:space scope
  31. /// </summary>
  32. public abstract XmlSpace XmlSpace {get;}
  33. // Public Methods
  34. //===========================================================================
  35. /// <summary>
  36. /// When overriden, closes this stream and the underlying stream.
  37. /// </summary>
  38. /// <exception cref="InvalidOperationException">A call is made to write more output when the stream is closed.</exception>
  39. public abstract void Close();
  40. /// <summary>
  41. /// Flushes whatever is in the buffer to the underlying streams, and flushes any underlying streams.
  42. /// </summary>
  43. public abstract void Flush();
  44. /// <summary>
  45. /// Returns closest prefix in current namespace, or null if none found.
  46. /// </summary>
  47. /// <param name="ns">namespace URI to find a prefix for.</param>
  48. /// <exception cref="ArgumentException">ns is null, or string.Empty</exception>
  49. /// <returns></returns>
  50. public abstract string LookupPrefix(string ns);
  51. /// <summary>
  52. /// Write out all the attributes found at the current position in the XmlReader
  53. /// </summary>
  54. /// <param name="reader">XmlReader to read from</param>
  55. /// <param name="defattr">true to copy default attributes</param>
  56. /// <exception cref="ArgumentException">Reader is a null reference</exception>
  57. public virtual void WriteAttributes(
  58. XmlReader reader,
  59. bool defattr
  60. )
  61. {
  62. //TODO - implement XmlWriter.WriteAttributes(XmlReader, bool)
  63. throw new NotImplementedException();
  64. }
  65. }
  66. }