Todd Fiala | e77fce0 | 2016-09-04 00:18:56 +0000 | [diff] [blame] | 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 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 20 | class CFString : public CFReleaser<CFStringRef> { |
Todd Fiala | e77fce0 | 2016-09-04 00:18:56 +0000 | [diff] [blame] | 21 | public: |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 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(); |
Todd Fiala | e77fce0 | 2016-09-04 00:18:56 +0000 | [diff] [blame] | 30 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 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); |
Todd Fiala | e77fce0 | 2016-09-04 00:18:56 +0000 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | #endif // #ifndef __CFString_h__ |