Skip to content

Commit

Permalink
Added Animal methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Globostofo committed Oct 4, 2023
1 parent 70c3e43 commit f7d4707
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 0 deletions.
40 changes: 40 additions & 0 deletions include/faker-cxx/Animal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#pragma once

#include <string>

namespace faker
{
class Animal
{
public:
static std::string bear();

static std::string bird();

static std::string cat();

static std::string cetacean();

static std::string cow();

static std::string crocodilia();

static std::string dog();

static std::string fish();

static std::string horse();

static std::string insect();

static std::string lion();

static std::string rabbit();

static std::string rodent();

static std::string snake();

static std::string type();
};
}
96 changes: 96 additions & 0 deletions src/modules/animal/Animal.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#include "faker-cxx/Animal.h"

#include "data/Bears.h"
#include "data/Birds.h"
#include "data/Cats.h"
#include "data/Cetaceans.h"
#include "data/Cows.h"
#include "data/Crocodilia.h"
#include "data/Dogs.h"
#include "data/Fishes.h"
#include "data/Horses.h"
#include "data/Insects.h"
#include "data/Lions.h"
#include "data/Rabbits.h"
#include "data/Rodents.h"
#include "data/Snakes.h"
#include "data/Types.h"
#include "faker-cxx/Helper.h"

namespace faker
{
std::string Animal::bear()
{
return Helper::arrayElement<std::string>(bears);
}

std::string Animal::bird()
{
return Helper::arrayElement<std::string>(birds);
}

std::string Animal::cat()
{
return Helper::arrayElement<std::string>(cats);
}

std::string Animal::cetacean()
{
return Helper::arrayElement<std::string>(cetaceans);
}

std::string Animal::cow()
{
return Helper::arrayElement<std::string>(cows);
}

std::string Animal::crocodilia()
{
return Helper::arrayElement<std::string>(faker::crocodilia);
}

std::string Animal::dog()
{
return Helper::arrayElement<std::string>(dogs);
}

std::string Animal::fish()
{
return Helper::arrayElement<std::string>(fishes);
}

std::string Animal::horse()
{
return Helper::arrayElement<std::string>(horses);
}

std::string Animal::insect()
{
return Helper::arrayElement<std::string>(insects);
}

std::string Animal::lion()
{
return Helper::arrayElement<std::string>(lions);
}

std::string Animal::rabbit()
{
return Helper::arrayElement<std::string>(rabbits);
}

std::string Animal::rodent()
{
return Helper::arrayElement<std::string>(rodents);
}

std::string Animal::snake()
{
return Helper::arrayElement<std::string>(snakes);
}

std::string Animal::type()
{
return Helper::arrayElement<std::string>(types);
}
}

0 comments on commit f7d4707

Please sign in to comment.