2025-09-24 08:25:11 -04:00
|
|
|
using System;
|
|
|
|
|
|
2026-03-18 16:18:10 -04:00
|
|
|
namespace SabreTools.ObjectIdentifier
|
2025-09-24 08:25:11 -04:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Methods related to Object Identifiers (OID) and dot notation
|
|
|
|
|
/// </summary>
|
2025-09-24 10:47:00 -04:00
|
|
|
public static partial class Parser
|
2025-09-24 08:25:11 -04:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Parse an OID in separated-value notation into dot notation
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="values">List of values to check against</param>
|
|
|
|
|
/// <returns>List of values representing the dot notation</returns>
|
|
|
|
|
public static string? ParseOIDToDotNotation(ulong[]? values)
|
|
|
|
|
{
|
|
|
|
|
// If we have an invalid set of values, we can't do anything
|
2026-01-25 14:30:18 -05:00
|
|
|
if (values is null || values.Length == 0)
|
2025-09-24 08:25:11 -04:00
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
var stringValues = Array.ConvertAll(values, v => v.ToString());
|
|
|
|
|
return string.Join(".", [.. stringValues]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|