1 //===-- SWIG Interface for SBStringList -------------------------*- 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 namespace lldb { 10 11 %feature("docstring", 12 "Represents a list of strings." 13 ) SBStringList; 14 class SBStringList 15 { 16 public: 17 18 SBStringList (); 19 20 SBStringList (const lldb::SBStringList &rhs); 21 22 ~SBStringList (); 23 24 bool 25 IsValid() const; 26 27 explicit operator bool() const; 28 29 void 30 AppendString (const char *str); 31 32 void 33 AppendList (const char **strv, int strc); 34 35 void 36 AppendList (const lldb::SBStringList &strings); 37 38 uint32_t 39 GetSize () const; 40 41 const char * 42 GetStringAtIndex (size_t idx); 43 44 void 45 Clear (); 46 47 #ifdef SWIGPYTHON 48 %pythoncode%{ 49 def __iter__(self): 50 '''Iterate over all strings in a lldb.SBStringList object.''' 51 return lldb_iter(self, 'GetSize', 'GetStringAtIndex') 52 53 def __len__(self): 54 '''Return the number of strings in a lldb.SBStringList object.''' 55 return self.GetSize() 56 %} 57 #endif 58 }; 59 60 } // namespace lldb 61