brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 66ad2b8 Raw
44 lines · c
1//===-- CFCMutableArray.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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEARRAY_H10#define LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEARRAY_H11 12#include "CFCReleaser.h"13 14class CFCMutableArray : public CFCReleaser<CFMutableArrayRef> {15public:16  // Constructors and Destructors17  CFCMutableArray(CFMutableArrayRef array = NULL);18  CFCMutableArray(const CFCMutableArray &rhs); // This will copy the array19                                               // contents into a new array20  CFCMutableArray &operator=(const CFCMutableArray &rhs); // This will re-use21                                                          // the same array and22                                                          // just bump the ref23                                                          // count24  ~CFCMutableArray() override;25 26  CFIndex GetCount() const;27  CFIndex GetCountOfValue(const void *value) const;28  CFIndex GetCountOfValue(CFRange range, const void *value) const;29  const void *GetValueAtIndex(CFIndex idx) const;30  bool SetValueAtIndex(CFIndex idx, const void *value);31  bool AppendValue(const void *value,32                   bool can_create = true); // Appends value and optionally33                                            // creates a CFCMutableArray if this34                                            // class doesn't contain one35  bool36  AppendCStringAsCFString(const char *cstr,37                          CFStringEncoding encoding = kCFStringEncodingUTF8,38                          bool can_create = true);39  bool AppendFileSystemRepresentationAsCFString(const char *s,40                                                bool can_create = true);41};42 43#endif // LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEARRAY_H44