-
Notifications
You must be signed in to change notification settings - Fork 9
/
MultipleLangStringList.cpp
28 lines (25 loc) · 1.56 KB
/
MultipleLangStringList.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "MultipleLangStringList.h"
MultipleLangStringList::MultipleLangStringList() {
mLangStrList = (MultipleLangString **) malloc(sizeof(MultipleLangString *));
numElems = 0;
}
bool MultipleLangStringList::addMultipleLangString(const char * strSP, const char * strEN, const char * strIT, const char * strFR, const char * strGE,
const char * strPO, const char * strCA, const char * strAR, const char * strBU, const char * strCZ,
const char * strCH, const char * strCR, const char * strDA, const char * strFI, const char * strGR,
const char * strHI, const char * strDU, const char * strJA, const char * strNO, const char * strPL,
const char * strRU, const char * strSW, std::vector<std::string> filenameList) {
bool err = false;
if (numElems > 0) {
mLangStrList = (MultipleLangString **) realloc(mLangStrList, sizeof(MultipleLangString *) * (numElems + 1));
if (mLangStrList == NULL) err = true;
}
if (!err) {
*(mLangStrList + numElems) = (MultipleLangString *) malloc(sizeof(MultipleLangString));
if (*(mLangStrList + numElems) != NULL) {
*(mLangStrList + numElems) = new MultipleLangString(strSP, strEN, strIT, strFR, strGE, strPO, strCA, strAR, strBU, strCZ, strCH, strCR, strDA, strFI, strGR, strHI, strDU, strJA, strNO, strPL, strRU, strSW, filenameList);
numElems++;
return true;
}
}
return false;
}