Page MenuHomeWildfire Games

Move GUI string parsing specializations to a separate file
ClosedPublic

Authored by elexis on Aug 19 2019, 9:12 PM.

Details

Summary

The GUI class with static members and the non-static CGUISetting class in GUIutil.h should become merged, since they have the same purpose (managing setting values).
To make this refactoring easier, the many specializations of ParseString warrant to be moved to a separate file, similar ScriptInterface::FromJSVal in GUIScriptConversions, EngineScriptConversions.cpp, ScriptConversions.cpp.
While at it, remove the unneeded __ParseString proxy.

Test Plan

I remember writing the patch to remove duplication of the CRect and CPos parser, but that's not for this this commit. So the only check remaining is observing that the code is not modified except for the function signature, and that one may have cpp files without header files (similar to GUIScriptConversions.cpp or EngineScriptConversions.cpp).

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Aug 19 2019, 9:12 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/tests/test_ParseString.h
|  24| class·TestGuiParseString·:·public·CxxTest::TestSuite
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classTestGuiParseString:' is invalid C code. Use --std or --language to configure the language.

source/gui/GUIutil.h
|  44| template<typename·T>·class·GUI;
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'template<...' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/428/display/redirect

This revision was not accepted when it landed; it landed in state Needs Review.Aug 19 2019, 9:43 PM
This revision was automatically updated to reflect the committed changes.
elexis updated the Trac tickets for this revision.Aug 29 2019, 11:21 AM