Debian Codegraph @

Source/ResourceVersionInfo.h

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