130fdc8d8SChris Lattner //===-- CFCMutableArray.h ---------------------------------------*- C++ -*-===// 230fdc8d8SChris Lattner // 32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 630fdc8d8SChris Lattner // 730fdc8d8SChris Lattner //===----------------------------------------------------------------------===// 830fdc8d8SChris Lattner 9cdc514e4SJonas Devlieghere #ifndef LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEARRAY_H 10cdc514e4SJonas Devlieghere #define LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEARRAY_H 1130fdc8d8SChris Lattner 1230fdc8d8SChris Lattner #include "CFCReleaser.h" 1330fdc8d8SChris Lattner 14b9c1b51eSKate Stone class CFCMutableArray : public CFCReleaser<CFMutableArrayRef> { 1530fdc8d8SChris Lattner public: 1630fdc8d8SChris Lattner // Constructors and Destructors 1730fdc8d8SChris Lattner CFCMutableArray(CFMutableArrayRef array = NULL); 18b9c1b51eSKate Stone CFCMutableArray(const CFCMutableArray &rhs); // This will copy the array 19b9c1b51eSKate Stone // contents into a new array 20b9c1b51eSKate Stone CFCMutableArray &operator=(const CFCMutableArray &rhs); // This will re-use 21b9c1b51eSKate Stone // the same array and 22b9c1b51eSKate Stone // just bump the ref 23b9c1b51eSKate Stone // count 24*99166339SJonas Devlieghere ~CFCMutableArray() override; 2530fdc8d8SChris Lattner 2630fdc8d8SChris Lattner CFIndex GetCount() const; 2730fdc8d8SChris Lattner CFIndex GetCountOfValue(const void *value) const; 2830fdc8d8SChris Lattner CFIndex GetCountOfValue(CFRange range, const void *value) const; 2930fdc8d8SChris Lattner const void *GetValueAtIndex(CFIndex idx) const; 3030fdc8d8SChris Lattner bool SetValueAtIndex(CFIndex idx, const void *value); 31b9c1b51eSKate Stone bool AppendValue(const void *value, 32b9c1b51eSKate Stone bool can_create = true); // Appends value and optionally 33b9c1b51eSKate Stone // creates a CFCMutableArray if this 34b9c1b51eSKate Stone // class doesn't contain one 35b9c1b51eSKate Stone bool 36b9c1b51eSKate Stone AppendCStringAsCFString(const char *cstr, 37dd36defdSGreg Clayton CFStringEncoding encoding = kCFStringEncodingUTF8, 38dd36defdSGreg Clayton bool can_create = true); 39dd36defdSGreg Clayton bool AppendFileSystemRepresentationAsCFString(const char *s, 40dd36defdSGreg Clayton bool can_create = true); 4130fdc8d8SChris Lattner }; 4230fdc8d8SChris Lattner 43cdc514e4SJonas Devlieghere #endif // LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCMUTABLEARRAY_H 44