# BaseSet< T, Tnum_files, Tsubdir > Struct Template Reference

Information about a single base set. More...

`#include <base_media_base.h>`

## Public Types
typedef SmallMap< const char *, const char * > | TranslatedStrings
## Public Member Functions
| ~BaseSet ()
| Free everything we allocated.
int | GetNumMissing () const
| Get the number of missing files.
int | GetNumInvalid () const
| Get the number of invalid files.
bool | FillSetDetails (IniFile *ini, const char *path, const char *full_filename, bool allow_empty_filename=true)
| Read the set information from a loaded ini.
const char * | GetDescription (const char *isocode=NULL) const
| Get the description for the given ISO code.
## Data Fields
const char * | name
| The name of the base set.
TranslatedStrings | description
| Description of the base set.
uint32 | shortname
| Four letter short variant of the name.
uint32 | version
| The version of this base set.
bool | fallback
| This set is a fallback set, i.e. it should be used only as last resort.
MD5File | files [NUM_FILES]
| All files part of this set.
uint | found_files
| Number of the files that could be found.
uint | valid_files
| Number of the files that could be found and are valid.
T * | next
| The next base set in this list.
## Static Public Attributes
static const size_t | NUM_FILES = Tnum_files
| Number of files in this set.
static const Subdirectory | SUBDIR = Tsubdir
| The sub directory to search for the files.
static const char *const * | file_names = _graphics_file_names
| Internal names of the files in this set.

## Detailed Description

### template<class T, size_t Tnum_files, Subdirectory Tsubdir>
struct BaseSet< T, Tnum_files, Tsubdir >

Information about a single base set.

Template Parameters:

  | T | the real class we're going to be
  | Tnum_files | the number of files in the set
  | Tsubdir | the subdirectory where to find the files

Definition at line 46 of file base_media_base.h.

## Member Function Documentation

template<class T , size_t Tnum_files, Subdirectory Tsubdir>

bool BaseSet< T, Tnum_files, Tsubdir >::FillSetDetails | ( | IniFile * | ini,
|  | const char * | path,
|  | const char * | full_filename,
|  | bool | allow_empty_filename = `true` |
| ) |  |  | `[inline]`

Read the set information from a loaded ini.

Parameters:

  | ini | the ini to read from
  | path | the path to this ini file (for filenames)
  | full_filename | the full filename of the loaded file (for error reporting purposes)
  | allow_empty_filename | empty filenames are valid

Returns:
  true if loading was successful.

Definition at line 35 of file base_media_func.h.

References MD5File::CheckMD5(), MD5File::CR_MATCH, MD5File::CR_MISMATCH, MD5File::CR_NO_FILE, BaseSet< T, Tnum_files, Tsubdir >::description, BaseSet< T, Tnum_files, Tsubdir >::fallback, fetch_metadata, MD5File::filename, BaseSet< T, Tnum_files, Tsubdir >::files, BaseSet< T, Tnum_files, Tsubdir >::found_files, IniFile::GetGroup(), IniGroup::GetItem(), MD5File::hash, IniGroup::item, MD5File::missing_warning, IniItem::name, BaseSet< T, Tnum_files, Tsubdir >::name, IniItem::next, BaseSet< T, Tnum_files, Tsubdir >::shortname, BaseSet< T, Tnum_files, Tsubdir >::valid_files, IniItem::value, and BaseSet< T, Tnum_files, Tsubdir >::version.

template<class T, size_t Tnum_files, Subdirectory Tsubdir>

const char* BaseSet< T, Tnum_files, Tsubdir >::GetDescription | ( | const char * | isocode = `NULL` | ) | const`[inline]`

Get the description for the given ISO code.

It falls back to the first two characters of the ISO code in case no match could be made with the full ISO code. If even then the matching fails the default is returned.

Parameters:

  | isocode | the isocode to search for

Returns:
  the description

Definition at line 125 of file base_media_base.h.

template<class T, size_t Tnum_files, Subdirectory Tsubdir>

int BaseSet< T, Tnum_files, Tsubdir >::GetNumInvalid | ( |  | ) | const`[inline]`

Get the number of invalid files.

Note:
  a missing file is invalid too!

Returns:
  the number

Definition at line 102 of file base_media_base.h.

Referenced by CheckExternalFiles(), GameOptionsWindow::OnInvalidateData(), and GameOptionsWindow::UpdateWidgetSize().

template<class T, size_t Tnum_files, Subdirectory Tsubdir>

int BaseSet< T, Tnum_files, Tsubdir >::GetNumMissing | ( |  | ) | const`[inline]`

Get the number of missing files.

Returns:
  the number

Definition at line 92 of file base_media_base.h.

Referenced by GameOptionsWindow::OnInvalidateData().

## Field Documentation

template<class T, size_t Tnum_files, Subdirectory Tsubdir>

const char *const * BaseSet< T, Tnum_files, Tsubdir >::file_names = _graphics_file_names`[inline, static]`

Internal names of the files in this set.

Implementation.

Definition at line 56 of file base_media_base.h.

The documentation for this struct was generated from the following files:

- src/base_media_base.h
- src/base_media_func.h
- src/gfxinit.cpp
- src/music.cpp
- src/sound.cpp