mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Allow other root XML than entity.
Implements a `GetOnlyChild()`, following discussion at https://irclogs.wildfiregames.com/%230ad-dev/2022-05-06-QuakeNet-%230ad-dev.log. Differential revision: https://code.wildfiregames.com/D4738 Comments by: @phosit, @Stan, @vladislavbelov, @wraitii This was SVN commit r27323.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2022 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
TS_ASSERT_EQUALS(node.GetChild("test").GetChild("Bar").GetChild("Baz").ToInt(), 3);
|
||||
TS_ASSERT(node.GetChild("test").GetChild("Qux").IsOk());
|
||||
TS_ASSERT(!node.GetChild("test").GetChild("Qux").GetChild("Baz").IsOk());
|
||||
TS_ASSERT_STR_EQUALS(node.GetChild("test").ToXMLString(), node.GetOnlyChild().ToXMLString());
|
||||
|
||||
CParamNode nullOne(false);
|
||||
CParamNode nullTwo = nullOne;
|
||||
|
||||
Reference in New Issue
Block a user