⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oxunc.h

📁 《Windows多媒体编程基础》书第五章源代码SimpleBrowse一款简单易用的图片浏览器。其他目录中都是编译时需要的库和包含文件等(Bin是调试输出)。该工程较好的演示了一个工程中个要素之间的关
💻 H
📖 第 1 页 / 共 2 页
字号:
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Copies a file to a different locatiuon

	BOOL Move(COXUNC destinationUNC, BOOL bReplaceExisting = FALSE, BOOL bCopyAllowed = TRUE);
	// --- In  : destinationUNC : 
	//			 bReplaceExisting : Whether an already existing destination should be overwritten
	//			 bCopyAllowed : Whether a copy is allowed (needed when source and destination
	//				are not on the same disk)
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Moves a file to a different locatiuon

	BOOL Rename(COXUNC destinationUNC, BOOL bReplaceExisting = FALSE);
	// --- In  : destinationUNC : 
	//			 bReplaceExisting : Whether an already existing destination should be overwritten
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Renames a file or directory

	BOOL Delete(BOOL bRemoveReadOnly = FALSE);
	// --- In  : bRemoveReadOnly : Whether a read/only file should be deleted as well
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Deletes a file or (empty) dierectory

	// *** Navigation

	BOOL GetCurrentDirectory();
	// --- In  : 
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Makes this UNC the current directury

	BOOL SetCurrentDirectory();
	// --- In  : 
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Sets the current directury to this UNC

	BOOL GetWindowsDirectory();
	// --- In  : 
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Makes this UNC the windows directury

	BOOL GetSystemDirectory();
	// --- In  : 
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Makes this UNC the windows system directury

	BOOL GetApplicationDirectory();
	// --- In  : 
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Makes this UNC the application directury
	//				(Directory in which the EXE is located)

	BOOL GetTemporaryDirectory();
	// --- In  : 
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Makes this UNC the temporary directury

	// *** Classification

	LONGLONG GetSize();
	// --- In  : 
	// --- Out : 
	// --- Returns : The size of the UNC file if successful,
	//				 -1 otherwise (sets LastError())
	// --- Effect : 

	LONGLONG GetCompressedSize();
	// --- In  : 
	// --- Out : 
	// --- Returns : The compressed size of the UNC file if successful,
	//				 -1 otherwise (sets LastError())
	// --- Effect : 

	BOOL SetSize(LONGLONG nNewSize);
	// --- In  : nNewSize : The new size of the file
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Resizes the specified file
	//				When the file is enlarged, the added bytes have an undefined value

	COXUNC GetShortName();
	// --- In  : 
	// --- Out : 
	// --- Returns : The short UNC representation (8.3 format) of this object
	//				 empty otherwise (sets LastError())
	// --- Effect : 

	COXUNC GetLongName();
	// --- In  : 
	// --- Out : 
	// --- Returns : The Long File Neme UNC representation of this object
	//				 empty otherwise (sets LastError())
	// --- Effect : 

	BOOL GetLogicalDrives(CStringArray& drives);
	// --- In  : drives
	// --- Out : drives : A collection of all the logical drives "A:", etc.
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Retrieves a list of all the logical drives

	UINT GetDriveType();
	// --- In  : 
	// --- Out : 
	// --- Returns : The type of drive if successful or 0 otherwise (sets LastError())
	// --- Effect : Retrieves to type of drive.  Possible values in case of success are
	//				DRIVE_REMOVABLE, DRIVE_FIXED, DRIVE_REMOTE, DRIVE_CDROM, DRIVE_RAMDISK

	LONGLONG GetTotalDiskSpace();
	// --- In  : 
	// --- Out : 
	// --- Returns : The total number of bytes on the disk if successful 
	//				 or -1 otherwise (sets LastError())
	// --- Effect : 

	LONGLONG GetFreeDiskSpace();
	// --- In  : 
	// --- Out : 
	// --- Returns : The number of bytes of the free space on the disk if successful 
	//				 or -1 otherwise (sets LastError())
	// --- Effect : 

	CString GetDiskName();
	// --- In  : 
	// --- Out : 
	// --- Returns : The name of the disk if successful or empty otherwise (sets LastError())
	// --- Effect : 

	BOOL SetDiskName(LPCTSTR pszDiskName);
	// --- In  : pszDiskName : The new name of the disk
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : 

	DWORD GetDiskSerialNumber();
	// --- In  : 
	// --- Out : 
	// --- Returns : The serial number of the disk if successful or 0 otherwise (sets LastError())
	// --- Effect : 

	DWORD GetDiskMaximumComponentLength();
	// --- In  : 
	// --- Out : 
	// --- Returns : The maximum length, in characters, of a filename component supported 
	//				 by the specified file system if successful 
	//				 or 0 otherwise (sets LastError())
	// --- Effect : 

	DWORD GetDiskFileSystemFlags();
	// --- In  : 
	// --- Out : 
	// --- Returns : The file system flags of the specified file system if successful 
	//				 or 0 otherwise (sets LastError())
	// --- Effect : Possible values are any combination of the following
	//				FS_CASE_IS_PRESERVED : File system preserves the case of filenames
	//				FS_CASE_SENSITIVE : File system supports case-sensitive filenames
	//				FS_UNICODE_STORED_ON_DISK : The file system supports Unicode in filenames
	//				FS_PERSISTENT_ACLS : File system preserves and enforces ACLs. 
	//				FS_FILE_COMPRESSION	 : File system supports file-based compression.
	//				FS_VOL_IS_COMPRESSED : The specified volume is a compressed volume


	CString GetDiskFileSystemName();
	// --- In  : 
	// --- Out : 
	// --- Returns : The name of the file system (e.g. "NTFS", "FAT" etc) of this disk if successful or 
	//				 empty otherwise (sets LastError())
	// --- Effect : 

	DWORD GetAttributes();
	// --- In  : 
	// --- Out : 
	// --- Returns : The attributes of this file or directory if successful 
	//				 or MAXDWORD otherwise (sets LastError())
	// --- Effect : Possible values are any combination of the following
	//				FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_HIDDEN, FILE_ATTRIBUTE_NORMAL,
	//				FILE_ATTRIBUTE_OFFLINE, FILE_ATTRIBUTE_READONLY, FILE_ATTRIBUTE_SYSTEM, 
	//				FILE_ATTRIBUTE_TEMPORARY, FILE_ATTRIBUTE_COMPRESSED, FILE_ATTRIBUTE_DIRECTORY

	BOOL ModifyAttributes(DWORD nRemoveAttributes, DWORD nAddAttributes);
	// --- In  : nRemoveAttributes : The attributes to remove
	//			 nAddAttributes : The attributes to add
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : Possible values are any combination of the following
	//				FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_HIDDEN, FILE_ATTRIBUTE_NORMAL,
	//				FILE_ATTRIBUTE_OFFLINE, FILE_ATTRIBUTE_READONLY, FILE_ATTRIBUTE_SYSTEM, 
	//				FILE_ATTRIBUTE_TEMPORARY, FILE_ATTRIBUTE_COMPRESSED

	CTime GetCreationTime();
	// --- In  : 
	// --- Out : 
	// --- Returns : The creation time of the files or directory if successful 
	//				 or 0 otherwise (sets LastError())
	// --- Effect : 

	CTime GetLastAccessTime();
	// --- In  : 
	// --- Out : 
	// --- Returns : The last access time of the files or directory if successful 
	//				 or 0 otherwise (sets LastError())
	// --- Effect : 

	CTime GetLastWriteTime();
	// --- In  : 
	// --- Out : 
	// --- Returns : The last write time of the files or directory if successful 
	//				 or 0 otherwise (sets LastError())
	// --- Effect : 

	BOOL SetCreationTime(CTime newCreationTime);
	// --- In  : newCreationTime : The new time to set
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : 

	BOOL SetLastAccessTime(CTime newLastAccessTime);
	// --- In  : newLastAccessTime : The new time to set
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : 

	BOOL SetLastWriteTime(CTime newLastWriteTime); 
	// --- In  : newLastWriteTime : The new time to set
	// --- Out : 
	// --- Returns : Whether it succeeded or not (sets LastError())
	// --- Effect : 

#ifdef _DEBUG
#endif

	~COXUNC();
	// --- In  :
	// --- Out : 
	// --- Returns :
	// --- Effect : Destructor of the object

protected:
	void BuildMain();
	void BuildParts();
	void AdjustMain();
	void AdjustParts();
	static void Trim(CString& sText);
	void SetMainBuilt();
	void SetPartsBuilt();
	void DestroyMain();
	void DestroyParts();
	BOOL IsMainBuilt() const;
	BOOL ArePartsBuilt() const;

	static void ConvertBackslashToSlash(CString& sText);
	static void ConvertSlashToBackslash(CString& sText);

private:
};

// Include inline functions
#include "OXUNC.inl"

#endif // __OXUNC_H__
// ==========================================================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -