Imposta il valore dell'elemento di sintassi specificato.
void cpiSetElementValueValue( int* returnCode, CciElement* targetElement, CciElementValue* value);
Nessuno. Se si verifica un errore, il parametro returnCode indica il motivo dell'errore.
Questo esempio è estratto dal file del programma di analisi di esempio BipSampPluginParser.c (da riga 675 a 698):
void cpiSetElementValue( CciParser* parser, CciElement* element, CciElementValue* value ){ CciElement* newElement; int rc; if ((cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_VALUE) || (cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_NAME_VALUE)) { cpiSetElementValueValue(&rc, element, value); } else if (cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_NAME) { /* Crea un nuovo elemento valore, lo aggiunge come primo child e imposta il valore */ newElement = cpiCreateElement(&rc, parser); cpiSetElementType(&rc, newElement, CCI_ELEMENT_TYPE_VALUE); cpiSetElementValueValue(&rc, newElement, value); cpiAddAsFirstChild(&rc, element, newElement); } else { } return; }