00001 //**************************************************************************/ 00002 // Copyright (c) 1998-2006 Autodesk, Inc. 00003 // All rights reserved. 00004 // 00005 // These coded instructions, statements, and computer programs contain 00006 // unpublished proprietary information written by Autodesk, Inc., and are 00007 // protected by Federal copyright law. They may not be disclosed to third 00008 // parties or copied or duplicated in any form, in whole or in part, without 00009 // the prior written consent of Autodesk, Inc. 00010 //**************************************************************************/ 00011 // DESCRIPTION: Path class 00012 // AUTHOR: Nicolas Desjardins 00013 // DATE: 2006-02-27 00014 //***************************************************************************/ 00015 00016 #ifndef _MAXSDK_UTIL_PATH_H_ 00017 #define _MAXSDK_UTIL_PATH_H_ 00018 00019 00020 #include "maxheap.h" 00021 #include "utilexp.h" 00022 #include "strclass.h" 00023 #include "maxversion.h" 00024 #include "autoptr.h" 00025 00026 namespace MaxSDK 00027 { 00028 namespace Util 00029 { 00072 class Path : public MaxHeapOperators 00073 { 00074 private: 00075 class PathImpl; 00076 const AutoPtr<PathImpl> mImpl; 00077 00078 public: 00079 00085 UtilExport Path(); 00086 00093 UtilExport Path(const MSTR &pathString); 00094 00101 UtilExport Path(const MCHAR *pathString); 00102 00110 UtilExport Path(const Path &other); 00111 00115 UtilExport ~Path(); 00116 00123 UtilExport Path& SetPath(const Path &other); 00124 00132 UtilExport Path& SetPath(const MCHAR *pathString); 00133 00140 UtilExport Path& SetPath(const MSTR &pathString); 00141 00147 UtilExport Path& operator=(const Path &other); 00148 00155 UtilExport Path& operator=(const MCHAR *pathString); 00156 00162 UtilExport Path& operator=(const MSTR &pathString); 00163 00164 00173 UtilExport bool IsAbsolute() const; 00174 00181 UtilExport bool IsEmpty() const; 00182 00193 UtilExport bool IsLegal() const; 00194 00213 UtilExport bool IsRoot() const; 00214 00223 UtilExport bool IsUnc() const; 00224 00231 UtilExport bool IsUncShare() const; 00232 00241 UtilExport bool IsRootedAtBackslash() const; 00242 00248 UtilExport bool IsRootedAtDriveLetter() const; 00249 00256 UtilExport bool HasUnresolvedSymbols() const; 00257 00264 UtilExport bool StartsWithUpDirectory() const; 00265 00276 UtilExport bool IsEqual(const Path &other) const; 00277 00286 UtilExport bool operator==(const Path &other) const; 00287 00299 UtilExport bool ResolvesEquivalent(const Path &other) const; 00300 00306 UtilExport bool HasTrailingBackslash() const; 00307 00313 UtilExport Path& AddTrailingBackslash(); 00314 00321 UtilExport Path& RemoveTrailingBackslash(); 00322 00345 UtilExport Path& Prepend(const Path &newParent); 00346 00366 UtilExport Path& Append(const Path &relativeChild); 00367 00378 UtilExport Path& StripToTopParent(); 00379 00390 UtilExport Path& RemoveTopParent(); 00391 00402 UtilExport Path& StripToLeaf(); 00403 00414 UtilExport Path& RemoveLeaf(); 00415 00425 UtilExport Path& ResolveSymbols(); 00426 00443 UtilExport Path& Normalize(); 00444 00450 UtilExport Path& ConvertToLowerCase(); 00451 00470 UtilExport Path& ConvertToRelativeTo(const Path &newBase); 00471 00481 UtilExport Path& ConvertToUNC(); 00482 00497 UtilExport Path& ConvertToAbsolute(); 00498 00510 UtilExport const Path& GetResolvedAbsolutePath() const; 00511 00523 UtilExport Path& ConvertToRelativeToProjectFolder(); 00524 00531 UtilExport MSTR GetString() const; 00532 00543 UtilExport const MCHAR* GetCStr() const; 00544 00550 PathImpl& GetImpl(); 00551 00558 const PathImpl& GetImpl() const; 00559 }; 00560 00561 } 00562 } 00563 00564 #if !defined(NDEBUG) && defined(BUILD_WITH_IMPL) 00565 // Debug and Hybrid builds can pull in implementation details 00566 #include "..\..\include\SymbolString\TSymbolString.h" 00567 #include "..\..\util\pathImpl.h" 00568 #endif 00569 00570 00571 #endif