LLDB  mainline
CFCMutableArray.h
Go to the documentation of this file.
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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEARRAY_H
10 #define LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEARRAY_H
11 
12 #include "CFCReleaser.h"
13 
14 class CFCMutableArray : public CFCReleaser<CFMutableArrayRef> {
15 public:
16  // Constructors and Destructors
17  CFCMutableArray(CFMutableArrayRef array = NULL);
18  CFCMutableArray(const CFCMutableArray &rhs); // This will copy the array
19  // contents into a new array
20  CFCMutableArray &operator=(const CFCMutableArray &rhs); // This will re-use
21  // the same array and
22  // just bump the ref
23  // count
24  virtual ~CFCMutableArray();
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 optionally
33  // creates a CFCMutableArray if this
34  // class doesn't contain one
35  bool
36  AppendCStringAsCFString(const char *cstr,
37  CFStringEncoding encoding = kCFStringEncodingUTF8,
38  bool can_create = true);
40  bool can_create = true);
41 };
42 
43 #endif // LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEARRAY_H
CFCMutableArray::operator=
CFCMutableArray & operator=(const CFCMutableArray &rhs)
Definition: CFCMutableArray.cpp:24
CFCMutableArray::GetCount
CFIndex GetCount() const
Definition: CFCMutableArray.cpp:34
CFCMutableArray::GetValueAtIndex
const void * GetValueAtIndex(CFIndex idx) const
Definition: CFCMutableArray.cpp:56
CFCMutableArray::AppendFileSystemRepresentationAsCFString
bool AppendFileSystemRepresentationAsCFString(const char *s, bool can_create=true)
Definition: CFCMutableArray.cpp:114
CFCReleaser
CFCMutableArray::AppendCStringAsCFString
bool AppendCStringAsCFString(const char *cstr, CFStringEncoding encoding=kCFStringEncodingUTF8, bool can_create=true)
Definition: CFCMutableArray.cpp:95
CFCReleaser.h
CFCMutableArray::GetCountOfValue
CFIndex GetCountOfValue(const void *value) const
Definition: CFCMutableArray.cpp:49
CFCMutableArray::SetValueAtIndex
bool SetValueAtIndex(CFIndex idx, const void *value)
Definition: CFCMutableArray.cpp:67
CFCMutableArray::~CFCMutableArray
virtual ~CFCMutableArray()
Definition: CFCMutableArray.cpp:32
CFCMutableArray::CFCMutableArray
CFCMutableArray(CFMutableArrayRef array=NULL)
Definition: CFCMutableArray.cpp:13
CFCMutableArray
Definition: CFCMutableArray.h:14
CFCMutableArray::AppendValue
bool AppendValue(const void *value, bool can_create=true)
Definition: CFCMutableArray.cpp:79