pathfn.hpp 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef _RAR_PATHFN_
  2. #define _RAR_PATHFN_
  3. wchar* PointToName(const wchar *Path);
  4. wchar* PointToLastChar(const wchar *Path);
  5. wchar* ConvertPath(const wchar *SrcPath,wchar *DestPath,size_t DestSize);
  6. void SetName(wchar *FullName,const wchar *Name,size_t MaxSize);
  7. void SetExt(wchar *Name,const wchar *NewExt,size_t MaxSize);
  8. void SetSFXExt(wchar *SFXName,size_t MaxSize);
  9. wchar *GetExt(const wchar *Name);
  10. bool CmpExt(const wchar *Name,const wchar *Ext);
  11. bool IsWildcard(const wchar *Str);
  12. bool IsPathDiv(int Ch);
  13. bool IsDriveDiv(int Ch);
  14. bool IsDriveLetter(const wchar *Path);
  15. int GetPathDisk(const wchar *Path);
  16. void AddEndSlash(wchar *Path,size_t MaxLength);
  17. void MakeName(const wchar *Path,const wchar *Name,wchar *Pathname,size_t MaxSize);
  18. void GetFilePath(const wchar *FullName,wchar *Path,size_t MaxLength);
  19. void RemoveNameFromPath(wchar *Path);
  20. #if defined(_WIN_ALL) && !defined(SFX_MODULE)
  21. bool GetAppDataPath(wchar *Path,size_t MaxSize,bool Create);
  22. void GetRarDataPath(wchar *Path,size_t MaxSize,bool Create);
  23. #endif
  24. #ifndef SFX_MODULE
  25. bool EnumConfigPaths(uint Number,wchar *Path,size_t MaxSize,bool Create);
  26. void GetConfigName(const wchar *Name,wchar *FullName,size_t MaxSize,bool CheckExist,bool Create);
  27. #endif
  28. wchar* GetVolNumPart(const wchar *ArcName);
  29. void NextVolumeName(wchar *ArcName,uint MaxLength,bool OldNumbering);
  30. bool IsNameUsable(const wchar *Name);
  31. void MakeNameUsable(char *Name,bool Extended);
  32. void MakeNameUsable(wchar *Name,bool Extended);
  33. void UnixSlashToDos(const char *SrcName,char *DestName,size_t MaxLength);
  34. void DosSlashToUnix(const char *SrcName,char *DestName,size_t MaxLength);
  35. void UnixSlashToDos(const wchar *SrcName,wchar *DestName,size_t MaxLength);
  36. void DosSlashToUnix(const wchar *SrcName,wchar *DestName,size_t MaxLength);
  37. inline void SlashToNative(const char *SrcName,char *DestName,size_t MaxLength)
  38. {
  39. #ifdef _WIN_ALL
  40. UnixSlashToDos(SrcName,DestName,MaxLength);
  41. #else
  42. DosSlashToUnix(SrcName,DestName,MaxLength);
  43. #endif
  44. }
  45. inline void SlashToNative(const wchar *SrcName,wchar *DestName,size_t MaxLength)
  46. {
  47. #ifdef _WIN_ALL
  48. UnixSlashToDos(SrcName,DestName,MaxLength);
  49. #else
  50. DosSlashToUnix(SrcName,DestName,MaxLength);
  51. #endif
  52. }
  53. void ConvertNameToFull(const wchar *Src,wchar *Dest,size_t MaxSize);
  54. bool IsFullPath(const wchar *Path);
  55. bool IsFullRootPath(const wchar *Path);
  56. void GetPathRoot(const wchar *Path,wchar *Root,size_t MaxSize);
  57. int ParseVersionFileName(wchar *Name,bool Truncate);
  58. wchar* VolNameToFirstName(const wchar *VolName,wchar *FirstName,size_t MaxSize,bool NewNumbering);
  59. wchar* GetWideName(const char *Name,const wchar *NameW,wchar *DestW,size_t DestSize);
  60. #ifndef SFX_MODULE
  61. void GenerateArchiveName(wchar *ArcName,size_t MaxSize,const wchar *GenerateMask,bool Archiving);
  62. #endif
  63. #ifdef _WIN_ALL
  64. bool GetWinLongPath(const wchar *Src,wchar *Dest,size_t MaxSize);
  65. void ConvertToPrecomposed(wchar *Name,size_t NameSize);
  66. void MakeNameCompatible(wchar *Name,size_t MaxSize);
  67. #endif
  68. #endif