Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
IccToXml.cpp
Go to the documentation of this file.
1// IccToXml.cpp : Defines the entry point for the console application.
2//
3
4#include <stdio.h>
5#include "IccTagXmlFactory.h"
6#include "IccMpeXmlFactory.h"
7#include "IccProfileXml.h"
8#include "IccIO.h"
9#include "IccProfLibVer.h"
10#include "IccLibXMLVer.h"
11
12int main(int argc, char* argv[])
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
22 CIccProfileXml profile;
23 CIccFileIO srcIO, dstIO;
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
48 if (dstIO.Write8((char*)xml.c_str(), (icInt32Number)xml.size())==(icInt32Number)xml.size()) {
49 printf("XML successfully created\n");
50 }
51 else {
52 printf("Unable to write '%s'\n", argv[2]);
53 return -1;
54 }
55
56 dstIO.Close();
57
58 return 0;
59}
60
File: IccIO.h.
#define ICCLIBXMLVER
Definition IccLibXMLVer.h:2
File: IccMpeXmlFactory.h.
#define ICCPROFLIBVER
File: IccProfileXml.h.
File: IccTagXmlFactory.h.
int main()
Core and external libraries necessary for the fuzzer functionality.
Type: Class.
Definition IccIO.h:150
virtual void Close()
Definition IccIO.cpp:443
virtual icInt32Number Write8(void *pBuf, icInt32Number nNum=1)
Definition IccIO.cpp:461
bool Open(const icChar *szFilename, const icChar *szAttr)
Definition IccIO.cpp:382
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.
long icInt32Number