1 //===-- OptionValueUUID.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/OptionValueUUID.h" 11 12 // C Includes 13 // C++ Includes 14 // Other libraries and framework includes 15 // Project includes 16 #include "lldb/Core/Stream.h" 17 18 using namespace lldb; 19 using namespace lldb_private; 20 21 void 22 OptionValueUUID::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) 23 { 24 if (dump_mask & eDumpOptionType) 25 strm.Printf ("(%s)", GetTypeAsCString ()); 26 if (dump_mask & eDumpOptionValue) 27 { 28 if (dump_mask & eDumpOptionType) 29 strm.PutCString (" = "); 30 m_uuid.Dump (&strm); 31 } 32 } 33 34 Error 35 OptionValueUUID::SetValueFromCString (const char *value_cstr, 36 VarSetOperationType op) 37 { 38 Error error; 39 switch (op) 40 { 41 case eVarSetOperationClear: 42 Clear(); 43 break; 44 45 case eVarSetOperationReplace: 46 case eVarSetOperationAssign: 47 { 48 if (m_uuid.SetfromCString(value_cstr) == 0) 49 error.SetErrorStringWithFormat ("invalid uuid string value '%s'", value_cstr); 50 else 51 m_value_was_set = true; 52 } 53 break; 54 55 case eVarSetOperationInsertBefore: 56 case eVarSetOperationInsertAfter: 57 case eVarSetOperationRemove: 58 case eVarSetOperationAppend: 59 case eVarSetOperationInvalid: 60 error = OptionValue::SetValueFromCString (value_cstr, op); 61 break; 62 } 63 return error; 64 } 65 66 lldb::OptionValueSP 67 OptionValueUUID::DeepCopy () const 68 { 69 return OptionValueSP(new OptionValueUUID(*this)); 70 } 71