API:System.SysUtils.TUnicodeEncoding.GetByteCount

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

Delphi

function GetByteCount(Chars: PChar; CharCount: Integer): Integer; overload; override;

C++

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

プロパティ

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

説明

文字列または文字群のセットをエンコードすることで生成されたバイト数を返します。

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

文字列または文字群のセットをエンコードすることで生成されたバイト数を返します。

メモ: 文字列内のバイト数は、指定された文字配列や文字列の文字数に、厳密に比例している必要はありません。

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

Return Value は、実際にエンコードされたバイト数、または、実際の TBytes バイト シーケンスのバイト数です。

関連項目


コード サンプル