| 1 |
//===-- CFCString.h ---------------------------------------------*- C++ -*-===// |
| 2 |
// |
| 3 |
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 |
// See https://llvm.org/LICENSE.txt for license information. |
| 5 |
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 |
// |
| 7 |
//===----------------------------------------------------------------------===// |
| 8 |
|
| 9 |
#ifndef LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCSTRING_H |
| 10 |
#define LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCSTRING_H |
| 11 |
|
| 12 |
#include <iosfwd> |
| 13 |
|
| 14 |
#include "CFCReleaser.h" |
| 15 |
|
| 16 |
class CFCString : public CFCReleaser<CFStringRef> { |
| 17 |
public: |
| 18 |
// Constructors and Destructors |
| 19 |
CFCString(CFStringRef cf_str = NULL); |
| 20 |
CFCString(const char *s, CFStringEncoding encoding = kCFStringEncodingUTF8); |
| 21 |
CFCString(const CFCString &rhs); |
| 22 |
CFCString &operator=(const CFCString &rhs); |
| 23 |
~CFCString() override; |
| 24 |
|
| 25 |
const char *GetFileSystemRepresentation(std::string &str); |
| 26 |
CFStringRef SetFileSystemRepresentation(const char *path); |
| 27 |
CFStringRef SetFileSystemRepresentationFromCFType(CFTypeRef cf_type); |
| 28 |
CFStringRef SetFileSystemRepresentationAndExpandTilde(const char *path); |
| 29 |
const char *UTF8(std::string &str); |
| 30 |
CFIndex GetLength() const; |
| 31 |
static const char *UTF8(CFStringRef cf_str, std::string &str); |
| 32 |
static const char *FileSystemRepresentation(CFStringRef cf_str, |
| 33 |
std::string &str); |
| 34 |
static const char *ExpandTildeInPath(const char *path, |
| 35 |
std::string &expanded_path); |
| 36 |
}; |
| 37 |
|
| 38 |
#endif // LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCSTRING_H |