• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 {
22 public:
23     //------------------------------------------------------------------
24     // Constructors and Destructors
25     //------------------------------------------------------------------
26                         CFString (CFStringRef cf_str = NULL);
27                         CFString (const char *s, CFStringEncoding encoding = kCFStringEncodingUTF8);
28                         CFString (const CFString& rhs);
29                         CFString& operator= (const CFString& rhs);
30                         virtual ~CFString ();
31 
32         const char *    GetFileSystemRepresentation (std::string& str);
33         CFStringRef     SetFileSystemRepresentation (const char *path);
34         CFStringRef     SetFileSystemRepresentationFromCFType (CFTypeRef cf_type);
35         CFStringRef     SetFileSystemRepresentationAndExpandTilde (const char *path);
36         const char *    UTF8 (std::string& str);
37         CFIndex         GetLength() const;
38         static const char *UTF8 (CFStringRef cf_str, std::string& str);
39         static const char *FileSystemRepresentation (CFStringRef cf_str, std::string& str);
40         static const char* GlobPath(const char* path, std::string &expanded_path);
41 };
42 
43 #endif // #ifndef __CFString_h__
44