Multi diag tools
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Mdt::Translation::TranslationInfoList Class Reference

Container that contains a list of TranslationInfo. More...

#include <TranslationInfoList.h>

Public Types

using const_iterator = QVector< TranslationInfo >::const_iterator
 STL-style const iterator.
 
using value_type = QVector< TranslationInfo >::value_type
 STL value type.
 

Public Member Functions

 TranslationInfoList ()=default
 Construct a empty translation info list.
 
 TranslationInfoList (const TranslationInfoList &)=default
 Copy construct a translation info list from a other.
 
TranslationInfoListoperator= (const TranslationInfoList &)=default
 Copy assign a translation info list this this one.
 
 TranslationInfoList (TranslationInfoList &&)=default
 Move construct a translation info list from a other.
 
TranslationInfoListoperator= (TranslationInfoList &&)=default
 Move assign a translation info list this this one.
 
void addTranslation (const TranslationInfo &translation)
 Add a translation info to the end of this list. More...
 
void addTranslations (const TranslationInfoList &translations)
 Add a list of qt translations to this list. More...
 
int count () const
 Get count of items in this list.
 
bool isEmpty () const
 Check if this list is empty.
 
const TranslationInfoat (int index) const
 Get translation at index. More...
 
QStringList getUsedFileSuffixes () const
 Get used file suffixes in this list. More...
 
TranslationInfoList getTranslationsForFileSuffix (const QString &fileSuffix) const
 Get translations for a of file suffixe. More...
 
TranslationInfoList getTranslationsForFileSuffixes (const QStringList &fileSuffixes) const
 Get translations for a list of file suffixes. More...
 
const_iterator cbegin () const
 Returns an STL-style const iterator pointing to the first item in this list.
 
const_iterator cend () const
 Returns an STL-style iterator pointing to the imaginary item after the last item in this list.
 
const_iterator begin () const
 Returns an STL-style const iterator pointing to the first item in this list.
 
const_iterator end () const
 Returns an STL-style iterator pointing to the imaginary item after the last item in this list.
 
QStringList toQmFilePathList () const
 Get a list of file path for this list.
 
LanguageCodeList toLanguageCodeList () const
 Get a list of language codes existing in this list.
 

Static Public Member Functions

static TranslationInfoList fromQmFilePathList (const QStringList &qmFilePathList)
 Create a translation info list from a list of files. More...
 

Detailed Description

Container that contains a list of TranslationInfo.

Definition at line 35 of file TranslationInfoList.h.

Member Function Documentation

void Mdt::Translation::TranslationInfoList::addTranslation ( const TranslationInfo translation)

Add a translation info to the end of this list.

If translation allready exists, it will not be added.

Definition at line 25 of file TranslationInfoList.cpp.

void Mdt::Translation::TranslationInfoList::addTranslations ( const TranslationInfoList translations)

Add a list of qt translations to this list.

Will add each translation from translations that not actually exists in this list.

Definition at line 33 of file TranslationInfoList.cpp.

const TranslationInfo& Mdt::Translation::TranslationInfoList::at ( int  index) const
inline

Get translation at index.

Precondition
index must be in valid range ( 0 <= index < count() ).

Definition at line 99 of file TranslationInfoList.h.

TranslationInfoList Mdt::Translation::TranslationInfoList::fromQmFilePathList ( const QStringList &  qmFilePathList)
static

Create a translation info list from a list of files.

Precondition
For each path in qmFilePathList , the file must have .qm extension. (it is not checked if the file exists).

Definition at line 104 of file TranslationInfoList.cpp.

TranslationInfoList Mdt::Translation::TranslationInfoList::getTranslationsForFileSuffix ( const QString &  fileSuffix) const

Get translations for a of file suffixe.

fileSuffix refers to TranslationInfo::fileSuffix()

Precondition
fileSuffix must not be empty.

Definition at line 54 of file TranslationInfoList.cpp.

TranslationInfoList Mdt::Translation::TranslationInfoList::getTranslationsForFileSuffixes ( const QStringList &  fileSuffixes) const

Get translations for a list of file suffixes.

fileSuffixes refers to TranslationInfo::fileSuffix()

Precondition
fileSuffixes must not be empty.
no suffix must be empty in fileSuffixes .

Definition at line 68 of file TranslationInfoList.cpp.

QStringList Mdt::Translation::TranslationInfoList::getUsedFileSuffixes ( ) const

Get used file suffixes in this list.

See also
TranslationInfo::fileSuffix()

Definition at line 40 of file TranslationInfoList.cpp.


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