[Toponaming] create ElementMap class (#9175)

* Copypaste ElementMap
* Add MappedNameRef
* Fix missing include
* Copypaste `findTagInElementName`
* fix error introduced _somewhere_
* refactor toponaming constants
* Move `findTagInElementName` in `MappedName`
* reintroduce workaround to compile ElementMap
* Added missing functions copied from complexgeodata
* fix last compile errors, reorder and format files
* remove recursive refs to ComplexGeoData
* Add more comments
* fixed comments and added tests
* added FIXME, make functions private, misc fixes
* Move static functions from complexGeoData to PostfixStringReferences. Rename to ElementNamingUtils
* Fix broken includes due to previous change
* Revert constants from string to const char*
* added childmap tests and made hasher public
* Make functions private
* Added remaining tests
* removed bool return from `erase` functions
* fix missing appexport

Co-authored-by: John Dupuy <jdupuy98@gmail.com>
This commit is contained in:
Pesc0
2023-06-15 16:05:24 +02:00
committed by GitHub
parent 32d8029780
commit 4a8d3853ba
26 changed files with 2450 additions and 218 deletions

View File

@@ -51,7 +51,7 @@ TEST(MappedName, namedConstructionWithMaxSize)
TEST(MappedName, namedConstructionDiscardPrefix)
{
// Arrange
std::string name = Data::ComplexGeoData::elementMapPrefix() + "TEST";
std::string name = std::string(Data::ELEMENT_MAP_PREFIX) + "TEST";
// Act
Data::MappedName mappedName(name.c_str());
@@ -80,7 +80,7 @@ TEST(MappedName, stringNamedConstruction)
TEST(MappedName, stringNamedConstructionDiscardPrefix)
{
// Arrange
std::string name = Data::ComplexGeoData::elementMapPrefix() + "TEST";
std::string name = std::string(Data::ELEMENT_MAP_PREFIX) + "TEST";
// Act
Data::MappedName mappedName(name);
@@ -560,7 +560,7 @@ TEST(MappedName, appendToBufferWithPrefix)
// Arrange
Data::MappedName mappedName(Data::MappedName("TEST"), "POSTFIXTEST");
std::string buffer("STUFF");
std::string elemMapPrefix = Data::ComplexGeoData::elementMapPrefix();
std::string elemMapPrefix = Data::ELEMENT_MAP_PREFIX;
// Act
mappedName.appendToBufferWithPrefix(buffer);
@@ -586,7 +586,7 @@ TEST(MappedName, toPrefixedString)
// Arrange
Data::MappedName mappedName(Data::MappedName("TEST"), "POSTFIXTEST");
std::string buffer("STUFF");
std::string elemMapPrefix = Data::ComplexGeoData::elementMapPrefix();
std::string elemMapPrefix = Data::ELEMENT_MAP_PREFIX;
// Act
buffer += mappedName.toPrefixedString();