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
/********************************************************************
*
*	Created:	16/9/2014   10:00
*
*	File:		fsCStringsFile.h
*
*	Author:		Martin P. King
*	
*	Purpose:	Convert the XML strings to simple VariableTable
*				strings
*
*********************************************************************/

#ifndef fsCStringsFilehdr
#define fsCStringsFilehdr

#include <vector>

#include <fsCore/fsBaseTypes.h>
#include <fsCore/fsStr.h>

#include "fsCVariableTable.h"

class fsCVariableTable;

class fsCStringsFile : public fsCVariableTable
{
public:

	static const fsStr mRowOpenTag;
	static const fsStr mRowCloseTag;
	static const fsStr mCellOpenTag;
	static const fsStr mCellCloseTag;
	static const fsStr mStringPropertyTag;
	static const fsStr mNumberPropertyTag;
	static const fsStr mEllipsisChar;

	static fsBool nextKeyGet(fsStr& pOutStr, std::vector<fsStr>& pLines, std::vector<fsStr>::iterator& pLine);
	static fsBool nextValueGet(fsStr& pOutStr, std::vector<fsStr>& pLines, std::vector<fsStr>::iterator& pLine);

	void read();
	void write();

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

protected:

	fsCStringsFile();

	void read(const fsStr& pFileName, fsCVariableTable* pStrings);

private:

	fsStr mSrcFilename;
	fsStr mOutPath;
};

#endif