diff options
author | Aki <please@ignore.pl> | 2024-03-26 01:45:33 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-03-26 01:49:16 +0100 |
commit | ea4c0557d0b7c2317e03d3d3aaefd6063c99f091 (patch) | |
tree | dad4634faf3c17f3642d736f62350df88c117a59 /StarsEx/ParseUtil.h | |
parent | 38332f77dc1e7bb03776631101eff6e8ad8bcaef (diff) | |
download | starshatter-ea4c0557d0b7c2317e03d3d3aaefd6063c99f091.zip starshatter-ea4c0557d0b7c2317e03d3d3aaefd6063c99f091.tar.gz starshatter-ea4c0557d0b7c2317e03d3d3aaefd6063c99f091.tar.bz2 |
DWORD replaced with std::uint32_t in non-Win32-related parts
With the exception of some netcode. This brings some important questions
and solidifies me in pursuing better abstract over definitions. It might
also be a good idea to have distinct aliases or compound types for time
and (net) identifiers.
Diffstat (limited to 'StarsEx/ParseUtil.h')
-rw-r--r-- | StarsEx/ParseUtil.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/StarsEx/ParseUtil.h b/StarsEx/ParseUtil.h index 0e147e0..221531e 100644 --- a/StarsEx/ParseUtil.h +++ b/StarsEx/ParseUtil.h @@ -11,9 +11,9 @@ Parser utility functions */ -#ifndef ParseUtil_h -#define ParseUtil_h +#pragma once +#include <cstdint> #include <vector> #include <starshatter/definition.h> @@ -23,28 +23,21 @@ #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); +template <typename Number> bool GetDefNumber(Number& 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 +#include "ParseUtil.inl.h" |