API:System.SysUtils.TUnicodeEncoding.GetBytes

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

function GetBytes(Chars: PChar; CharCount: Integer; Bytes: PByte; ByteCount: Integer): Integer; overload; override;

C++

virtual int __fastcall GetBytes(System::WideChar * Chars, int CharCount, System::PByte Bytes, int ByteCount)/* overload */;
inline System::DynamicArray<System::Byte> __fastcall  GetBytes(const System::WideChar Chars){ return TEncoding::GetBytes(Chars); }
inline System::DynamicArray<System::Byte> __fastcall  GetBytes(const System::WideChar *Chars, const int Chars_High){ return TEncoding::GetBytes(Chars, Chars_High); }
inline System::DynamicArray<System::Byte> __fastcall  GetBytes(const System::DynamicArray<System::WideChar> Chars){ return TEncoding::GetBytes(Chars); }
inline System::DynamicArray<System::Byte> __fastcall  GetBytes(const System::WideChar *Chars, const int Chars_High, int CharIndex, int CharCount){ return TEncoding::GetBytes(Chars, Chars_High, CharIndex, CharCount); }
inline System::DynamicArray<System::Byte> __fastcall  GetBytes(const System::DynamicArray<System::WideChar> Chars, int CharIndex, int CharCount){ return TEncoding::GetBytes(Chars, CharIndex, CharCount); }
inline int __fastcall  GetBytes(const System::WideChar *Chars, const int Chars_High, int CharIndex, int CharCount, const System::DynamicArray<System::Byte> Bytes, int ByteIndex){ return TEncoding::GetBytes(Chars, Chars_High, CharIndex, CharCount, Bytes, ByteIndex); }
inline int __fastcall  GetBytes(const System::DynamicArray<System::WideChar> Chars, int CharIndex, int CharCount, const System::DynamicArray<System::Byte> Bytes, int ByteIndex){ return TEncoding::GetBytes(Chars, CharIndex, CharCount, Bytes, ByteIndex); }
inline System::DynamicArray<System::Byte> __fastcall  GetBytes(const System::UnicodeString S){ return TEncoding::GetBytes(S); }
inline int __fastcall  GetBytes(const System::UnicodeString S, int CharIndex, int CharCount, const System::DynamicArray<System::Byte> Bytes, int ByteIndex){ return TEncoding::GetBytes(S, CharIndex, CharCount, Bytes, ByteIndex); }
inline int __fastcall  GetBytes(const System::UnicodeString S, int CharIndex, int CharCount, const System::DynamicArray<System::Byte> Bytes, int ByteIndex, const int StringBaseIndex){ return TEncoding::GetBytes(S, CharIndex, CharCount, Bytes, ByteIndex, StringBaseIndex); }

プロパティ

種類 可視性 ソース ユニット
function
class protected
public
System.SysUtils.pas
System.SysUtils.hpp
System.SysUtils TUnicodeEncoding

説明

指定された文字列または文字群から、文字のセットをエンコードします。

System.SysUtils.TUnicodeEncoding.GetBytes は System.SysUtils.TEncoding.GetBytes を継承しています。以下の内容はすべて System.SysUtils.TEncoding.GetBytes を参照しています。

指定された文字列または文字群から、文字のセットをエンコードします。

  • function GetBytes(Chars: PChar; CharCount: Integer; Bytes: PByte; ByteCount: Integer): Integer; overload; virtual; abstract;
このオーバーロードは、このクラスの抽象メソッドです。 実際の実装は、子孫クラスにゆだねられます。
  • function GetBytes(const Chars: Char): TBytes; overload;
Chars 1 文字を、バイトのシーケンスとしてエンコードおよび返します。
  • Chars: エンコードする UNICODE の 1 文字
戻り値は、指定された文字シーケンスをエンコードした結果を格納したバイト配列です。
  • function GetBytes(const Chars: array of Char): TBytes; overload;
  • function GetBytes(const Chars: TCharArray): TBytes; overload;
Chars 配列の文字のシーケンスを、バイトのシーケンスとしてエンコードし、返します。
  • Chars: エンコードする文字群のセットを格納する、文字の配列。
戻り値は、指定された文字シーケンスをエンコードした結果を格納したバイト配列です。
  • function GetBytes(const Chars: array of Char; CharIndex, CharCount: Integer): TBytes; overload;
  • function GetBytes(const Chars: TCharArray; CharIndex, CharCount: Integer): TBytes; overload;
Chars 配列の CharIndex から、CharCount 分の文字群のシーケンスを、バイトのシーケンスとしてエンコードし、返します。
  • Chars: エンコードする文字群のセットを格納する、文字の配列。
  • CharIndexChars 配列でエンコードする最初の文字のインデックス。
  • CharCount: エンコードする文字数を指定するパラメータ。
戻り値は、指定された文字シーケンスをエンコードした結果を格納したバイト配列です。
  • function GetBytes(const Chars: array of Char; CharIndex, CharCount: Integer; const Bytes: TBytes; ByteIndex: Integer): Integer; overload;
  • function GetBytes(const Chars: TCharArray; CharIndex, CharCount: Integer; const Bytes: TBytes; ByteIndex: Integer): Integer; overload;
CharsCharIndex から、CharCount 分の文字群のシーケンスを、バイトのシーケンスとして、Bytes にエンコードし、返します。
  • Chars: エンコードする文字群のセットを格納する、文字の配列。
  • CharIndexChars 配列でエンコードする最初の文字のインデックス。
  • CharCount: エンコードする文字数を指定するパラメータ。
  • Bytes: 結果のバイトのシーケンスを格納するバイト配列。バイトのシーケンスがどこに記録されるかを指定します。
戻り値は、Bytes に書き込まれる実際のバイト数です。
  • function GetBytes(const S: string): TBytes; overload;
S 文字列を、バイトのシーケンスとしてエンコードおよび返します。
  • S: エンコードする文字群のセットを格納する文字列。
戻り値は、指定された文字列をエンコードした結果を格納したバイト配列です。
  • function GetBytes(const S: string; CharIndex, CharCount: Integer; const Bytes: TBytes; ByteIndex: Integer): Integer; overload;
文字列 S のインデックス CharIndex から、CharCount 分の文字群を、ByteIndex オフセットの配列 Bytes に、バイトのシーケンスとしてエンコードします。CharIndex は、デスクトップ プラットフォーム(Windows、Mac OS X、Linux)上では、1 始まりのインデックス、モバイル プラットフォーム(iOS や Android)では 0 始まりのインデックスです。
  • S: エンコードする文字群のセットを格納する文字列。
  • CharIndex: エンコードする最初の文字のインデックス。 デスクトップ プラットフォーム(Windows、Mac OS X、Linux)では、CharIndex は 1 から始まります。 モバイル プラットフォーム(iOS や Android)では、CharIndex は 0 から始まります。
  • CharCount: エンコードする文字数を指定するパラメータ。
  • Bytes: 結果のバイトのシーケンスを格納するバイト配列。バイトのシーケンスがどこに記録されるかを指定します。
  • ByteIndex: 結果のバイトのシーケンスが記録され始めるインデックス。
戻り値は、Bytes に書き込まれる実際のバイト数です。
  • function GetBytes(const S: string; CharIndex, CharCount: Integer; const Bytes: TBytes; ByteIndex: Integer; const StringBaseIndex: Integer): Integer; overload;
文字列 S のインデックス CharIndex から、CharCount 分の文字群を、ByteIndex オフセットの配列 Bytes に、バイトのシーケンスとしてエンコードします。 StringBaseIndex は、基準のインデックス番号で、S 文字列上の CharIndex の 0 か 1 です。
  • S: エンコードする文字群のセットを格納する文字列。
  • CharIndex: エンコードする最初の文字のインデックス。 StringBaseIndex で制御されるインデックスの基準。
  • CharCount: エンコードする文字数を指定するパラメータ。
  • Bytes: 結果のバイトのシーケンスを格納するバイト配列。バイトのシーケンスがどこに記録されるかを指定します。
  • ByteIndex: 結果のバイトのシーケンスが記録され始めるインデックス。
  • StringBaseIndex: 文字列 s での CharIndex の基準インデックス番号。 この値は 0 か 1 となります。 その他の数値が指定された場合、EEncodingError 例外が発生します。
戻り値は、Bytes に書き込まれる実際のバイト数です。


関連項目


コード サンプル