Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
CIccIt8Parser Class Reference
+ Collaboration diagram for CIccIt8Parser:

Public Member Functions

 CIccIt8Parser ()
 
bool findTokenLine (std::vector< std::string > &line, const char *szToken)
 
bool isEOF ()
 
bool open (const char *szFilename)
 
bool parseLine (std::vector< std::string > &line)
 
bool parseNextLine (std::vector< std::string > &line)
 
 ~CIccIt8Parser ()
 

Protected Attributes

std::ifstream * m_f
 

Detailed Description

Definition at line 828 of file IccCmmConfig.cpp.

Constructor & Destructor Documentation

◆ CIccIt8Parser()

CIccIt8Parser::CIccIt8Parser ( )
inline

Definition at line 831 of file IccCmmConfig.cpp.

831{ m_f = nullptr; }
std::ifstream * m_f

References m_f.

◆ ~CIccIt8Parser()

CIccIt8Parser::~CIccIt8Parser ( )
inline

Definition at line 832 of file IccCmmConfig.cpp.

832{ if (m_f) delete m_f; }

References m_f.

Member Function Documentation

◆ findTokenLine()

bool CIccIt8Parser::findTokenLine ( std::vector< std::string > & line,
const char * szToken )
inline

Definition at line 882 of file IccCmmConfig.cpp.

882 {
883 while (parseNextLine(line)) {
884 if (line[0] == szToken)
885 break;
886 }
887 return false;
888 }
bool parseNextLine(std::vector< std::string > &line)

References parseNextLine().

Referenced by CIccCfgColorData::fromIt8().

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

◆ isEOF()

bool CIccIt8Parser::isEOF ( )
inline

Definition at line 840 of file IccCmmConfig.cpp.

840{ return m_f->eof(); }

References m_f.

Referenced by CIccCfgColorData::fromIt8(), and parseLine().

+ Here is the caller graph for this function:

◆ open()

bool CIccIt8Parser::open ( const char * szFilename)
inline

Definition at line 834 of file IccCmmConfig.cpp.

834 {
835 if (m_f)
836 delete m_f;
837 m_f = new std::ifstream(szFilename);
838 return m_f != nullptr;
839 }

References m_f.

Referenced by CIccCfgColorData::fromIt8().

+ Here is the caller graph for this function:

◆ parseLine()

bool CIccIt8Parser::parseLine ( std::vector< std::string > & line)
inline

Definition at line 841 of file IccCmmConfig.cpp.

841 {
842 line.clear();
843 if (isEOF())
844 return false;
845 std::string str;
846
847 int c = 0;
848 while (!isEOF()) {
849 c = m_f->get();
850 if (c < 0) {
851 if (str.size())
852 line.push_back(str);
853 if (!line.size())
854 return false;
855 break;
856 }
857 else if (c == '\n')
858 continue;
859 else if (c == '\r') {
860 line.push_back(str);
861 break;
862 }
863 else if (c == '\t') {
864 line.push_back(str);
865 str.clear();
866 }
867 else {
868 str += c;
869 }
870 }
871 return true;
872 }

References isEOF(), and m_f.

Referenced by parseNextLine().

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

◆ parseNextLine()

bool CIccIt8Parser::parseNextLine ( std::vector< std::string > & line)
inline

Definition at line 874 of file IccCmmConfig.cpp.

874 {
875 while (parseLine(line)) {
876 if (line.size())
877 return true;
878 }
879 return false;
880 }
bool parseLine(std::vector< std::string > &line)

References parseLine().

Referenced by findTokenLine(), and CIccCfgColorData::fromIt8().

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

Member Data Documentation

◆ m_f

std::ifstream* CIccIt8Parser::m_f
protected

Definition at line 891 of file IccCmmConfig.cpp.

Referenced by CIccIt8Parser(), isEOF(), open(), parseLine(), and ~CIccIt8Parser().


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