xref: /openbsd-src/gnu/llvm/lldb/bindings/interface/SBStringList.i (revision be691f3bb6417f04a68938fadbcaee2d5795e764)
1061da546Spatrick //===-- SWIG Interface for SBStringList -------------------------*- C++ -*-===//
2061da546Spatrick //
3061da546Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4061da546Spatrick // See https://llvm.org/LICENSE.txt for license information.
5061da546Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6061da546Spatrick //
7061da546Spatrick //===----------------------------------------------------------------------===//
8061da546Spatrick 
9061da546Spatrick namespace lldb {
10061da546Spatrick 
11*be691f3bSpatrick %feature("docstring",
12*be691f3bSpatrick "Represents a list of strings."
13*be691f3bSpatrick ) SBStringList;
14061da546Spatrick class SBStringList
15061da546Spatrick {
16061da546Spatrick public:
17061da546Spatrick 
18061da546Spatrick     SBStringList ();
19061da546Spatrick 
20061da546Spatrick     SBStringList (const lldb::SBStringList &rhs);
21061da546Spatrick 
22061da546Spatrick     ~SBStringList ();
23061da546Spatrick 
24061da546Spatrick     bool
25061da546Spatrick     IsValid() const;
26061da546Spatrick 
27061da546Spatrick     explicit operator bool() const;
28061da546Spatrick 
29061da546Spatrick     void
30061da546Spatrick     AppendString (const char *str);
31061da546Spatrick 
32061da546Spatrick     void
33061da546Spatrick     AppendList (const char **strv, int strc);
34061da546Spatrick 
35061da546Spatrick     void
36061da546Spatrick     AppendList (const lldb::SBStringList &strings);
37061da546Spatrick 
38061da546Spatrick     uint32_t
39061da546Spatrick     GetSize () const;
40061da546Spatrick 
41061da546Spatrick     const char *
42061da546Spatrick     GetStringAtIndex (size_t idx);
43061da546Spatrick 
44061da546Spatrick     void
45061da546Spatrick     Clear ();
46061da546Spatrick 
47061da546Spatrick #ifdef SWIGPYTHON
48061da546Spatrick     %pythoncode%{
49061da546Spatrick     def __iter__(self):
50061da546Spatrick         '''Iterate over all strings in a lldb.SBStringList object.'''
51061da546Spatrick         return lldb_iter(self, 'GetSize', 'GetStringAtIndex')
52061da546Spatrick 
53061da546Spatrick     def __len__(self):
54061da546Spatrick         '''Return the number of strings in a lldb.SBStringList object.'''
55061da546Spatrick         return self.GetSize()
56061da546Spatrick     %}
57061da546Spatrick #endif
58061da546Spatrick };
59061da546Spatrick 
60061da546Spatrick } // namespace lldb
61