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