library/src/blockclass/subclasses/BP_CommandLineOptionParser.cc
// retrieves a url token based on the provided token.
retrieves a url token based on the provided token.
retrieves a url token based on the provided token .
char * BP_CommandLineOptionParser::retrieveUrlValueByOption(char *option_value, BP_BOOL duplicate_value_on_return)
{
	if(!option_value)
	{
		this->retrieval_ok = BP_FALSE;
		return NULL;
	}
	P_BP_COMMAND_LINE_PARSER_TOKENS token = this->optionLookup(option_value);
	if(!token)
	{
		this->retrieval_ok = BP_FALSE;
		return NULL;
	}
	if(token->value_has_been_set_ok)
	{
		this->retrieval_ok = BP_TRUE;
		if(duplicate_value_on_return)
		{
			if(!token->parsed_value_as_string)
				return NULL;
			return strdup(token->parsed_value_as_string);
		}
		else
			return token->parsed_value_as_string;
	}
	else
	{
		this->retrieval_ok = BP_TRUE;
		if(duplicate_value_on_return)
		{
			if(!token->default_value_as_string)
				return NULL;
			return strdup(token->default_value_as_string);
		}
		else
			return token->default_value_as_string;
	}
}
char * BP_CommandLineOptionParser :: retrieveUrlValueByOption ( char * option_value , BP_BOOL duplicate_value_on_return ) { if ( ! option_value ) { this -> retrieval_ok = BP_FALSE ; return NULL ; } P_BP_COMMAND_LINE_PARSER_TOKENS token = this -> optionLookup ( option_value ) ; if ( ! token ) { this -> retrieval_ok = BP_FALSE ; return NULL ; } if ( token -> value_has_been_set_ok ) { this -> retrieval_ok = BP_TRUE ; if ( duplicate_value_on_return ) { if ( ! token -> parsed_value_as_string ) return NULL ; return strdup ( token -> parsed_value_as_string ) ; } else return token -> parsed_value_as_string ; } else { this -> retrieval_ok = BP_TRUE ; if ( duplicate_value_on_return ) { if ( ! token -> default_value_as_string ) return NULL ; return strdup ( token -> default_value_as_string ) ; } else return token -> default_value_as_string ; } }
retrieves a url token based on the provided token.
retrieves a url token based on the provided token .
// ensure we have an option value // attempt to lookup the token // generate value or dupe if necessary // set retrieval indicator as OK // duplicate on return if specified // set retrieval indicator as OK // duplicate on return if specified