Changeset 57632 in vbox
- Timestamp:
- Sep 4, 2015 2:25:02 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/USBIdDatabaseGenerator.cpp
r57625 r57632 14 14 #include <fstream> 15 15 #include <iostream> 16 #include <iomanip> 16 17 #include <algorithm> 17 18 #include <vector> … … 23 24 using namespace std; 24 25 25 const char* header = "/*\n\ 26 * Copyright(C) 2005 - 2015 Oracle Corporation\n\ 27 *\n\ 28 * This file is part of VirtualBox Open Source Edition(OSE), as\n\ 29 * available from http ://www.virtualbox.org. This file is free software;\n\ 30 * you can redistribute it and / or modify it under the terms of the GNU\n\ 31 * General Public License(GPL) as published by the Free Software\n\ 32 * Foundation, in version 2 as it comes in the \"COPYING\" file of the\n\ 33 * VirtualBox OSE distribution.VirtualBox OSE is distributed in the\n\ 34 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.\n\ 35 *\n\ 36 */\ 37 \n\ 38 \n\ 39 #include \"USBIdDatabase.h\"\n\ 40 \n\ 41 /** USB devices aliases array.\n\ 42 * Format: VendorId, ProductId, Vendor Name, Product Name\n\ 43 * The source of the list is http://www.linux-usb.org/usb.ids\n\ 44 */\n\ 45 Product AliasDictionary::productArray[] = { \n"; 46 47 const char* footer = "};\n\ 48 \n\ 49 const size_t AliasDictionary::products_size = sizeof(AliasDictionary::productArray) / sizeof(Product); \n"; 50 51 const char* vendor_header = "\nVendor AliasDictionary::vendorArray[] = { \n"; 52 const char* vendor_footer = "};\n\ 53 \n\ 54 const size_t AliasDictionary::vendors_size = sizeof(AliasDictionary::vendorArray) / sizeof(Vendor);"; 55 56 const char* start_block = "# Vendors, devices and interfaces. Please keep sorted."; 57 const char* end_block = "# List of known device classes, subclasses and protocols"; 26 const char *header = 27 "/*\n" 28 " * Copyright(C) 2015 Oracle Corporation\n" 29 " *\n" 30 " * This file is part of VirtualBox Open Source Edition(OSE), as\n" 31 " * available from http ://www.virtualbox.org. This file is free software;\n" 32 " * you can redistribute it and / or modify it under the terms of the GNU\n" 33 " * General Public License(GPL) as published by the Free Software\n" 34 " * Foundation, in version 2 as it comes in the \"COPYING\" file of the\n" 35 " * VirtualBox OSE distribution.VirtualBox OSE is distributed in the\n" 36 " * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.\n" 37 " */" 38 "\n" 39 "\n" 40 "#include \"USBIdDatabase.h\"\n" 41 "\n" 42 "/**\n" 43 " * USB devices aliases array.\n" 44 " * Format: VendorId, ProductId, Vendor Name, Product Name\n" 45 " * The source of the list is http://www.linux-usb.org/usb.ids\n" 46 " */\n" 47 "Product AliasDictionary::productArray[] =\n" 48 "{\n"; 49 50 const char *footer = 51 "};\n" 52 "\n" 53 "const size_t AliasDictionary::products_size = sizeof(AliasDictionary::productArray) / sizeof(Product);\n"; 54 55 const char *vendor_header = 56 "\nVendor AliasDictionary::vendorArray[] =\n" 57 "{\n"; 58 const char *vendor_footer = 59 "};\n" 60 "\n" 61 "const size_t AliasDictionary::vendors_size = sizeof(AliasDictionary::vendorArray) / sizeof(Vendor);\n"; 62 63 const char *start_block = "# Vendors, devices and interfaces. Please keep sorted."; 64 const char *end_block = "# List of known device classes, subclasses and protocols"; 58 65 59 66 #define USBKEY(vendorId, productId) (((vendorId) << 16) | (productId)) … … 116 123 ostream& operator <<(ostream& stream, const ProductRecord product) 117 124 { 118 stream << " {USBKEY(0x"<< hex << product.vendorID119 << ", 0x"<< product.productID << "), "120 << "\"" << conv(product.product).c_str() << "\" }," << endl;125 stream << " { USBKEY(0x" << setfill('0') << setw(4) << hex << product.vendorID 126 << ", 0x" << setfill('0') << setw(4) << product.productID << "), " 127 << "\"" << conv(product.product).c_str() << "\" }," << endl; 121 128 return stream; 122 129 } … … 124 131 ostream& operator <<(ostream& stream, const VendorRecord vendor) 125 132 { 126 stream << " {0x"<< hex << vendor.vendorID127 << ", \"" << conv(vendor.vendor).c_str() << "\" }," << endl;133 stream << " { 0x" << setfill('0') << setw(4) << hex << vendor.vendorID 134 << ", \"" << conv(vendor.vendor).c_str() << "\" }," << endl; 128 135 return stream; 129 136 }
Note:
See TracChangeset
for help on using the changeset viewer.

