13{
14 if (argc<=2) {
15 printf(
"IccToXml built with IccProfLib Version " ICCPROFLIBVER ", IccLibXML Version " ICCLIBXMLVER "\n\nUsage: IccToXml src_icc_profile dest_xml_file\n");
16 return -1;
17 }
18
21
24
25 if (!srcIO.
Open(argv[1],
"r")) {
26 printf("Unable to open '%s'\n", argv[1]);
27 return -1;
28 }
29
30 if (!profile.Read(&srcIO)) {
31 printf("Unable to read '%s'\n", argv[1]);
32 return -1;
33 }
34
35 std::string xml;
36 xml.reserve(40000000);
37
38 if (!profile.
ToXml(xml)) {
39 printf("Unable to convert '%s' to xml\n", argv[1]);
40 return -1;
41 }
42
43 if (!dstIO.
Open(argv[2],
"wb")) {
44 printf("unable to open '%s'\n", argv[2]);
45 return -1;
46 }
47
49 printf("XML successfully created\n");
50 }
51 else {
52 printf("Unable to write '%s'\n", argv[2]);
53 return -1;
54 }
55
57
58 return 0;
59}
virtual icInt32Number Write8(void *pBuf, icInt32Number nNum=1)
bool Open(const icChar *szFilename, const icChar *szAttr)
static void PushFactory(IIccMpeFactory *pFactory)
Function: PushFactory(pFactory) Add an IIccMpeFactory to the stack of element factories tracked by th...
Class: CIccMpeXmlFactory.
bool ToXml(std::string &xmlString)
static void PushFactory(IIccTagFactory *pFactory)
Function: PushFactory(pFactory) Add an IIccTagFactory to the stack of tag factories tracked by the sy...
Class: CIccTagXmlFactory.