- Timestamp:
- Feb 17, 2009 2:59:38 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r16836 r16849 214 214 // globals 215 215 //////////////////////////////////////////////////////////////////////////////// 216 217 template<class T> inline com::Utf8Str toString(const T &val);218 219 // specializations220 template<> com::Utf8Str toString<uint32_t>(const uint32_t &val)221 {222 return Utf8StrFmt("%RI16", val);223 }224 225 template<> com::Utf8Str toString<uint64_t>(const uint64_t &val)226 {227 return Utf8StrFmt("%RI32", val);228 }229 216 230 217 static Utf8Str stripFilename(const Utf8Str &strFile) … … 1253 1240 /* Guest OS type */ 1254 1241 Utf8Str strOsTypeVBox, 1255 strCIMOSType = toString<ULONG>(vsysThis.cimos);1242 strCIMOSType = Utf8StrFmt("%RI32", (uint32_t)vsysThis.cimos); 1256 1243 convertCIMOSType2VBoxOSType(strOsTypeVBox, vsysThis.cimos); 1257 1244 pNewDesc->addEntry(VirtualSystemDescriptionType_OS, … … 1290 1277 pNewDesc->addEntry(VirtualSystemDescriptionType_CPU, 1291 1278 "", 1292 toString<ULONG>(vsysThis.cCPUs),1293 toString<ULONG>(cpuCountVBox));1279 Utf8StrFmt("%RI32", (uint32_t)vsysThis.cCPUs), 1280 Utf8StrFmt("%RI32", (uint32_t)cpuCountVBox)); 1294 1281 1295 1282 /* RAM */ … … 1315 1302 pNewDesc->addEntry(VirtualSystemDescriptionType_Memory, 1316 1303 "", 1317 toString<uint64_t>(vsysThis.ullMemorySize),1318 toString<uint64_t>(ullMemSizeVBox));1304 Utf8StrFmt("%RI64", (uint64_t)vsysThis.ullMemorySize), 1305 Utf8StrFmt("%RI64", (uint64_t)ullMemSizeVBox)); 1319 1306 1320 1307 /* Audio */ … … 1325 1312 "", 1326 1313 vsysThis.strSoundCardType, 1327 toString<ULONG>(AudioControllerType_AC97));1314 Utf8StrFmt("%RI32", (uint32_t)AudioControllerType_AC97)); 1328 1315 1329 1316 /* USB Controller */ … … 1371 1358 "", // ref 1372 1359 strNetwork, // orig 1373 toString<ULONG>(nwAdapterVBox), // conf1360 Utf8StrFmt("%RI32", (uint32_t)nwAdapterVBox), // conf 1374 1361 Utf8StrFmt("network=%s", strNetwork.c_str())); // extra conf 1375 1362 } … … 1397 1384 { 1398 1385 const HardDiskController &hdc = hdcIt->second; 1399 Utf8Str strControllerID = toString<uint32_t>(hdc.idController);1386 Utf8Str strControllerID = Utf8StrFmt("%RI32", (uint32_t)hdc.idController); 1400 1387 1401 1388 switch (hdc.system) … … 1410 1397 // @todo: figure out the IDE types 1411 1398 /* Use PIIX4 as default */ 1412 // IDEControllerType_T hdcController = IDEControllerType_PIIX4;1413 1399 Utf8Str strType = "PIIX4"; 1414 1400 if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX3")) 1415 1401 strType = "PIIX3"; 1416 // else // if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX4"))1417 // hdcController = IDEControllerType_PIIX4;1418 1402 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, 1419 1403 strControllerID, … … 2389 2373 const VirtualSystemDescriptionEntry* VirtualSystemDescription::findControllerFromID(uint32_t id) 2390 2374 { 2391 Utf8Str strRef = toString<uint32_t>(id);2375 Utf8Str strRef = Utf8StrFmt("%RI32", id); 2392 2376 list<VirtualSystemDescriptionEntry>::const_iterator it; 2393 2377 for (it = m->descriptions.begin();
Note:
See TracChangeset
for help on using the changeset viewer.