-
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
950 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
#pragma once | ||
|
||
#include <string_view> | ||
|
||
namespace faker | ||
{ | ||
class Plant | ||
{ | ||
public: | ||
/** | ||
* @brief Returns a random species of tree. | ||
* | ||
* @returns Species of tree. | ||
* | ||
* @code | ||
* Plant::tree() // "Oak" | ||
* @endcode | ||
*/ | ||
static std::string_view tree(); | ||
|
||
/** | ||
* @brief Returns a random species of flower. | ||
* | ||
* @returns Species of flower. | ||
* | ||
* @code | ||
* Plant::flower() // "Rose" | ||
* @endcode | ||
*/ | ||
static std::string_view flower(); | ||
|
||
/** | ||
* @brief Returns a random species of shrub. | ||
* | ||
* @returns Species of shrub. | ||
* | ||
* @code | ||
* Plant::shrub() // "Azalea" | ||
* @endcode | ||
*/ | ||
static std::string_view shrub(); | ||
|
||
/** | ||
* @brief Returns a random species of grass. | ||
* | ||
* @returns Species of grass. | ||
* | ||
* @code | ||
* Plant::grass() // "Kentucky Bluegrass" | ||
* @endcode | ||
*/ | ||
static std::string_view grass(); | ||
|
||
/** | ||
* @brief Returns a random species of fern. | ||
* | ||
* @returns Species of fern. | ||
* | ||
* @code | ||
* Plant::fern() // "Maidenhair" | ||
* @endcode | ||
*/ | ||
static std::string_view fern(); | ||
|
||
/** | ||
* @brief Returns a random species of succulent. | ||
* | ||
* @returns Species of succulent. | ||
* | ||
* @code | ||
* Plant::succulent() // "Aloe Vera" | ||
* @endcode | ||
*/ | ||
static std::string_view succulent(); | ||
|
||
/** | ||
* @brief Returns a random species of vine. | ||
* | ||
* @returns Species of vine. | ||
* | ||
* @code | ||
* Plant::vine() // "Ivy" | ||
* @endcode | ||
*/ | ||
static std::string_view vine(); | ||
|
||
/** | ||
* @brief Returns a random type of plant. | ||
* | ||
* @returns Type of plant. | ||
* | ||
* @code | ||
* Plant::type() // "tree" | ||
* @endcode | ||
*/ | ||
static std::string_view type(); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include "faker-cxx/Plant.h" | ||
|
||
#include <string_view> | ||
|
||
#include "PlantData.h" | ||
#include "faker-cxx/Helper.h" | ||
|
||
namespace faker | ||
{ | ||
std::string_view Plant::tree() | ||
{ | ||
return Helper::arrayElement(trees); | ||
} | ||
|
||
std::string_view Plant::flower() | ||
{ | ||
return Helper::arrayElement(flowers); | ||
} | ||
|
||
std::string_view Plant::shrub() | ||
{ | ||
return Helper::arrayElement(shrubs); | ||
} | ||
|
||
std::string_view Plant::grass() | ||
{ | ||
return Helper::arrayElement(grasses); | ||
} | ||
|
||
std::string_view Plant::fern() | ||
{ | ||
return Helper::arrayElement(ferns); | ||
} | ||
|
||
std::string_view Plant::succulent() | ||
{ | ||
return Helper::arrayElement(succulents); | ||
} | ||
|
||
std::string_view Plant::vine() | ||
{ | ||
return Helper::arrayElement(vines); | ||
} | ||
|
||
std::string_view Plant::type() | ||
{ | ||
return Helper::arrayElement(types); | ||
} | ||
} |
Oops, something went wrong.