Refactor all element name pairs into clearer struct names - definitions
This commit is contained in:
@@ -2,8 +2,39 @@
|
||||
#define ELEMENT_NAMING_UTILS_H
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include "FCGlobal.h"
|
||||
|
||||
namespace App
|
||||
{
|
||||
|
||||
/** Return type for lookups of new and old style sub-element names
|
||||
*
|
||||
*/
|
||||
struct ElementNamePair
|
||||
{
|
||||
std::string newName;
|
||||
std::string oldName;
|
||||
|
||||
ElementNamePair() = default;
|
||||
|
||||
ElementNamePair(std::string newNameStr, std::string oldNameStr) :
|
||||
newName(std::move(newNameStr)), oldName(std::move(oldNameStr))
|
||||
{
|
||||
}
|
||||
|
||||
bool operator==(const ElementNamePair& other) const
|
||||
{
|
||||
return this->newName == other.newName && this->oldName == other.oldName;
|
||||
};
|
||||
|
||||
void swap(ElementNamePair& other) noexcept
|
||||
{
|
||||
std::swap(*this, other);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
namespace Data
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
#include <boost/any.hpp>
|
||||
#include <FCConfig.h>
|
||||
|
||||
#include "ElementNamingUtils.h"
|
||||
|
||||
namespace Py {
|
||||
class Object;
|
||||
}
|
||||
@@ -486,7 +488,7 @@ protected:
|
||||
String documentName;
|
||||
String documentObjectName;
|
||||
String subObjectName;
|
||||
std::pair<std::string,std::string> shadowSub;
|
||||
ElementNamePair shadowSub;
|
||||
std::vector<Component> components;
|
||||
bool documentNameSet;
|
||||
bool documentObjectNameSet;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <string>
|
||||
#include <FCGlobal.h>
|
||||
|
||||
#include "ElementNamingUtils.h"
|
||||
namespace Py {
|
||||
class Object;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user