sqlparser/sqlparser.cpp
// Append a copy of the token
Append a copy of the token
Append a copy of the token
Token* SqlParser::AppendCopy(Token *token, Token *app)
{
	if(token == NULL || app == NULL)
		return NULL;
	Token *append = new Token();
	*append = *app;
	if(app->source_allocated)
	{
		if(app->str != NULL)
			append->str = Str::GetCopy(app->str, app->len);
	}
	if(app->t_len != 0)
	{
		if(app->t_str != NULL)
			append->t_str = Str::GetCopy(app->t_str, app->t_len);
	}
	Append(token, append);
	return append;
}
Token * SqlParser :: AppendCopy ( Token * token , Token * app ) { if ( token == NULL || app == NULL ) return NULL ; Token * append = new Token ( ) ; * append = * app ; if ( app -> source_allocated ) { if ( app -> str != NULL ) append -> str = Str :: GetCopy ( app -> str , app -> len ) ; } if ( app -> t_len != 0 ) { if ( app -> t_str != NULL ) append -> t_str = Str :: GetCopy ( app -> t_str , app -> t_len ) ; } Append ( token , append ) ; return append ; }
Append a copy of the token
Append a copy of the token
// Reallocate source if space is not in place as the original token can be removed later // Reallocate target values to separate buffers if set