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

#include <IccTagXml.h>

+ Inheritance diagram for CIccTagXmlMultiLocalizedUnicode:
+ Collaboration diagram for CIccTagXmlMultiLocalizedUnicode:

Public Member Functions

 CIccTagXmlMultiLocalizedUnicode ()
 
 CIccTagXmlMultiLocalizedUnicode (const CIccTagXmlMultiLocalizedUnicode &ITMLU)
 
virtual ~CIccTagXmlMultiLocalizedUnicode ()
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
virtual void DetachIO ()
 
CIccLocalizedUnicodeFind (icLanguageCode nLanguageCode=icLanguageCodeEnglish, icCountryCode nRegionCode=icCountryCodeUSA)
 
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 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 ()
 
void SetText (const icChar *szText, icLanguageCode nLanguageCode=icLanguageCodeEnglish, icCountryCode nRegionCode=icCountryCodeUSA)
 
void SetText (const icUInt16Number *sszUnicode16Text, icLanguageCode nLanguageCode=icLanguageCodeEnglish, icCountryCode nRegionCode=icCountryCodeUSA)
 
void SetText (const icUInt32Number *sszUnicode32Text, icLanguageCode nLanguageCode=icLanguageCodeEnglish, icCountryCode nRegionCode=icCountryCodeUSA)
 
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
 
CIccMultiLocalizedUnicodem_Strings
 

Detailed Description

Constructor & Destructor Documentation

◆ CIccTagXmlMultiLocalizedUnicode() [1/2]

CIccTagXmlMultiLocalizedUnicode::CIccTagXmlMultiLocalizedUnicode ( )
inline
CIccTagMultiLocalizedUnicode()
Definition IccTagBasic.cpp:7374

References CIccTagMultiLocalizedUnicode::CIccTagMultiLocalizedUnicode().

+ Here is the call graph for this function:

◆ CIccTagXmlMultiLocalizedUnicode() [2/2]

CIccTagXmlMultiLocalizedUnicode::CIccTagXmlMultiLocalizedUnicode ( const CIccTagXmlMultiLocalizedUnicode ITMLU)
inline

References CIccTagMultiLocalizedUnicode::CIccTagMultiLocalizedUnicode().

Referenced by NewCopy().

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

◆ ~CIccTagXmlMultiLocalizedUnicode()

virtual CIccTagXmlMultiLocalizedUnicode::~CIccTagXmlMultiLocalizedUnicode ( )
inlinevirtual
358{}

Member Function Documentation

◆ 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 CIccTagMultiLocalizedUnicode::Describe ( std::string &  sDescription,
int  nVerboseness 
)
virtualinherited

Name: CIccTagMultiLocalizedUnicode::Describe

Purpose: Dump data associated with the tag to a string

Args: sDescription - string to concatenate tag dump to

Reimplemented from CIccTag.

7599{
7600 char szBuf[128];
7601 std::string utf8;
7602 int nSize = 127;
7603 CIccMultiLocalizedUnicode::iterator i;
7604
7605 for (i=m_Strings->begin(); i!=m_Strings->end(); i++) {
7606 if (i!=m_Strings->begin())
7607 sDescription += "\n";
7608
7609 // Bad ICCs can have unprintables...
7610 sDescription += "Language = ";
7611 if (isprint(i->m_nLanguageCode >> 8) && isprint(i->m_nLanguageCode & 0x00FF)) {
7612 sprintf(szBuf, "'%c%c'", i->m_nLanguageCode >> 8, i->m_nLanguageCode & 0x00FF);
7613 }
7614 else {
7615 sprintf(szBuf, "'\?\?' (0x%04X)", i->m_nLanguageCode);
7616 }
7617 sDescription += szBuf;
7618
7619 if (i->m_nCountryCode) {
7620 // Region Codes are optional according to ISO
7621 sDescription += ", Region = ";
7622 if (isprint(i->m_nCountryCode >> 8) && isprint(i->m_nCountryCode & 0x00FF)) {
7623 sprintf(szBuf, "'%c%c'", i->m_nCountryCode>>8, i->m_nCountryCode & 0x00FF);
7624 }
7625 else {
7626 sprintf(szBuf, "'\?\?' (0x%04X)", i->m_nCountryCode);
7627 }
7628 sDescription += szBuf;
7629 }
7630 sDescription += "\n";
7631
7632 i->GetText(utf8);
7633 sDescription += "\"";
7634 sDescription += utf8;
7635 sDescription += "\"\n";
7636 }
7637}
CIccMultiLocalizedUnicode * m_Strings
Definition IccTagBasic.h:1260

References CIccLocalizedUnicode::GetText(), CIccLocalizedUnicode::m_nCountryCode, CIccLocalizedUnicode::m_nLanguageCode, and CIccTagMultiLocalizedUnicode::m_Strings.

Referenced by CIccDictEntry::Describe(), and CIccProfileIdDesc::Describe().

+ Here is the call graph for this function:
+ Here is the caller 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{}

◆ Find()

CIccLocalizedUnicode * CIccTagMultiLocalizedUnicode::Find ( icLanguageCode  nLanguageCode = icLanguageCodeEnglish,
icCountryCode  nRegionCode = icCountryCodeUSA 
)
inherited

Name: refIccMAX::CIccTagMultiLocalizedUnicode::Find

Purpose:

Args: nLanguageCode nRegionCode

Return: Pointer to CIccLocalizedUnicode object associated with the nLanguageCode and nRegionCode or NULL if not found

7694{
7695 CIccMultiLocalizedUnicode::iterator i;
7696
7697 for (i=m_Strings->begin(); i!=m_Strings->end(); i++) {
7698 if (i->m_nLanguageCode == nLanguageCode &&
7699 i->m_nCountryCode == nRegionCode) {
7700 return &(*i);
7701 }
7702 }
7703
7704 return NULL;
7705}

References CIccLocalizedUnicode::m_nCountryCode, CIccLocalizedUnicode::m_nLanguageCode, and CIccTagMultiLocalizedUnicode::m_Strings.

Referenced by icGetTagText(), CIccTagMultiLocalizedUnicode::SetText(), CIccTagMultiLocalizedUnicode::SetText(), and CIccTagMultiLocalizedUnicode::SetText().

+ Here is the caller graph for this function:

◆ GetClassName()

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

Reimplemented from CIccTagMultiLocalizedUnicode.

362{return "CIccTagXmlMultiLocalizedUnicode"; }

◆ 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 * CIccTagXmlMultiLocalizedUnicode::GetExtension ( )
inlinevirtual

Reimplemented from CIccTag.

364{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:

◆ GetType()

virtual icTagTypeSignature CIccTagMultiLocalizedUnicode::GetType ( ) const
inlinevirtualinherited

Function: GetType()

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

Reimplemented from CIccTag.

@ icSigMultiLocalizedUnicodeType
Definition icProfileHeader.h:549

References icSigMultiLocalizedUnicodeType.

Referenced by CIccTagMultiLocalizedUnicode::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 * CIccTagXmlMultiLocalizedUnicode::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 CIccTagMultiLocalizedUnicode.

360{return new CIccTagXmlMultiLocalizedUnicode(*this);}
CIccTagXmlMultiLocalizedUnicode()
Definition IccTagXml.h:356

References CIccTagXmlMultiLocalizedUnicode().

+ Here is the call graph for this function:

◆ ParseXml()

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

Implements CIccTagXml.

1682{
1683 xmlAttr *langCode;
1684 int n = 0;
1685
1686 for (pNode = icXmlFindNode(pNode, "LocalizedText"); pNode; pNode = icXmlFindNode(pNode->next, "LocalizedText")) {
1687 if ((langCode = icXmlFindAttr(pNode, "LanguageCountry"))) {
1688 xmlNode *pText;
1689
1690 for (pText = pNode->children; pText; pText = pText->next) {
1691 if (pText->type == XML_TEXT_NODE || pText->type == XML_CDATA_SECTION_NODE)
1692 break;
1693 }
1694
1695 if (pText) {
1697 CIccUTF16String str((const char*)pText->content);
1698
1699 SetText(str.c_str(), (icLanguageCode)(lc>>16), (icCountryCode)(lc & 0xffff));
1700 n++;
1701 }
1702 else {
1703 SetText("");
1704 n++;
1705 }
1706 }
1707 }
1708 return n>0; //We succeed if we parsed at least one string
1709}
icUInt16Number icCountryCode
Definition icProfileHeader.h:1273
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icUInt16Number icLanguageCode
Definition icProfileHeader.h:1248
ICCPROFLIB_API icUInt32Number icGetSigVal(const icChar *pBuf)
Definition IccUtil.cpp:1258
xmlAttr * icXmlFindAttr(xmlNode *pNode, const char *szAttrName)
Definition IccUtilXml.cpp:669
xmlNode * icXmlFindNode(xmlNode *pNode, const char *szNodeName)
Definition IccUtilXml.cpp:687
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault="")
Definition IccUtilXml.cpp:572
void SetText(const icChar *szText, icLanguageCode nLanguageCode=icLanguageCodeEnglish, icCountryCode nRegionCode=icCountryCodeUSA)
Definition IccTagBasic.cpp:7719
Definition IccUtilXml.h:75

References CIccUTF16String::CIccUTF16String(), CIccUTF16String::c_str(), icGetSigVal(), icXmlAttrValue(), icXmlFindAttr(), icXmlFindNode(), CIccTagMultiLocalizedUnicode::SetText(), and CIccTagMultiLocalizedUnicode::SetText().

+ Here is the call graph for this function:

◆ Read() [1/2]

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

Name: CIccTagMultiLocalizedUnicode::Read

Purpose: Read in the tag contents into a data block

Since MultiLocalizedUnicode tags can be embedded in other tags this function ensures that the current read pointer will be set to the position just after the last name record.

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

Return: true = successful, false = failure

Reimplemented from CIccTag.

7452{
7454 icUInt32Number nNumRec, nRecSize;
7455 icLanguageCode nLanguageCode;
7456 icCountryCode nRegionCode;
7457 icUInt32Number nLength, nOffset, nNumChar;
7458
7459 if (!m_Strings->empty())
7460 m_Strings->clear();
7461
7462 if (sizeof(icTagTypeSignature) +
7463 sizeof(icUInt32Number)*3 > size)
7464 return false;
7465
7466 if (!pIO) {
7467 return false;
7468 }
7469
7470 icUInt32Number nTagPos = pIO->Tell();
7471
7472 if (!pIO->Read32(&sig) ||
7473 !pIO->Read32(&m_nReserved) ||
7474 !pIO->Read32(&nNumRec) ||
7475 !pIO->Read32(&nRecSize))
7476 return false;
7477
7478
7479 if (nRecSize!=12) { //Recognized version name records are 12 bytes each
7480 return false;
7481 }
7482
7483 icUInt32Number i;
7484 CIccLocalizedUnicode Unicode;
7485 icUInt32Number nLastPos = 0;
7486
7487 for (i=0; i<nNumRec; i++) {
7488 if (4*sizeof(icUInt32Number) + (i+1)*12 > size)
7489 return false;
7490
7491 pIO->Seek(nTagPos+4*sizeof(icUInt32Number) + i*12, icSeekSet);
7492
7493 if (!pIO->Read16(&nLanguageCode) ||
7494 !pIO->Read16(&nRegionCode) ||
7495 !pIO->Read32(&nLength) ||
7496 !pIO->Read32(&nOffset))
7497 return false;
7498
7499 if (nOffset+nLength > size)
7500 return false;
7501
7502 //Find out position of the end of last named record
7503 if (nOffset+nLength > nLastPos)
7504 nLastPos = nOffset + nLength;
7505
7506 nNumChar = nLength / sizeof(icUInt16Number);
7507
7508 if (!Unicode.SetSize(nNumChar))
7509 return false;
7510
7511 Unicode.m_nLanguageCode = nLanguageCode;
7512 Unicode.m_nCountryCode = nRegionCode;
7513
7514 pIO->Seek(nTagPos+nOffset, icSeekSet);
7515
7516 if (pIO->Read16(Unicode.GetBuf(), nNumChar) != (icInt32Number)nNumChar)
7517 return false;
7518
7519 m_Strings->push_back(Unicode);
7520 }
7521
7522 //Now seek past the last named record
7523 if (nLastPos > 0)
7524 pIO->Seek(nTagPos+nLastPos, icSeekSet);
7525
7526 return true;
7527}
unsigned short icUInt16Number
Definition icProfileHeader.h:256
long icInt32Number
Definition icProfileHeader.h:291
icTagTypeSignature
Definition icProfileHeader.h:526
@ icSeekSet
Definition IccIO.h:83
icInt32Number Read16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:114
virtual icInt32Number Tell()
Definition IccIO.h:133
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
Definition IccIO.h:132
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
icUInt32Number m_nReserved
Definition IccTagBasic.h:235
Definition IccTagBasic.h:1169
icLanguageCode m_nLanguageCode
Definition IccTagBasic.h:1201
icUInt16Number * GetBuf() const
Definition IccTagBasic.h:1177
bool SetSize(icUInt32Number)
Definition IccTagBasic.cpp:7141
icCountryCode m_nCountryCode
Definition IccTagBasic.h:1202

References CIccLocalizedUnicode::GetBuf(), icSeekSet, CIccLocalizedUnicode::m_nCountryCode, CIccLocalizedUnicode::m_nLanguageCode, CIccTag::m_nReserved, CIccTagMultiLocalizedUnicode::m_Strings, CIccIO::Read16(), CIccIO::Read32(), CIccIO::Seek(), CIccLocalizedUnicode::SetSize(), and CIccIO::Tell().

Referenced by CIccTagDict::Read(), and CIccProfileIdDesc::Read().

+ Here is the call graph for this function:
+ Here is the caller 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]

void CIccTagMultiLocalizedUnicode::SetText ( const icChar szText,
icLanguageCode  nLanguageCode = icLanguageCodeEnglish,
icCountryCode  nRegionCode = icCountryCodeUSA 
)
inherited

Name: refIccMAX::CIccTagMultiLocalizedUnicode::SetText

Purpose:

Args: sszUnicodeText nLanguageCode RegionCode

7722{
7723 CIccLocalizedUnicode *pText = Find(nLanguageCode, nRegionCode);
7724
7725 if (!pText) {
7726 CIccLocalizedUnicode newText;
7727 newText.SetText(szText, nLanguageCode, nRegionCode);
7728 m_Strings->push_back(newText);
7729 }
7730 else {
7731 pText->SetText(szText, nLanguageCode, nRegionCode);
7732 }
7733}
bool SetText(const icChar *szText, icLanguageCode nLanguageCode=icLanguageCodeEnglish, icCountryCode nRegionCode=icCountryCodeUSA)
Definition IccTagBasic.cpp:7172
CIccLocalizedUnicode * Find(icLanguageCode nLanguageCode=icLanguageCodeEnglish, icCountryCode nRegionCode=icCountryCodeUSA)
Definition IccTagBasic.cpp:7692

References CIccTagMultiLocalizedUnicode::Find(), CIccTagMultiLocalizedUnicode::m_Strings, and CIccLocalizedUnicode::SetText().

Referenced by CIccProfileIdDesc::CIccProfileIdDesc(), CDevLinkWriter::begin(), main(), ParseXml(), CIccTagXmlProfileSequenceId::ParseXml(), and CIccTagXmlDict::ParseXml().

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

◆ SetText() [2/3]

void CIccTagMultiLocalizedUnicode::SetText ( const icUInt16Number sszUnicode16Text,
icLanguageCode  nLanguageCode = icLanguageCodeEnglish,
icCountryCode  nRegionCode = icCountryCodeUSA 
)
inherited

Name: refIccMAX::CIccTagMultiLocalizedUnicode::SetText

Purpose:

Args: sszUnicodeText nLanguageCode RegionCode

7751{
7752 CIccLocalizedUnicode *pText = Find(nLanguageCode, nRegionCode);
7753
7754 if (!pText) {
7755 CIccLocalizedUnicode newText;
7756 newText.SetText(sszUnicode16Text, nLanguageCode, nRegionCode);
7757 m_Strings->push_back(newText);
7758 }
7759 else {
7760 pText->SetText(sszUnicode16Text, nLanguageCode, nRegionCode);
7761 }
7762}

References CIccTagMultiLocalizedUnicode::Find(), CIccTagMultiLocalizedUnicode::m_Strings, and CIccLocalizedUnicode::SetText().

Referenced by ParseXml(), CIccTagXmlProfileSequenceId::ParseXml(), and CIccTagXmlDict::ParseXml().

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

◆ SetText() [3/3]

void CIccTagMultiLocalizedUnicode::SetText ( const icUInt32Number sszUnicode32Text,
icLanguageCode  nLanguageCode = icLanguageCodeEnglish,
icCountryCode  nRegionCode = icCountryCodeUSA 
)
inherited

Name: refIccMAX::CIccTagMultiLocalizedUnicode::SetText

Purpose:

Args: sszUnicodeText nLanguageCode RegionCode

7779{
7780 CIccLocalizedUnicode *pText = Find(nLanguageCode, nRegionCode);
7781
7782 if (!pText) {
7783 CIccLocalizedUnicode newText;
7784 newText.SetText(sszUnicode32Text, nLanguageCode, nRegionCode);
7785 m_Strings->push_back(newText);
7786 }
7787 else {
7788 pText->SetText(sszUnicode32Text, nLanguageCode, nRegionCode);
7789 }
7790}

References CIccTagMultiLocalizedUnicode::Find(), CIccTagMultiLocalizedUnicode::m_Strings, and CIccLocalizedUnicode::SetText().

+ Here is the call graph for this function:

◆ ToXml()

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

Implements CIccTagXml.

1661{
1662 std::string xmlbuf;
1663 char data[256];
1664 std::string bufstr;
1665 CIccMultiLocalizedUnicode::iterator i;
1666
1667 if (!m_Strings)
1668 return false;
1669
1670 for (i=m_Strings->begin(); i!=m_Strings->end(); i++) {
1671 xml += blanks + "<LocalizedText LanguageCountry=\"";
1672 xml += icFixXml(xmlbuf, icGetSigStr(data, (i->m_nLanguageCode<<16) + i->m_nCountryCode));
1673 xml += "\"><![CDATA[";
1674 xml += icFixXml(xmlbuf, icUtf16ToUtf8(bufstr, i->GetBuf(), i->GetLength()));
1675 xml += "]]></LocalizedText>\n";
1676 }
1677 return true;
1678}
ICCPROFLIB_API const icChar * icGetSigStr(icChar *pBuf, icUInt32Number nSig)
Definition IccUtil.cpp:1056
const char * icUtf16ToUtf8(std::string &buf, const icUInt16Number *szSrc, int sizeSrc=0)
Definition IccUtilXml.cpp:341
const char * icFixXml(char *szDest, const char *szStr)
Definition IccUtilXml.cpp:305

References CIccLocalizedUnicode::GetBuf(), CIccLocalizedUnicode::GetLength(), icFixXml(), icGetSigStr(), icUtf16ToUtf8(), CIccLocalizedUnicode::m_nCountryCode, CIccLocalizedUnicode::m_nLanguageCode, and CIccTagMultiLocalizedUnicode::m_Strings.

+ Here is the call graph for this function:

◆ Validate()

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

Name: CIccTagMultiLocalizedUnicode::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.

7655{
7656 icValidateStatus rv = CIccTag::Validate(sigPath, sReport, pProfile);
7657
7658 CIccInfo Info;
7659 std::string sSigPathName = Info.GetSigPathName(sigPath);
7660
7661 if (!m_Strings->size()) {
7662 sReport += icMsgValidateWarning;
7663 sReport += sSigPathName;
7664 sReport += " - Empty tag!\n";
7666 }
7667
7668 CIccMultiLocalizedUnicode::iterator i;
7669 for (i=m_Strings->begin(); i!=m_Strings->end(); i++) {
7670 // TODO: Validate ISO-639 Language Codes and and ISO-3166 Country codes.
7671 // Needs to be done against a full set of codes or many false warnings.
7672 }
7673
7674 return rv;
7675}
icValidateStatus
Definition IccDefs.h:119
@ icValidateWarning
Definition IccDefs.h:121
ICCPROFLIB_API const char * icMsgValidateWarning
Definition IccUtil.cpp:90
ICCPROFLIB_API icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Definition IccUtil.cpp:244
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, CIccTagMultiLocalizedUnicode::m_Strings, and CIccTag::Validate().

Referenced by CIccProfileIdDesc::Validate().

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

◆ Write()

bool CIccTagMultiLocalizedUnicode::Write ( CIccIO pIO)
virtualinherited

Name: CIccTagMultiLocalizedUnicode::Write

Purpose: Write the tag to a file

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

Return: true = succesful, false = failure

Reimplemented from CIccTag.

7544{
7546 icUInt32Number nNumRec=(icUInt32Number)m_Strings->size(), nRecSize=12;
7547 icUInt32Number nLength;
7548
7549 if (!pIO) {
7550 return false;
7551 }
7552
7553 if (!pIO->Write32(&sig) ||
7554 !pIO->Write32(&m_nReserved) ||
7555 !pIO->Write32(&nNumRec) ||
7556 !pIO->Write32(&nRecSize))
7557 return false;
7558
7559
7560 icUInt32Number nPos = 4*sizeof(icUInt32Number) + nNumRec*12;
7561
7562 CIccMultiLocalizedUnicode::iterator i;
7563
7564 for (i=m_Strings->begin(); i!=m_Strings->end(); i++) {
7565 nLength = i->GetLength() * sizeof(icUInt16Number);
7566
7567 if (!pIO->Write16(&i->m_nLanguageCode) ||
7568 !pIO->Write16(&i->m_nCountryCode) ||
7569 !pIO->Write32(&nLength) ||
7570 !pIO->Write32(&nPos))
7571 return false;
7572 nPos += nLength;
7573 }
7574
7575 for (i=m_Strings->begin(); i!=m_Strings->end(); i++) {
7576 nLength = i->GetLength();
7577
7578 if (nLength) {
7579 if (pIO->Write16(i->GetBuf(), nLength) != (icInt32Number)nLength)
7580 return false;
7581 }
7582 }
7583
7584 return true;
7585}
icInt32Number Write16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:122
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
virtual icTagTypeSignature GetType() const
Definition IccTagBasic.h:1237

References CIccLocalizedUnicode::GetBuf(), CIccLocalizedUnicode::GetLength(), CIccTagMultiLocalizedUnicode::GetType(), CIccLocalizedUnicode::m_nCountryCode, CIccLocalizedUnicode::m_nLanguageCode, CIccTag::m_nReserved, CIccTagMultiLocalizedUnicode::m_Strings, CIccIO::Write16(), and CIccIO::Write32().

Referenced by CIccTagDict::Write(), and CIccProfileIdDesc::Write().

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

Field Documentation

◆ 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_Strings


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