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

Public Member Functions

 CIccIt8Parser ()
 
 ~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)
 

Protected Attributes

std::ifstream * m_f
 

Detailed Description

Constructor & Destructor Documentation

◆ CIccIt8Parser()

CIccIt8Parser::CIccIt8Parser ( )
inline
831{ m_f = nullptr; }
std::ifstream * m_f
Definition IccCmmConfig.cpp:891

References m_f.

◆ ~CIccIt8Parser()

CIccIt8Parser::~CIccIt8Parser ( )
inline
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
882 {
883 while (parseNextLine(line)) {
884 if (line[0] == szToken)
885 break;
886 }
887 return false;
888 }
bool parseNextLine(std::vector< std::string > &line)
Definition IccCmmConfig.cpp:874

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
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
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
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 }
bool isEOF()
Definition IccCmmConfig.cpp:840

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
874 {
875 while (parseLine(line)) {
876 if (line.size())
877 return true;
878 }
879 return false;
880 }
bool parseLine(std::vector< std::string > &line)
Definition IccCmmConfig.cpp:841

References parseLine().

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

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

Field Documentation

◆ m_f

std::ifstream* CIccIt8Parser::m_f
protected

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