You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 rivejä
3.2 KiB

  1. /* Copyright (C) 2008-2016 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4. * of this software and associated documentation files (the "Software"), to deal
  5. * in the Software without restriction, including without limitation the rights
  6. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. * copies of the Software, and to permit persons to whom the Software is
  8. * furnished to do so, subject to the following conditions:
  9. *
  10. * The above copyright notice and this permission notice shall be included in
  11. * all copies or substantial portions of the Software.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. * THE SOFTWARE.
  20. */
  21. namespace Alphaleonis.Win32.Filesystem
  22. {
  23. /// <summary>The <see cref="BackupStreamInfo"/> structure contains stream header data.</summary>
  24. /// <seealso cref="BackupFileStream"/>
  25. public sealed class BackupStreamInfo
  26. {
  27. #region Private Fields
  28. private readonly long m_size;
  29. private readonly string m_name;
  30. private readonly BackupStreamType m_streamType;
  31. private readonly StreamAttributes m_attributes;
  32. #endregion
  33. #region Constructor
  34. /// <summary>Initializes a new instance of the <see cref="BackupStreamInfo"/> class.</summary>
  35. /// <param name="streamID">The stream ID.</param>
  36. /// <param name="name">The name.</param>
  37. internal BackupStreamInfo(NativeMethods.WIN32_STREAM_ID streamID, string name)
  38. {
  39. m_name = name;
  40. m_size = (long) streamID.Size;
  41. m_attributes = streamID.dwStreamAttributes;
  42. m_streamType = streamID.dwStreamId;
  43. }
  44. #endregion
  45. #region Public Properties
  46. /// <summary>Gets the size of the data in the substream, in bytes.</summary>
  47. /// <value>The size of the data in the substream, in bytes.</value>
  48. public long Size
  49. {
  50. get { return m_size; }
  51. }
  52. /// <summary>Gets a string that specifies the name of the alternative data stream.</summary>
  53. /// <value>A string that specifies the name of the alternative data stream.</value>
  54. public string Name
  55. {
  56. get { return m_name; }
  57. }
  58. /// <summary>Gets the type of the data in the stream.</summary>
  59. /// <value>The type of the data in the stream.</value>
  60. public BackupStreamType StreamType
  61. {
  62. get { return m_streamType; }
  63. }
  64. /// <summary>Gets the attributes of the data to facilitate cross-operating system transfer.</summary>
  65. /// <value>Attributes of the data to facilitate cross-operating system transfer.</value>
  66. public StreamAttributes Attributes
  67. {
  68. get { return m_attributes; }
  69. }
  70. #endregion // Public Properties
  71. }
  72. }