ホーム › Globalization › u_getPropertyName
u_getPropertyName
関数プロパティの名前を取得する。
シグネチャ
// icuuc.dll
#include <windows.h>
LPSTR u_getPropertyName(
UProperty property,
UPropertyNameChoice nameChoice
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| property | UProperty | in |
| nameChoice | UPropertyNameChoice | in |
戻り値の型: LPSTR
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
LPSTR u_getPropertyName(
UProperty property,
UPropertyNameChoice nameChoice
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr u_getPropertyName(
int property, // UProperty
int nameChoice // UPropertyNameChoice
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function u_getPropertyName(
[property] As Integer, ' UProperty
nameChoice As Integer ' UPropertyNameChoice
) As IntPtr
End Function' property : UProperty
' nameChoice : UPropertyNameChoice
Declare PtrSafe Function u_getPropertyName Lib "icuuc" ( _
ByVal property As Long, _
ByVal nameChoice As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
u_getPropertyName = ctypes.cdll.icuuc.u_getPropertyName
u_getPropertyName.restype = wintypes.LPSTR
u_getPropertyName.argtypes = [
ctypes.c_int, # property : UProperty
ctypes.c_int, # nameChoice : UPropertyNameChoice
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
u_getPropertyName = Fiddle::Function.new(
lib['u_getPropertyName'],
[
Fiddle::TYPE_INT, # property : UProperty
Fiddle::TYPE_INT, # nameChoice : UPropertyNameChoice
],
Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn u_getPropertyName(
property: i32, // UProperty
nameChoice: i32 // UPropertyNameChoice
) -> *mut u8;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr u_getPropertyName(int property, int nameChoice);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_u_getPropertyName' -Namespace Win32 -PassThru
# $api::u_getPropertyName(property, nameChoice)#uselib "icuuc.dll"
#func global u_getPropertyName "u_getPropertyName" sptr, sptr
; u_getPropertyName property, nameChoice ; 戻り値は stat
; property : UProperty -> "sptr"
; nameChoice : UPropertyNameChoice -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "icuuc.dll"
#cfunc global u_getPropertyName "u_getPropertyName" int, int
; res = u_getPropertyName(property, nameChoice)
; property : UProperty -> "int"
; nameChoice : UPropertyNameChoice -> "int"; LPSTR u_getPropertyName(UProperty property, UPropertyNameChoice nameChoice)
#uselib "icuuc.dll"
#cfunc global u_getPropertyName "u_getPropertyName" int, int
; res = u_getPropertyName(property, nameChoice)
; property : UProperty -> "int"
; nameChoice : UPropertyNameChoice -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procu_getPropertyName = icuuc.NewProc("u_getPropertyName")
)
// property (UProperty), nameChoice (UPropertyNameChoice)
r1, _, err := procu_getPropertyName.Call(
uintptr(property),
uintptr(nameChoice),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // LPSTRfunction u_getPropertyName(
property: Integer; // UProperty
nameChoice: Integer // UPropertyNameChoice
): PAnsiChar; cdecl;
external 'icuuc.dll' name 'u_getPropertyName';result := DllCall("icuuc\u_getPropertyName"
, "Int", property ; UProperty
, "Int", nameChoice ; UPropertyNameChoice
, "Cdecl Ptr") ; return: LPSTR●u_getPropertyName(property, nameChoice) = DLL("icuuc.dll", "char* u_getPropertyName(int, int)")
# 呼び出し: u_getPropertyName(property, nameChoice)
# property : UProperty -> "int"
# nameChoice : UPropertyNameChoice -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。