1 //===-- CFCString.h ---------------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef CoreFoundationCPP_CFString_h_ 11 #define CoreFoundationCPP_CFString_h_ 12 13 #include <iosfwd> 14 15 #include "CFCReleaser.h" 16 17 class CFCString : public CFCReleaser<CFStringRef> 18 { 19 public: 20 //------------------------------------------------------------------ 21 // Constructors and Destructors 22 //------------------------------------------------------------------ 23 CFCString (CFStringRef cf_str = NULL); 24 CFCString (const char *s, CFStringEncoding encoding = kCFStringEncodingUTF8); 25 CFCString (const CFCString& rhs); 26 CFCString& operator= (const CFCString& rhs); 27 virtual ~CFCString (); 28 29 const char * GetFileSystemRepresentation (std::string& str); 30 CFStringRef SetFileSystemRepresentation (const char *path); 31 CFStringRef SetFileSystemRepresentationFromCFType (CFTypeRef cf_type); 32 CFStringRef SetFileSystemRepresentationAndExpandTilde (const char *path); 33 const char * UTF8 (std::string& str); 34 CFIndex GetLength() const; 35 static const char *UTF8 (CFStringRef cf_str, std::string& str); 36 static const char *FileSystemRepresentation (CFStringRef cf_str, std::string& str); 37 static const char *ExpandTildeInPath(const char* path, std::string &expanded_path); 38 39 }; 40 41 #endif // #ifndef CoreFoundationCPP_CFString_h_ 42