int main() { Param_t * param = createParam(); //Create new Parameter param = stringtokenizer(param); //get commands and tokenize deleteParam(param); return 0; }
void CSplashScreen::init() { String strSplash = RHOCONF().getString("splash_screen"); CTokenizer stringtokenizer(strSplash, ";"); while (stringtokenizer.hasMoreTokens()) { String tok = stringtokenizer.nextToken(); tok = trim(tok); if (tok.length() == 0) { continue; } if (tok.find("delay") == 0) { int nEq = tok.find('='); if (nEq>=0) { String val = tok.substr(nEq+1); val = trim(val); if ( val.length() > 0 ) convertFromStringA( val.c_str(), m_nDelay ); } }else if (tok.find("zoom") == 0) { m_nFlags |= VZOOM | HZOOM; }else if ( tok.find("vzoom") == 0) { m_nFlags |= VZOOM; }else if ( tok.find("hzoom") == 0) { m_nFlags |= HZOOM; }else if ( tok.find("center") == 0) { m_nFlags |= VCENTER | HCENTER; }else if ( tok.find("vcenter") == 0) { m_nFlags |= VCENTER; }else if ( tok.find("hcenter") == 0) { m_nFlags |= HCENTER; } } }
/*static*/ void URI::parseCookie(const char* szCookie, CParsedCookie& cookie) { boolean bAuth = false; boolean bSession = false; common::CTokenizer stringtokenizer(szCookie, ";"); while (stringtokenizer.hasMoreTokens()) { String tok = stringtokenizer.nextToken(); tok = trim(tok); if (tok.length() == 0) { continue; } int i = 0; if ( (i=tok.find("auth_token=")) >= 0 ) { String val = trim(tok.substr(i+11)); if ( val.length() > 0 ) { cookie.strAuth = "auth_token=" + val; bAuth = true; } }else if ( (i=tok.find("path=")) >= 0 ) { String val = trim(tok.substr(i+6)); if ( val.length() > 0 ) { if (bAuth) cookie.strAuth += ";path=" + val; else if (bSession) cookie.strSession += ";path=" + val; } }else if ( (i=tok.find("rhosync_session=")) >= 0 ) { String val = trim(tok.substr(i+16)); if ( val.length() > 0 ) { cookie.strSession = "rhosync_session=" + val; bSession = true; } } } }
/*static*/ void URI::parseCookie(const char* szCookie, String& strRes) { common::CTokenizer stringtokenizer(szCookie, ";"); while (stringtokenizer.hasMoreTokens()) { String tok = stringtokenizer.nextToken(); tok = String_trim(tok); if (tok.length() == 0) { continue; } //expires=Thu, 01 Jan 1970 00:00:00 GMT, auth_token= int nExp = tok.find("expires="); if ( nExp >= 0 ) { int nEnd = tok.find(',', nExp); if ( nEnd >= 0 ) { int nEnd1 = tok.find(',', nEnd+1); if ( nEnd1 >= 0 ) nEnd = nEnd1; else nEnd = tok.length()-1; } tok = tok.substr(0,nExp) + tok.substr(nEnd+1); tok = String_trim(tok); } int nEq = tok.find('='); if ( nEq < 0 ) continue; strRes += tok + ";"; /* int i = 0; if ( (i=tok.find("auth_token=")) >= 0 ) { String val = trim(tok.substr(i+11)); if ( val.length() > 0 ) { cookie.strAuth = "auth_token=" + val; bAuth = true; } }else if ( (i=tok.find("path=")) >= 0 ) { String val = trim(tok.substr(i+6)); if ( val.length() > 0 ) { if (bAuth) cookie.strAuth += ";path=" + val; else if (bSession) cookie.strSession += ";path=" + val; } }else if ( (i=tok.find("rhosync_session=")) >= 0 ) { String val = trim(tok.substr(i+16)); if ( val.length() > 0 ) { cookie.strSession = "rhosync_session=" + val; bSession = true; } } */ } }