mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-05 22:01:33 +00:00
This change looks dramatic, but it's just separating out the already-split namespaces into separate top-level folders. In theory, every single one could be built into their own Nuget package. `SabreTools.Serialization` still builds the normal Nuget package that is used by all other projects and includes all namespaces.
26 lines
857 B
C#
26 lines
857 B
C#
using System;
|
|
|
|
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
|
|
if (values is null || values.Length == 0)
|
|
return null;
|
|
|
|
var stringValues = Array.ConvertAll(values, v => v.ToString());
|
|
return string.Join(".", [.. stringValues]);
|
|
}
|
|
}
|
|
}
|