Skip to content

Commit

Permalink
Fixed build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtApone117 committed Dec 2, 2024
1 parent 721c2fd commit 1536b21
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 26 deletions.
12 changes: 6 additions & 6 deletions include/faker-cxx/movie.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#pragma once

#include <string_view>
#include "faker-cxx/types/locale.h"

#include "faker-cxx/export.h"
#include "faker-cxx/types/locale.h"

namespace faker::movie
{
/**
* @brief Returns a random movie genre
*
*
* @brief Returns a random movie genre.
*
* @returns Movie genre.
Expand All @@ -22,7 +22,7 @@ FAKER_CXX_EXPORT std::string_view genre(Locale locale = Locale::en_US);

/**
* @param locale The locale. Defaults to `Locale::en_US`.
*
*
* @brief Returns a random movie title.
*
* @returns Movie title.
Expand All @@ -47,7 +47,7 @@ FAKER_CXX_EXPORT std::string_view tvShow(Locale locale = Locale::en_US);

/**
* @param locale The locale. Defaults to `Locale::en_US`.
*
*
* @brief Returns a random movie director name.
*
* @returns Movie director name.
Expand All @@ -60,7 +60,7 @@ FAKER_CXX_EXPORT std::string_view director(Locale locale = Locale::en_US);

/**
* @param locale The locale. Defaults to `Locale::en_US`.
*
*
* @brief Returns a random actor name.
*
* @returns Actor name.
Expand All @@ -73,7 +73,7 @@ FAKER_CXX_EXPORT std::string_view actor(Locale locale = Locale::en_US);

/**
* @param locale The locale. Defaults to `Locale::en_US`.
*
*
* @brief Returns a random actress name.
*
* @returns Actress name.
Expand Down
21 changes: 12 additions & 9 deletions src/modules/movie.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
#include "faker-cxx/movie.h"

#include <string_view>

#include "faker-cxx/helper.h"
#include "movie_data.h"

namespace faker::movie
{
namespace
namespace
{
const struct MovieDefinition& getMovie(Locale locale)
{
switch (locale)
{
const struct MovieDefinition& getMovie(Locale locale)
{
switch (locale)
{
default:
return enUSmoviesDefinitions;
}
}
default:
return enUSmoviesDefinitions;
}
}
}

std::string_view genre(Locale locale)
{
const auto& movie = getMovie(locale);
Expand Down
24 changes: 13 additions & 11 deletions src/modules/movie_data.h
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
#pragma once

#include <array>
#include <string_view>
#include <span>
#include <string_view>

#include "faker-cxx/movie.h"

namespace faker::movie
{

struct MovieDefinition
{
std::span<const std::string_view> actors;
std::span<const std::string_view> actresses;
std::span<const std::string_view> directors;
std::span<const std::string_view> genres;
std::span<const std::string_view> movies;
std::span<const std::string_view> tvShows;
};
struct MovieDefinition
{
std::span<const std::string_view> actors;
std::span<const std::string_view> actresses;
std::span<const std::string_view> directors;
std::span<const std::string_view> genres;
std::span<const std::string_view> movies;
std::span<const std::string_view> tvShows;
};

// "en-us"
// "en-us"
const auto enUSactors = std::to_array<std::string_view>({
"Aamir Khan",
"Abbott and Costello",
Expand Down Expand Up @@ -1314,5 +1315,6 @@ const MovieDefinition enUSmoviesDefinitions = {
.directors = enUSdirectors,
.genres = enUSmovieGenres,
.movies = enUSmovies,
.tvShows = enUStvShows,
};
}

0 comments on commit 1536b21

Please sign in to comment.