IccMAX 2.1.27
Color Profile Tools
Loading...
Searching...
No Matches
CIccTagXmlZipUtf8Text Class Reference

#include <IccTagXml.h>

+ Inheritance diagram for CIccTagXmlZipUtf8Text:
+ Collaboration diagram for CIccTagXmlZipUtf8Text:

Public Member Functions

 CIccTagXmlZipUtf8Text ()
 
 CIccTagXmlZipUtf8Text (const CIccTagXmlZipUtf8Text &ITT)
 
virtual ~CIccTagXmlZipUtf8Text ()
 
icUCharAllocBuffer (icUInt32Number nSize)
 
icUInt32Number BufferSize () const
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
virtual void DetachIO ()
 
icUCharGetBuffer () const
 
virtual const char * GetClassName () const
 
virtual const char * GetExtClassName () const
 
virtual const char * GetExtDerivedClassName () const
 
virtual IIccExtensionTagGetExtension ()
 
virtual icArraySignature GetTagArrayType () const
 
virtual icStructSignature GetTagStructType () const
 
virtual bool GetText (std::string &str) const
 
virtual icTagTypeSignature GetType () const
 
virtual bool IsArrayType ()
 
virtual bool IsMBBType ()
 
virtual bool IsNumArrayType () const
 
virtual bool IsSupported ()
 
virtual CIccTagNewCopy () const
 
virtual bool ParseXml (xmlNode *pNode, std::string &parseStr)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO, CIccProfile *pProfile)
 
virtual bool ReadAll ()
 
bool SetText (const icChar *szText)
 
virtual bool SetText (const icUChar *szText)
 
bool SetText (const icUChar16 *szText)
 
virtual bool ToXml (std::string &xml, std::string blanks="")
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 
virtual bool Write (CIccIO *pIO)
 

Static Public Member Functions

static CIccTagCreate (icTagTypeSignature sig)
 

Data Fields

icUInt32Number m_nReserved
 

Protected Attributes

icUInt32Number m_nBufSize
 
icUCharm_pZipBuf
 

Detailed Description

Constructor & Destructor Documentation

◆ CIccTagXmlZipUtf8Text() [1/2]

CIccTagXmlZipUtf8Text::CIccTagXmlZipUtf8Text ( )
inline
CIccTagZipUtf8Text()
Definition IccTagBasic.cpp:1056

References CIccTagZipUtf8Text::CIccTagZipUtf8Text().

+ Here is the call graph for this function:

◆ CIccTagXmlZipUtf8Text() [2/2]

CIccTagXmlZipUtf8Text::CIccTagXmlZipUtf8Text ( const CIccTagXmlZipUtf8Text ITT)
inline
138: CIccTagZipUtf8Text(ITT) {}

References CIccTagZipUtf8Text::CIccTagZipUtf8Text().

Referenced by NewCopy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~CIccTagXmlZipUtf8Text()

virtual CIccTagXmlZipUtf8Text::~CIccTagXmlZipUtf8Text ( )
inlinevirtual
139{}

Member Function Documentation

◆ AllocBuffer()

icUChar * CIccTagZipUtf8Text::AllocBuffer ( icUInt32Number  nSize)
inherited

Name: CIccTagZipUtf8Text::AllocBuffer

Purpose: This function allocates room and returns pointer to data buffer to put string into

Args: nSize = Requested size of data buffer.

Return: The character buffer array

1421{
1422 if (m_nBufSize != nSize) {
1423 if (!nSize) {
1424 if (m_pZipBuf) {
1425 free(m_pZipBuf);
1426 m_pZipBuf = NULL;
1427 }
1428
1429 m_nBufSize = nSize;
1430 return NULL;
1431 }
1432
1433 if (!m_nBufSize)
1434 m_pZipBuf = (icUChar*)malloc(nSize);
1435 else
1437
1438 m_nBufSize = nSize;
1439
1440 }
1441
1442 return m_pZipBuf;
1443}
unsigned char icUChar
Definition IccDefs.h:111
ICCPROFLIB_API void * icRealloc(void *ptr, size_t size)
Definition IccUtil.cpp:111
icUInt32Number m_nBufSize
Definition IccTagBasic.h:401
icUChar * m_pZipBuf
Definition IccTagBasic.h:400

References icRealloc(), CIccTagZipUtf8Text::m_nBufSize, and CIccTagZipUtf8Text::m_pZipBuf.

Referenced by CIccTagZipUtf8Text::CIccTagZipUtf8Text(), CIccTagZipUtf8Text::operator=(), ParseXml(), CIccTagXmlZipXml::ParseXml(), and CIccTagZipUtf8Text::Read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BufferSize()

icUInt32Number CIccTagZipUtf8Text::BufferSize ( ) const
inlineinherited
396{ return m_nBufSize; }

References CIccTagZipUtf8Text::m_nBufSize.

Referenced by CIccTagZipUtf8Text::CIccTagZipUtf8Text(), and CIccTagZipUtf8Text::operator=().

+ Here is the caller graph for this function:

◆ Create()

CIccTag * CIccTag::Create ( icTagTypeSignature  sig)
staticinherited

Name: CIccTag::Create

Purpose: This is a static tag creator based upon tag signature type

Args: sig = tag type signature

Return: Pointer to Allocated tag

144{
145 return CIccTagCreator::CreateTag(sig);
146}
static CIccTag * CreateTag(icTagTypeSignature tagTypeSig)
Definition IccTagFactory.h:279

References CIccTagCreator::CreateTag().

Referenced by CIccDefaultEncProfileConverter::ConvertFromParams(), CIccTagStruct::LoadElem(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccMpeXmlTintArray::ParseXml(), CIccTagXmlArray::ParseXml(), CIccMpeTintArray::Read(), CIccTagLutAtoB::Read(), CIccTagLut8::Read(), CIccTagLut16::Read(), CIccTagLut8::SetColorSpaces(), CIccTagLut16::SetColorSpaces(), and CIccProfileDescText::SetType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Describe()

void CIccTagZipUtf8Text::Describe ( std::string &  sDescription,
int  nVerboseness 
)
virtualinherited

Name: CIccTagZipUtf8Text::Describe

Purpose: Dump data associated with the tag to a string

Args: sDescription - string to concatenate tag dump to

Reimplemented from CIccTag.

1205{
1206 std::string str;
1207#ifdef ICC_USE_ZLIB
1208 if (!GetText(str)) {
1209 sDescription += "Error! - Unable to decompress text data.\n";
1210 }
1211 else if (m_nBufSize > 4 && !memcmp(m_pZipBuf, icFaultyXmlZipData, 4)) {
1212 sDescription += "Warning! - Correcting for improperly encoded ";
1213 sDescription += CIccTagCreator::GetTagTypeSigName(GetType());
1214 sDescription += " tag.\n\n";
1215 }
1216
1217 sDescription += "ZLib Compressed String=\"";
1218 sDescription += str;
1219 sDescription += "\"\n";
1220#else
1221 char size[30];
1222 sprintf(size, "%d", m_nBufSize);
1223 sDescription += "BEGIN_COMPESSED_DATA[\"";
1224 sDescription += size;
1225 sDescription += "]\n";
1226 if (m_nBufSize) {
1228 sDescription += str;
1229 sDescription += "\n";
1230 }
1231 sDescription += "END_COMPRESSED_DATA\n";
1232#endif
1233}
ICCPROFLIB_API void icMemDump(std::string &sDump, void *pBuf, icUInt32Number nNum)
Definition IccUtil.cpp:951
static unsigned char icFaultyXmlZipData[4]
Definition IccTagBasic.cpp:1046
virtual bool GetText(std::string &str) const
Definition IccTagBasic.cpp:1245
virtual icTagTypeSignature GetType() const
Definition IccTagBasic.h:375
static const icChar * GetTagTypeSigName(icTagTypeSignature tagTypeSig)
Definition IccTagFactory.h:322

References icMemDump(), CIccTagZipUtf8Text::m_nBufSize, and CIccTagZipUtf8Text::m_pZipBuf.

+ Here is the call graph for this function:

◆ DetachIO()

virtual void CIccTag::DetachIO ( )
inlinevirtualinherited

Function: ReadAll() - Read All sub data for tag from file. Called by CIccProfile::ReadAll() to read all sub data for tag

Returns true if ReadAll is successful.

183{}

◆ GetBuffer()

icUChar * CIccTagZipUtf8Text::GetBuffer ( ) const
inlineinherited
395{ return m_pZipBuf; }

References CIccTagZipUtf8Text::m_pZipBuf.

Referenced by CIccTagZipUtf8Text::CIccTagZipUtf8Text(), and CIccTagZipUtf8Text::operator=().

+ Here is the caller graph for this function:

◆ GetClassName()

virtual const char * CIccTagXmlZipUtf8Text::GetClassName ( ) const
inlinevirtual

Reimplemented from CIccTagZipUtf8Text.

143{return "CIccTagXmlZipUtf8Text"; }

◆ GetExtClassName()

virtual const char * CIccTagXml::GetExtClassName ( ) const
inlinevirtualinherited

Implements IIccExtensionTag.

79{ return "CIccTagXml"; }

Referenced by icProfDescToXml(), and icXmlParseProfDesc().

+ Here is the caller graph for this function:

◆ GetExtDerivedClassName()

virtual const char * CIccTagXml::GetExtDerivedClassName ( ) const
inlinevirtualinherited

Implements IIccExtensionTag.

Reimplemented in CIccCurveXml.

80{ return ""; }

◆ GetExtension()

virtual IIccExtensionTag * CIccTagXmlZipUtf8Text::GetExtension ( )
inlinevirtual

Reimplemented from CIccTag.

145{return this; }

◆ GetTagArrayType()

virtual icArraySignature CIccTag::GetTagArrayType ( ) const
inlinevirtualinherited

Reimplemented in CIccTagArray.

133{ return icSigUndefinedArray; }
@ icSigUndefinedArray
Definition icProfileHeader.h:617

References icSigUndefinedArray.

Referenced by icGetTagArrayHandlerOfType(), and CIccProfileXml::ParseTag().

+ Here is the caller graph for this function:

◆ GetTagStructType()

virtual icStructSignature CIccTag::GetTagStructType ( ) const
inlinevirtualinherited

Reimplemented in CIccTagStruct.

132{ return icSigUndefinedStruct; }
@ icSigUndefinedStruct
Definition icProfileHeader.h:606

References icSigUndefinedStruct.

Referenced by icGetTagStructHandlerOfType(), CIccArrayColorantInfo::Validate(), and CIccArrayNamedColor::Validate().

+ Here is the caller graph for this function:

◆ GetText()

bool CIccTagZipUtf8Text::GetText ( std::string &  str) const
virtualinherited

Name: CIccTagZipUtf8Text::GetText

Purpose: Allows text data associated with the tag to be set.

Args: text - string to put uncompressed text into

1246{
1247#ifndef ICC_USE_ZLIB
1248 str="";
1249 return false;
1250#else
1251 int zstat;
1252 z_stream zstr;
1253 memset(&zstr, 0, sizeof(zstr));
1254 unsigned char buf[32767] = { 0 };
1255
1256 zstat = inflateInit(&zstr);
1257
1258 if (zstat != Z_OK) {
1259 return false;
1260 }
1261
1262 zstat = inflateReset(&zstr);
1263
1264 if (zstat != Z_OK) {
1265 return false;
1266 }
1267
1268 if (m_nBufSize > 4 && !memcmp(m_pZipBuf, icFaultyXmlZipData, 4)) {
1269 //xrite creates invalid zipXMLType tags
1270 zstr.next_in = m_pZipBuf+4;
1271 zstr.avail_in = m_nBufSize-4;
1272 }
1273 else {
1274 zstr.next_in = m_pZipBuf;
1275 zstr.avail_in = m_nBufSize;
1276 }
1277
1278 do {
1279 unsigned int i, n;
1280
1281 zstr.next_out = buf;
1282 zstr.avail_out = sizeof(buf);
1283
1284 zstat = inflate(&zstr, Z_SYNC_FLUSH);
1285
1286 if (zstat != Z_OK && zstat != Z_STREAM_END) {
1287 inflateEnd(&zstr);
1288 return false;
1289 }
1290
1291 n = sizeof(buf) - zstr.avail_out;
1292
1293 for (i = 0; i < n; i++) {
1294 str += buf[i];
1295 }
1296 } while (zstat != Z_STREAM_END);
1297
1298 inflateEnd(&zstr);
1299
1300 return true;
1301#endif
1302}

Referenced by icGetTagText().

+ Here is the caller graph for this function:

◆ GetType()

virtual icTagTypeSignature CIccTagZipUtf8Text::GetType ( ) const
inlinevirtualinherited

Function: GetType()

Purpose: Get Tag Type. Each derived tag will implement it's own GetType() function.

Reimplemented from CIccTag.

Reimplemented in CIccTagZipXml.

375{ return icSigZipUtf8TextType; }
@ icSigZipUtf8TextType
Definition icProfileHeader.h:578

References icSigZipUtf8TextType.

Referenced by CIccTagZipUtf8Text::Write().

+ Here is the caller graph for this function:

◆ IsArrayType()

virtual bool CIccTag::IsArrayType ( )
inlinevirtualinherited

Reimplemented in CIccTagXYZ, CIccTagChromaticity, CIccTagSparseMatrixArray, CIccTagFixedNum< T, Tsig >, CIccTagNum< T, Tsig >, CIccTagFloatNum< T, Tsig >, and CIccTagData.

135{ return false; }

Referenced by MyTagDialog::MyTagDialog(), and DumpTag().

+ Here is the caller graph for this function:

◆ IsMBBType()

virtual bool CIccTag::IsMBBType ( )
inlinevirtualinherited

Reimplemented in CIccMBB.

136{ return false; } //If true then CIccTag can be cast as an CIccMBB

Referenced by CIccProfileXml::ParseTag().

+ Here is the caller graph for this function:

◆ IsNumArrayType()

virtual bool CIccTag::IsNumArrayType ( ) const
inlinevirtualinherited

Reimplemented in CIccTagSparseMatrixArray, CIccTagFixedNum< T, Tsig >, CIccTagNum< T, Tsig >, and CIccTagFloatNum< T, Tsig >.

137{ return false;} //If true then CIccTag can be cast as a CIccTagNumArray

Referenced by CIccArrayNamedColor::FindDeviceColor(), CIccArrayNamedColor::FindPcsColor(), CIccArrayNamedColor::FindSpectralColor(), CIccTagStruct::GetElemNumberValue(), CIccStructNamedColor::GetNumArray(), CIccMpeXmlTintArray::ParseXml(), and CIccMpeTintArray::Read().

+ Here is the caller graph for this function:

◆ IsSupported()

virtual bool CIccTag::IsSupported ( )
inlinevirtualinherited

Function: IsSupported(size, pIO) - Check if tag fully supported for apply purposes. By Default inherited classes are supported. Unknown tag types are not supported.

Returns true if tag type is supported.

Reimplemented in CIccTagUnknown, CIccTagEmbeddedProfile, and CIccTagMultiProcessElement.

153{ return true; }

◆ NewCopy()

virtual CIccTag * CIccTagXmlZipUtf8Text::NewCopy ( ) const
inlinevirtual

Function: NewCopy(sDescription) Each derived tag will implement it's own NewCopy() function.

Parameter(s): none

Returns a new CIccTag object that is a copy of this object.

Reimplemented from CIccTagZipUtf8Text.

141{return new CIccTagXmlZipUtf8Text(*this);}
CIccTagXmlZipUtf8Text()
Definition IccTagXml.h:137

References CIccTagXmlZipUtf8Text().

+ Here is the call graph for this function:

◆ ParseXml()

bool CIccTagXmlZipUtf8Text::ParseXml ( xmlNode *  pNode,
std::string &  parseStr 
)
virtual

Implements CIccTagXml.

276{
277 while (pNode) {
278 if (pNode->type==XML_ELEMENT_NODE) {
279 if (!icXmlStrCmp(pNode->name, "HexCompressedData") && pNode->children && pNode->children->content) {
280 CIccUInt8Array buf;
281 if (!buf.SetSize(icXmlGetHexDataSize((const icChar*)pNode->children->content) ||
282 icXmlGetHexData(buf.GetBuf(), (const icChar*)pNode->children->content, buf.GetSize())!=buf.GetSize()))
283 return false;
284
285 AllocBuffer(buf.GetSize());
286 if (m_nBufSize && m_pZipBuf) {
287 memcpy(m_pZipBuf, buf.GetBuf(), m_nBufSize);
288 }
289 return true;
290 }
291 }
292 pNode = pNode->next;
293 }
294
295 std::string str = icXmlParseTextString(pNode, parseStr, false);
296
297 return SetText(str.c_str());
298}
char icChar
Definition IccDefs.h:110
static std::string icXmlParseTextString(xmlNode *pNode, std::string &parseStr, bool bConvert=true)
Definition IccTagXml.cpp:180
icUInt32Number icXmlGetHexDataSize(const char *szText)
Definition IccUtilXml.cpp:630
#define icXmlStrCmp(x, y)
Definition IccUtilXml.h:134
icUInt32Number icXmlGetHexData(void *pBuf, const char *szText, icUInt32Number nBufSize)
Definition IccUtilXml.cpp:609
bool SetText(const icUChar16 *szText)
Definition IccTagBasic.cpp:1390
icUChar * AllocBuffer(icUInt32Number nSize)
Definition IccTagBasic.cpp:1420
Definition IccUtilXml.h:145
bool SetSize(icUInt32Number nSize)
Definition IccUtilXml.cpp:1102
T * GetBuf()
Definition IccUtilXml.h:165
icUInt32Number GetSize()
Definition IccUtilXml.h:166

References CIccTagZipUtf8Text::AllocBuffer(), CIccXmlArrayType< T, Tsig >::GetBuf(), CIccXmlArrayType< T, Tsig >::GetSize(), icXmlGetHexData(), icXmlGetHexDataSize(), icXmlParseTextString(), CIccTagZipUtf8Text::m_nBufSize, CIccTagZipUtf8Text::m_pZipBuf, CIccXmlArrayType< T, Tsig >::SetSize(), and CIccTagZipUtf8Text::SetText().

+ Here is the call graph for this function:

◆ Read() [1/2]

bool CIccTagZipUtf8Text::Read ( icUInt32Number  size,
CIccIO pIO 
)
virtualinherited

Name: CIccTagZipUtf8Text::Read

Purpose: Read in a text type tag into a data block

Args: size - # of bytes in tag, pIO - IO object to read tag from

Return: true = successful, false = failure

Reimplemented from CIccTag.

1134{
1136
1137 if (size<sizeof(icTagTypeSignature) || !pIO) {
1138 AllocBuffer(0);
1139 return false;
1140 }
1141
1142 if (!pIO->Read32(&sig))
1143 return false;
1144
1145 if (!pIO->Read32(&m_nReserved))
1146 return false;
1147
1148 icUInt32Number nSize = size - sizeof(icTagTypeSignature) - sizeof(icUInt32Number);
1149
1150 icUChar *pBuf = AllocBuffer(nSize);
1151
1152 if (m_nBufSize && pBuf) {
1153 if (pIO->Read8(pBuf, m_nBufSize) != (icInt32Number)m_nBufSize) {
1154 return false;
1155 }
1156 }
1157
1158 return true;
1159}
long icInt32Number
Definition icProfileHeader.h:291
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icTagTypeSignature
Definition icProfileHeader.h:526
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:104
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
icUInt32Number m_nReserved
Definition IccTagBasic.h:235

References CIccTagZipUtf8Text::AllocBuffer(), CIccTagZipUtf8Text::m_nBufSize, CIccTag::m_nReserved, CIccIO::Read32(), and CIccIO::Read8().

+ Here is the call graph for this function:

◆ Read() [2/2]

virtual bool CIccTag::Read ( icUInt32Number  size,
CIccIO pIO,
CIccProfile pProfile 
)
inlinevirtualinherited

Function: Read(size, pIO) - Read tag from file. Each derived tag will implement it's own Read() function.

Parameter(s): size - number of bytes in tag including the type signature. pIO - IO object used to read in tag. The IO object should already be initialized to point to the begining of the tag.

Returns true if Read is successful.

Reimplemented in CIccTagEmbeddedProfile.

197{ return Read(size, pIO); }
virtual bool Read(icUInt32Number size, CIccIO *pIO)
Definition IccTagBasic.h:167

References CIccTag::Read().

+ Here is the call graph for this function:

◆ ReadAll()

virtual bool CIccTag::ReadAll ( )
inlinevirtualinherited

Function: ReadAll() - Read All sub data for tag from file. Called by CIccProfile::ReadAll() to read all sub data for tag

Returns true if ReadAll is successful.

Reimplemented in CIccTagEmbeddedProfile.

175{ return true; }

◆ SetText() [1/3]

bool CIccTagZipUtf8Text::SetText ( const icChar szText)
inlineinherited
384{ return SetText((icUChar*)szText); }

References CIccTagZipUtf8Text::SetText().

Referenced by ParseXml(), CIccTagXmlZipXml::ParseXml(), and CIccTagZipUtf8Text::SetText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetText() [2/3]

bool CIccTagZipUtf8Text::SetText ( const icUChar szText)
virtualinherited

Name: CIccTagZipUtf8Text::SetText

Purpose: Allows text data associated with the tag to be set.

Args: szText - zero terminated string to put in tag

1316{
1317#ifndef ICC_USE_ZLIB
1318 return false;
1319#else
1320 if (!szText)
1321 szText = (const icUChar*)"";
1322
1323 icUInt32Number nSize = (icUInt32Number)strlen((const char*)szText) + 1;
1324 icUtf8Vector compress;
1325 int i;
1326
1327 int zstat;
1328 z_stream zstr;
1329 unsigned char buf[32767];
1330 memset(&zstr, 0, sizeof(zstr));
1331
1332 zstat = deflateInit(&zstr, Z_DEFAULT_COMPRESSION);
1333
1334 if (zstat != Z_OK) {
1335 return false;
1336 }
1337
1338 zstat = deflateReset(&zstr);
1339 zstr.next_in = (Bytef*)szText;
1340 zstr.avail_in = nSize;
1341
1342 if (zstat != Z_OK) {
1343 return false;
1344 }
1345
1346
1347 do {
1348 int n;
1349 zstr.next_out = buf;
1350 zstr.avail_out = sizeof(buf);
1351
1352 zstat = deflate(&zstr, Z_FINISH);
1353
1354 if (zstat != Z_OK && zstat != Z_STREAM_END) {
1355 deflateEnd(&zstr);
1356 return false;
1357 }
1358
1359 n = sizeof(buf) - zstr.avail_out;
1360
1361 for (i = 0; i < n; i++) {
1362 compress.push_back(buf[i]);
1363 }
1364 } while (zstat != Z_STREAM_END);
1365
1366 deflateEnd(&zstr);
1367
1368 icUChar *pBuf = AllocBuffer((icUInt32Number)compress.size());
1369
1370 if (pBuf) {
1371 for (i = 0; i < (int)m_nBufSize; i++) {
1372 pBuf[i] = compress[i];
1373}
1374 }
1375
1376 return true;
1377#endif
1378}

Referenced by CIccTagZipUtf8Text::SetText(), and CIccTagZipUtf8Text::SetText().

+ Here is the caller graph for this function:

◆ SetText() [3/3]

bool CIccTagZipUtf8Text::SetText ( const icUChar16 szText)
inherited

Name: CIccTagZipUtf8Text::SetText

Purpose: Allows text data associated with the tag to be set.

Args: szText - zero terminated string to put in tag

1391{
1392 if (!szText) {
1393 return SetText("");
1394 }
1395
1396 icUtf8Vector text;
1397 icUInt32Number len;
1398 for (len=0; szText[len]; len++);
1399
1400 icConvertUTF16toUTF8(szText, &szText[len], text, lenientConversion);
1401
1402 return SetText((const icUChar*)&text[0]);
1403}
@ lenientConversion
Definition IccConvertUTF.h:127
icUtfConversionResult icConvertUTF16toUTF8(const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, icUtfConversionFlags flags)
Definition IccConvertUTF.cpp:299

References icConvertUTF16toUTF8(), lenientConversion, CIccTagZipUtf8Text::SetText(), and CIccTagZipUtf8Text::SetText().

+ Here is the call graph for this function:

◆ ToXml()

bool CIccTagXmlZipUtf8Text::ToXml ( std::string &  xml,
std::string  blanks = "" 
)
virtual

Implements CIccTagXml.

157{
158 xml += blanks + "<HexCompressedData>\n";
159 icXmlDumpHexData(xml, blanks+" ", m_pZipBuf, m_nBufSize);
160 xml += blanks + "</HexCompressedData>\n";
161
162 return true;
163}
icUInt32Number icXmlDumpHexData(std::string &xml, std::string blanks, void *pBuf, icUInt32Number nBufSize)
Definition IccUtilXml.cpp:648

References icXmlDumpHexData(), CIccTagZipUtf8Text::m_nBufSize, and CIccTagZipUtf8Text::m_pZipBuf.

+ Here is the call graph for this function:

◆ Validate()

icValidateStatus CIccTagZipUtf8Text::Validate ( std::string  sigPath,
std::string &  sReport,
const CIccProfile pProfile = NULL 
) const
virtualinherited

Name: CIccTagZipUtf8Text::Validate

Purpose: Check tag data validity.

Args: sig = signature of tag being validated, sReport = String to add report information to

Return: icValidateStatusOK if valid, or other error status.

Reimplemented from CIccTag.

1461{
1462 icValidateStatus rv = CIccTag::Validate(sigPath, sReport, pProfile);
1463
1464 CIccInfo Info;
1465 std::string sSigPathName = Info.GetSigPathName(sigPath);
1466
1467 if (!m_nBufSize) {
1468 sReport += icMsgValidateWarning;
1469 sReport += sSigPathName;
1470 sReport += " - Empty Tag.\n";
1472 }
1473 else {
1474#ifdef ICC_USE_ZLIB
1475 std::string sText;
1476 if (!GetText(sText)) {
1477 sReport += icMsgValidateNonCompliant;
1478 sReport += sSigPathName;
1479 sReport += " - Unable to get text for tag (possibly corrupt compressed data).\n";
1481 }
1482 else if (m_nBufSize > 4 && !memcmp(m_pZipBuf, icFaultyXmlZipData, 4)) {
1483 sReport += icMsgValidateNonCompliant;
1484 sReport += sSigPathName;
1485 sReport += " - Improperly encoded ";
1487 sReport += " tag.\n";
1489 }
1490#else
1491 sReport += icMsgValidateWarning;
1492 sReport += sSigPathName;
1493 sReport += " - Zip compression not supported by CMM - unable to validate text compression.\n";
1495#endif
1496 }
1497
1498 return rv;
1499}
icValidateStatus
Definition IccDefs.h:119
@ icValidateWarning
Definition IccDefs.h:121
@ icValidateNonCompliant
Definition IccDefs.h:122
ICCPROFLIB_API const char * icMsgValidateWarning
Definition IccUtil.cpp:90
ICCPROFLIB_API icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Definition IccUtil.cpp:244
ICCPROFLIB_API const char * icMsgValidateNonCompliant
Definition IccUtil.cpp:91
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
Definition IccTagBasic.cpp:164

References CIccInfo::GetSigPathName(), icMaxStatus(), icMsgValidateWarning, icValidateWarning, CIccTagZipUtf8Text::m_nBufSize, and CIccTag::Validate().

+ Here is the call graph for this function:

◆ Write()

bool CIccTagZipUtf8Text::Write ( CIccIO pIO)
virtualinherited

Name: CIccTagZipUtf8Text::Write

Purpose: Write a text type tag to a file

Args: pIO - The IO object to write tag to.

Return: true = succesful, false = failure

Reimplemented from CIccTag.

1175{
1177
1178 if (!pIO)
1179 return false;
1180
1181 if (!pIO->Write32(&sig))
1182 return false;
1183
1184 if (!pIO->Write32(&m_nReserved))
1185 return false;
1186
1187 if (m_pZipBuf) {
1189 return false;
1190 }
1191 return true;
1192}
virtual icInt32Number Write8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:105
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152

References CIccTagZipUtf8Text::GetType(), CIccTagZipUtf8Text::m_nBufSize, CIccTag::m_nReserved, CIccTagZipUtf8Text::m_pZipBuf, CIccIO::Write32(), and CIccIO::Write8().

+ Here is the call graph for this function:

Field Documentation

◆ m_nBufSize

◆ m_nReserved

icUInt32Number CIccTag::m_nReserved
inherited

Referenced by CIccTag::CIccTag(), CIccTagMultiProcessElement::CIccTagMultiProcessElement(), CIccTagMultiProcessElement::CIccTagMultiProcessElement(), CIccTagMultiProcessElement::operator=(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccMpeXmlTintArray::ParseXml(), CIccTagXmlArray::ParseXml(), CIccTagText::Read(), CIccTagUtf8Text::Read(), CIccTagZipUtf8Text::Read(), CIccTagUtf16Text::Read(), CIccTagTextDescription::Read(), CIccTagSignature::Read(), CIccTagNamedColor2::Read(), CIccTagXYZ::Read(), CIccTagChromaticity::Read(), CIccTagCicp::Read(), CIccTagSparseMatrixArray::Read(), CIccTagFixedNum< T, Tsig >::Read(), CIccTagNum< T, Tsig >::Read(), CIccTagFloatNum< T, Tsig >::Read(), CIccTagMeasurement::Read(), CIccTagMultiLocalizedUnicode::Read(), CIccTagData::Read(), CIccTagDateTime::Read(), CIccTagColorantOrder::Read(), CIccTagColorantTable::Read(), CIccTagViewingConditions::Read(), CIccTagProfileSeqDesc::Read(), CIccTagResponseCurveSet16::Read(), CIccTagSpectralDataInfo::Read(), CIccTagSpectralViewingConditions::Read(), CIccTagEmbeddedHeightImage::Read(), CIccTagEmbeddedNormalImage::Read(), CIccTagStruct::Read(), CIccTagArray::Read(), CIccTagDict::Read(), CIccTagCurve::Read(), CIccTagParametricCurve::Read(), CIccTagLutAtoB::Read(), CIccTagLut8::Read(), CIccTagLut16::Read(), CIccTagGamutBoundaryDesc::Read(), CIccTagMultiProcessElement::Read(), CIccTagProfileSequenceId::Read(), CIccTagEmbeddedProfile::Read(), CIccTag::Validate(), CIccTagText::Write(), CIccTagUtf8Text::Write(), CIccTagZipUtf8Text::Write(), CIccTagUtf16Text::Write(), CIccTagTextDescription::Write(), CIccTagSignature::Write(), CIccTagNamedColor2::Write(), CIccTagXYZ::Write(), CIccTagChromaticity::Write(), CIccTagCicp::Write(), CIccTagSparseMatrixArray::Write(), CIccTagFixedNum< T, Tsig >::Write(), CIccTagNum< T, Tsig >::Write(), CIccTagFloatNum< T, Tsig >::Write(), CIccTagMeasurement::Write(), CIccTagMultiLocalizedUnicode::Write(), CIccTagData::Write(), CIccTagDateTime::Write(), CIccTagColorantOrder::Write(), CIccTagColorantTable::Write(), CIccTagViewingConditions::Write(), CIccTagProfileSeqDesc::Write(), CIccTagResponseCurveSet16::Write(), CIccTagSpectralDataInfo::Write(), CIccTagSpectralViewingConditions::Write(), CIccTagEmbeddedHeightImage::Write(), CIccTagEmbeddedNormalImage::Write(), CIccTagStruct::Write(), CIccTagArray::Write(), CIccTagDict::Write(), CIccTagEmbeddedProfile::Write(), CIccTagCurve::Write(), CIccTagParametricCurve::Write(), CIccTagLutAtoB::Write(), CIccTagLut8::Write(), CIccTagLut16::Write(), CIccTagGamutBoundaryDesc::Write(), CIccTagMultiProcessElement::Write(), and CIccTagProfileSequenceId::Write().

◆ m_pZipBuf


The documentation for this class was generated from the following files: