Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
CIccEmbedIO Class Reference

Type: Class. More...

#include <IccIO.h>

+ Inheritance diagram for CIccEmbedIO:
+ Collaboration diagram for CIccEmbedIO:

Public Member Functions

bool Attach (CIccIO *pIO, icInt32Number nSize=0, bool bOwnIO=false)
 
 CIccEmbedIO ()
 
virtual void Close ()
 
virtual icInt32Number GetLength ()
 
virtual icInt32Number Read8 (void *pBuf, icInt32Number nNum=1)
 
virtual icInt32Number Seek (icInt32Number nOffset, icSeekVal pos)
 
virtual icInt32Number Tell ()
 
virtual icInt32Number Write8 (void *pBuf, icInt32Number nNum=1)
 
virtual ~CIccEmbedIO ()
 
- Public Member Functions inherited from CIccIO
bool Align32 ()
 Write operation to make sure that filelength is evenly divisible by 4.
 
icInt32Number Read16 (void *pBuf16, icInt32Number nNum=1)
 
icInt32Number Read32 (void *pBuf32, icInt32Number nNum=1)
 
icInt32Number Read64 (void *pBuf64, icInt32Number nNum=1)
 
icInt32Number ReadFloat16Float (void *pBufFloat, icInt32Number nNum=1)
 
icInt32Number ReadFloat32Float (void *pBufFloat, icInt32Number nNum=1)
 
icInt32Number ReadLine (void *pBuf8, icInt32Number nNum=256)
 
icInt32Number ReadUInt16Float (void *pBufFloat, icInt32Number nNum=1)
 
icInt32Number ReadUInt8Float (void *pBufFloat, icInt32Number nNum=1)
 
bool Sync32 (icUInt32Number nOffset=0)
 Operation to make sure read position is evenly divisible by 4.
 
icInt32Number Write16 (void *pBuf16, icInt32Number nNum=1)
 
icInt32Number Write32 (void *pBuf32, icInt32Number nNum=1)
 
icInt32Number Write64 (void *pBuf64, icInt32Number nNum=1)
 
icInt32Number WriteFloat16Float (void *pBuf16, icInt32Number nNum=1)
 
icInt32Number WriteFloat32Float (void *pBufFloat, icInt32Number nNum=1)
 
icInt32Number WriteUInt16Float (void *pBuf16, icInt32Number nNum=1)
 
icInt32Number WriteUInt8Float (void *pBuf16, icInt32Number nNum=1)
 
virtual ~CIccIO ()
 

Protected Attributes

bool m_bOwnIO
 
icInt32Number m_nSize
 
icInt32Number m_nStartPos
 
CIccIOm_pIO
 

Detailed Description

Type: Class.

Purpose: Handles embedding a file within a file

Definition at line 184 of file IccIO.h.

Constructor & Destructor Documentation

◆ CIccEmbedIO()

CIccEmbedIO::CIccEmbedIO ( )

Definition at line 506 of file IccIO.cpp.

506 : CIccIO()
507{
508 m_pIO = NULL;
509 m_nStartPos = 0;
510 m_nSize = -1;
511 m_bOwnIO = false;
512}
bool m_bOwnIO
Definition IccIO.h:205
icInt32Number m_nSize
Definition IccIO.h:204
icInt32Number m_nStartPos
Definition IccIO.h:203
CIccIO * m_pIO
Definition IccIO.h:202
Type: Class.
Definition IccIO.h:97

References m_bOwnIO, m_nSize, m_nStartPos, and m_pIO.

◆ ~CIccEmbedIO()

CIccEmbedIO::~CIccEmbedIO ( )
virtual

Definition at line 514 of file IccIO.cpp.

515{
516 Close();
517}
virtual void Close()
Definition IccIO.cpp:536

References Close().

+ Here is the call graph for this function:

Member Function Documentation

◆ Attach()

bool CIccEmbedIO::Attach ( CIccIO * pIO,
icInt32Number nSize = 0,
bool bOwnIO = false )

Definition at line 519 of file IccIO.cpp.

520{
521 if (!pIO)
522 return false;
523
524 m_nStartPos = pIO->Tell();
525 m_nSize = nSize;
526 m_bOwnIO = bOwnIO;
527 m_pIO = pIO;
528
529 if (m_nStartPos < 0)
530 return false;
531
532 return true;
533}
virtual icInt32Number Tell()
Definition IccIO.h:133

References m_bOwnIO, m_nSize, m_nStartPos, m_pIO, and CIccIO::Tell().

Referenced by CIccTagEmbeddedProfile::Write().

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

◆ Close()

void CIccEmbedIO::Close ( )
virtual

Reimplemented from CIccIO.

Definition at line 536 of file IccIO.cpp.

537{
538 if (m_pIO && m_bOwnIO) {
539 m_pIO->Close();
540
541 delete m_pIO;
542 m_pIO = NULL;
543 }
544}
virtual void Close()
Definition IccIO.h:102

References CIccIO::Close(), m_bOwnIO, and m_pIO.

Referenced by ~CIccEmbedIO().

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

◆ GetLength()

icInt32Number CIccEmbedIO::GetLength ( )
virtual

Reimplemented from CIccIO.

Definition at line 573 of file IccIO.cpp.

574{
575 if (!m_pIO)
576 return 0;
577
578 if (m_nSize)
579 return m_nSize;
580
581 return m_pIO->GetLength() - m_nStartPos;
582}
virtual icInt32Number GetLength()
Definition IccIO.h:130

References CIccIO::GetLength(), m_nSize, m_nStartPos, and m_pIO.

+ Here is the call graph for this function:

◆ Read8()

icInt32Number CIccEmbedIO::Read8 ( void * pBuf,
icInt32Number nNum = 1 )
virtual

Reimplemented from CIccIO.

Definition at line 547 of file IccIO.cpp.

548{
549 if (!m_pIO)
550 return 0;
551
552 if (m_nSize > 0) {
553 icUInt32Number nPos = m_pIO->Tell();
554 icUInt32Number nOffset = nPos - m_nStartPos;
555
556 if (nOffset + nNum > (icUInt64Number)m_nSize)
557 nNum = m_nSize - nOffset;
558 }
559
560 return m_pIO->Read8(pBuf, nNum);
561}
unsigned int icUInt32Number
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:104
icUInt32Number icUInt64Number[2]

References m_nSize, m_nStartPos, m_pIO, CIccIO::Read8(), and CIccIO::Tell().

+ Here is the call graph for this function:

◆ Seek()

icInt32Number CIccEmbedIO::Seek ( icInt32Number nOffset,
icSeekVal pos )
virtual

Reimplemented from CIccIO.

Definition at line 585 of file IccIO.cpp.

586{
587 icInt32Number nPos;
588 if (!m_pIO)
589 return -1;
590
591 if (pos == icSeekSet) {
592 if (m_nSize > 0 && nOffset > m_nSize)
593 nOffset = m_nSize;
594 else if (nOffset < 0)
595 nOffset = m_nStartPos;
596
597 nPos = m_pIO->Seek(nOffset + m_nStartPos, icSeekSet);
598
599 }
600 else if (pos == icSeekEnd) {
601 if (m_nSize > 0) {
602 nOffset = m_nSize + nOffset;
603 }
604 else {
605 nOffset = nOffset + m_pIO->GetLength() - m_nStartPos;
606 }
607 if (nOffset < 0)
608 nOffset = 0;
609 nOffset += m_nStartPos;
610
611 nPos = m_pIO->Seek(nOffset, icSeekSet);
612 }
613 else {//pos == icSeekCur
614 nOffset = m_pIO->Tell() + nOffset;
615
616 if (m_nSize && nOffset - m_nStartPos > m_nSize)
617 nOffset = m_nStartPos + m_nSize;
618 else if (nOffset < m_nStartPos)
619 nOffset = m_nStartPos;
620
621 nPos = m_pIO->Seek(nOffset, icSeekSet);
622 }
623
624 if (nPos >= m_nStartPos)
625 return nPos - m_nStartPos;
626
627 return nPos;
628}
@ icSeekEnd
Definition IccIO.h:85
@ icSeekSet
Definition IccIO.h:83
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
Definition IccIO.h:132
long icInt32Number

References CIccIO::GetLength(), icSeekEnd, icSeekSet, m_nSize, m_nStartPos, m_pIO, CIccIO::Seek(), and CIccIO::Tell().

+ Here is the call graph for this function:

◆ Tell()

icInt32Number CIccEmbedIO::Tell ( )
virtual

Reimplemented from CIccIO.

Definition at line 631 of file IccIO.cpp.

632{
633 if (!m_pIO)
634 return -1;
635
636 icUInt32Number nPos = m_pIO->Tell();
637
638 if ((icInt32Number)nPos >= m_nStartPos)
639 return nPos - m_nStartPos;
640
641 return nPos;
642}

References m_nStartPos, m_pIO, and CIccIO::Tell().

+ Here is the call graph for this function:

◆ Write8()

icInt32Number CIccEmbedIO::Write8 ( void * pBuf,
icInt32Number nNum = 1 )
virtual

Reimplemented from CIccIO.

Definition at line 564 of file IccIO.cpp.

565{
566 if (!m_pIO)
567 return 0;
568
569 return m_pIO->Write8(pBuf, nNum);
570}
virtual icInt32Number Write8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:105

References m_pIO, and CIccIO::Write8().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_bOwnIO

bool CIccEmbedIO::m_bOwnIO
protected

Definition at line 205 of file IccIO.h.

Referenced by Attach(), CIccEmbedIO(), and Close().

◆ m_nSize

icInt32Number CIccEmbedIO::m_nSize
protected

Definition at line 204 of file IccIO.h.

Referenced by Attach(), CIccEmbedIO(), GetLength(), Read8(), and Seek().

◆ m_nStartPos

icInt32Number CIccEmbedIO::m_nStartPos
protected

Definition at line 203 of file IccIO.h.

Referenced by Attach(), CIccEmbedIO(), GetLength(), Read8(), Seek(), and Tell().

◆ m_pIO

CIccIO* CIccEmbedIO::m_pIO
protected

Definition at line 202 of file IccIO.h.

Referenced by Attach(), CIccEmbedIO(), Close(), GetLength(), Read8(), Seek(), Tell(), and Write8().


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