| 315 | // strSection is not an acceptable genre for this OS |
| 316 | |
| 317 | void cParserHelper::SetSection(TSTRING& strSection) // throw( eParserHelper ) |
| 318 | { |
| 319 | // |
| 320 | // do we recognize the section string? |
| 321 | // |
| 322 | cGenre::Genre g = cGenreSwitcher::GetInstance()->StringToGenre(strSection.c_str()); |
| 323 | if (cGenre::GENRE_INVALID != g && cGenreSwitcher::GetInstance()->IsGenreAppropriate(g)) |
| 324 | { |
| 325 | cGenreSwitcher::GetInstance()->SelectGenre(g); |
| 326 | |
| 327 | // set current genre info pointer |
| 328 | GenreContainer::iterator i = mAph.find(cGenreSwitcher::GetInstance()->CurrentGenre()); |
| 329 | if (mAph.end() == i) |
| 330 | { |
| 331 | pCurrentGenreInfo = new cGenreParseInfo; |
| 332 | mAph.insert(GenreContainer::value_type(cGenreSwitcher::GetInstance()->CurrentGenre(), pCurrentGenreInfo)); |
| 333 | |
| 334 | cPreprocessor::ReadSection(); |
| 335 | } |
| 336 | else |
| 337 | { |
| 338 | throw eParserSectionAlreadyDefined(strSection); |
| 339 | } |
| 340 | } |
| 341 | else // ignore |
| 342 | { |
| 343 | if (!ParseOnly()) |
| 344 | { |
| 345 | eParserIgnoringSection e(strSection); |
| 346 | e.SetFatality(false); |
| 347 | if (mpError) |
| 348 | mpError->AddError(e); |
| 349 | } |
| 350 | |
| 351 | cPreprocessor::IgnoreSection(); |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | // A function for inserting a global variable into the global variable table. Throws |
| 356 | // an exception if they try to redefine one of the predefined variables. Returns |
nothing calls this directly
no test coverage detected