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

#include <IccTagBasic.h>

+ Inheritance diagram for CIccTagMultiLocalizedUnicode:
+ Collaboration diagram for CIccTagMultiLocalizedUnicode:

Public Member Functions

 CIccTagMultiLocalizedUnicode ()
 
 CIccTagMultiLocalizedUnicode (const CIccTagMultiLocalizedUnicode &ITMLU)
 
virtual ~CIccTagMultiLocalizedUnicode ()
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
virtual void DetachIO ()
 
CIccLocalizedUnicodeFind (icLanguageCode nLanguageCode=icLanguageCodeEnglish, icCountryCode nRegionCode=icCountryCodeUSA)
 
virtual const icCharGetClassName () 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
 
CIccTagMultiLocalizedUnicodeoperator= (const CIccTagMultiLocalizedUnicode &MultiLocalizedTag)
 
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 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

Class: CIccTagMultiLocalizedUnicode

Purpose: The MultiLocalizedUnicode tag

Constructor & Destructor Documentation

◆ CIccTagMultiLocalizedUnicode() [1/2]

CIccTagMultiLocalizedUnicode::CIccTagMultiLocalizedUnicode ( )

Name: CIccTagMultiLocalizedUnicode::CIccTagMultiLocalizedUnicode

Purpose: Constructor

7375{
7377}
std::list< CIccLocalizedUnicode > CIccMultiLocalizedUnicode
Definition IccTagBasic.h:1218
CIccMultiLocalizedUnicode * m_Strings
Definition IccTagBasic.h:1260

References m_Strings.

Referenced by CIccTagXmlMultiLocalizedUnicode::CIccTagXmlMultiLocalizedUnicode(), CDevLinkWriter::begin(), main(), CIccTagXmlDict::ParseXml(), and CIccTagDict::Read().

+ Here is the caller graph for this function:

◆ CIccTagMultiLocalizedUnicode() [2/2]

CIccTagMultiLocalizedUnicode::CIccTagMultiLocalizedUnicode ( const CIccTagMultiLocalizedUnicode ITMLU)

Name: CIccTagMultiLocalizedUnicode::CIccTagMultiLocalizedUnicode

Purpose: Copy Constructor

Args: ITMLU = The CIccTagMultiLocalizedUnicode object to be copied

7391{
7393 *m_Strings = *ITMLU.m_Strings;
7394}

References m_Strings.

Referenced by CIccTagXmlMultiLocalizedUnicode::CIccTagXmlMultiLocalizedUnicode(), and NewCopy().

+ Here is the caller graph for this function:

◆ ~CIccTagMultiLocalizedUnicode()

CIccTagMultiLocalizedUnicode::~CIccTagMultiLocalizedUnicode ( )
virtual

Name: CIccTagMultiLocalizedUnicode::~CIccTagMultiLocalizedUnicode

Purpose: Destructor

7428{
7429 delete m_Strings;
7430}

References m_Strings.

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 
)
virtual

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}

References CIccLocalizedUnicode::GetText(), CIccLocalizedUnicode::m_nCountryCode, CIccLocalizedUnicode::m_nLanguageCode, and 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 
)

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 m_Strings.

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

+ Here is the caller graph for this function:

◆ GetClassName()

virtual const icChar * CIccTagMultiLocalizedUnicode::GetClassName ( ) const
inlinevirtual

Reimplemented from CIccTag.

Reimplemented in CIccTagXmlMultiLocalizedUnicode.

1238{ return "CIcciSigMultiLocalizedUnicode"; }

◆ GetExtension()

virtual IIccExtensionTag * CIccTag::GetExtension ( )
inlinevirtualinherited

Reimplemented in CIccTagXmlUnknown, CIccTagXmlText, CIccTagXmlUtf8Text, CIccTagXmlZipUtf8Text, CIccTagXmlZipXml, CIccTagXmlUtf16Text, CIccTagXmlTextDescription, CIccTagXmlSignature, CIccTagXmlNamedColor2, CIccTagXmlXYZ, CIccTagXmlChromaticity, CIccTagXmlCicp, CIccTagXmlSparseMatrixArray, CIccTagXmlFixedNum< T, Tsig >, CIccTagXmlNum< T, A, Tsig >, CIccTagXmlFloatNum< T, A, Tsig >, CIccTagXmlMeasurement, CIccTagXmlMultiLocalizedUnicode, CIccTagXmlTagData, CIccTagXmlDateTime, CIccTagXmlColorantOrder, CIccTagXmlColorantTable, CIccTagXmlViewingConditions, CIccTagXmlSpectralDataInfo, CIccTagXmlSpectralViewingConditions, CIccTagXmlProfileSeqDesc, CIccTagXmlResponseCurveSet16, CIccTagXmlCurve, CIccTagXmlParametricCurve, CIccTagXmlSegmentedCurve, CIccTagXmlLutAtoB, CIccTagXmlLutBtoA, CIccTagXmlLut8, CIccTagXmlLut16, CIccTagXmlMultiProcessElement, CIccTagXmlProfileSequenceId, CIccTagXmlDict, CIccTagXmlStruct, CIccTagXmlArray, CIccTagXmlGamutBoundaryDesc, CIccTagXmlEmbeddedHeightImage, CIccTagXmlEmbeddedNormalImage, and CIccTagXmlEmbeddedProfile.

143{return NULL;}

Referenced by icCurvesFromXml(), icCurvesToXml(), icProfDescToXml(), icXmlParseProfDesc(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccMpeXmlTintArray::ParseXml(), CIccTagXmlArray::ParseXml(), CIccMpeXmlTintArray::ToXml(), CIccTagXmlStruct::ToXml(), CIccTagXmlArray::ToXml(), and CIccProfileXml::ToXmlWithBlanks().

+ Here is the caller graph for this function:

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

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 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 * CIccTagMultiLocalizedUnicode::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 CIccTag.

Reimplemented in CIccTagXmlMultiLocalizedUnicode.

1234{return new CIccTagMultiLocalizedUnicode(*this);}
CIccTagMultiLocalizedUnicode()
Definition IccTagBasic.cpp:7374

References CIccTagMultiLocalizedUnicode().

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

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

◆ operator=()

CIccTagMultiLocalizedUnicode & CIccTagMultiLocalizedUnicode::operator= ( const CIccTagMultiLocalizedUnicode MultiLocalizedTag)

Name: CIccTagMultiLocalizedUnicode::operator=

Purpose: Copy Operator

Args: MultiLocalizedTag = The CIccTagMultiLocalizedUnicode object to be copied

7408{
7409 if (&MultiLocalizedTag == this)
7410 return *this;
7411
7412 m_Strings->clear();
7413 *m_Strings = *MultiLocalizedTag.m_Strings;
7414
7415 return *this;
7416}

References m_Strings.

Referenced by CIccProfileIdDesc::CIccProfileIdDesc(), CIccProfileIdDesc::CIccProfileIdDesc(), CIccProfileIdDesc::CIccProfileIdDesc(), CDevLinkWriter::iterate(), and CIccProfileIdDesc::operator=().

+ Here is the caller graph for this function:

◆ Read() [1/2]

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

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
icUInt16Number icCountryCode
Definition icProfileHeader.h:1273
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icUInt16Number icLanguageCode
Definition icProfileHeader.h:1248
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, 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 
)

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 Find(), m_Strings, and CIccLocalizedUnicode::SetText().

Referenced by CIccProfileIdDesc::CIccProfileIdDesc(), CDevLinkWriter::begin(), main(), CIccTagXmlMultiLocalizedUnicode::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 
)

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 Find(), m_Strings, and CIccLocalizedUnicode::SetText().

Referenced by CIccTagXmlMultiLocalizedUnicode::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 
)

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 Find(), m_Strings, and CIccLocalizedUnicode::SetText().

+ Here is the call graph for this function:

◆ Validate()

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

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, 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)
virtual

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(), GetType(), CIccLocalizedUnicode::m_nCountryCode, CIccLocalizedUnicode::m_nLanguageCode, CIccTag::m_nReserved, 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(), 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(), 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: