sqlparser/sqlparser.cpp
// Prepend a copy of the token
Prepend a copy of the token
Prepend a copy of the token
Token* SqlParser::PrependCopy(Token *token, Token *pre)
{
	if(token == NULL || pre == NULL)
		return NULL;
	Token *prepend = new Token();
	*prepend = *pre;
	prepend->flags = TOKEN_INSERTED;
	if(pre->source_allocated == true)
	{
		prepend->str = Str::GetCopy(pre->str, pre->len);
	}
	if(pre->t_len != 0)
	{
		if(pre->t_str != NULL)
			prepend->t_str = Str::GetCopy(pre->t_str, pre->t_len);
	}
	_tokens.Prepend(token, prepend);
	return prepend;
}
Token * SqlParser :: PrependCopy ( Token * token , Token * pre ) { if ( token == NULL || pre == NULL ) return NULL ; Token * prepend = new Token ( ) ; * prepend = * pre ; prepend -> flags = TOKEN_INSERTED ; if ( pre -> source_allocated == true ) { prepend -> str = Str :: GetCopy ( pre -> str , pre -> len ) ; } if ( pre -> t_len != 0 ) { if ( pre -> t_str != NULL ) prepend -> t_str = Str :: GetCopy ( pre -> t_str , pre -> t_len ) ; } _tokens . Prepend ( token , prepend ) ; return prepend ; }
Prepend a copy of the token
Prepend a copy of the token
// Reallocate source values to separate buffers if set // Reallocate target values to separate buffers if set