| 152 | |
| 153 | |
| 154 | void PolymakeFile::close() |
| 155 | { |
| 156 | FILE *f=fopen(fileName.c_str(),"w"); |
| 157 | assert(f); |
| 158 | |
| 159 | if(isXml) |
| 160 | { |
| 161 | fprintf(f,"<properties>\n"); |
| 162 | |
| 163 | for(list<PolymakeProperty>::const_iterator i=properties.begin();i!=properties.end();i++) |
| 164 | { |
| 165 | fprintf(f,"<property name=\"%s\">\n",i->name.c_str()); |
| 166 | fprintf(f,"%s",i->value.c_str()); |
| 167 | fprintf(f,"</property>\n"); |
| 168 | } |
| 169 | fprintf(f,"</properties>\n"); |
| 170 | } |
| 171 | else |
| 172 | { |
| 173 | fprintf(f,"_application %s\n",application.c_str()); |
| 174 | fprintf(f,"_version 2.2\n"); |
| 175 | fprintf(f,"_type %s\n",type.c_str()); |
| 176 | |
| 177 | for(list<PolymakeProperty>::const_iterator i=properties.begin();i!=properties.end();i++) |
| 178 | { |
| 179 | fprintf(f,"\n%s\n",i->name.c_str()); |
| 180 | fprintf(f,"%s",i->value.c_str()); |
| 181 | } |
| 182 | } |
| 183 | fclose(f); |
| 184 | } |
| 185 | |
| 186 | |
| 187 | void PolymakeFile::writeStream(ostream &file) |