46 Useful Utility Functions For #Delphi XE8

来源:互联网 发布:学钢琴 软件 编辑:程序博客网 时间:2024/06/06 02:24
function GetCaseSensitiveFileName(const FileName: string; RootPath: string = ”): string;function isPathCanUseNow(const PathOrDir: string; const Default: Boolean = True): Boolean;function GetSDCardPath(Index: Integer = 0): string;function FindSDCardSubPath(SubPath: string; Index: Integer = 0): string;function GetAppPath: string;function BuildFileListInAPath(const Path: string; const Attr: Integer; const List: TStrings;JustFile: Boolean = False): Boolean; overload;function BuildFileListInAPath(const Path: string; const Attr: Integer;JustFile: Boolean = False): string; overload;function GetFileNamesFromDirectory(const DirName: string; const SearchFilter: string = ‘*';const FileAttribs: Integer = faAnyFile; const isIncludeSubDirName: Boolean = False; const Recursion: Boolean = False;const FullName: Boolean = False): string;function DeleteDirectoryByEcho(const Source: string;AbortOnFailure: Boolean = False; YesToAll: Boolean = True;WaitMinSecond: Integer = DeleteDirectories_WaitMinSecond): Boolean;function GetTotalSpaceSize(Path: string = PathDelim): UInt64;function GetAvailableSpaceSize(Path: string = PathDelim): UInt64;function GetFreeSpaceSize(Path: string = PathDelim): UInt64;function GetTotalMemorySize: UInt64;function GetFreeMemorySize: UInt64;function IsPadOrPC(MiniScreenInches: Single = 6.2): Boolean;function GetVolumePaths: string;function GetExternalStoragePath: string;function GetExterStoragePath: string;function GetInnerStoragePath: string;function GetIsExternalStorageRemovable: Boolean;function FindJavaClass(NamePath: string): Boolean;function FindJavaMethod(MethodName, Signature: string; CalssNamePath: string = ”): Boolean;function FindJavaStaticMethod(MethodName, Signature: string; CalssNamePath: string = ”): Boolean;Here are the string utility functions:function DetectUTF8Encoding(const s: TBytes): TEncodeType;function HasExtendCharacter(const s: TBytes): Boolean;function HasUTF8BOM(S : TStream) : boolean; overload;function HasUTF8BOM(const S: TBytes) : boolean; overload;function HasUTF8BOM(const S: MarshaledAString) : boolean; overload;function BytesAutoToString(const S: TBytes; const UnknowEncodeDefaultIsAnsi: Boolean = True): string; overload;function BytesAutoToString(const S: MarshaledAString; const UnknowEncodeDefaultIsAnsi: Boolean = True): string; overload;function StreamAutoToString(const aStream: TStream; const UnknowEncodeDefaultIsAnsi: Boolean = True): string;function IsUTF8String(const s: MarshaledAString): Boolean; overload;function IsUTF8String(const s: TBytes): Boolean; overload;Here are the Firemonkey screen functions:function GetScreenPixelsXY(const Context: TFmxObject = nil): TPoint;function GetScreenClientPixelsXY(const Context: TFmxObject = nil): TPoint;function GetScreenInchXY(const Context: TFmxObject = nil): TPointF;function GetScreenDPIXY(const Context: TFmxObject = nil): TPointF;function GetScreenDPI(const Context: TFmxObject = nil): Single;function GetScreenInches(const Context: TFmxObject = nil): Single;function GetFormXY(const AForm: TCustomForm): TPointF;function GetFormClientXY(const AForm: TCustomForm): TPointF;function GetFormClient(const AForm: TCustomForm): TRectF;function GetFormPixelsXY(const AForm: TCustomForm): TPointF;function GetFormClientPixelsXY(const AForm: TCustomForm): TPointF;And here are the message dialog functions:procedure ShowMessageWait(const AMessage: string);procedure ShowMessageFmtWait(const AMessage: string; const AParams: array of const);procedure ShowMessagePosWait(const AMessage: string; const AX, AY: Integer);

0 0
原创粉丝点击