Unit msefileutils

Description

 

Overview

Classes, Interfaces, Objects and Records

Name Description
Class tcustomfiledatalist  
Class tfiledatalist  

Functions and Procedures

function quotefilename(const name: filenamety): filenamety; overload;
function quotefilename(const directory,name: filenamety): filenamety; overload;
function quotefilename(const names: filenamearty): filenamety; overload;
function quotefilename(const names: array of filenamety): filenamety; overload;
procedure unquotefilename(const names: filenamety; var result: filenamearty); overload;
function unquotefilename(const name: filenamety): filenamety; overload;
function extractrootpath(var names: filenamearty): filenamety;
function combinerootpath(const rootpath: filenamety; const names: filenamearty): filenamearty; overload;
function combinerootpath(const rootpaths: filenamearty; const name: filenamety): filenamearty; overload;
function syscommandline(const acommandline: filenamety): filenamety;
function filepath( directory: filenamety; filename: filenamety; kind: filekindty = fk_default; relative: boolean = false): filenamety; overload;
function filepath( path: filenamety; kind: filekindty = fk_default; relative: boolean = false): filenamety; overload;
function relativepath(const path: filenamety; const root: filenamety = ''; const kind: filekindty = fk_default): filenamety;
function relocatepath(const olddir,newdir: filenamety; var apath: filenamety; const options: pathrelocateoptionsty = []): boolean;
function isrelativepath(const path: filenamety): boolean;
function isrootdir(const path: filenamety): boolean;
function removelastpathsection(path: filenamety): filenamety;
function getlastpathsection(const path: filenamety): filenamety;
function removelastdir(path: filenamety; var newpath: filenamety): filenamety;
procedure splitfilepath(const path: filenamety; out directory,filename: filenamety); overload;
procedure splitfilepath(const path: filenamety; out directory,filename,fileext: filenamety); overload;
function splitfilepath(const path: filenamety): filenamearty;
function splitrootpath(const path: filenamety): filenamearty;
function mergerootpath(const segments: filenamearty): filenamety;
function checkfilename(const filename,mask: filenamety; casesensitive: boolean = false): boolean; overload;
function checkfilename(const filename: filenamety; const mask: filenamearty; casesensitive: boolean = false): boolean; overload;
function checkfilename(const filename: filenamety; const dirstream: dirstreamty): boolean; overload;
function hasmaskchars(const filename: filenamety): boolean;
function issamefilename(const a,b: filenamety): boolean;
function issamefilepath(const a,b: filenamety): boolean;
function filename(const path: filenamety): filenamety;
function filedir(const path: filenamety): filenamety;
function filenamebase(const path: filenamety): filenamety;
function fileext(const path: filenamety): filenamety;
function removefileext(const path: filenamety): filenamety;
function hasfileext(const path: filenamety): boolean;
function checkfileext(const path: filenamety; const extensions: array of filenamety): boolean;
function replacefileext(const path,newext: filenamety): filenamety;
function tomsefilepath(const path: filenamety; const quoted: boolean = false): filenamety;
procedure tomsefilepath1(var path: filenamety; const quoted: boolean = false);
function tosysfilepath(const path: filenamety; const quoted: boolean = false): filenamety;
function tosysfilepath(const path: filenamearty; const quoted: boolean = false): filenamearty;
procedure tosysfilepath1(var path: filenamety; const quoted: boolean = false);
function searchfile(const filename: filenamety; dir: boolean = false; const aoptions: dirstreamoptionsty = []): filenamety; overload;
function searchfile(const afilename: filenamety; const adirnames: array of filenamety; const ainclude: fileattributesty = [fa_all]; const aexclude: fileattributesty = []; const aoptions: dirstreamoptionsty = []): filenamety; overload;
function searchfile(const afilename: filenamety; const adirname: filenamety; const ainclude: fileattributesty = [fa_all]; const aexclude: fileattributesty = []; const aoptions: dirstreamoptionsty = []): filenamety; overload;
function searchfiles(const afilename: filenamety; const adirnames: array of filenamety; const ainclude: fileattributesty = [fa_all]; const aexclude: fileattributesty = []; const aoptions: dirstreamoptionsty = []): filenamearty; overload;
function searchfiles(const afilename: filenamety; const adirname: filenamety; const ainclude: fileattributesty = [fa_all]; const aexclude: fileattributesty = []; const aoptions: dirstreamoptionsty = []): filenamearty; overload;
function searchfilenames(const afilename: filenamety; const adirname: filenamety; const ainclude: fileattributesty = [fa_all]; const aexclude: fileattributesty = []; const aoptions: dirstreamoptionsty = []): filenamearty;
function dirhasentries(const adirname: filenamety; const ainclude: fileattributesty = [fa_all]; const aexclude: fileattributesty = []): boolean;
function findfile(filename: filenamety; const dirnames: array of filenamety; var path: filenamety): boolean; overload;
function findfile(filename: filenamety; var path: filenamety): boolean; overload;
function findfile(const filename: filenamety; const dirnames: array of filenamety): boolean; overload;
function findfile(const filename: filenamety): boolean; overload;
function finddir(const filename: filenamety): boolean;
function findfileordir(const filename: filenamety): boolean;
function uniquefilename(const path: filenamety): filenamety;
function isrootpath(const path: filenamety): boolean;
function copyfile(const oldfile,newfile: filenamety; const canoverwrite: boolean = true): boolean;
function trycopyfile(const oldfile,newfile: filenamety; const canoverwrite: boolean = true): boolean;
function renamefile(const oldname,newname: filenamety; const canoverwrite: boolean = true): boolean;
function deletefile(const filename: filenamety): boolean;
function trydeletefile(const filename: filenamety): boolean;
procedure createdir(const path: filenamety; const rights: filerightsty = defaultdirrights);
procedure createdirpath(const path: filenamety; const rights: filerightsty = defaultdirrights);
function deletedir(const path: filenamety): boolean;
function trydeletedir(const path: filenamety): boolean;
function getcurrentdir: filenamety; deprecated;
function getcurrentdirmse: filenamety;
function setcurrentdir(const path: filenamety): filenamety; deprecated;
function setcurrentdirmse(const path: filenamety): filenamety;
function trysetcurrentdirmse(const path: filenamety): boolean; overload;
function trysetcurrentdirmse(const path: filenamety; out pathbefore: msestring): boolean; overload;
procedure clearfileinfo(var info: fileinfoty);
procedure initdirfileinfo(var info: fileinfoty; const aname: filenamety; open: boolean = false);
function getfileinfo(const path: filenamety; var info: fileinfoty): boolean;
function getfilemodtime(const path: filenamety): tdatetime;
function filesystemiscaseinsensitive: boolean;
function compfileinfos(const info1,info2: fileinfoty): filechangesty;
function compfiletime(const a,b: tdatetime): integer;
function intermediatefilename(const aname: filenamety): filenamety;
function msegettempdir: filenamety;
function msegettempfilename(const aname: filenamety): filenamety;

Types

filelistoptionty = (...);
filelistoptionsty = set of filelistoptionty;
filekindty = (...);
filechangety = (...);
filechangesty = set of filechangety;
checkfileeventty = procedure (const sender: tobject; const streaminfo: dirstreaminfoty; const fileinfo: fileinfoty; var accept: boolean) of object;
pathrelocateoptionty = (...);
pathrelocateoptionsty = set of pathrelocateoptionty;
filesortfuncty = function(const l,r: fileinfoty): integer of object;

Constants

sortflags: filelistoptionsty = [flo_sortname,flo_sorttime,flo_sortsize];
intermediatefileextension = '.tmp';

Description

Functions and Procedures

function quotefilename(const name: filenamety): filenamety; overload;
 
function quotefilename(const directory,name: filenamety): filenamety; overload;
 
function quotefilename(const names: filenamearty): filenamety; overload;
 
function quotefilename(const names: array of filenamety): filenamety; overload;
 
procedure unquotefilename(const names: filenamety; var result: filenamearty); overload;
 
function unquotefilename(const name: filenamety): filenamety; overload;
 
function extractrootpath(var names: filenamearty): filenamety;
 
function combinerootpath(const rootpath: filenamety; const names: filenamearty): filenamearty; overload;
 
function combinerootpath(const rootpaths: filenamearty; const name: filenamety): filenamearty; overload;
 
function syscommandline(const acommandline: filenamety): filenamety;
 
function filepath( directory: filenamety; filename: filenamety; kind: filekindty = fk_default; relative: boolean = false): filenamety; overload;
 
function filepath( path: filenamety; kind: filekindty = fk_default; relative: boolean = false): filenamety; overload;
 
function relativepath(const path: filenamety; const root: filenamety = ''; const kind: filekindty = fk_default): filenamety;
 
function relocatepath(const olddir,newdir: filenamety; var apath: filenamety; const options: pathrelocateoptionsty = []): boolean;
 
function isrelativepath(const path: filenamety): boolean;
 
function isrootdir(const path: filenamety): boolean;
 
function removelastpathsection(path: filenamety): filenamety;
 
function getlastpathsection(const path: filenamety): filenamety;
 
function removelastdir(path: filenamety; var newpath: filenamety): filenamety;
 
procedure splitfilepath(const path: filenamety; out directory,filename: filenamety); overload;
 
procedure splitfilepath(const path: filenamety; out directory,filename,fileext: filenamety); overload;
 
function splitfilepath(const path: filenamety): filenamearty;
 
function splitrootpath(const path: filenamety): filenamearty;
 
function mergerootpath(const segments: filenamearty): filenamety;
 
function checkfilename(const filename,mask: filenamety; casesensitive: boolean = false): boolean; overload;
 
function checkfilename(const filename: filenamety; const mask: filenamearty; casesensitive: boolean = false): boolean; overload;
 
function checkfilename(const filename: filenamety; const dirstream: dirstreamty): boolean; overload;
 
function hasmaskchars(const filename: filenamety): boolean;
 
function issamefilename(const a,b: filenamety): boolean;
 
function issamefilepath(const a,b: filenamety): boolean;
 
function filename(const path: filenamety): filenamety;
 
function filedir(const path: filenamety): filenamety;
 
function filenamebase(const path: filenamety): filenamety;
 
function fileext(const path: filenamety): filenamety;
 
function removefileext(const path: filenamety): filenamety;
 
function hasfileext(const path: filenamety): boolean;
 
function checkfileext(const path: filenamety; const extensions: array of filenamety): boolean;
 
function replacefileext(const path,newext: filenamety): filenamety;
 
function tomsefilepath(const path: filenamety; const quoted: boolean = false): filenamety;
 
procedure tomsefilepath1(var path: filenamety; const quoted: boolean = false);
 
function tosysfilepath(const path: filenamety; const quoted: boolean = false): filenamety;
 
function tosysfilepath(const path: filenamearty; const quoted: boolean = false): filenamearty;
 
procedure tosysfilepath1(var path: filenamety; const quoted: boolean = false);
 
function searchfile(const filename: filenamety; dir: boolean = false; const aoptions: dirstreamoptionsty = []): filenamety; overload;
 
function searchfile(const afilename: filenamety; const adirnames: array of filenamety; const ainclude: fileattributesty = [fa_all]; const aexclude: fileattributesty = []; const aoptions: dirstreamoptionsty = []): filenamety; overload;
 
function searchfile(const afilename: filenamety; const adirname: filenamety; const ainclude: fileattributesty = [fa_all]; const aexclude: fileattributesty = []; const aoptions: dirstreamoptionsty = []): filenamety; overload;
 
function searchfiles(const afilename: filenamety; const adirnames: array of filenamety; const ainclude: fileattributesty = [fa_all]; const aexclude: fileattributesty = []; const aoptions: dirstreamoptionsty = []): filenamearty; overload;
 
function searchfiles(const afilename: filenamety; const adirname: filenamety; const ainclude: fileattributesty = [fa_all]; const aexclude: fileattributesty = []; const aoptions: dirstreamoptionsty = []): filenamearty; overload;
 
function searchfilenames(const afilename: filenamety; const adirname: filenamety; const ainclude: fileattributesty = [fa_all]; const aexclude: fileattributesty = []; const aoptions: dirstreamoptionsty = []): filenamearty;
 
function dirhasentries(const adirname: filenamety; const ainclude: fileattributesty = [fa_all]; const aexclude: fileattributesty = []): boolean;
 
function findfile(filename: filenamety; const dirnames: array of filenamety; var path: filenamety): boolean; overload;
 
function findfile(filename: filenamety; var path: filenamety): boolean; overload;
 
function findfile(const filename: filenamety; const dirnames: array of filenamety): boolean; overload;
 
function findfile(const filename: filenamety): boolean; overload;
 
function finddir(const filename: filenamety): boolean;
 
function findfileordir(const filename: filenamety): boolean;
 
function uniquefilename(const path: filenamety): filenamety;
 
function isrootpath(const path: filenamety): boolean;
 
function copyfile(const oldfile,newfile: filenamety; const canoverwrite: boolean = true): boolean;
 
function trycopyfile(const oldfile,newfile: filenamety; const canoverwrite: boolean = true): boolean;
 
function renamefile(const oldname,newname: filenamety; const canoverwrite: boolean = true): boolean;
 
function deletefile(const filename: filenamety): boolean;
 
function trydeletefile(const filename: filenamety): boolean;
 
procedure createdir(const path: filenamety; const rights: filerightsty = defaultdirrights);
 
procedure createdirpath(const path: filenamety; const rights: filerightsty = defaultdirrights);
 
function deletedir(const path: filenamety): boolean;
 
function trydeletedir(const path: filenamety): boolean;
 
function getcurrentdir: filenamety; deprecated;

Warning: this symbol is deprecated.

 
function getcurrentdirmse: filenamety;
 
function setcurrentdir(const path: filenamety): filenamety; deprecated;

Warning: this symbol is deprecated.

 
function setcurrentdirmse(const path: filenamety): filenamety;
 
function trysetcurrentdirmse(const path: filenamety): boolean; overload;
 
function trysetcurrentdirmse(const path: filenamety; out pathbefore: msestring): boolean; overload;
 
procedure clearfileinfo(var info: fileinfoty);
 
procedure initdirfileinfo(var info: fileinfoty; const aname: filenamety; open: boolean = false);
 
function getfileinfo(const path: filenamety; var info: fileinfoty): boolean;
 
function getfilemodtime(const path: filenamety): tdatetime;
 
function filesystemiscaseinsensitive: boolean;
 
function compfileinfos(const info1,info2: fileinfoty): filechangesty;
 
function compfiletime(const a,b: tdatetime): integer;
 
function intermediatefilename(const aname: filenamety): filenamety;
 
function msegettempdir: filenamety;
 
function msegettempfilename(const aname: filenamety): filenamety;
 

Types

filelistoptionty = (...);
 
Values
  • flo_sortname
  • flo_sorttime
  • flo_sortsize
  • flo_sorttype
  • flo_casesensitive
  • flo_downsort
filelistoptionsty = set of filelistoptionty;
 
filekindty = (...);
 
Values
  • fk_default
  • fk_file
  • fk_dir
filechangety = (...);
 
Values
  • fc_name
  • fc_attributes
  • fc_modtime
  • fc_accesstime
  • fc_ctime
  • fc_size
  • fc_removed
  • fc_direntries
  • fc_force
filechangesty = set of filechangety;
 
checkfileeventty = procedure (const sender: tobject; const streaminfo: dirstreaminfoty; const fileinfo: fileinfoty; var accept: boolean) of object;
 
pathrelocateoptionty = (...);
 
Values
  • pro_preferenew
  • pro_onlynew
  • pro_rootpath
pathrelocateoptionsty = set of pathrelocateoptionty;
 
filesortfuncty = function(const l,r: fileinfoty): integer of object;
 

Constants

sortflags: filelistoptionsty = [flo_sortname,flo_sorttime,flo_sortsize];
 
intermediatefileextension = '.tmp';
 

Generated by PasDoc 0.16.0.