//*************************************************************************** // // OBJVALUE.CPP // // Module: OLE MS Provider Framework // // Copyright (c) 1996-2001 Microsoft Corporation, All Rights Reserved // //*************************************************************************** #include "precomp.h" #include #include #include WbemPropertyListValue :: WbemPropertyListValue () { propertyListValue = new CList ; } WbemPropertyListValue :: WbemPropertyListValue ( const WbemPropertyListValue &listValue ) { propertyListValue = new CList ; CList *list = ( CList * ) propertyListValue ; CList *copyList = ( CList * ) listValue.propertyListValue ; POSITION position = copyList->GetHeadPosition () ; while ( position ) { WbemPropertyValue *value = copyList->GetNext ( position ) ; list->AddTail ( value->Copy () ) ; } } WbemPropertyListValue :: ~WbemPropertyListValue () { CList *list = ( CList * ) propertyListValue ; POSITION position = list->GetHeadPosition () ; while ( position ) { WbemPropertyValue *value = list->GetNext ( position ) ; delete value ; } list->RemoveAll () ; delete ( CList * ) propertyListValue ; } WbemPropertyValue *WbemPropertyListValue :: Copy () const { return new WbemPropertyListValue ( *this ) ; } ULONG WbemPropertyListValue :: GetCount () const { CList *list = ( CList * ) propertyListValue ; return list->GetCount () ; } BOOL WbemPropertyListValue :: IsEmpty () const { CList *list = ( CList * ) propertyListValue ; return list->IsEmpty () ; } void WbemPropertyListValue :: Reset () { CList *list = ( CList * ) propertyListValue ; listPosition = list->GetHeadPosition () ; } WbemPropertyValue *WbemPropertyListValue :: Next () { WbemPropertyValue *value = NULL ; POSITION position = ( POSITION ) listPosition ; if ( position ) { CList *list = ( CList * ) propertyListValue ; value = list->GetNext ( position ) ; listPosition = position ; } return value ; } void WbemPropertyListValue :: Add ( WbemPropertyValue *propertyValue ) { CList *list = ( CList * ) propertyListValue ; list->AddTail ( propertyValue ) ; } WbemPropertyNameValue :: WbemPropertyNameValue ( const WbemPropertyNameValue &propertyNameValue ) { wchar_t *name = propertyNameValue.GetName () ; propertyName = new wchar_t [ wcslen ( name ) + 1 ] ; wcscpy ( propertyName , name ) ; propertyValue = propertyNameValue.GetValue ()->Copy () ; } WbemPropertyNameValue :: WbemPropertyNameValue ( wchar_t *name , WbemPropertyValue *value ) { propertyName = name ; propertyValue = value ; } WbemPropertyNameValue :: ~WbemPropertyNameValue () { delete [] propertyName ; delete propertyValue ; } WbemOidReference :: WbemOidReference () { } WbemOidReference :: WbemOidReference ( const WbemOidReference © ) : guid ( copy.guid ) { } WbemOidReference :: ~WbemOidReference () { } WbemClassReference :: WbemClassReference () : className ( NULL ) { } WbemClassReference :: WbemClassReference ( const WbemClassReference © ) { className = new wchar_t [ wcslen ( copy.className ) + 1 ] ; wcscpy ( className , copy.className ) ; } WbemClassReference :: ~WbemClassReference () { delete [] className ; } void WbemClassReference :: SetClass ( wchar_t *classArg ) { delete [] className ; className = new wchar_t [ wcslen ( classArg ) + 1 ] ; wcscpy ( className , classArg ) ; } WbemKeyLessClassReference :: WbemKeyLessClassReference () : className ( NULL ) { } WbemKeyLessClassReference :: WbemKeyLessClassReference ( const WbemKeyLessClassReference © ) { className = new wchar_t [ wcslen ( copy.className ) + 1 ] ; wcscpy ( className , copy.className ) ; } WbemKeyLessClassReference :: ~WbemKeyLessClassReference () { delete [] className ; } void WbemKeyLessClassReference :: SetClass ( wchar_t *classArg ) { delete [] className ; className = new wchar_t [ wcslen ( classArg ) + 1 ] ; wcscpy ( className , classArg ) ; } WbemClassKeySpecification :: WbemClassKeySpecification () : className ( NULL ) , classValue ( NULL ) { } WbemClassKeySpecification :: WbemClassKeySpecification ( const WbemClassKeySpecification © ) { className = new wchar_t [ wcslen ( copy.className ) + 1 ] ; wcscpy ( className , copy.className ) ; classValue = copy.classValue->Copy () ; } WbemClassKeySpecification :: ~WbemClassKeySpecification () { delete [] className ; delete classValue ; } void WbemClassKeySpecification :: SetClass ( wchar_t *classArg ) { delete [] className ; className = new wchar_t [ wcslen ( classArg ) + 1 ] ; wcscpy ( className , classArg ) ; } void WbemClassKeySpecification :: SetClassValue ( WbemPropertyValue *propertyValueArg ) { delete classValue ; classValue = propertyValueArg ; } ; WbemInstanceSpecification :: WbemInstanceSpecification ( const WbemInstanceSpecification © ) { className = new wchar_t [ wcslen ( copy.className ) + 1 ] ; wcscpy ( className , copy.className ) ; propertyNameValueList = new CList ; CList *propList = ( CList * ) propertyNameValueList ; CList *copyPropList = ( CList * ) copy.propertyNameValueList ; POSITION position = copyPropList->GetHeadPosition () ; while ( position ) { WbemPropertyNameValue *value = copyPropList->GetNext ( position ) ; propList->AddTail ( value->Copy () ) ; delete value ; } } WbemInstanceSpecification :: WbemInstanceSpecification () : className ( NULL ) { propertyNameValueList = new CList ; } WbemInstanceSpecification :: ~WbemInstanceSpecification () { CList *propList = ( CList * ) propertyNameValueList ; POSITION position = propList->GetHeadPosition () ; while ( position ) { WbemPropertyNameValue *value = propList->GetNext ( position ) ; delete value ; } propList->RemoveAll () ; delete [] className ; delete ( CList * ) propertyNameValueList ; } void WbemInstanceSpecification :: SetClass ( wchar_t *classArg ) { delete [] className ; className = new wchar_t [ wcslen ( classArg ) + 1 ] ; wcscpy ( className , classArg ) ; } BOOL WbemInstanceSpecification :: IsEmpty () const { CList *list = ( CList * ) propertyNameValueList ; return list->IsEmpty () ; } ULONG WbemInstanceSpecification :: GetCount () const { CList *list = ( CList * ) propertyNameValueList ; return list->GetCount () ; } void WbemInstanceSpecification :: Reset () { CList *list = ( CList * ) propertyNameValueList ; propertyNameValueListPosition = list->GetHeadPosition () ; } WbemPropertyNameValue *WbemInstanceSpecification :: Next () { WbemPropertyNameValue *value = NULL ; POSITION position = ( POSITION ) propertyNameValueListPosition ; if ( position ) { CList *list = ( CList * ) propertyNameValueList ; value = list->GetNext ( position ) ; propertyNameValueListPosition = position ; } return value ; } void WbemInstanceSpecification :: Add ( WbemPropertyNameValue *propertyNameValue ) { CList *list = ( CList * ) propertyNameValueList ; list->AddTail ( propertyNameValue ) ; }