Skip to content

Commit

Permalink
refactor: change movie class to namespace (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
cieslarmichal authored Jun 25, 2024
1 parent 13d94a3 commit 61b49a3
Show file tree
Hide file tree
Showing 4 changed files with 1,349 additions and 1,363 deletions.
126 changes: 61 additions & 65 deletions include/faker-cxx/Movie.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,71 @@

#include <string_view>

namespace faker
namespace faker::movie
{
class Movie
{
public:
/**
* @brief Returns a random movie genre.
*
* @returns Movie genre.
*
* @code
* Movie::genre() // "Drama"
* @endcode
*/
static std::string_view genre();
/**
* @brief Returns a random movie genre.
*
* @returns Movie genre.
*
* @code
* movie::genre() // "Drama"
* @endcode
*/
std::string_view genre();

/**
* @brief Returns a random movie title.
*
* @returns Movie title.
*
* @code
* Movie::movieTitle() // "Pulp Fiction"
* @endcode
*/
static std::string_view movieTitle();
/**
* @brief Returns a random movie title.
*
* @returns Movie title.
*
* @code
* movie::movieTitle() // "Pulp Fiction"
* @endcode
*/
std::string_view movieTitle();

/**
* @brief Returns a random tv show.
*
* @returns Tv show.
*
* @code
* Movie::tvShow() // "The Sopranos"
* @endcode
*/
static std::string_view tvShow();
/**
* @brief Returns a random tv show.
*
* @returns Tv show.
*
* @code
* movie::tvShow() // "The Sopranos"
* @endcode
*/
std::string_view tvShow();

/**
* @brief Returns a random movie director name.
*
* @returns Movie director name.
*
* @code
* Movie::director() // "Quentin Tarantino"
* @endcode
*/
static std::string_view director();
/**
* @brief Returns a random movie director name.
*
* @returns Movie director name.
*
* @code
* movie::director() // "Quentin Tarantino"
* @endcode
*/
std::string_view director();

/**
* @brief Returns a random actor name.
*
* @returns Actor name.
*
* @code
* Movie::actor() // "John Travolta"
* @endcode
*/
static std::string_view actor();
/**
* @brief Returns a random actor name.
*
* @returns Actor name.
*
* @code
* movie::actor() // "John Travolta"
* @endcode
*/
std::string_view actor();

/**
* @brief Returns a random actress name.
*
* @returns Actress name.
*
* @code
* Movie::actress() // "Scarlett Johansson"
* @endcode
*/
static std::string_view actress();
};
/**
* @brief Returns a random actress name.
*
* @returns Actress name.
*
* @code
* movie::actress() // "Scarlett Johansson"
* @endcode
*/
std::string_view actress();
}
14 changes: 7 additions & 7 deletions src/modules/movie/Movie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@
#include "faker-cxx/Helper.h"
#include "MovieData.h"

namespace faker
namespace faker::movie
{
std::string_view Movie::genre()
std::string_view genre()
{
return Helper::arrayElement(movieGenres);
}

std::string_view Movie::movieTitle()
std::string_view movieTitle()
{
return Helper::arrayElement(movies);
}

std::string_view Movie::tvShow()
std::string_view tvShow()
{
return Helper::arrayElement(tvShows);
}

std::string_view Movie::director()
std::string_view director()
{
return Helper::arrayElement(directors);
}

std::string_view Movie::actor()
std::string_view actor()
{
return Helper::arrayElement(actors);
}

std::string_view Movie::actress()
std::string_view actress()
{
return Helper::arrayElement(actresses);
}
Expand Down
Loading

0 comments on commit 61b49a3

Please sign in to comment.