Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
IccIoXml.cpp
Go to the documentation of this file.
1/** @file
2File: IccIoXml.cpp
3
4Contains: Implementation of the IIccOpenFileIO interface.
5
6Version: V1
7
8Copyright: (c) see ICC Software License
9*/
10
11/*
12 * The ICC Software License, Version 0.2
13 *
14 *
15 * Copyright (c) 2003-2012 The International Color Consortium. All rights
16 * reserved.
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 *
22 * 1. Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 *
25 * 2. Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in
27 * the documentation and/or other materials provided with the
28 * distribution.
29 *
30 * 3. In the absence of prior written permission, the names "ICC" and "The
31 * International Color Consortium" must not be used to imply that the
32 * ICC organization endorses or promotes products derived from this
33 * software.
34 *
35 *
36 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39 * DISCLAIMED. IN NO EVENT SHALL THE INTERNATIONAL COLOR CONSORTIUM OR
40 * ITS CONTRIBUTING MEMBERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47 * SUCH DAMAGE.
48 * ====================================================================
49 *
50 * This software consists of voluntary contributions made by many
51 * individuals on behalf of the The International Color Consortium.
52 *
53 *
54 * Membership in the ICC is encouraged when this software is used for
55 * commercial purposes.
56 *
57 *
58 * For more information on The International Color Consortium, please
59 * see <http://www.color.org/>.
60 *
61 *
62 */
63
64#include "IccIoXml.h"
65
66#ifdef USEREFICCMAXNAMESPACE
67namespace refIccMAX {
68#endif
69
70/**
71****************************************************************************
72* Name: CIccStandardFileIO::OpenFile
73*
74* Purpose: Open a file
75*
76* Args:
77* szFilename - path to file to be opened
78* szAttr - attributes of open (identical to attributes in fopen call).
79*
80* Return:
81* Pointer a CIccIO object that IO can be performed with or NULL if file
82* cannot be opened.
83*****************************************************************************
84*/
85CIccIO* CIccStandardFileIO::OpenFile(const icChar *szFilename, const char *szAttr)
86{
87 CIccFileIO *file = new CIccFileIO();
88
89 if (!file->Open(szFilename, szAttr)) {
90 delete file;
91 return NULL;
92 }
93
94 return file;
95}
96
99
100CIccIO* IccOpenFileIO(const icChar *szFilename, const char *szAttr)
101{
102 if (g_pIccFileIO) {
103 return g_pIccFileIO->OpenFile(szFilename, szAttr);
104 }
105
106 return NULL;
107}
108
110{
111 g_pIccFileIO = pOpenIO;
112}
113
114//////////////////////////////////////////////////////////////////////
115// Class CIccIO
116//////////////////////////////////////////////////////////////////////
117
118#ifdef USEREFICCMAXNAMESPACE
119} //namespace refIccMAX
120#endif
char icChar
Definition IccDefs.h:109
static IIccOpenFileIO * g_pIccFileIO
Definition IccIoXml.cpp:98
CIccIO * IccOpenFileIO(const icChar *szFilename, const char *szAttr)
Definition IccIoXml.cpp:100
void IccSetOpenFileIO(IIccOpenFileIO *pOpenIO)
Definition IccIoXml.cpp:109
static CIccStandardFileIO g_IccStandardFileIO
Definition IccIoXml.cpp:97
File: IccIoXml.h.
Type: Class.
Definition IccIO.h:150
bool Open(const icChar *szFilename, const icChar *szAttr)
Definition IccIO.cpp:382
Type: Class.
Definition IccIO.h:97
Type: class.
Definition IccIoXml.h:104
virtual CIccIO * OpenFile(const icChar *szFilename, const char *szAttr)
Name: CIccStandardFileIO::OpenFile.
Definition IccIoXml.cpp:85
Type: Interface.
Definition IccIoXml.h:90
virtual CIccIO * OpenFile(const icChar *szFilename, const char *szAttr)=0