Example #1
0
void	card(char *s, char *p, int type, t_list *tokens)
{
	struct dirent	*f;
	DIR				*ret;
	char			*t;
	int				i;

	if ((i = 0) && s[0] == '/')
		return (card(s + 1, "/", type, tokens));
	if ((ret = opendir(p)) == NULL)
		return ;
	if (((t = ft_strchr(s, '/')) != NULL))
	{
		while ((f = readdir(ret)) != NULL)
		{
			if ((match(f->d_name, ft_strsub(s, 0, t - s))) && (i = 1))
			{
				ft_putchar(p[s - t]);
				if (((p[s - t] != '.' && s[s - t - 1] != '.') &&
					!ft_strcmp(f->d_name, "..")) || end_point(f->d_name))
					continue ;
				card(t + 1, ft_strjoin(p, f->d_name), type, tokens);
			}
		}
	}
	i = (i == 0) ? card2(s, p, type, tokens) : i;
	closedir(ret);
}
Example #2
0
TEST (CardTest, cardsShouldBeSuccessfulCompared)
{
  Card card1 (Card_Figure::JACK,Card_Color::DIAMOND);
  Card card2 (Card_Figure::JACK,Card_Color::DIAMOND);
  EXPECT_TRUE (card1 == card2);
}