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
14class CFCMutableArray : public CFCReleaser<CFMutableArrayRef> {
15public:
16 // Constructors and Destructors
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 ~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 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
bool AppendFileSystemRepresentationAsCFString(const char *s, bool can_create=true)
CFCMutableArray(const CFCMutableArray &rhs)
bool SetValueAtIndex(CFIndex idx, const void *value)
CFIndex GetCount() const
bool AppendCStringAsCFString(const char *cstr, CFStringEncoding encoding=kCFStringEncodingUTF8, bool can_create=true)
CFIndex GetCountOfValue(const void *value) const
const void * GetValueAtIndex(CFIndex idx) const
~CFCMutableArray() override
bool AppendValue(const void *value, bool can_create=true)
CFCMutableArray & operator=(const CFCMutableArray &rhs)