// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#include "Precompiled.h"
#include "SharedIncludes.h"
namespace RuntimeForStatic {
//==================================================================================================

PWSTR $Str::Duplicate($AM,PCWSTR source,int length) $fatal_error_on_failure $needs_free
{
   return Duplicate($ci,$ci, source, length );
}
PWSTR $Str::DuplicateNS($AM,PCWSTR source,int length) $null_on_failure $last_error $needs_free
{
   return DuplicateNS($ci,$ci, source, length );
}

//==================================================================================================

PWSTR $Str::Duplicate($A,$M,PCWSTR source,int length) $fatal_error_on_failure $needs_free
{
   auto rslt = HelpersRT::DuplicateStr($ci,$m, source, length );
   if ( !rslt )
      $FatalError::RaiseMemoryAllocationFailure();
   return rslt;
}
PWSTR $Str::DuplicateNS($A,$M,PCWSTR source,int length) $null_on_failure $last_error $needs_free
{
   auto rslt = HelpersRT::DuplicateStr($ci,$m, source, length );
   return rslt ? $RESET_LE( rslt ) :
      $SET_ERROR_LE( $StaticMessages::MemoryAllocationFailure() );
}

//==================================================================================================
} // RuntimeForStatic
