6#if !defined(OWL_FILENAME_H)
10#if defined(BI_HAS_PRAGMA_ONCE)
39 void Parse(LPCTSTR freeform,
bool pathOnly =
false);
69 TFileName(LPCTSTR serverName, LPCTSTR shareOrDeviceName, LPCTSTR path,
70 LPCTSTR file, LPCTSTR ext);
74 TFileName(LPCTSTR freeform,
bool pathOnly =
false);
108 tchar* GetNameNoExt();
109 tchar* GetNameAndExt()
const;
110 tchar* GetFullFileName();
111 tchar* GetFullFileNameNoExt();
113 void FormCanonicalName();
114 const tstring& Canonical(
bool forceUNC =
false)
const;
115 const tchar* CanonicalStr(
bool forceUNC =
false)
const;
116 const tchar* ShortName(
bool forceUNC =
false)
const;
118 const tchar* Title()
const;
120 const tchar* Squeezed(
int maxLen,
bool keepName =
true)
const;
133 bool HasParts(
uint p)
const;
141 bool IsValid()
const;
147 bool operator ==(
const TFileName& other)
const;
161 bool Copy(
const TFileName& newName,
bool failIfExists)
const;
163 int ChangeDir()
const;
164 int CreateDir()
const;
194 operator const tchar*()
const;
204 virtual bool FindNext(
TFileStatus& status,
void* findData);
279inline TFileNameIterator::operator
const tchar*()
const
341 return IsDir() && p[0] ==
_T(
'.') &&
344 (p[1] ==
_T(
'.') && p[2] ==
_T(
'\0'))
The TFileName class constructs filenames.
TFileName()
Constructs an empty filename.
const tchar * CanonicalStr(bool forceUNC=false) const
tstring DeviceStr
Holds the device filename part.
tchar NameBuffer[_MAX_PATH]
TPart
Obtain any combination of various filename parts.
@ Device
Logical device or sharename.
@ Path
Directory path to the file.
@ File
Filename part without the extension.
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.
bool operator==(const TFileName &other) const
Returns true if this filename is canonically equal to other.
tstring ExtStr
Holds the extension filename part.
bool Unc
true if UNC naming convention in use; false otherwise.
static LPCTSTR WildName()
General wildstring.
TFileName & operator=(const TFileName &src)
Assigns new filename or freeform to this name.
bool IsUNC() const
Determines whether the name is UNC format as opposed to a logical-drive based machine.
static LPCTSTR WildPart(uint)
Part specific?
tstring FileStr
Holds the file filename part (no extension).
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.
tstring FullCanonicalName
const TFileStatus & Current() const
Returns a reference to the Status member indicating the results of the last operation.
TFileStatus Status
Status of last attempt to find a file. See TFileStatus structure.
unsigned long GetAttributes() const
const TFileStatus & operator++()
Attempts to find the next file.
void * Data
Under Win32 a pointer to a WIN32_FIND_DATA structure.
const TFileStatus & operator*() const
Dereference operator returns a reference to the Status member indicating the results of the last oper...
TFileNameIterator(const tstring &wildName)
Under Win32 a WIN32_FIND_DATA structure (the Data member) is allocated and intialized.
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.
bool IsSysDir() const
true if it is the "." or ".." system directory;
Object Windows Library (OWLNext Core).
tchar fullName[_MAX_PATH]
Definition of TSystem, a system information provider class.