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
/********************************************************************
*
*	File:		gfCCatalogueParserVarTable.h
*
*	Purpose:	Parse the catalogue data file
*
*********************************************************************/

#ifndef gfCCatalogueParserVarTablehdr
#define gfCCatalogueParserVarTablehdr

#include "../gfICatalogueParser.h"

class gfICatalogueEntry;
class gfCCatalogueCatalogue;
class fsCVariableTable;


class gfCCatalogueParserVarTable : public gfICatalogueParser
{
public:

	gfCCatalogueCatalogue* const catalogueLoad(const fsStr& pFileName) override;

	gfCCatalogueParserVarTable();
	virtual ~gfCCatalogueParserVarTable();<--- Destructor in derived class

protected:


	void categoryLoad(gfCCatalogueCatalogue* pCatalogue, const fsStr& pParentCategory, const fsStr& pFileName);

private:

	struct SSettings
	{
		fsStr mIconFileBase;
		fsStr mImageFileBase;
		fsStr mDefaultAction;
	};

	void entriesCreate(gfCCatalogueCatalogue* pCatalogue, const fsStr& pParentCategory,
	                   fsCVariableTable* pVarTable, const SSettings& pSettings);
	static fsBool itemCreate(gfCCatalogueCatalogue* pCatalogue, const fsStr& pParentCategory,
	                         fsCVariableTable* pVarTable, const SSettings& pSettings, fsS32 pIndex);
	static void graphicFileBasesGet(fsCVariableTable* pVarTable, SSettings& pSettings);
	static fsStr extensionAdd(const fsStr& pFilename);
};

#endif