Files
SabreTools.Serialization/SabreTools.ObjectIdentifier/Parser.dot.cs

26 lines
857 B
C#
Raw Normal View History

using System;
2026-03-18 16:18:10 -04:00
namespace SabreTools.ObjectIdentifier
{
/// <summary>
/// Methods related to Object Identifiers (OID) and dot notation
/// </summary>
public static partial class Parser
{
/// <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)
return null;
var stringValues = Array.ConvertAll(values, v => v.ToString());
return string.Join(".", [.. stringValues]);
}
}
}