68 if ( iFileName.empty() )
70 std::cerr <<
"empty filename" << std::endl;
84 std::ifstream ifs(
m_FileName.c_str(), std::ifstream::in);
98 for (
int i = 0; i < 5; i++ )
139 for (
int i = 0; i < 8; i++ )
152 ifs >> word >> color;
153 std::ostringstream channelColor1;
154 channelColor1 <<
"ChannelColor" << std::setw(2) << std::setfill(
'0') << i;
155 std::ostringstream channelColor2;
156 channelColor2 <<
"ChannelColor" << i;
157 CheckKeyWord(word, channelColor1.str(), lineNumber, channelColor2.str());
172 for (
int i = 0; i < 5; i++ )
176 std::string date, hours;
177 ifs >> word >> date >> hours;
186 std::cerr <<
"Unable to open file" << std::endl;
192 std::vector< int > oRGB(3);
193 oRGB[0] =
static_cast< int >( ( iColor / ( 256 * 256 ) ) % 256 );
194 oRGB[1] =
static_cast< int >( ( iColor / 256 ) % 256 );
195 oRGB[2] =
static_cast< int >( iColor % 256 );
210 CheckKeyWord(std::string iWord, std::string iCompare,
int& iLineNumber,
211 std::string iExtraKeyWord)
214 if( (iWord.compare(iCompare) != 0) && (iWord.compare(iExtraKeyWord) != 0) )
216 std::cerr <<
">> ERROR: *" << iCompare <<
"* keyword should on the line *"
217 << iLineNumber <<
"* of your .meg file"<< std::endl;
218 throw std::string(
"Corrupted header file");