//////////////////////////////////////////////////////////////////////
/// @fn string str_find_range()
/// @brief -- Overload of the all-string variant.
//////////////////////////////////////////////////////////////////////
string str_find_range(string str, char start, char end, bool nested,
                  bool inclusive, bool ignore_quotes, char ignore_following) {
  
  return str_find_range(str, char_to_str(start), char_to_str(end), nested,
                    inclusive, ignore_quotes, ignore_following);

}
예제 #2
0
파일: command2.c 프로젝트: darkael88/42sh
void	refresh_command_line(t_char **list)
{
	t_char	*temp;
	t_char	**activechar;
	int		i;
	char	*tempstr;

	cursor_move_left(*(getcurpos()));
	tputs(tgetstr("cd", NULL), 1, t_write);
	activechar = getactivechar();
	ft_putstr_fd("$> ", *(gettty()));
	if (*list)
	{
		tempstr = char_to_str((*list)->next);
		*(getcurpos()) = 3 + ft_strlen(tempstr);
		ft_putstr_fd(tempstr, *(gettty()));
		ft_memdel((void **)&tempstr);
		temp = (*list)->next;
		i = 3;
		while (temp && temp != *activechar)
		{
			i++;
			temp = temp->next;
		}
		cursor_move_left(*(getcurpos()) - i);
	}
}
//////////////////////////////////////////////////////////////////////
/// @fn string str_replace_all()
/// @brief -- Overload of the all-string version
//////////////////////////////////////////////////////////////////////
string str_replace_all(string str, char to_replace, char replace_with, char ignore_following) {

  return str_replace_all(str, char_to_str(to_replace), char_to_str(replace_with), ignore_following);

}
//////////////////////////////////////////////////////////////////////
/// @fn string str_strip()
/// @brief -- Overload of the all-string version
//////////////////////////////////////////////////////////////////////
string str_strip(string str, char to_strip, bool leading, bool inner, bool trailing) {

  return str_strip(str, char_to_str(to_strip), leading, inner, trailing);

}