ホーム › Globalization › uset_containsAllCodePoints
uset_containsAllCodePoints
関数USetが文字列の全コードポイントを含むかを判定する。
シグネチャ
// icuuc.dll
#include <windows.h>
CHAR uset_containsAllCodePoints(
const USet* set,
const WORD* str,
INT strLen
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| set | USet* | in |
| str | WORD* | in |
| strLen | INT | in |
戻り値の型: CHAR
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
CHAR uset_containsAllCodePoints(
const USet* set,
const WORD* str,
INT strLen
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern sbyte uset_containsAllCodePoints(
ref IntPtr set, // USet*
ref ushort str, // WORD*
int strLen // INT
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function uset_containsAllCodePoints(
ByRef [set] As IntPtr, ' USet*
ByRef str As UShort, ' WORD*
strLen As Integer ' INT
) As SByte
End Function' set : USet*
' str : WORD*
' strLen : INT
Declare PtrSafe Function uset_containsAllCodePoints Lib "icuuc" ( _
ByRef set As LongPtr, _
ByRef str As Integer, _
ByVal strLen As Long) As Byte
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
uset_containsAllCodePoints = ctypes.cdll.icuuc.uset_containsAllCodePoints
uset_containsAllCodePoints.restype = ctypes.c_byte
uset_containsAllCodePoints.argtypes = [
ctypes.c_void_p, # set : USet*
ctypes.POINTER(ctypes.c_ushort), # str : WORD*
ctypes.c_int, # strLen : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
uset_containsAllCodePoints = Fiddle::Function.new(
lib['uset_containsAllCodePoints'],
[
Fiddle::TYPE_VOIDP, # set : USet*
Fiddle::TYPE_VOIDP, # str : WORD*
Fiddle::TYPE_INT, # strLen : INT
],
Fiddle::TYPE_CHAR, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn uset_containsAllCodePoints(
set: *const isize, // USet*
str: *const u16, // WORD*
strLen: i32 // INT
) -> i8;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern sbyte uset_containsAllCodePoints(ref IntPtr set, ref ushort str, int strLen);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uset_containsAllCodePoints' -Namespace Win32 -PassThru
# $api::uset_containsAllCodePoints(set, str, strLen)#uselib "icuuc.dll"
#func global uset_containsAllCodePoints "uset_containsAllCodePoints" sptr, sptr, sptr
; uset_containsAllCodePoints set, varptr(str), strLen ; 戻り値は stat
; set : USet* -> "sptr"
; str : WORD* -> "sptr"
; strLen : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icuuc.dll" #cfunc global uset_containsAllCodePoints "uset_containsAllCodePoints" int, var, int ; res = uset_containsAllCodePoints(set, str, strLen) ; set : USet* -> "int" ; str : WORD* -> "var" ; strLen : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuuc.dll" #cfunc global uset_containsAllCodePoints "uset_containsAllCodePoints" int, sptr, int ; res = uset_containsAllCodePoints(set, varptr(str), strLen) ; set : USet* -> "int" ; str : WORD* -> "sptr" ; strLen : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; CHAR uset_containsAllCodePoints(USet* set, WORD* str, INT strLen) #uselib "icuuc.dll" #cfunc global uset_containsAllCodePoints "uset_containsAllCodePoints" int, var, int ; res = uset_containsAllCodePoints(set, str, strLen) ; set : USet* -> "int" ; str : WORD* -> "var" ; strLen : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; CHAR uset_containsAllCodePoints(USet* set, WORD* str, INT strLen) #uselib "icuuc.dll" #cfunc global uset_containsAllCodePoints "uset_containsAllCodePoints" int, intptr, int ; res = uset_containsAllCodePoints(set, varptr(str), strLen) ; set : USet* -> "int" ; str : WORD* -> "intptr" ; strLen : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procuset_containsAllCodePoints = icuuc.NewProc("uset_containsAllCodePoints")
)
// set (USet*), str (WORD*), strLen (INT)
r1, _, err := procuset_containsAllCodePoints.Call(
uintptr(set),
uintptr(str),
uintptr(strLen),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // CHARfunction uset_containsAllCodePoints(
set: Pointer; // USet*
str: Pointer; // WORD*
strLen: Integer // INT
): Shortint; cdecl;
external 'icuuc.dll' name 'uset_containsAllCodePoints';result := DllCall("icuuc\uset_containsAllCodePoints"
, "Ptr", set ; USet*
, "Ptr", str ; WORD*
, "Int", strLen ; INT
, "Cdecl Char") ; return: CHAR●uset_containsAllCodePoints(set, str, strLen) = DLL("icuuc.dll", "char uset_containsAllCodePoints(void*, void*, int)")
# 呼び出し: uset_containsAllCodePoints(set, str, strLen)
# set : USet* -> "void*"
# str : WORD* -> "void*"
# strLen : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。