Skip to content

Instantly share code, notes, and snippets.

@Hugoberry
Created March 22, 2023 22:56
Show Gist options
  • Save Hugoberry/1f7fb9cc8e64f87546f5baf644def494 to your computer and use it in GitHub Desktop.
Save Hugoberry/1f7fb9cc8e64f87546f5baf644def494 to your computer and use it in GitHub Desktop.
Data structures from Analysis Services Backup file format
using System.Xml.Serialization;
[Serializable]
[XmlRoot("BackupLog")]
public class BackupLogHeader{
[XmlElement("BackupRestoreSyncVersion")]
public int BackupRestoreSyncVersion { get; set; }
[XmlElement("Fault")]
public bool Fault { get; set; }
[XmlElement("faultcode")]
public uint faultcode { get; set; }
[XmlElement("ErrorCode")]
public bool ErrorCode { get; set; }
[XmlElement("EncryptionFlag")]
public bool EncryptionFlag { get; set; }
[XmlElement("EncryptionKey")]
public int EncryptionKey { get; set; }
[XmlElement("ApplyCompression")]
public bool ApplyCompression { get; set; }
[XmlElement("m_cbOffsetHeader")]
public ulong m_cbOffsetHeader { get; set; }
[XmlElement("DataSize")]
public ulong DataSize { get; set; }
[XmlElement("Files")]
public uint Files { get; set; }
[XmlElement("ObjectID")]
public Guid? ObjectID { get; set; }
[XmlElement("m_cbOffsetData")]
public ulong m_cbOffsetData { get; set; }
}
[Serializable]
public class BackupFile{
[XmlElement("Path")]
public string? Path { get; set; }
[XmlElement("Size")]
public int Size { get; set; }
[XmlElement("m_cbOffsetHeader")]
public int m_cbOffsetHeader { get; set; }
[XmlElement("Delete")]
public bool Delete { get; set; }
[XmlElement("CreatedTimestamp")]
public long CreatedTimestamp { get; set; }
[XmlElement("Access")]
public long Access { get; set; }
[XmlElement("LastWriteTime")]
public long LastWriteTime { get; set; }
}
[Serializable]
public class VirtualDirectory{
[XmlElement("BackupFile")]
public BackupFile[]? BackupFile { get; set; }
}
[Serializable]
public class FileList{
[XmlElement("BackupFile")]
public BackupFile[]? BackupFile { get; set; }
}
[Serializable]
public class FileGroup{
[XmlElement("Class")]
public int Class { get; set; }
[XmlElement("ID")]
public string? ID { get; set; }
[XmlElement("Name")]
public string? Name { get; set; }
[XmlElement("ObjectVersion")]
public int ObjectVersion { get; set; }
[XmlElement("PersistLocation")]
public int PersistLocation { get; set; }
[XmlElement("PersistLocationPath")]
public string? PersistLocationPath { get; set; }
[XmlElement("StorageLocationPath")]
public string? StorageLocationPath { get; set; }
[XmlElement("ObjectID")]
public Guid? ObjectID { get; set; }
[XmlElement("FileList")]
public FileList[]? FileList { get; set; }
}
[Serializable]
public class FileGroups{
[XmlElement("FileGroup")]
public FileGroup[]? FileGroup { get; set; }
}
[Serializable]
public class Languages{
[XmlElement("Language")]
public int[]? Language { get; set; }
}
[Serializable]
public class Collations{
[XmlElement("Collation")]
public string[]? Collation { get; set; }
}
[Serializable]
public class BackupLog {
[XmlElement("BackupRestoreSyncVersion")]
public string? BackupRestoreSyncVersion { get; set; }
[XmlElement("ServerRoot")]
public string? ServerRoot { get; set; }
[XmlElement("SvrEncryptPwdFlag")]
public bool SvrEncryptPwdFlag { get; set; }
[XmlElement("ServerEnableBinaryXML")]
public bool ServerEnableBinaryXML { get; set; }
[XmlElement("ServerEnableCompression")]
public bool ServerEnableCompression { get; set; }
[XmlElement("CompressionFlag")]
public bool CompressionFlag { get; set; }
[XmlElement("EncryptionFlag")]
public bool EncryptionFlag { get; set; }
[XmlElement("ObjectName")]
public string? ObjectName { get; set; }
[XmlElement("ObjectId")]
public string? ObjectId { get; set; }
[XmlElement("Write")]
public string? Write { get; set; }
[XmlElement("OlapInfo")]
public bool OlapInfo { get; set; }
[XmlElement("IsTabular")]
public bool IsTabular { get; set; }
[XmlElement("Collations")]
public Collations? Collations { get; set; }
[XmlElement("Languages")]
public Languages? Languages { get; set; }
[XmlElement("FileGroups")]
public FileGroups? FileGroups { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment