// Copyright Epic Games, Inc. All Rights Reserved.
// This file is automatically generated. Changes to this file may be overwritten.
namespace Epic.OnlineServices
{
public sealed partial class ProductUserId : Handle
{
public ProductUserId()
{
}
public ProductUserId(System.IntPtr innerHandle) : base(innerHandle)
{
}
///
/// A character buffer of this size is large enough to fit a successful output of . This length does not include the null-terminator.
///
public const int ProductuseridMaxLength = 128;
///
/// Retrieve an from a raw string representing an Epic Online Services Product User ID. The input string must be null-terminated.
/// NOTE: There is no validation on the string format, this should only be used with values serialized from legitimate sources such as
///
/// The stringified product user ID for which to retrieve the Epic Online Services Product User ID
///
/// The that corresponds to the ProductUserIdString
///
public static ProductUserId FromString(string productUserIdString)
{
var productUserIdStringAddress = System.IntPtr.Zero;
Helper.TryMarshalSet(ref productUserIdStringAddress, productUserIdString);
var funcResult = Bindings.EOS_ProductUserId_FromString(productUserIdStringAddress);
Helper.TryMarshalDispose(ref productUserIdStringAddress);
ProductUserId funcResultReturn;
Helper.TryMarshalGet(funcResult, out funcResultReturn);
return funcResultReturn;
}
///
/// Check whether or not the given account unique ID is considered valid
/// NOTE: This will return true for any created with as there is no validation
///
/// The Product User ID to check for validity
///
/// true if the is valid, otherwise false
///
public bool IsValid()
{
var funcResult = Bindings.EOS_ProductUserId_IsValid(InnerHandle);
bool funcResultReturn;
Helper.TryMarshalGet(funcResult, out funcResultReturn);
return funcResultReturn;
}
///
/// Retrieve a null-terminated stringified Product User ID from an . This is useful for replication of Product User IDs in multiplayer games.
/// This string will be no larger than + 1 and will only contain UTF8-encoded printable characters (excluding the null-terminator).
///
/// The Product User ID for which to retrieve the stringified version.
/// The buffer into which the character data should be written
///
/// The size of the OutBuffer in characters.
/// The input buffer should include enough space to be null-terminated.
/// When the function returns, this parameter will be filled with the length of the string copied into OutBuffer including the null termination character.
///
///
/// An that indicates whether the Product User ID string was copied into the OutBuffer.
/// - The OutBuffer was filled, and InOutBufferLength contains the number of characters copied into OutBuffer including the null terminator.
/// - Either OutBuffer or InOutBufferLength were passed as NULL parameters.
/// - The AccountId is invalid and cannot be stringified.
/// - The OutBuffer is not large enough to receive the Product User ID string. InOutBufferLength contains the required minimum length to perform the operation successfully.
///
public Result ToString(out string outBuffer)
{
System.IntPtr outBufferAddress = System.IntPtr.Zero;
int inOutBufferLength = ProductuseridMaxLength + 1;
Helper.TryMarshalAllocate(ref outBufferAddress, inOutBufferLength);
var funcResult = Bindings.EOS_ProductUserId_ToString(InnerHandle, outBufferAddress, ref inOutBufferLength);
Helper.TryMarshalGet(outBufferAddress, out outBuffer);
Helper.TryMarshalDispose(ref outBufferAddress);
return funcResult;
}
public override string ToString()
{
string funcResult;
ToString(out funcResult);
return funcResult;
}
}
}