1 //===-- CFCMutableArray.h ---------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEARRAY_H
10 #define LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEARRAY_H
12 #include "CFCReleaser.h"
14 class CFCMutableArray
: public CFCReleaser
<CFMutableArrayRef
> {
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
24 ~CFCMutableArray() override
;
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
36 AppendCStringAsCFString(const char *cstr
,
37 CFStringEncoding encoding
= kCFStringEncodingUTF8
,
38 bool can_create
= true);
39 bool AppendFileSystemRepresentationAsCFString(const char *s
,
40 bool can_create
= true);
43 #endif // LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEARRAY_H