1 //===-- SBStringList.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_SBStringList_h_
10 #define LLDB_SBStringList_h_
11 
12 #include "lldb/API/SBDefines.h"
13 
14 namespace lldb {
15 
16 class LLDB_API SBStringList {
17 public:
18   SBStringList();
19 
20   SBStringList(const lldb::SBStringList &rhs);
21 
22   const SBStringList &operator=(const SBStringList &rhs);
23 
24   ~SBStringList();
25 
26   explicit operator bool() const;
27 
28   bool IsValid() const;
29 
30   void AppendString(const char *str);
31 
32   void AppendList(const char **strv, int strc);
33 
34   void AppendList(const lldb::SBStringList &strings);
35 
36   uint32_t GetSize() const;
37 
38   const char *GetStringAtIndex(size_t idx);
39 
40   const char *GetStringAtIndex(size_t idx) const;
41 
42   void Clear();
43 
44 protected:
45   friend class SBCommandInterpreter;
46   friend class SBDebugger;
47   friend class SBBreakpoint;
48   friend class SBBreakpointLocation;
49   friend class SBBreakpointName;
50 
51   SBStringList(const lldb_private::StringList *lldb_strings);
52 
53   void AppendList(const lldb_private::StringList &strings);
54 
55   const lldb_private::StringList *operator->() const;
56 
57   const lldb_private::StringList &operator*() const;
58 
59 private:
60   std::unique_ptr<lldb_private::StringList> m_opaque_up;
61 };
62 
63 } // namespace lldb
64 
65 #endif // LLDB_SBStringList_h_
66