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

Type: Class. More...

#include <IccIO.h>

+ Inheritance diagram for CIccFileIO:
+ Collaboration diagram for CIccFileIO:

Public Member Functions

bool Attach (FILE *f)
 
 CIccFileIO ()
 
virtual void Close ()
 
void Detach ()
 
virtual icInt32Number GetLength ()
 
bool Open (const icChar *szFilename, const icChar *szAttr)
 
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 ~CIccFileIO ()
 
- 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

FILE * m_fFile
 

Detailed Description

Type: Class.

Purpose: Handles generic File IO

Definition at line 149 of file IccIO.h.

Constructor & Destructor Documentation

◆ CIccFileIO()

CIccFileIO::CIccFileIO ( )

Definition at line 372 of file IccIO.cpp.

372 : CIccIO()
373{
374 m_fFile = NULL;
375}
FILE * m_fFile
Definition IccIO.h:174
Type: Class.
Definition IccIO.h:97

References m_fFile.

◆ ~CIccFileIO()

CIccFileIO::~CIccFileIO ( )
virtual

Definition at line 377 of file IccIO.cpp.

378{
379 Close();
380}
virtual void Close()
Definition IccIO.cpp:443

References Close().

+ Here is the call graph for this function:

Member Function Documentation

◆ Attach()

bool CIccFileIO::Attach ( FILE * f)

Definition at line 426 of file IccIO.cpp.

427{
428 if (m_fFile)
429 fclose(m_fFile);
430
431 m_fFile = f;
432
433 return m_fFile != NULL;
434}

References m_fFile.

Referenced by SaveIccProfile().

+ Here is the caller graph for this function:

◆ Close()

void CIccFileIO::Close ( )
virtual

Reimplemented from CIccIO.

Definition at line 443 of file IccIO.cpp.

444{
445 if (m_fFile) {
446 fclose(m_fFile);
447 m_fFile = NULL;
448 }
449}

References m_fFile.

Referenced by main(), main(), and ~CIccFileIO().

+ Here is the caller graph for this function:

◆ Detach()

void CIccFileIO::Detach ( )

Definition at line 437 of file IccIO.cpp.

438{
439 m_fFile = NULL;
440}

References m_fFile.

Referenced by SaveIccProfile().

+ Here is the caller graph for this function:

◆ GetLength()

icInt32Number CIccFileIO::GetLength ( )
virtual

Reimplemented from CIccIO.

Definition at line 470 of file IccIO.cpp.

471{
472 if (!m_fFile)
473 return 0;
474
475 fflush(m_fFile);
476 icInt32Number current = (icInt32Number)ftell(m_fFile), end;
477 fseek (m_fFile, 0, SEEK_END);
478 end = (icInt32Number)ftell(m_fFile);
479 fseek (m_fFile, current, SEEK_SET);
480 return end;
481}
long icInt32Number

References m_fFile.

Referenced by main(), and main().

+ Here is the caller graph for this function:

◆ Open()

bool CIccFileIO::Open ( const icChar * szFilename,
const icChar * szAttr )

Definition at line 382 of file IccIO.cpp.

383{
384#ifdef WIN32
385 char myAttr[20];
386
387 if (!strchr(szAttr, 'b')) {
388 myAttr[0] = szAttr[0];
389 myAttr[1] = 'b';
390 strcpy(myAttr+2, szAttr+1);
391 szAttr = myAttr;
392 }
393#endif
394
395 if (m_fFile)
396 fclose(m_fFile);
397
398 m_fFile = fopen(szFilename, szAttr);
399
400 return m_fFile != NULL;
401}

References m_fFile.

Referenced by CalcProfileID(), main(), main(), CIccStandardFileIO::OpenFile(), OpenIccProfile(), ReadIccProfile(), SaveIccProfile(), and ValidateIccProfile().

+ Here is the caller graph for this function:

◆ Read8()

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

Reimplemented from CIccIO.

Definition at line 452 of file IccIO.cpp.

453{
454 if (!m_fFile)
455 return 0;
456
457 return (icInt32Number)fread(pBuf, 1, nNum, m_fFile);
458}

References m_fFile.

Referenced by main(), and main().

+ Here is the caller graph for this function:

◆ Seek()

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

Reimplemented from CIccIO.

Definition at line 484 of file IccIO.cpp.

485{
486 if (!m_fFile)
487 return -1;
488
489 return !fseek(m_fFile, nOffset, pos) ? (icInt32Number)ftell(m_fFile) : -1;
490}

References m_fFile.

◆ Tell()

icInt32Number CIccFileIO::Tell ( )
virtual

Reimplemented from CIccIO.

Definition at line 493 of file IccIO.cpp.

494{
495 if (!m_fFile)
496 return -1;
497
498 return (icInt32Number)ftell(m_fFile);
499}

References m_fFile.

◆ Write8()

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

Reimplemented from CIccIO.

Definition at line 461 of file IccIO.cpp.

462{
463 if (!m_fFile)
464 return 0;
465
466 return (icInt32Number)fwrite(pBuf, 1, nNum, m_fFile);
467}

References m_fFile.

Referenced by main().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_fFile

FILE* CIccFileIO::m_fFile
protected

Definition at line 174 of file IccIO.h.

Referenced by Attach(), CIccFileIO(), Close(), Detach(), GetLength(), Open(), Read8(), Seek(), Tell(), and Write8().


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