ホーム › Globalization › uiter_setUTF16BE
uiter_setUTF16BE
関数UTF-16BE文字列に対する文字イテレータを初期化する。
シグネチャ
// icuuc.dll
#include <windows.h>
void uiter_setUTF16BE(
UCharIterator* iter,
LPCSTR s,
INT length
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| iter | UCharIterator* | inout |
| s | LPCSTR | in |
| length | INT | in |
戻り値の型: void
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
void uiter_setUTF16BE(
UCharIterator* iter,
LPCSTR s,
INT length
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void uiter_setUTF16BE(
IntPtr iter, // UCharIterator* in/out
[MarshalAs(UnmanagedType.LPStr)] string s, // LPCSTR
int length // INT
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub uiter_setUTF16BE(
iter As IntPtr, ' UCharIterator* in/out
<MarshalAs(UnmanagedType.LPStr)> s As String, ' LPCSTR
length As Integer ' INT
)
End Sub' iter : UCharIterator* in/out
' s : LPCSTR
' length : INT
Declare PtrSafe Sub uiter_setUTF16BE Lib "icuuc" ( _
ByVal iter As LongPtr, _
ByVal s As String, _
ByVal length As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
uiter_setUTF16BE = ctypes.cdll.icuuc.uiter_setUTF16BE
uiter_setUTF16BE.restype = None
uiter_setUTF16BE.argtypes = [
ctypes.c_void_p, # iter : UCharIterator* in/out
wintypes.LPCSTR, # s : LPCSTR
ctypes.c_int, # length : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
uiter_setUTF16BE = Fiddle::Function.new(
lib['uiter_setUTF16BE'],
[
Fiddle::TYPE_VOIDP, # iter : UCharIterator* in/out
Fiddle::TYPE_VOIDP, # s : LPCSTR
Fiddle::TYPE_INT, # length : INT
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn uiter_setUTF16BE(
iter: *mut UCharIterator, // UCharIterator* in/out
s: *const u8, // LPCSTR
length: i32 // INT
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void uiter_setUTF16BE(IntPtr iter, [MarshalAs(UnmanagedType.LPStr)] string s, int length);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uiter_setUTF16BE' -Namespace Win32 -PassThru
# $api::uiter_setUTF16BE(iter, s, length)#uselib "icuuc.dll"
#func global uiter_setUTF16BE "uiter_setUTF16BE" sptr, sptr, sptr
; uiter_setUTF16BE varptr(iter), s, length
; iter : UCharIterator* in/out -> "sptr"
; s : LPCSTR -> "sptr"
; length : INT -> "sptr"出力引数:
#uselib "icuuc.dll" #func global uiter_setUTF16BE "uiter_setUTF16BE" var, str, int ; uiter_setUTF16BE iter, s, length ; iter : UCharIterator* in/out -> "var" ; s : LPCSTR -> "str" ; length : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuuc.dll" #func global uiter_setUTF16BE "uiter_setUTF16BE" sptr, str, int ; uiter_setUTF16BE varptr(iter), s, length ; iter : UCharIterator* in/out -> "sptr" ; s : LPCSTR -> "str" ; length : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void uiter_setUTF16BE(UCharIterator* iter, LPCSTR s, INT length) #uselib "icuuc.dll" #func global uiter_setUTF16BE "uiter_setUTF16BE" var, str, int ; uiter_setUTF16BE iter, s, length ; iter : UCharIterator* in/out -> "var" ; s : LPCSTR -> "str" ; length : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void uiter_setUTF16BE(UCharIterator* iter, LPCSTR s, INT length) #uselib "icuuc.dll" #func global uiter_setUTF16BE "uiter_setUTF16BE" intptr, str, int ; uiter_setUTF16BE varptr(iter), s, length ; iter : UCharIterator* in/out -> "intptr" ; s : LPCSTR -> "str" ; length : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procuiter_setUTF16BE = icuuc.NewProc("uiter_setUTF16BE")
)
// iter (UCharIterator* in/out), s (LPCSTR), length (INT)
r1, _, err := procuiter_setUTF16BE.Call(
uintptr(iter),
uintptr(unsafe.Pointer(windows.BytePtrFromString(s))),
uintptr(length),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure uiter_setUTF16BE(
iter: Pointer; // UCharIterator* in/out
s: PAnsiChar; // LPCSTR
length: Integer // INT
); cdecl;
external 'icuuc.dll' name 'uiter_setUTF16BE';result := DllCall("icuuc\uiter_setUTF16BE"
, "Ptr", iter ; UCharIterator* in/out
, "AStr", s ; LPCSTR
, "Int", length ; INT
, "Cdecl Int") ; return: void●uiter_setUTF16BE(iter, s, length) = DLL("icuuc.dll", "int uiter_setUTF16BE(void*, char*, int)")
# 呼び出し: uiter_setUTF16BE(iter, s, length)
# iter : UCharIterator* in/out -> "void*"
# s : LPCSTR -> "char*"
# length : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。