blob: 18d60a5a74bd89d78be2fbda5b2089eb6c7996d6 [file] [log] [blame]
Todd Fialae77fce02016-09-04 00:18:56 +00001//===-- 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 Stoneb9c1b512016-09-06 20:57:50 +000020class CFString : public CFReleaser<CFStringRef> {
Todd Fialae77fce02016-09-04 00:18:56 +000021public:
Kate Stoneb9c1b512016-09-06 20:57:50 +000022 //------------------------------------------------------------------
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 Fialae77fce02016-09-04 00:18:56 +000030
Kate Stoneb9c1b512016-09-06 20:57:50 +000031 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 Fialae77fce02016-09-04 00:18:56 +000041};
42
43#endif // #ifndef __CFString_h__