1 //===-- OptionValueArgs.cpp -------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "lldb/Interpreter/OptionValueArgs.h" 11 12 // C Includes 13 // C++ Includes 14 // Other libraries and framework includes 15 // Project includes 16 #include "lldb/Interpreter/Args.h" 17 18 using namespace lldb; 19 using namespace lldb_private; 20 21 size_t GetArgs(Args & args)22OptionValueArgs::GetArgs (Args &args) 23 { 24 const uint32_t size = m_values.size(); 25 std::vector<const char *> argv; 26 for (uint32_t i = 0; i<size; ++i) 27 { 28 const char *string_value = m_values[i]->GetStringValue (); 29 if (string_value) 30 argv.push_back(string_value); 31 } 32 33 if (argv.empty()) 34 args.Clear(); 35 else 36 args.SetArguments(argv.size(), &argv[0]); 37 return args.GetArgumentCount(); 38 } 39