/******************************************************************************************************

	UPath.h
	
 ******************************************************************************************************

	Author:			Peter Baumgartner		Mail: peter@baumgartner.com

					Copyright © 2004-2006 by Peter Baumgartner - All Rights Reserved

 ******************************************************************************************************/

/******************************************************************************************************
	READ ME
 ******************************************************************************************************/

	#pragma mark READ ME

	// Provides various path utilities...


	
/******************************************************************************************************
	UPath
 ******************************************************************************************************/

	#if !__LP64__
	
	#pragma mark

	class UPath
	{
		public:
		
			static bool FileExists(NSString* inPath);
			static bool IsAbsolutePath(NSString* inPath);
			static bool IsRelativePath(NSString* inPath);
		
			static NSString* GetAbsolutePath(NSString* inBasePath,NSString* inRelativePath);
			static NSString* GetRelativePath(NSString* inBasePath,NSString* inAbsolutePath);
			static NSString* GetResolvedPath(NSString* inAbsolutePath);
			static NSString* ResolveLeafAlias(NSString* inAbsolutePath);
			
			static NSString* ReplaceIllegalCharactersInFilename(NSString* inFileName);
			static NSString* ReplacePathDelimitersInFileName(NSString* inFileName);

			#if !__LP64__
			static OSStatus AbsolutePathToFSSpec(NSString* inAbsolutePath,FSSpec* outSpec);
			#endif
			static OSStatus PathToFSRef(NSString* inAbsolutePath,FSRef* outRef);
			static NSString* FSRefToPath(FSRef inRef);
			
			static NSString* GetApplicationPath(OSType inCreator);
			static NSString* GetApplicationSupportFolder(NSString* inAppName);
			static NSString* GetTempFolder(NSString* inAbsolutePath);
			static NSString* GetTempFolder(short inVRefNum);
			static BOOL CreateFolder(NSString* inPath);
			
			static unsigned long long GetFileSize(NSString* inPath);
			static unsigned long long GetFreeDiskBytesForFolder(NSString* inPath);
			static NSString* GetFreeDiskStringForFolder(NSString* inPath);
			static NSString* GetSizeString(double inBytes);
	};

	#endif


/******************************************************************************************************/
