1 //===-- CFString.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 // Created by Greg Clayton on 1/16/08. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef __CFString_h__ 15 #define __CFString_h__ 16 17 #include "CFUtils.h" 18 #include <iosfwd> 19 20 class CFString : public CFReleaser<CFStringRef> { 21 public: 22 //------------------------------------------------------------------ 23 // Constructors and Destructors 24 //------------------------------------------------------------------ 25 CFString(CFStringRef cf_str = NULL); 26 CFString(const char *s, CFStringEncoding encoding = kCFStringEncodingUTF8); 27 CFString(const CFString &rhs); 28 CFString &operator=(const CFString &rhs); 29 virtual ~CFString(); 30 31 const char *GetFileSystemRepresentation(std::string &str); 32 CFStringRef SetFileSystemRepresentation(const char *path); 33 CFStringRef SetFileSystemRepresentationFromCFType(CFTypeRef cf_type); 34 CFStringRef SetFileSystemRepresentationAndExpandTilde(const char *path); 35 const char *UTF8(std::string &str); 36 CFIndex GetLength() const; 37 static const char *UTF8(CFStringRef cf_str, std::string &str); 38 static const char *FileSystemRepresentation(CFStringRef cf_str, 39 std::string &str); 40 static const char *GlobPath(const char *path, std::string &expanded_path); 41 }; 42 43 #endif // #ifndef __CFString_h__ 44