Naming fixes.

This commit is contained in:
2020-07-20 21:11:20 +01:00
parent 222d660d6b
commit 1fe6700b11
14 changed files with 288 additions and 274 deletions

View File

@@ -37,6 +37,7 @@
// ****************************************************************************/
using System;
using System.Diagnostics.CodeAnalysis;
namespace Aaru.CommonTypes.Enums
{
@@ -110,6 +111,7 @@ namespace Aaru.CommonTypes.Enums
}
/// <summary>Metadata present for each media.</summary>
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum MediaTagType
{
/// <summary>CD table of contents</summary>

View File

@@ -45,17 +45,17 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Implements extents for <see cref="byte" /></summary>
public class ExtentsByte
{
List<Tuple<byte, byte>> backend;
List<Tuple<byte, byte>> _backend;
/// <summary>Initialize an empty list of extents</summary>
public ExtentsByte() => backend = new List<Tuple<byte, byte>>();
public ExtentsByte() => _backend = new List<Tuple<byte, byte>>();
/// <summary>Initializes extents with an specific list</summary>
/// <param name="list">List of extents as tuples "start, end"</param>
public ExtentsByte(IEnumerable<Tuple<byte, byte>> list) => backend = list.OrderBy(t => t.Item1).ToList();
public ExtentsByte(IEnumerable<Tuple<byte, byte>> list) => _backend = list.OrderBy(t => t.Item1).ToList();
/// <summary>Gets a count of how many extents are stored</summary>
public int Count => backend.Count;
public int Count => _backend.Count;
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
/// <param name="item"></param>
@@ -65,59 +65,59 @@ namespace Aaru.CommonTypes.Extents
Tuple<byte, byte> removeTwo = null;
Tuple<byte, byte> itemToAdd = null;
for(int i = 0; i < backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= backend[i].Item1 &&
item <= backend[i].Item2)
if(item >= _backend[i].Item1 &&
item <= _backend[i].Item2)
return;
// Expands existing extent start
if(item == backend[i].Item1 - 1)
if(item == _backend[i].Item1 - 1)
{
removeOne = backend[i];
removeOne = _backend[i];
if(i > 0 &&
item == backend[i - 1].Item2 + 1)
item == _backend[i - 1].Item2 + 1)
{
removeTwo = backend[i - 1];
itemToAdd = new Tuple<byte, byte>(backend[i - 1].Item1, backend[i].Item2);
removeTwo = _backend[i - 1];
itemToAdd = new Tuple<byte, byte>(_backend[i - 1].Item1, _backend[i].Item2);
}
else
itemToAdd = new Tuple<byte, byte>(item, backend[i].Item2);
itemToAdd = new Tuple<byte, byte>(item, _backend[i].Item2);
break;
}
// Expands existing extent end
if(item != backend[i].Item2 + 1)
if(item != _backend[i].Item2 + 1)
continue;
removeOne = backend[i];
removeOne = _backend[i];
if(i < backend.Count - 1 &&
item == backend[i + 1].Item1 - 1)
if(i < _backend.Count - 1 &&
item == _backend[i + 1].Item1 - 1)
{
removeTwo = backend[i + 1];
itemToAdd = new Tuple<byte, byte>(backend[i].Item1, backend[i + 1].Item2);
removeTwo = _backend[i + 1];
itemToAdd = new Tuple<byte, byte>(_backend[i].Item1, _backend[i + 1].Item2);
}
else
itemToAdd = new Tuple<byte, byte>(backend[i].Item1, item);
itemToAdd = new Tuple<byte, byte>(_backend[i].Item1, item);
break;
}
if(itemToAdd != null)
{
backend.Remove(removeOne);
backend.Remove(removeTwo);
backend.Add(itemToAdd);
_backend.Remove(removeOne);
_backend.Remove(removeTwo);
_backend.Add(itemToAdd);
}
else
backend.Add(new Tuple<byte, byte>(item, item));
_backend.Add(new Tuple<byte, byte>(item, item));
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
}
/// <summary>Adds a new extent</summary>
@@ -144,10 +144,10 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
/// <param name="item">Item to seach for</param>
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
public bool Contains(byte item) => backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
public bool Contains(byte item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
/// <summary>Removes all extents from this instance</summary>
public void Clear() => backend.Clear();
public void Clear() => _backend.Clear();
/// <summary>Removes an item from the extents in this instance</summary>
/// <param name="item">Item to remove</param>
@@ -158,7 +158,7 @@ namespace Aaru.CommonTypes.Extents
Tuple<byte, byte> toAddOne = null;
Tuple<byte, byte> toAddTwo = null;
foreach(Tuple<byte, byte> extent in backend)
foreach(Tuple<byte, byte> extent in _backend)
{
// Extent is contained and not a border
if(item > extent.Item1 &&
@@ -205,16 +205,16 @@ namespace Aaru.CommonTypes.Extents
if(toRemove == null)
return false;
backend.Remove(toRemove);
_backend.Remove(toRemove);
if(toAddOne != null)
backend.Add(toAddOne);
_backend.Add(toAddOne);
if(toAddTwo != null)
backend.Add(toAddTwo);
_backend.Add(toAddTwo);
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
return true;
}
@@ -224,7 +224,7 @@ namespace Aaru.CommonTypes.Extents
/// T2 is last element
/// </summary>
/// <returns>Array of <see cref="Tuple" /></returns>
public Tuple<byte, byte>[] ToArray() => backend.ToArray();
public Tuple<byte, byte>[] ToArray() => _backend.ToArray();
/// <summary>Gets the first element of the extent that contains the specified item</summary>
/// <param name="item">Item</param>
@@ -234,7 +234,7 @@ namespace Aaru.CommonTypes.Extents
{
start = 0;
foreach(Tuple<byte, byte> extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
foreach(Tuple<byte, byte> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
{
start = extent.Item1;

View File

@@ -45,17 +45,17 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Implements extents for <see cref="int" /></summary>
public class ExtentsInt
{
List<Tuple<int, int>> backend;
List<Tuple<int, int>> _backend;
/// <summary>Initialize an empty list of extents</summary>
public ExtentsInt() => backend = new List<Tuple<int, int>>();
public ExtentsInt() => _backend = new List<Tuple<int, int>>();
/// <summary>Initializes extents with an specific list</summary>
/// <param name="list">List of extents as tuples "start, end"</param>
public ExtentsInt(IEnumerable<Tuple<int, int>> list) => backend = list.OrderBy(t => t.Item1).ToList();
public ExtentsInt(IEnumerable<Tuple<int, int>> list) => _backend = list.OrderBy(t => t.Item1).ToList();
/// <summary>Gets a count of how many extents are stored</summary>
public int Count => backend.Count;
public int Count => _backend.Count;
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
/// <param name="item"></param>
@@ -65,59 +65,59 @@ namespace Aaru.CommonTypes.Extents
Tuple<int, int> removeTwo = null;
Tuple<int, int> itemToAdd = null;
for(int i = 0; i < backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= backend[i].Item1 &&
item <= backend[i].Item2)
if(item >= _backend[i].Item1 &&
item <= _backend[i].Item2)
return;
// Expands existing extent start
if(item == backend[i].Item1 - 1)
if(item == _backend[i].Item1 - 1)
{
removeOne = backend[i];
removeOne = _backend[i];
if(i > 0 &&
item == backend[i - 1].Item2 + 1)
item == _backend[i - 1].Item2 + 1)
{
removeTwo = backend[i - 1];
itemToAdd = new Tuple<int, int>(backend[i - 1].Item1, backend[i].Item2);
removeTwo = _backend[i - 1];
itemToAdd = new Tuple<int, int>(_backend[i - 1].Item1, _backend[i].Item2);
}
else
itemToAdd = new Tuple<int, int>(item, backend[i].Item2);
itemToAdd = new Tuple<int, int>(item, _backend[i].Item2);
break;
}
// Expands existing extent end
if(item != backend[i].Item2 + 1)
if(item != _backend[i].Item2 + 1)
continue;
removeOne = backend[i];
removeOne = _backend[i];
if(i < backend.Count - 1 &&
item == backend[i + 1].Item1 - 1)
if(i < _backend.Count - 1 &&
item == _backend[i + 1].Item1 - 1)
{
removeTwo = backend[i + 1];
itemToAdd = new Tuple<int, int>(backend[i].Item1, backend[i + 1].Item2);
removeTwo = _backend[i + 1];
itemToAdd = new Tuple<int, int>(_backend[i].Item1, _backend[i + 1].Item2);
}
else
itemToAdd = new Tuple<int, int>(backend[i].Item1, item);
itemToAdd = new Tuple<int, int>(_backend[i].Item1, item);
break;
}
if(itemToAdd != null)
{
backend.Remove(removeOne);
backend.Remove(removeTwo);
backend.Add(itemToAdd);
_backend.Remove(removeOne);
_backend.Remove(removeTwo);
_backend.Add(itemToAdd);
}
else
backend.Add(new Tuple<int, int>(item, item));
_backend.Add(new Tuple<int, int>(item, item));
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
}
/// <summary>Adds a new extent</summary>
@@ -144,10 +144,10 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
/// <param name="item">Item to seach for</param>
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
public bool Contains(int item) => backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
public bool Contains(int item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
/// <summary>Removes all extents from this instance</summary>
public void Clear() => backend.Clear();
public void Clear() => _backend.Clear();
/// <summary>Removes an item from the extents in this instance</summary>
/// <param name="item">Item to remove</param>
@@ -158,7 +158,7 @@ namespace Aaru.CommonTypes.Extents
Tuple<int, int> toAddOne = null;
Tuple<int, int> toAddTwo = null;
foreach(Tuple<int, int> extent in backend)
foreach(Tuple<int, int> extent in _backend)
{
// Extent is contained and not a border
if(item > extent.Item1 &&
@@ -205,16 +205,16 @@ namespace Aaru.CommonTypes.Extents
if(toRemove == null)
return false;
backend.Remove(toRemove);
_backend.Remove(toRemove);
if(toAddOne != null)
backend.Add(toAddOne);
_backend.Add(toAddOne);
if(toAddTwo != null)
backend.Add(toAddTwo);
_backend.Add(toAddTwo);
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
return true;
}
@@ -224,7 +224,7 @@ namespace Aaru.CommonTypes.Extents
/// T2 is last element
/// </summary>
/// <returns>Array of <see cref="Tuple" /></returns>
public Tuple<int, int>[] ToArray() => backend.ToArray();
public Tuple<int, int>[] ToArray() => _backend.ToArray();
/// <summary>Gets the first element of the extent that contains the specified item</summary>
/// <param name="item">Item</param>
@@ -234,7 +234,7 @@ namespace Aaru.CommonTypes.Extents
{
start = 0;
foreach(Tuple<int, int> extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
foreach(Tuple<int, int> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
{
start = extent.Item1;

View File

@@ -45,17 +45,17 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Implements extents for <see cref="long" /></summary>
public class ExtentsLong
{
List<Tuple<long, long>> backend;
List<Tuple<long, long>> _backend;
/// <summary>Initialize an empty list of extents</summary>
public ExtentsLong() => backend = new List<Tuple<long, long>>();
public ExtentsLong() => _backend = new List<Tuple<long, long>>();
/// <summary>Initializes extents with an specific list</summary>
/// <param name="list">List of extents as tuples "start, end"</param>
public ExtentsLong(IEnumerable<Tuple<long, long>> list) => backend = list.OrderBy(t => t.Item1).ToList();
public ExtentsLong(IEnumerable<Tuple<long, long>> list) => _backend = list.OrderBy(t => t.Item1).ToList();
/// <summary>Gets a count of how many extents are stored</summary>
public int Count => backend.Count;
public int Count => _backend.Count;
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
/// <param name="item"></param>
@@ -65,59 +65,59 @@ namespace Aaru.CommonTypes.Extents
Tuple<long, long> removeTwo = null;
Tuple<long, long> itemToAdd = null;
for(int i = 0; i < backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= backend[i].Item1 &&
item <= backend[i].Item2)
if(item >= _backend[i].Item1 &&
item <= _backend[i].Item2)
return;
// Expands existing extent start
if(item == backend[i].Item1 - 1)
if(item == _backend[i].Item1 - 1)
{
removeOne = backend[i];
removeOne = _backend[i];
if(i > 0 &&
item == backend[i - 1].Item2 + 1)
item == _backend[i - 1].Item2 + 1)
{
removeTwo = backend[i - 1];
itemToAdd = new Tuple<long, long>(backend[i - 1].Item1, backend[i].Item2);
removeTwo = _backend[i - 1];
itemToAdd = new Tuple<long, long>(_backend[i - 1].Item1, _backend[i].Item2);
}
else
itemToAdd = new Tuple<long, long>(item, backend[i].Item2);
itemToAdd = new Tuple<long, long>(item, _backend[i].Item2);
break;
}
// Expands existing extent end
if(item != backend[i].Item2 + 1)
if(item != _backend[i].Item2 + 1)
continue;
removeOne = backend[i];
removeOne = _backend[i];
if(i < backend.Count - 1 &&
item == backend[i + 1].Item1 - 1)
if(i < _backend.Count - 1 &&
item == _backend[i + 1].Item1 - 1)
{
removeTwo = backend[i + 1];
itemToAdd = new Tuple<long, long>(backend[i].Item1, backend[i + 1].Item2);
removeTwo = _backend[i + 1];
itemToAdd = new Tuple<long, long>(_backend[i].Item1, _backend[i + 1].Item2);
}
else
itemToAdd = new Tuple<long, long>(backend[i].Item1, item);
itemToAdd = new Tuple<long, long>(_backend[i].Item1, item);
break;
}
if(itemToAdd != null)
{
backend.Remove(removeOne);
backend.Remove(removeTwo);
backend.Add(itemToAdd);
_backend.Remove(removeOne);
_backend.Remove(removeTwo);
_backend.Add(itemToAdd);
}
else
backend.Add(new Tuple<long, long>(item, item));
_backend.Add(new Tuple<long, long>(item, item));
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
}
/// <summary>Adds a new extent</summary>
@@ -144,10 +144,10 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
/// <param name="item">Item to seach for</param>
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
public bool Contains(long item) => backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
public bool Contains(long item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
/// <summary>Removes all extents from this instance</summary>
public void Clear() => backend.Clear();
public void Clear() => _backend.Clear();
/// <summary>Removes an item from the extents in this instance</summary>
/// <param name="item">Item to remove</param>
@@ -158,7 +158,7 @@ namespace Aaru.CommonTypes.Extents
Tuple<long, long> toAddOne = null;
Tuple<long, long> toAddTwo = null;
foreach(Tuple<long, long> extent in backend)
foreach(Tuple<long, long> extent in _backend)
{
// Extent is contained and not a border
if(item > extent.Item1 &&
@@ -205,16 +205,16 @@ namespace Aaru.CommonTypes.Extents
if(toRemove == null)
return false;
backend.Remove(toRemove);
_backend.Remove(toRemove);
if(toAddOne != null)
backend.Add(toAddOne);
_backend.Add(toAddOne);
if(toAddTwo != null)
backend.Add(toAddTwo);
_backend.Add(toAddTwo);
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
return true;
}
@@ -224,7 +224,7 @@ namespace Aaru.CommonTypes.Extents
/// T2 is last element
/// </summary>
/// <returns>Array of <see cref="Tuple" /></returns>
public Tuple<long, long>[] ToArray() => backend.ToArray();
public Tuple<long, long>[] ToArray() => _backend.ToArray();
/// <summary>Gets the first element of the extent that contains the specified item</summary>
/// <param name="item">Item</param>
@@ -234,7 +234,7 @@ namespace Aaru.CommonTypes.Extents
{
start = 0;
foreach(Tuple<long, long> extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
foreach(Tuple<long, long> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
{
start = extent.Item1;

View File

@@ -45,17 +45,17 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Implements extents for <see cref="sbyte" /></summary>
public class ExtentsSByte
{
List<Tuple<sbyte, sbyte>> backend;
List<Tuple<sbyte, sbyte>> _backend;
/// <summary>Initialize an empty list of extents</summary>
public ExtentsSByte() => backend = new List<Tuple<sbyte, sbyte>>();
public ExtentsSByte() => _backend = new List<Tuple<sbyte, sbyte>>();
/// <summary>Initializes extents with an specific list</summary>
/// <param name="list">List of extents as tuples "start, end"</param>
public ExtentsSByte(IEnumerable<Tuple<sbyte, sbyte>> list) => backend = list.OrderBy(t => t.Item1).ToList();
public ExtentsSByte(IEnumerable<Tuple<sbyte, sbyte>> list) => _backend = list.OrderBy(t => t.Item1).ToList();
/// <summary>Gets a count of how many extents are stored</summary>
public int Count => backend.Count;
public int Count => _backend.Count;
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
/// <param name="item"></param>
@@ -65,59 +65,59 @@ namespace Aaru.CommonTypes.Extents
Tuple<sbyte, sbyte> removeTwo = null;
Tuple<sbyte, sbyte> itemToAdd = null;
for(int i = 0; i < backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= backend[i].Item1 &&
item <= backend[i].Item2)
if(item >= _backend[i].Item1 &&
item <= _backend[i].Item2)
return;
// Expands existing extent start
if(item == backend[i].Item1 - 1)
if(item == _backend[i].Item1 - 1)
{
removeOne = backend[i];
removeOne = _backend[i];
if(i > 0 &&
item == backend[i - 1].Item2 + 1)
item == _backend[i - 1].Item2 + 1)
{
removeTwo = backend[i - 1];
itemToAdd = new Tuple<sbyte, sbyte>(backend[i - 1].Item1, backend[i].Item2);
removeTwo = _backend[i - 1];
itemToAdd = new Tuple<sbyte, sbyte>(_backend[i - 1].Item1, _backend[i].Item2);
}
else
itemToAdd = new Tuple<sbyte, sbyte>(item, backend[i].Item2);
itemToAdd = new Tuple<sbyte, sbyte>(item, _backend[i].Item2);
break;
}
// Expands existing extent end
if(item != backend[i].Item2 + 1)
if(item != _backend[i].Item2 + 1)
continue;
removeOne = backend[i];
removeOne = _backend[i];
if(i < backend.Count - 1 &&
item == backend[i + 1].Item1 - 1)
if(i < _backend.Count - 1 &&
item == _backend[i + 1].Item1 - 1)
{
removeTwo = backend[i + 1];
itemToAdd = new Tuple<sbyte, sbyte>(backend[i].Item1, backend[i + 1].Item2);
removeTwo = _backend[i + 1];
itemToAdd = new Tuple<sbyte, sbyte>(_backend[i].Item1, _backend[i + 1].Item2);
}
else
itemToAdd = new Tuple<sbyte, sbyte>(backend[i].Item1, item);
itemToAdd = new Tuple<sbyte, sbyte>(_backend[i].Item1, item);
break;
}
if(itemToAdd != null)
{
backend.Remove(removeOne);
backend.Remove(removeTwo);
backend.Add(itemToAdd);
_backend.Remove(removeOne);
_backend.Remove(removeTwo);
_backend.Add(itemToAdd);
}
else
backend.Add(new Tuple<sbyte, sbyte>(item, item));
_backend.Add(new Tuple<sbyte, sbyte>(item, item));
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
}
/// <summary>Adds a new extent</summary>
@@ -144,10 +144,10 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
/// <param name="item">Item to seach for</param>
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
public bool Contains(sbyte item) => backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
public bool Contains(sbyte item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
/// <summary>Removes all extents from this instance</summary>
public void Clear() => backend.Clear();
public void Clear() => _backend.Clear();
/// <summary>Removes an item from the extents in this instance</summary>
/// <param name="item">Item to remove</param>
@@ -158,7 +158,7 @@ namespace Aaru.CommonTypes.Extents
Tuple<sbyte, sbyte> toAddOne = null;
Tuple<sbyte, sbyte> toAddTwo = null;
foreach(Tuple<sbyte, sbyte> extent in backend)
foreach(Tuple<sbyte, sbyte> extent in _backend)
{
// Extent is contained and not a border
if(item > extent.Item1 &&
@@ -205,16 +205,16 @@ namespace Aaru.CommonTypes.Extents
if(toRemove == null)
return false;
backend.Remove(toRemove);
_backend.Remove(toRemove);
if(toAddOne != null)
backend.Add(toAddOne);
_backend.Add(toAddOne);
if(toAddTwo != null)
backend.Add(toAddTwo);
_backend.Add(toAddTwo);
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
return true;
}
@@ -224,7 +224,7 @@ namespace Aaru.CommonTypes.Extents
/// T2 is last element
/// </summary>
/// <returns>Array of <see cref="Tuple" /></returns>
public Tuple<sbyte, sbyte>[] ToArray() => backend.ToArray();
public Tuple<sbyte, sbyte>[] ToArray() => _backend.ToArray();
/// <summary>Gets the first element of the extent that contains the specified item</summary>
/// <param name="item">Item</param>
@@ -234,7 +234,8 @@ namespace Aaru.CommonTypes.Extents
{
start = 0;
foreach(Tuple<sbyte, sbyte> extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
foreach(Tuple<sbyte, sbyte> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)
)
{
start = extent.Item1;

View File

@@ -45,17 +45,17 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Implements extents for <see cref="short" /></summary>
public class ExtentsShort
{
List<Tuple<short, short>> backend;
List<Tuple<short, short>> _backend;
/// <summary>Initialize an empty list of extents</summary>
public ExtentsShort() => backend = new List<Tuple<short, short>>();
public ExtentsShort() => _backend = new List<Tuple<short, short>>();
/// <summary>Initializes extents with an specific list</summary>
/// <param name="list">List of extents as tuples "start, end"</param>
public ExtentsShort(IEnumerable<Tuple<short, short>> list) => backend = list.OrderBy(t => t.Item1).ToList();
public ExtentsShort(IEnumerable<Tuple<short, short>> list) => _backend = list.OrderBy(t => t.Item1).ToList();
/// <summary>Gets a count of how many extents are stored</summary>
public int Count => backend.Count;
public int Count => _backend.Count;
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
/// <param name="item"></param>
@@ -65,59 +65,59 @@ namespace Aaru.CommonTypes.Extents
Tuple<short, short> removeTwo = null;
Tuple<short, short> itemToAdd = null;
for(int i = 0; i < backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= backend[i].Item1 &&
item <= backend[i].Item2)
if(item >= _backend[i].Item1 &&
item <= _backend[i].Item2)
return;
// Expands existing extent start
if(item == backend[i].Item1 - 1)
if(item == _backend[i].Item1 - 1)
{
removeOne = backend[i];
removeOne = _backend[i];
if(i > 0 &&
item == backend[i - 1].Item2 + 1)
item == _backend[i - 1].Item2 + 1)
{
removeTwo = backend[i - 1];
itemToAdd = new Tuple<short, short>(backend[i - 1].Item1, backend[i].Item2);
removeTwo = _backend[i - 1];
itemToAdd = new Tuple<short, short>(_backend[i - 1].Item1, _backend[i].Item2);
}
else
itemToAdd = new Tuple<short, short>(item, backend[i].Item2);
itemToAdd = new Tuple<short, short>(item, _backend[i].Item2);
break;
}
// Expands existing extent end
if(item != backend[i].Item2 + 1)
if(item != _backend[i].Item2 + 1)
continue;
removeOne = backend[i];
removeOne = _backend[i];
if(i < backend.Count - 1 &&
item == backend[i + 1].Item1 - 1)
if(i < _backend.Count - 1 &&
item == _backend[i + 1].Item1 - 1)
{
removeTwo = backend[i + 1];
itemToAdd = new Tuple<short, short>(backend[i].Item1, backend[i + 1].Item2);
removeTwo = _backend[i + 1];
itemToAdd = new Tuple<short, short>(_backend[i].Item1, _backend[i + 1].Item2);
}
else
itemToAdd = new Tuple<short, short>(backend[i].Item1, item);
itemToAdd = new Tuple<short, short>(_backend[i].Item1, item);
break;
}
if(itemToAdd != null)
{
backend.Remove(removeOne);
backend.Remove(removeTwo);
backend.Add(itemToAdd);
_backend.Remove(removeOne);
_backend.Remove(removeTwo);
_backend.Add(itemToAdd);
}
else
backend.Add(new Tuple<short, short>(item, item));
_backend.Add(new Tuple<short, short>(item, item));
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
}
/// <summary>Adds a new extent</summary>
@@ -144,10 +144,10 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
/// <param name="item">Item to seach for</param>
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
public bool Contains(short item) => backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
public bool Contains(short item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
/// <summary>Removes all extents from this instance</summary>
public void Clear() => backend.Clear();
public void Clear() => _backend.Clear();
/// <summary>Removes an item from the extents in this instance</summary>
/// <param name="item">Item to remove</param>
@@ -158,7 +158,7 @@ namespace Aaru.CommonTypes.Extents
Tuple<short, short> toAddOne = null;
Tuple<short, short> toAddTwo = null;
foreach(Tuple<short, short> extent in backend)
foreach(Tuple<short, short> extent in _backend)
{
// Extent is contained and not a border
if(item > extent.Item1 &&
@@ -205,16 +205,16 @@ namespace Aaru.CommonTypes.Extents
if(toRemove == null)
return false;
backend.Remove(toRemove);
_backend.Remove(toRemove);
if(toAddOne != null)
backend.Add(toAddOne);
_backend.Add(toAddOne);
if(toAddTwo != null)
backend.Add(toAddTwo);
_backend.Add(toAddTwo);
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
return true;
}
@@ -224,7 +224,7 @@ namespace Aaru.CommonTypes.Extents
/// T2 is last element
/// </summary>
/// <returns>Array of <see cref="Tuple" /></returns>
public Tuple<short, short>[] ToArray() => backend.ToArray();
public Tuple<short, short>[] ToArray() => _backend.ToArray();
/// <summary>Gets the first element of the extent that contains the specified item</summary>
/// <param name="item">Item</param>
@@ -234,7 +234,8 @@ namespace Aaru.CommonTypes.Extents
{
start = 0;
foreach(Tuple<short, short> extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
foreach(Tuple<short, short> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)
)
{
start = extent.Item1;

View File

@@ -45,17 +45,17 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Implements extents for <see cref="uint" /></summary>
public class ExtentsUInt
{
List<Tuple<uint, uint>> backend;
List<Tuple<uint, uint>> _backend;
/// <summary>Initialize an empty list of extents</summary>
public ExtentsUInt() => backend = new List<Tuple<uint, uint>>();
public ExtentsUInt() => _backend = new List<Tuple<uint, uint>>();
/// <summary>Initializes extents with an specific list</summary>
/// <param name="list">List of extents as tuples "start, end"</param>
public ExtentsUInt(IEnumerable<Tuple<uint, uint>> list) => backend = list.OrderBy(t => t.Item1).ToList();
public ExtentsUInt(IEnumerable<Tuple<uint, uint>> list) => _backend = list.OrderBy(t => t.Item1).ToList();
/// <summary>Gets a count of how many extents are stored</summary>
public int Count => backend.Count;
public int Count => _backend.Count;
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
/// <param name="item"></param>
@@ -65,59 +65,59 @@ namespace Aaru.CommonTypes.Extents
Tuple<uint, uint> removeTwo = null;
Tuple<uint, uint> itemToAdd = null;
for(int i = 0; i < backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= backend[i].Item1 &&
item <= backend[i].Item2)
if(item >= _backend[i].Item1 &&
item <= _backend[i].Item2)
return;
// Expands existing extent start
if(item == backend[i].Item1 - 1)
if(item == _backend[i].Item1 - 1)
{
removeOne = backend[i];
removeOne = _backend[i];
if(i > 0 &&
item == backend[i - 1].Item2 + 1)
item == _backend[i - 1].Item2 + 1)
{
removeTwo = backend[i - 1];
itemToAdd = new Tuple<uint, uint>(backend[i - 1].Item1, backend[i].Item2);
removeTwo = _backend[i - 1];
itemToAdd = new Tuple<uint, uint>(_backend[i - 1].Item1, _backend[i].Item2);
}
else
itemToAdd = new Tuple<uint, uint>(item, backend[i].Item2);
itemToAdd = new Tuple<uint, uint>(item, _backend[i].Item2);
break;
}
// Expands existing extent end
if(item != backend[i].Item2 + 1)
if(item != _backend[i].Item2 + 1)
continue;
removeOne = backend[i];
removeOne = _backend[i];
if(i < backend.Count - 1 &&
item == backend[i + 1].Item1 - 1)
if(i < _backend.Count - 1 &&
item == _backend[i + 1].Item1 - 1)
{
removeTwo = backend[i + 1];
itemToAdd = new Tuple<uint, uint>(backend[i].Item1, backend[i + 1].Item2);
removeTwo = _backend[i + 1];
itemToAdd = new Tuple<uint, uint>(_backend[i].Item1, _backend[i + 1].Item2);
}
else
itemToAdd = new Tuple<uint, uint>(backend[i].Item1, item);
itemToAdd = new Tuple<uint, uint>(_backend[i].Item1, item);
break;
}
if(itemToAdd != null)
{
backend.Remove(removeOne);
backend.Remove(removeTwo);
backend.Add(itemToAdd);
_backend.Remove(removeOne);
_backend.Remove(removeTwo);
_backend.Add(itemToAdd);
}
else
backend.Add(new Tuple<uint, uint>(item, item));
_backend.Add(new Tuple<uint, uint>(item, item));
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
}
/// <summary>Adds a new extent</summary>
@@ -144,10 +144,10 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
/// <param name="item">Item to seach for</param>
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
public bool Contains(uint item) => backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
public bool Contains(uint item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
/// <summary>Removes all extents from this instance</summary>
public void Clear() => backend.Clear();
public void Clear() => _backend.Clear();
/// <summary>Removes an item from the extents in this instance</summary>
/// <param name="item">Item to remove</param>
@@ -158,7 +158,7 @@ namespace Aaru.CommonTypes.Extents
Tuple<uint, uint> toAddOne = null;
Tuple<uint, uint> toAddTwo = null;
foreach(Tuple<uint, uint> extent in backend)
foreach(Tuple<uint, uint> extent in _backend)
{
// Extent is contained and not a border
if(item > extent.Item1 &&
@@ -205,16 +205,16 @@ namespace Aaru.CommonTypes.Extents
if(toRemove == null)
return false;
backend.Remove(toRemove);
_backend.Remove(toRemove);
if(toAddOne != null)
backend.Add(toAddOne);
_backend.Add(toAddOne);
if(toAddTwo != null)
backend.Add(toAddTwo);
_backend.Add(toAddTwo);
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
return true;
}
@@ -224,7 +224,7 @@ namespace Aaru.CommonTypes.Extents
/// T2 is last element
/// </summary>
/// <returns>Array of <see cref="Tuple" /></returns>
public Tuple<uint, uint>[] ToArray() => backend.ToArray();
public Tuple<uint, uint>[] ToArray() => _backend.ToArray();
/// <summary>Gets the first element of the extent that contains the specified item</summary>
/// <param name="item">Item</param>
@@ -234,7 +234,7 @@ namespace Aaru.CommonTypes.Extents
{
start = 0;
foreach(Tuple<uint, uint> extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
foreach(Tuple<uint, uint> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
{
start = extent.Item1;

View File

@@ -45,17 +45,17 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Implements extents for <see cref="ulong" /></summary>
public class ExtentsULong
{
List<Tuple<ulong, ulong>> backend;
List<Tuple<ulong, ulong>> _backend;
/// <summary>Initialize an empty list of extents</summary>
public ExtentsULong() => backend = new List<Tuple<ulong, ulong>>();
public ExtentsULong() => _backend = new List<Tuple<ulong, ulong>>();
/// <summary>Initializes extents with an specific list</summary>
/// <param name="list">List of extents as tuples "start, end"</param>
public ExtentsULong(IEnumerable<Tuple<ulong, ulong>> list) => backend = list.OrderBy(t => t.Item1).ToList();
public ExtentsULong(IEnumerable<Tuple<ulong, ulong>> list) => _backend = list.OrderBy(t => t.Item1).ToList();
/// <summary>Gets a count of how many extents are stored</summary>
public int Count => backend.Count;
public int Count => _backend.Count;
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
/// <param name="item"></param>
@@ -65,59 +65,59 @@ namespace Aaru.CommonTypes.Extents
Tuple<ulong, ulong> removeTwo = null;
Tuple<ulong, ulong> itemToAdd = null;
for(int i = 0; i < backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= backend[i].Item1 &&
item <= backend[i].Item2)
if(item >= _backend[i].Item1 &&
item <= _backend[i].Item2)
return;
// Expands existing extent start
if(item == backend[i].Item1 - 1)
if(item == _backend[i].Item1 - 1)
{
removeOne = backend[i];
removeOne = _backend[i];
if(i > 0 &&
item == backend[i - 1].Item2 + 1)
item == _backend[i - 1].Item2 + 1)
{
removeTwo = backend[i - 1];
itemToAdd = new Tuple<ulong, ulong>(backend[i - 1].Item1, backend[i].Item2);
removeTwo = _backend[i - 1];
itemToAdd = new Tuple<ulong, ulong>(_backend[i - 1].Item1, _backend[i].Item2);
}
else
itemToAdd = new Tuple<ulong, ulong>(item, backend[i].Item2);
itemToAdd = new Tuple<ulong, ulong>(item, _backend[i].Item2);
break;
}
// Expands existing extent end
if(item != backend[i].Item2 + 1)
if(item != _backend[i].Item2 + 1)
continue;
removeOne = backend[i];
removeOne = _backend[i];
if(i < backend.Count - 1 &&
item == backend[i + 1].Item1 - 1)
if(i < _backend.Count - 1 &&
item == _backend[i + 1].Item1 - 1)
{
removeTwo = backend[i + 1];
itemToAdd = new Tuple<ulong, ulong>(backend[i].Item1, backend[i + 1].Item2);
removeTwo = _backend[i + 1];
itemToAdd = new Tuple<ulong, ulong>(_backend[i].Item1, _backend[i + 1].Item2);
}
else
itemToAdd = new Tuple<ulong, ulong>(backend[i].Item1, item);
itemToAdd = new Tuple<ulong, ulong>(_backend[i].Item1, item);
break;
}
if(itemToAdd != null)
{
backend.Remove(removeOne);
backend.Remove(removeTwo);
backend.Add(itemToAdd);
_backend.Remove(removeOne);
_backend.Remove(removeTwo);
_backend.Add(itemToAdd);
}
else
backend.Add(new Tuple<ulong, ulong>(item, item));
_backend.Add(new Tuple<ulong, ulong>(item, item));
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
}
/// <summary>Adds a new extent</summary>
@@ -144,10 +144,10 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
/// <param name="item">Item to seach for</param>
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
public bool Contains(ulong item) => backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
public bool Contains(ulong item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
/// <summary>Removes all extents from this instance</summary>
public void Clear() => backend.Clear();
public void Clear() => _backend.Clear();
/// <summary>Removes an item from the extents in this instance</summary>
/// <param name="item">Item to remove</param>
@@ -158,7 +158,7 @@ namespace Aaru.CommonTypes.Extents
Tuple<ulong, ulong> toAddOne = null;
Tuple<ulong, ulong> toAddTwo = null;
foreach(Tuple<ulong, ulong> extent in backend)
foreach(Tuple<ulong, ulong> extent in _backend)
{
// Extent is contained and not a border
if(item > extent.Item1 &&
@@ -205,16 +205,16 @@ namespace Aaru.CommonTypes.Extents
if(toRemove == null)
return false;
backend.Remove(toRemove);
_backend.Remove(toRemove);
if(toAddOne != null)
backend.Add(toAddOne);
_backend.Add(toAddOne);
if(toAddTwo != null)
backend.Add(toAddTwo);
_backend.Add(toAddTwo);
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
return true;
}
@@ -224,7 +224,7 @@ namespace Aaru.CommonTypes.Extents
/// T2 is last element
/// </summary>
/// <returns>Array of <see cref="Tuple" /></returns>
public Tuple<ulong, ulong>[] ToArray() => backend.ToArray();
public Tuple<ulong, ulong>[] ToArray() => _backend.ToArray();
/// <summary>Gets the first element of the extent that contains the specified item</summary>
/// <param name="item">Item</param>
@@ -234,7 +234,8 @@ namespace Aaru.CommonTypes.Extents
{
start = 0;
foreach(Tuple<ulong, ulong> extent in backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
foreach(Tuple<ulong, ulong> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)
)
{
start = extent.Item1;

View File

@@ -45,17 +45,17 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Implements extents for <see cref="ushort" /></summary>
public class ExtentsUShort
{
List<Tuple<ushort, ushort>> backend;
List<Tuple<ushort, ushort>> _backend;
/// <summary>Initialize an empty list of extents</summary>
public ExtentsUShort() => backend = new List<Tuple<ushort, ushort>>();
public ExtentsUShort() => _backend = new List<Tuple<ushort, ushort>>();
/// <summary>Initializes extents with an specific list</summary>
/// <param name="list">List of extents as tuples "start, end"</param>
public ExtentsUShort(IEnumerable<Tuple<ushort, ushort>> list) => backend = list.OrderBy(t => t.Item1).ToList();
public ExtentsUShort(IEnumerable<Tuple<ushort, ushort>> list) => _backend = list.OrderBy(t => t.Item1).ToList();
/// <summary>Gets a count of how many extents are stored</summary>
public int Count => backend.Count;
public int Count => _backend.Count;
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
/// <param name="item"></param>
@@ -65,59 +65,59 @@ namespace Aaru.CommonTypes.Extents
Tuple<ushort, ushort> removeTwo = null;
Tuple<ushort, ushort> itemToAdd = null;
for(int i = 0; i < backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= backend[i].Item1 &&
item <= backend[i].Item2)
if(item >= _backend[i].Item1 &&
item <= _backend[i].Item2)
return;
// Expands existing extent start
if(item == backend[i].Item1 - 1)
if(item == _backend[i].Item1 - 1)
{
removeOne = backend[i];
removeOne = _backend[i];
if(i > 0 &&
item == backend[i - 1].Item2 + 1)
item == _backend[i - 1].Item2 + 1)
{
removeTwo = backend[i - 1];
itemToAdd = new Tuple<ushort, ushort>(backend[i - 1].Item1, backend[i].Item2);
removeTwo = _backend[i - 1];
itemToAdd = new Tuple<ushort, ushort>(_backend[i - 1].Item1, _backend[i].Item2);
}
else
itemToAdd = new Tuple<ushort, ushort>(item, backend[i].Item2);
itemToAdd = new Tuple<ushort, ushort>(item, _backend[i].Item2);
break;
}
// Expands existing extent end
if(item != backend[i].Item2 + 1)
if(item != _backend[i].Item2 + 1)
continue;
removeOne = backend[i];
removeOne = _backend[i];
if(i < backend.Count - 1 &&
item == backend[i + 1].Item1 - 1)
if(i < _backend.Count - 1 &&
item == _backend[i + 1].Item1 - 1)
{
removeTwo = backend[i + 1];
itemToAdd = new Tuple<ushort, ushort>(backend[i].Item1, backend[i + 1].Item2);
removeTwo = _backend[i + 1];
itemToAdd = new Tuple<ushort, ushort>(_backend[i].Item1, _backend[i + 1].Item2);
}
else
itemToAdd = new Tuple<ushort, ushort>(backend[i].Item1, item);
itemToAdd = new Tuple<ushort, ushort>(_backend[i].Item1, item);
break;
}
if(itemToAdd != null)
{
backend.Remove(removeOne);
backend.Remove(removeTwo);
backend.Add(itemToAdd);
_backend.Remove(removeOne);
_backend.Remove(removeTwo);
_backend.Add(itemToAdd);
}
else
backend.Add(new Tuple<ushort, ushort>(item, item));
_backend.Add(new Tuple<ushort, ushort>(item, item));
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
}
/// <summary>Adds a new extent</summary>
@@ -144,10 +144,10 @@ namespace Aaru.CommonTypes.Extents
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
/// <param name="item">Item to seach for</param>
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
public bool Contains(ushort item) => backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
public bool Contains(ushort item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
/// <summary>Removes all extents from this instance</summary>
public void Clear() => backend.Clear();
public void Clear() => _backend.Clear();
/// <summary>Removes an item from the extents in this instance</summary>
/// <param name="item">Item to remove</param>
@@ -158,7 +158,7 @@ namespace Aaru.CommonTypes.Extents
Tuple<ushort, ushort> toAddOne = null;
Tuple<ushort, ushort> toAddTwo = null;
foreach(Tuple<ushort, ushort> extent in backend)
foreach(Tuple<ushort, ushort> extent in _backend)
{
// Extent is contained and not a border
if(item > extent.Item1 &&
@@ -205,16 +205,16 @@ namespace Aaru.CommonTypes.Extents
if(toRemove == null)
return false;
backend.Remove(toRemove);
_backend.Remove(toRemove);
if(toAddOne != null)
backend.Add(toAddOne);
_backend.Add(toAddOne);
if(toAddTwo != null)
backend.Add(toAddTwo);
_backend.Add(toAddTwo);
// Sort
backend = backend.OrderBy(t => t.Item1).ToList();
_backend = _backend.OrderBy(t => t.Item1).ToList();
return true;
}
@@ -224,7 +224,7 @@ namespace Aaru.CommonTypes.Extents
/// T2 is last element
/// </summary>
/// <returns>Array of <see cref="Tuple" /></returns>
public Tuple<ushort, ushort>[] ToArray() => backend.ToArray();
public Tuple<ushort, ushort>[] ToArray() => _backend.ToArray();
/// <summary>Gets the first element of the extent that contains the specified item</summary>
/// <param name="item">Item</param>
@@ -234,8 +234,8 @@ namespace Aaru.CommonTypes.Extents
{
start = 0;
foreach(Tuple<ushort, ushort> extent in backend.Where(extent =>
item >= extent.Item1 && item <= extent.Item2))
foreach(Tuple<ushort, ushort> extent in _backend.Where(extent => item >= extent.Item1 &&
item <= extent.Item2))
{
start = extent.Item1;

View File

@@ -42,7 +42,7 @@ namespace Aaru.CommonTypes
{
public static class Geometry
{
static readonly (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding
public static readonly (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding
encoding, bool variableSectorsPerTrack, MediaType type)[] KnownGeometries =
{
(32, 1, 8, 319, MediaEncoding.FM, false, MediaType.IBM23FD),

View File

@@ -36,9 +36,12 @@
// Copyright © 2011-2020 Natalia Portillo
// ****************************************************************************/
using System.Diagnostics.CodeAnalysis;
namespace Aaru.CommonTypes.Interop
{
/// <summary>Contains an arbitrary list of OSes, even if .NET does not run on them</summary>
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum PlatformID
{
/// <summary>Win32s</summary>

View File

@@ -37,6 +37,7 @@
// ****************************************************************************/
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Xml.Serialization;
namespace Aaru.CommonTypes.Metadata
@@ -182,6 +183,7 @@ namespace Aaru.CommonTypes.Metadata
public string Bus { get; set; }
}
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class NameValueStats
{
[XmlAttribute]
@@ -190,6 +192,7 @@ namespace Aaru.CommonTypes.Metadata
public long Value { get; set; }
}
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class OsStats
{
[XmlAttribute]

View File

@@ -464,6 +464,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes
}
}
[SuppressMessage("ReSharper", "InconsistentNaming")]
public struct ModePage_2A_WriteDescriptor
{
public byte RotationControl;

View File

@@ -38,6 +38,7 @@
// ****************************************************************************/
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace Aaru.CommonTypes.Structs
@@ -263,6 +264,7 @@ namespace Aaru.CommonTypes.Structs
}
/// <summary>Errors</summary>
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum Errno
{
/// <summary>No error happened</summary>