System.SysUtils.TOSVersion

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

Delphi

 TOSVersion = record
 public type
 TArchitecture = (arIntelX86, arIntelX64, arARM32, arARM64);
 TPlatform = (pfWindows, pfMacOS, pfiOS, pfAndroid, pfWinRT, pfLinux);
 public const
 AllArchitectures = [arIntelX86, arIntelX64, arARM32, arARM64];
 AllPlatforms = [pfWindows, pfMacOS, pfiOS, pfAndroid, pfWinRT, pfLinux];
 private
 class var FArchitecture: TArchitecture;
 class var FBuild: Integer;
 class var FMajor: Integer;
 class var FMinor: Integer;
 class var FName: string;
 class var FPlatform: TPlatform;
 class var FServicePackMajor: Integer;
 class var FServicePackMinor: Integer;
{$IFDEF LINUX}
 class var FPrettyName: string;
 class var FLibCVersionMajor: Integer;
 class var FLibCVersionMinor: Integer;
{$ENDIF LINUX}
 class constructor Create;
 public
 class function Check(AMajor: Integer): Boolean; overload; static; inline;
 class function Check(AMajor, AMinor: Integer): Boolean; overload; static; inline;
 class function Check(AMajor, AMinor, AServicePackMajor: Integer): Boolean; overload; static; inline;
 class function ToString: string; static;
 class property Architecture: TArchitecture read FArchitecture;
 class property Build: Integer read FBuild;
 class property Major: Integer read FMajor;
 class property Minor: Integer read FMinor;
 class property Name: string read FName;
 class property Platform: TPlatform read FPlatform;
 class property ServicePackMajor: Integer read FServicePackMajor;
 class property ServicePackMinor: Integer read FServicePackMinor;
{$IFDEF LINUX}
 class property PrettyName: string read FPrettyName;
 class property LibCVersionMajor: Integer read FLibCVersionMajor;
 class property LibCVersionMinor: Integer read FLibCVersionMinor;
{$ENDIF LINUX}
 end;

C++

struct DECLSPEC_DRECORD TOSVersion
{
public:
 enum DECLSPEC_DENUM TArchitecture : unsigned char { arIntelX86, arIntelX64, arARM32, arARM64 };
 enum DECLSPEC_DENUM TPlatform : unsigned char { pfWindows, pfMacOS, pfiOS, pfAndroid, pfWinRT, pfLinux };
public:
 #define TOSVersion_AllArchitectures (System::Set<TArchitecture, TArchitecture::arIntelX86, TArchitecture::arARM64>() << TArchitecture::arIntelX86 << TArchitecture::arIntelX64 << TArchitecture::arARM32 << TArchitecture::arARM64 )
 #define TOSVersion_AllPlatforms (System::Set<TPlatform, TPlatform::pfWindows, TPlatform::pfLinux>() << TPlatform::pfWindows << TPlatform::pfMacOS << TPlatform::pfiOS << TPlatform::pfAndroid << TPlatform::pfWinRT << TPlatform::pfLinux )
private:
 static TArchitecture FArchitecture;
 static int FBuild;
 static int FMajor;
 static int FMinor;
 static System::UnicodeString FName;
 static TPlatform FPlatform;
 static int FServicePackMajor;
 static int FServicePackMinor;
private:
public:
 static bool __fastcall Check(int AMajor)/* overload */;
 static bool __fastcall Check(int AMajor, int AMinor)/* overload */;
 static bool __fastcall Check(int AMajor, int AMinor, int AServicePackMajor)/* overload */;
 static System::UnicodeString __fastcall ToString();
 /* static */ __property TArchitecture Architecture = {read=FArchitecture};
 /* static */ __property int Build = {read=FBuild};
 /* static */ __property int Major = {read=FMajor};
 /* static */ __property int Minor = {read=FMinor};
 /* static */ __property System::UnicodeString Name = {read=FName};
 /* static */ __property TPlatform Platform = {read=FPlatform};
 /* static */ __property int ServicePackMajor = {read=FServicePackMajor};
 /* static */ __property int ServicePackMinor = {read=FServicePackMinor};
private:
};

プロパティ

種類 可視性 ソース ユニット
record
struct
public
System.SysUtils.pas
System.SysUtils.hpp
System.SysUtils System.SysUtils

説明

現在のオペレーティング システムについて、プラットフォームとバージョンを表します。

TOSVersion を使用すると、現在のオペレーティング システムについて以下のような情報を取得できます。

  • プラットフォーム(Windows または MAC OS X)
  • バージョン

その他に次の情報も含まれます。

  • アーキテクチャ(Intel x86 または Intel x64)
  • インストール済みのサービス パック

例:

 Writeln(TOSVersion.ToString);

出力例:

Windows XP Service Pack 3 (Version 5.1, Build 2600, 32-bit Edition)

TOSVersion の変数を作成することはできません。TOSVersion は、アプリケーションの起動時に初期化される静的な(グローバル)データを表します。

TOSVersion では、オペレーティング システムのバージョンを確認するためのメソッド群を提供しています。Check のオーバーロードを参照してください。

関連項目

https://docwiki.embarcadero.com/Libraries/Tokyo/j/index.php?title=System.SysUtils.TOSVersion&oldid=187906」から取得