System.SysUtils.TEncoding.GetByteCount
Delphi
function GetByteCount(Chars: PChar; CharCount: Integer): Integer; overload; virtual; abstract;
function GetByteCount(const Chars: Char): Integer; overload; inline;
function GetByteCount(const Chars: array of Char): Integer; overload;
function GetByteCount(const Chars: TCharArray): Integer; overload; inline;
function GetByteCount(const Chars: array of Char; CharIndex, CharCount: Integer): Integer; overload;
function GetByteCount(const Chars: TCharArray; CharIndex, CharCount: Integer): Integer; overload;
function GetByteCount(const S: string): Integer; overload; inline;
function GetByteCount(const S: string; CharIndex, CharCount: Integer): Integer; overload; inline;
function GetByteCount(const S: string; CharIndex, CharCount: Integer; const StringBaseIndex: Integer): Integer; overload;
C++
virtual int __fastcall GetByteCount(System::WideChar * Chars, int CharCount) = 0 /* overload */;
int __fastcall GetByteCount(const System::WideChar Chars)/* overload */;
int __fastcall GetByteCount(const System::WideChar *Chars, const int Chars_High)/* overload */;
int __fastcall GetByteCount(const System::DynamicArray<System::WideChar> Chars)/* overload */;
int __fastcall GetByteCount(const System::WideChar *Chars, const int Chars_High, int CharIndex, int CharCount)/* overload */;
int __fastcall GetByteCount(const System::DynamicArray<System::WideChar> Chars, int CharIndex, int CharCount)/* overload */;
int __fastcall GetByteCount(const System::UnicodeString S)/* overload */;
int __fastcall GetByteCount(const System::UnicodeString S, int CharIndex, int CharCount)/* overload */;
int __fastcall GetByteCount(const System::UnicodeString S, int CharIndex, int CharCount, const int StringBaseIndex)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | TEncoding |
Description
Returns the number of bytes produced by encoding a set of characters of string or characters.
Note: The number of bytes in a string is not necessarily exactly proportional to the number of characters in a given character array or string.
function GetByteCount(Chars: PChar; CharCount: Integer): Integer; overload; virtual; abstract;
- This overload version is an abstract method in this class. Actual implementation is deferred to a descendent class.
function GetByteCount(const Chars: Char): Integer; overload;
- Returns the number of bytes generated by encoding from Chars character.
- Chars: One UNICODE character that to encode.
function GetByteCount(const Chars: array of Char): Integer; overload;
function GetByteCount(const Chars: TCharArray): Integer; overload;
- Returns the number of bytes generated by encoding Chars array parameter.
- Chars: array of char that contains the set of characters to encode.
function GetByteCount(const Chars: array of Char; CharIndex, CharCount: Integer): Integer; overload;
function GetByteCount(const Chars: TCharArray; CharIndex, CharCount: Integer): Integer; overload;
- Returns the number of bytes generated by encoding CharCount characters from CharIndex index of Chars array parameter.
- Chars: array of char that contains the set of characters to encode.
- CharIndex: index of the first character to encode on Chars array.
- CharCount: parameter that specifies the number of characters to encode.
function GetByteCount(const S: string): Integer; overload;
- Returns the number of bytes generated by encoding S string parameter.
- S: string that contains the set of characters to encode.
function GetByteCount(const S: string; CharIndex, CharCount: Integer): Integer; overload;
- Returns the number of bytes generated by encoding CharCount characters from CharIndex index of string S. CharIndex is one-based index on Desktop platforms including Windows, Mac OS X, and Linux, or zero-based on Mobile platforms including iOS and Android.
- S: string that contains the set of characters to encode.
- CharIndex: index of the first character to encode. On Desktop platforms including Windows, Mac OS X, and Linux, CharIndex is one-based. On Mobile platforms including iOS and Android, CharIndex is zero-based.
- CharCount: parameter that specifies the number of characters to encode.
function GetByteCount(const S: string; CharIndex, CharCount: Integer; const StringBaseIndex: Integer): Integer; overload;
- Returns the number of bytes generated by encoding CharCount characters from CharIndex index of string S. StringBaseIndex is the base index number;
0
or1
of CharIndex on the S string.- S: string that contains the set of characters to encode.
- CharIndex: index of the first character to encode. Index base is controlled by StringBaseIndex.
- CharCount: parameter that specifies the number of characters to encode.
- StringBaseIndex: base index number of CharIndex on the s string. This value is 0 or 1. If other number is specified, EEncodingError exception is raised.
Return Value is a number of bytes that are actually encoded or the actual TBytes sequence of bytes.
See Also