1061da546Spatrick //===-- CFString.h ----------------------------------------------*- C++ -*-===// 2061da546Spatrick // 3061da546Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4061da546Spatrick // See https://llvm.org/LICENSE.txt for license information. 5061da546Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6061da546Spatrick // 7061da546Spatrick //===----------------------------------------------------------------------===// 8061da546Spatrick // 9061da546Spatrick // Created by Greg Clayton on 1/16/08. 10061da546Spatrick // 11061da546Spatrick //===----------------------------------------------------------------------===// 12061da546Spatrick 13*dda28197Spatrick #ifndef LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_CFSTRING_H 14*dda28197Spatrick #define LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_CFSTRING_H 15061da546Spatrick 16061da546Spatrick #include "CFUtils.h" 17061da546Spatrick #include <iosfwd> 18061da546Spatrick 19061da546Spatrick class CFString : public CFReleaser<CFStringRef> { 20061da546Spatrick public: 21061da546Spatrick // Constructors and Destructors 22061da546Spatrick CFString(CFStringRef cf_str = NULL); 23061da546Spatrick CFString(const char *s, CFStringEncoding encoding = kCFStringEncodingUTF8); 24061da546Spatrick CFString(const CFString &rhs); 25061da546Spatrick CFString &operator=(const CFString &rhs); 26061da546Spatrick virtual ~CFString(); 27061da546Spatrick 28061da546Spatrick const char *GetFileSystemRepresentation(std::string &str); 29061da546Spatrick CFStringRef SetFileSystemRepresentation(const char *path); 30061da546Spatrick CFStringRef SetFileSystemRepresentationFromCFType(CFTypeRef cf_type); 31061da546Spatrick CFStringRef SetFileSystemRepresentationAndExpandTilde(const char *path); 32061da546Spatrick const char *UTF8(std::string &str); 33061da546Spatrick CFIndex GetLength() const; 34061da546Spatrick static const char *UTF8(CFStringRef cf_str, std::string &str); 35061da546Spatrick static const char *FileSystemRepresentation(CFStringRef cf_str, 36061da546Spatrick std::string &str); 37061da546Spatrick static const char *GlobPath(const char *path, std::string &expanded_path); 38061da546Spatrick }; 39061da546Spatrick 40*dda28197Spatrick #endif // LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_CFSTRING_H 41