summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/ParseUtil.h
blob: 0e147e07887e86fb5d54bb8aa10a243908bb3e14 (plain)
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
/*  Starshatter: The Open Source Project
    Copyright (c) 2021-2024, Starshatter: The Open Source Project Contributors
    Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors
    Copyright (c) 1997-2006, Destroyer Studios LLC.

    AUTHOR:       John DiCamillo


    OVERVIEW
    ========
    Parser utility functions
*/

#ifndef ParseUtil_h
#define ParseUtil_h

#include <vector>

#include <starshatter/definition.h>
#include <starshatter/foundation/reader.h>

#include "Types.h"
#include "Geometry.h"
#include "Color.h"

// +--------------------------------------------------------------------+

bool GetDefBool(bool& dst, TermDef* def, const char* file);
bool GetDefText(Text& dst, TermDef* def, const char* file);
bool GetDefText(char* dst, TermDef* def, const char* file);
bool GetDefNumber(int& dst, TermDef* def, const char* file);
bool GetDefNumber(DWORD& dst, TermDef* def, const char* file);
bool GetDefNumber(float& dst, TermDef* def, const char* file);
bool GetDefNumber(double& dst, TermDef* def, const char* file);
bool GetDefVec(Vec3& dst, TermDef* def, const char* file);
bool GetDefColor(Color& dst, TermDef* def, const char* file);
bool GetDefColor(ColorValue& dst, TermDef* def, const char* file);
bool GetDefRect(Rect& dst, TermDef* def, const char* file);
bool GetDefInsets(Insets& dst, TermDef* def, const char* file);
bool GetDefTime(int& dst, TermDef* def, const char* file);

bool GetDefArray(int*    dst, int size, TermDef* def, const char* file);
bool GetDefArray(float*  dst, int size, TermDef* def, const char* file);
bool GetDefArray(double* dst, int size, TermDef* def, const char* file);
bool GetDefArray(std::vector<DWORD>& array,      TermDef* def, const char* file);
bool GetDefArray(std::vector<float>& array,      TermDef* def, const char* file);

// +--------------------------------------------------------------------+

#endif  // ParseUtil_h