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 OptionValueArgs::GetArgs(Args &args) { 22 const uint32_t size = m_values.size(); 23 std::vector<const char *> argv; 24 for (uint32_t i = 0; i < size; ++i) { 25 const char *string_value = m_values[i]->GetStringValue(); 26 if (string_value) 27 argv.push_back(string_value); 28 } 29 30 if (argv.empty()) 31 args.Clear(); 32 else 33 args.SetArguments(argv.size(), &argv[0]); 34 return args.GetArgumentCount(); 35 } 36