17#define WIN95_LONGFILENAME_MAX 260
19 static tchar serverNamePrefix[] =
_T(
"\\\\");
22 static tchar ldevTerminatorCh =
_T(
':');
23 static tchar ldevTerminatorStr[] =
_T(
":");
25 static tchar dirSeparator[] =
_T(
"/");
27 static tchar dirSeparatorStr[] =
_T(
"/");
29 static tchar dirSeparator[] =
_T(
"\\/");
31 static tchar dirSeparatorStr[] =
_T(
"\\");
33 static tchar extSeparatorCh =
_T(
'.');
34 static tchar extSeparatorStr[] =
_T(
".");
235 ServerStr(
src.ServerStr),
236 DeviceStr(
src.DeviceStr),
237 PathStr(
src.PathStr),
238 FileStr(
src.FileStr),
601 const auto pos =
subpath.find_last_of(dirSeparatorStr);
621 const auto pos =
subpath.find_last_of(dirSeparatorStr);
636 else if(s.length() >
len){
699 if (
n >
dname.length() + 3)
702 trimPath(p,
n -
static_cast<int>(
dname.length()));
703 if (p.length() > 0 && p[p.length() - 1] != dirSeparatorStr[0])
704 p += dirSeparatorStr;
1002 status.createTime = TTime(TFileTime(
data.Data.ftCreationTime));
1003 status.modifyTime = TTime(TFileTime(
data.Data.ftLastWriteTime));
1004 status.accessTime = TTime(TFileTime(
data.Data.ftLastAccessTime));
1005 status.size =
data.Data.nFileSizeLow;
1056 WARN(1,
"TFile::SetStatus() error ::SetFileAttributes(), line: " <<
__LINE__);
1111 __FillFileStr(
data, status);
#define WARN(condition, message)
The TFile class encapsulates standard file characteristics and operations.
@ OpenExisting
Opens the file. The function fails if the file does not exist.
The TFileName class constructs filenames.
bool Exists() const
Determines whether the device, directory, or file exists.
TFileName()
Constructs an empty filename.
const tchar * Title() const
The Title member function uses system conventions to get a human-readable rendering of the filename a...
const tchar * CanonicalStr(bool forceUNC=false) const
tstring DeviceStr
Holds the device filename part.
TFileName & StripParts(uint p)
Removes the specified filename parts from this set of parts.
tchar NameBuffer[_MAX_PATH]
tchar * GetFullFileNameNoExt()
TFileName & MergeParts(uint p, const TFileName &source)
Replaces the specified parts in this with the parts from source.
@ Device
Logical device or sharename.
@ Path
Directory path to the file.
@ File
Filename part without the extension.
tchar * GetNameAndExt() const
tstring ServerStr
Holds the server filename part.
const tstring & Canonical(bool forceUNC=false) const
Return normal fully qualified path string.
void Parse(LPCTSTR freeform, bool pathOnly=false)
Parses the freeform string into the filename parts.
int CreateDir() const
Creates the directory associated with this filename.
TFileName & SetPart(uint p, const tstring &partStr)
Replaces the specified filename parts with parts extracted from partStr.
int GetStatus(TFileStatus &status) const
Get the file status struct for the item associated with this filename.
int ChangeDir() const
Changes the current directory to the directory associated with this filename.
tstring ExtStr
Holds the extension filename part.
const tchar * Squeezed(int maxLen, bool keepName=true) const
Obtains a human-readable form of the filename.
bool Unc
true if UNC naming convention in use; false otherwise.
const tchar * GetParts(uint p) const
Reassembles any logical subset of filename parts.
const tchar * ShortName(bool forceUNC=false) const
Returns the short file path.
bool IsValid() const
Determines whether a filename is valid.
bool Move(const TFileName &newName, uint32 how=CopyAllowed)
Move (rename) the file associated with this filename, and change this name to the new name.
TFileName & operator=(const TFileName &src)
Assigns new filename or freeform to this name.
bool Copy(const TFileName &newName, bool failIfExists) const
Copy the file associated with this filename to a new file.
tstring FileStr
Holds the file filename part (no extension).
tchar * GetFullFileName()
tstring PathStr
Holds the path filename part.
TSpecialType
Construct a filename representing a special file or directory.
@ SysDir
Location of system files (LDID_SYS)
@ MachineDir
(LDID_MACHINE) currently not implemented?
@ SharedDir
Shared home directory for OS (LDID_SHARED) currently not implemented?
@ BootDir
Root dir of boot device (LDID_BOOT)
@ TempDir
Location of temporary files.
@ CurrentDir
Current working directory if any.
@ HomeDir
Home directory for OS (LDID_WIN)
@ TempFile
A temporary filename.
bool HasParts(uint p) const
Returns true if any of the parts specified by p are used.
tstring FullCanonicalName
int SetStatus(const TFileStatus &status)
Fills the status structure for the file associated with this filename with information from status.
TFileName & AddSubDir(const tstring &subdir)
bool Remove() const
Deletes this file associated with this name if possible; otherwise attempts to delete the directory a...
TFileStatus Status
Status of last attempt to find a file. See TFileStatus structure.
virtual ~TFileNameIterator()
Deletes the find file Data structure.
void * Data
Under Win32 a pointer to a WIN32_FIND_DATA structure.
virtual bool FindNext(TFileStatus &status, void *findData)
all work do here -> must fill TFileStatus structure return true on success
bool Done
Set false in the constructor.
TFileTime is a class derived from the structure FILETIME.
Definition of Common Dialog abstract base class.
#define WIN95_LONGFILENAME_MAX
Reliable platform independent header for common memory and string functions.
Object Windows Library (OWLNext Core)
void __MakeDosTime(const TTime &time, uint16 &fdate, uint16 &ftime)
uint __sys2Atr(uint32 attrib)
TTime __MakeTTime(uint16 fdate, uint16 ftime)
const int serverNamePrefixLen
uint __attr2Sys(uint attrib)
#define COUNTOF(s)
Array element count Important: Only use this with an argument of array type.
#define TYPESAFE_DOWNCAST(object, toClass)
tchar fullName[_MAX_PATH]