#include "vapiOptionsXML.h"
#include "vapiIOList.h"
#include "vapiXML.h"
Diagrama de dependências de inclusão para vapiIOXML.c:
Ir para o código fonte deste ficheiro.
Funções | |
void | vapiIOConfiguredListFromXML () |
void | vapiIOConfiguredToXML () |
xmlTextWriter * | vapiIOXMLFileInit () |
void vapiIOConfiguredListFromXML | ( | ) |
Definido na linha 98 do ficheiro vapiIOXML.c.
Referências GlobalIOList, _vIO::OptionsSettings, v_debug, v_info(), vapiIOListConfiguredAdd(), vapiIOListSelect(), vapiOptionsCheck(), vapiOptionsInit(), vapiOptionsXMLSetOptions() e vapiXMLNextElement().
Referenciado por main().
00099 { 00100 char *filename = "vapiIOconf.vpi"; 00101 xmlTextReader *xmlInput; 00102 vIO *tempIO; 00103 vOptions *tempOptions; 00104 int ret = 1; 00105 xmlInput = xmlReaderForFile (filename, "ISO-8859-1", XML_PARSE_DTDATTR | /* default DTD attributes */ 00106 XML_PARSE_NOENT | /* substitute entities */ 00107 XML_PARSE_DTDVALID); /* validate with the DTD */ 00108 00109 if (xmlInput==NULL) 00110 { 00111 return; 00112 } 00113 00114 xmlTextReaderRead (xmlInput); 00115 if (!strcmp 00116 ((char *) xmlTextReaderLocalName (xmlInput), 00117 "vapiCommunications ")) 00118 { 00119 v_debug ("não é ficheiro de comunicações"); 00120 return; 00121 } 00122 v_debug ("nome do tipo de xml detectado: %s",(char *) xmlTextReaderLocalName (xmlInput)); 00123 00124 xmlTextReaderRead (xmlInput); 00125 /* 00126 * Entramos nos IO's. 00127 */ 00128 if (vapiXMLNextElement (xmlInput) > 0) 00129 { 00130 if (strcmp 00131 ((char *) xmlTextReaderLocalName (xmlInput), 00132 "IOConfigured")) 00133 { 00134 v_debug ("não tem um io configured, tem: %s", (char *) xmlTextReaderLocalName (xmlInput)); 00135 return; 00136 } 00137 00138 while (ret > 0) 00139 { 00140 tempIO = vapiIOListSelect (GlobalIOList, 00141 (char *) 00142 xmlTextReaderGetAttribute 00143 (xmlInput, 00144 BAD_CAST "name")); 00145 v_debug ("IO name: %s", 00146 xmlTextReaderGetAttribute (xmlInput, 00147 BAD_CAST "name")); 00148 00149 tempOptions = 00150 vapiOptionsInit (tempIO->OptionsSettings); 00151 00152 //vapiXMLNextElement (xmlInput); 00153 00154 vapiOptionsXMLSetOptions (xmlInput, tempOptions, NULL); 00155 00156 vapiIOListConfiguredAdd (tempIO, tempOptions); 00157 00158 ret = vapiXMLNextElement (xmlInput); 00159 00160 vapiOptionsCheck (tempIO->OptionsSettings, 00161 tempOptions); 00162 00163 } 00164 00165 } 00166 00167 00168 v_info ("Carregada a List de Comunicações de xml"); 00169 }
Grafo de chamadas desta função:
Here is the caller graph for this function:
void vapiIOConfiguredToXML | ( | ) |
Definido na linha 44 do ficheiro vapiIOXML.c.
Referências GlobalIOListConfigured, _vIOConfigured::IO, _vIO::IOname, _vIOConfigured::Options, _vIO::OptionsSettings, v_info(), v_list_count_elements(), v_list_get(), vapiIOXMLFileInit() e vapiOptionsXMLGetOptions().
Referenciado por vapiGtkWindowIOAdd_Add(), vapiGtkWindowIOConfiguredRemove() e vapiGtkWindowIOConfiguredSaveChanges().
00045 { 00046 xmlTextWriter *xmlOutput; 00047 int i, ListSize; 00048 vIOConfigured *Item; 00049 00050 /* 00051 * Criar cabeçalho do Ficheiro XML. 00052 */ 00053 00054 xmlOutput = vapiIOXMLFileInit (); 00055 00056 /* 00057 * Ir a cada Operação da Macro. 00058 */ 00059 00060 ListSize = v_list_count_elements (GlobalIOListConfigured); 00061 00062 if (!ListSize) 00063 { 00064 return; 00065 } 00066 00067 for (i = 0; i < ListSize; i++) 00068 { 00069 Item = v_list_get (GlobalIOListConfigured, i); 00070 00071 xmlTextWriterStartElement (xmlOutput, 00072 BAD_CAST "IOConfigured"); 00073 00074 xmlTextWriterWriteAttribute (xmlOutput, BAD_CAST "name", 00075 BAD_CAST Item->IO->IOname); 00076 00077 /* 00078 * Get Options. 00079 */ 00080 vapiOptionsXMLGetOptions (xmlOutput, 00081 Item->IO->OptionsSettings, 00082 Item->Options, NULL); 00083 00084 00085 xmlTextWriterEndElement (xmlOutput); 00086 00087 } 00088 00089 00090 xmlTextWriterEndDocument (xmlOutput); 00091 00092 xmlFreeTextWriter (xmlOutput); 00093 v_info ("Guardada Lista de omunicações para xml"); 00094 00095 }
Grafo de chamadas desta função:
Here is the caller graph for this function:
xmlTextWriter* vapiIOXMLFileInit | ( | ) |
Definido na linha 6 do ficheiro vapiIOXML.c.
Referências vapiOptionsXMLOptionsElement().
Referenciado por vapiIOConfiguredToXML().
00007 { 00008 xmlTextWriter *xmlOutput; 00009 char *filename = "vapiIOconf.vpi"; 00010 /* 00011 * Como colocar a string do ficheiro Automatica. 00012 */ 00013 xmlOutput = xmlNewTextWriterFilename (filename, 0); 00014 00015 xmlTextWriterSetIndent (xmlOutput, 1); 00016 00017 xmlTextWriterStartDocument (xmlOutput, NULL, "ISO-8859-1", NULL); 00018 00019 xmlTextWriterStartDTD (xmlOutput, BAD_CAST "vapiCommunications", NULL, 00020 NULL); 00021 00022 xmlTextWriterWriteDTDElement (xmlOutput, 00023 BAD_CAST "vapiCommunications", 00024 BAD_CAST "(IOConfigured)*"); 00025 00026 xmlTextWriterWriteDTDElement (xmlOutput, 00027 BAD_CAST "IOConfigured", 00028 BAD_CAST "(option)*"); 00029 00030 xmlTextWriterWriteDTDAttlist (xmlOutput, 00031 BAD_CAST "IOConfigured", 00032 BAD_CAST "name NMTOKENS #REQUIRED"); 00033 00034 vapiOptionsXMLOptionsElement (xmlOutput, 0); 00035 00036 xmlTextWriterEndDTD (xmlOutput); 00037 00038 xmlTextWriterStartElement (xmlOutput, BAD_CAST "vapiCommunications"); 00039 00040 return xmlOutput; 00041 }
Grafo de chamadas desta função:
Here is the caller graph for this function: