Faster compilation
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2464 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
ed285baf9d
commit
e720007649
9 changed files with 418 additions and 116 deletions
|
@ -7,6 +7,64 @@
|
|||
#include <StdExcept>
|
||||
using namespace std;
|
||||
|
||||
struct langstring {
|
||||
int name;
|
||||
int index;
|
||||
};
|
||||
|
||||
class LangStringList : public SortedStringListND<struct langstring>
|
||||
{
|
||||
public:
|
||||
LangStringList()
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
~LangStringList() { }
|
||||
|
||||
int add(const char *name)
|
||||
{
|
||||
int pos=SortedStringListND<struct langstring>::add(name);
|
||||
if (pos == -1) return -1;
|
||||
|
||||
((struct langstring*)gr.get())[pos].index = index;
|
||||
|
||||
int temp = index;
|
||||
index++;
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
int get(char *name)
|
||||
{
|
||||
int v=SortedStringListND<struct langstring>::find(name);
|
||||
if (v==-1) return -1;
|
||||
return ((struct langstring*)gr.get())[v].index;
|
||||
}
|
||||
|
||||
int getnum()
|
||||
{
|
||||
return index;
|
||||
}
|
||||
|
||||
char *idx2name(int idx)
|
||||
{
|
||||
struct langstring *data=(struct langstring *)gr.get();
|
||||
|
||||
for (int i = 0; i < index; i++)
|
||||
{
|
||||
if (data[i].index == idx)
|
||||
{
|
||||
return ((char*)strings.get() + data[i].name);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
private:
|
||||
int index;
|
||||
};
|
||||
|
||||
struct StringTable {
|
||||
LANGID lang_id;
|
||||
common_strings common;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue