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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
/*
* ResourceVersionInfo.h: interface for the CResourceVersionInfo class.
*
* This file is a part of NSIS.
*
* Copyright (C) 1999-2025 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
*
* Licence details can be found in the file COPYING.
*
* This software is provided 'as-is', without any express or implied
* warranty.
*
* Unicode support and Doxygen comments by Jim Park -- 07/26/2007
*/
#if !defined(AFX_RESOURCEVERSIONINFO_H__80439ADA_49DA_4623_8DA9_1663FF356E76__INCLUDED_)
#define AFX_RESOURCEVERSIONINFO_H__80439ADA_49DA_4623_8DA9_1663FF356E76__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "exehead/config.h"
#ifdef NSIS_SUPPORT_VERSION_INFO
#include "Platform.h"
#include "strlist.h"
struct version_string_list;
class CVersionStrigList : public SortedStringListND<struct version_string_list>
{
public:
~CVersionStrigList();
/**
* Add a version_string_list struct referred to by langid. Then add the
* codepage value to the structure.
*
* @param langid The language ID (LANGID)
* @param codepage The code page value to set.
* @return The position to the inserted structure, false (0) if failed.
*/
int add(LANGID langid, int codepage);
/**
* Get the language ID given the positional index idx.
*/
LANGID get_lang(int idx);
/**
* Get the codepage value given the positional index idx.
*/
int get_codepage(int idx);
/**
* Get the string pair mappings given the positional index idx.
*/
DefineList* get_strings(int idx);
/**
* Given a language ID return the positional index that holds the
* version_string_list struct. Actually, the codepage value is ignored.
*/
int find(LANGID lang_id, int codepage);
/**
* Get the number of version_string_list objects stored in this list.
*/
int getnum();
};
/////////////////////////////////////////////////////////////////////////////////////////////
class CResourceVersionInfo
{
VS_FIXEDFILEINFO m_FixedInfo;
CVersionStrigList m_ChildStringLists;
public:
CResourceVersionInfo();
virtual ~CResourceVersionInfo();
int SetKeyValue(LANGID lang_id, int codepage, TCHAR* AKeyName, TCHAR* AValue);
/**
* Set the file version.
*/
void SetFileVersion(int HighPart, int LowPart);
/**
* Set the product version.
*/
void SetProductVersion(int HighPart, int LowPart);
/**
* Write the data out to the flat buffer 'strm'. Not sure where and how
* it gets read back in though.
*/
void ExportToStream(GrowBuf &strm, int Index);
/**
* How many string tables are we storing in the m_ChildStringLists?
*/
int GetStringTablesCount();
/**
* Given a positional index, get the Language ID associated with it.
*/
LANGID GetLangID(int Index);
/**
* Given a positional index, get the CodePage associated with it.
*/
int GetCodePage(int Index);
/**
* Given the language ID, codepage, and the 'keyname', return the
* TCHAR* pointer to the value portion of the key-value pair.
*
* @param LangID The language ID.
* @param codepage The codepage. (Not used.)
* @param pKeyName The key name in the key-value pair of strings.
* @return The value string associated with the key string. NULL
* if not found.
*/
TCHAR *FindKey(LANGID LangID, int codepage, const TCHAR *pKeyName);
};
#endif
#endif // !defined(AFX_RESOURCEVERSIONINFO_H__80439ADA_49DA_4623_8DA9_1663FF356E76__INCLUDED_)
|