/*++ Copyright (c) 1995 Microsoft Corporation Module Name: pcprase.cpp Abstract: This module implements an object for parsing FROM values. It works by creating a function for each grammer rule. When called the function will "eat up" any characters that parse and return TRUE. If no characters parse, then none will be eaten up and the return will be FALSE. Author: Carl Kadie (CarlK) 11-Dec-1995 Revision History: --*/ //#include "tigris.hxx" #include "stdinc.h" BOOL CPCParse::fParenChar( void ) /*++ Routine Description: Parse a "(" Arguments: None. Return Value: TRUE, if successful. FALSE, otherwise. --*/ { if ((0" Arguments: None. Return Value: TRUE, if successful. FALSE, otherwise. --*/ { CPCParse pcOld = *this; BOOL fOK = FALSE; // Assume the worst // try style 1 if (fStrictAddress()) { // address is ok fOK = TRUE; // now check for optional [ space "(" paren-phrase ")" ] if (fSpace()) { if (!( fParseSingleChar('(') && fParenPhrase() && fParseSingleChar(')') )) { fOK = FALSE; } else { fOK = TRUE ; } } } // If it didn't parse that way, try style 2 if (!fOK) { *this = pcOld; if (fPlainPhrase() && !fSpace()) { fOK = FALSE; } else if (!(fParseSingleChar('<') && fAddress() && fParseSingleChar('>') )) { fOK = FALSE; } else { fOK = TRUE ; } } // style 1 and 2 both failed if( !fOK ) { *this = pcOld; if( fAddress() ) { fOK = TRUE; } } // // There should be no characters left // if (0 != m_cch) { *this = pcOld; return FALSE; } return TRUE; } BOOL CPCParse::fEncodedWord( void ) /*++ Routine Description: encoded-word = "=?" charset "?" encoding "?" codes "?=" Arguments: None. Return Value: TRUE, if successful. FALSE, otherwise. --*/ { CPCParse pcOld = *this; if ( fParseSingleChar('=') && fParseSingleChar('?') && fCharset() && fParseSingleChar('?') && fEncoding() && fParseSingleChar('?') && fCodes() && fParseSingleChar('?') && fParseSingleChar('=') ) return TRUE; *this = pcOld; return FALSE; }