フォーラム


ゲスト  

ようこそ ゲスト さん。このフォーラムに投稿するには 登録が必要です。

ページ: [1]
トピック: uIOUtilsEx (ファイル操作をちょっと便利に)
DEKO
管理者
投稿数: 2690
uIOUtilsEx (ファイル操作をちょっと便利に)
on: 2014/04/23 20:33 Wed

「TFile / TDirectory / TPath にもう少し機能が欲しい」という事で、SHFileOperation() を置き換えられるような機能を追加した uIOUtilsEx.pas を作りました。使い方は Delphi ユーザなら解るでしょう (詳細はコメントに書いてあります)。ヘッダだけ貼っておきます。

type
TDriveEx = record
public
class function DefineLocalDevice(const DeviceName: string;
const TargetPath: string): Boolean; static;
class function UndefLocalDevice(const DeviceName: string;
const TargetPath: string = ''): Boolean; static;
class function DefineRemoteDevice(const DeviceName: string;
const TargetPath: string; const Username: string = '';
const Password: string = ''; const Persistent: Boolean = False): Boolean; static;
class function UndefRemoteDevice(const DeviceName: string;
const TargetPath: string = ''): Boolean; static;
end;

TDirectoryEx = record
public
class procedure Copy(const SourceDirName, DestDirName: string;
Persistent: Boolean = False); static;
class procedure Delete(const Path: string; const Recursive: Boolean = True;
Persistent: Boolean = False); static;
class procedure Move(const SourceDirName, DestDirName: string;
Persistent: Boolean = False); static;
end;

TFileEx = record
public
class procedure Copy(const SourceFileName, DestFileName: string;
const Overwrite: Boolean = True); overload; static;
class procedure CopyFiles(const SrcDir, SearchPattern, DstDir: string;
const Recursive: Boolean = False); static;
class procedure Delete(const FileName: string); static;
class procedure DeleteFiles(const Dir, SearchPattern: string;
const Recursive: Boolean = False); static;
class function GetSize(const iFileName: string): Int64; static;
class procedure Move(SourceFileName, DestFileName: string); static;
class procedure MoveFiles(const SrcDir, SearchPattern, DstDir: string;
const Recursive: Boolean = False); static;
end;

TPathEx = record
private
const
UNC_PREFIX = '\\';
EXTENDED_PREFIX = UNC_PREFIX + '?\';
EXTENDED_UNC_PREFIX = EXTENDED_PREFIX + 'UNC\';
private
class function PathDelimCount(const Path: string): Integer; static;
public
class function Combine(const Paths: array of string): string; static;
class function GetExtendedPath(const Path: string): string; static;
class function GetParentDir(const Path: string): string; static;
class function GetParentPath(const Path: string): string; static;
class function GetPathDepth(const Path: string): Integer; static;
class function GetReducedPath(const Path: string): string; static;
class function GetSubPath(const Path: string): string; static;
class function IsBasePath(const BasePath, Path: string): Boolean; static;
class function IsExtendedPath(const Path: string): Boolean; static;
class function IsExtendedUNCPath(const Path: string): Boolean; static;
class function IsRemotePath(const Path: string): Boolean; static;
class function IsRootPath(const Path: string): Boolean; static;
class function IsTrailingPathDelimiter(const Path: string): Boolean; static;
end;

 
Download: http://ht-deko.minim.ne.jp/software/uioutilsex_120.zip

※このユニットはハラヘッタウェアとなっています。
http://ht-deko.minim.ne.jp/delphiforum/harahettaware/

Mr.XRAY
メンバー
投稿数: 192
Re: uIOUtilsEx (ファイル操作をちょっと便利に)
on: 2015/11/08 18:17 Sun

引用 DEKO on 2014/04/23 20:33 Wed
Download: http://ht-deko.minim.ne.jp/software/uioutilsex_110.zip

ダウンロードできませんです.よろしくお願いしま~す !! (^^;

DEKO
管理者
投稿数: 2690
Re: uIOUtilsEx (ファイル操作をちょっと便利に)
on: 2015/11/09 04:00 Mon

失礼しました m(_ _)m
現在は DL できるようになっています!

Mr.XRAY
メンバー
投稿数: 192
Re: uIOUtilsEx (ファイル操作をちょっと便利に)
on: 2015/11/09 08:30 Mon

早っ !! ありがとうございます.

DEKO
管理者
投稿数: 2690
uIOUtilsEx ver 1.20
on: 2016/01/04 21:04 Mon

細川さんの提案 (?) を受けて GetSize() を実装しておきました。
http://qiita.com/pik/items/c253d0f55d749dd889ad

pik
メンバー
投稿数: 5
Re: uIOUtilsEx (ファイル操作をちょっと便利に)
on: 2016/01/05 12:30 Tue

やったー!ありがとうございます!

ページ: [1]
WP Forum Server by ForumPress | LucidCrew
バージョン: 1.7.5 ; ページロード: 0.056 sec.