Fixes and cleanup for recent correction changes
Signed-off-by: kberg-amzn <karlberg@amazon.com>
This commit is contained in:
@@ -10,19 +10,6 @@
|
||||
|
||||
namespace AzNetworking
|
||||
{
|
||||
StringifySerializer::StringifySerializer(char delimeter, bool outputFieldNames, const AZStd::string& seperator)
|
||||
: m_delimeter(delimeter)
|
||||
, m_outputFieldNames(outputFieldNames)
|
||||
, m_separator(seperator)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
const AZStd::string& StringifySerializer::GetString() const
|
||||
{
|
||||
return m_string;
|
||||
}
|
||||
|
||||
const StringifySerializer::ValueMap& StringifySerializer::GetValueMap() const
|
||||
{
|
||||
return m_valueMap;
|
||||
@@ -138,21 +125,8 @@ namespace AzNetworking
|
||||
bool StringifySerializer::ProcessData(const char* name, const T& value)
|
||||
{
|
||||
const AZStd::string keyString = m_prefix + name;
|
||||
|
||||
if (!m_string.empty())
|
||||
{
|
||||
// Only add delimeters after we have processed at least one element
|
||||
m_string += m_delimeter;
|
||||
}
|
||||
|
||||
if (m_outputFieldNames)
|
||||
{
|
||||
m_string += keyString;
|
||||
}
|
||||
|
||||
AZ::CVarFixedString valueString = AZ::ConsoleTypeHelpers::ValueToString(value);
|
||||
m_valueMap[keyString] = valueString.c_str();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,7 @@ namespace AzNetworking
|
||||
|
||||
using ValueMap = AZStd::map<AZStd::string, AZStd::string>;
|
||||
|
||||
StringifySerializer(char delimeter = ' ', bool outputFieldNames = true, const AZStd::string& seperator = "=");
|
||||
|
||||
//! After serializing objects, get the serialized values as a single string.
|
||||
const AZStd::string& GetString() const;
|
||||
StringifySerializer() = default;
|
||||
|
||||
//! After serializing objects, get the serialized values as a map of key/value pairs.
|
||||
const ValueMap& GetValueMap() const;
|
||||
@@ -60,15 +57,8 @@ namespace AzNetworking
|
||||
template <typename T>
|
||||
bool ProcessData(const char* name, const T& value);
|
||||
|
||||
private:
|
||||
|
||||
char m_delimeter;
|
||||
bool m_outputFieldNames = true;
|
||||
|
||||
ValueMap m_valueMap;
|
||||
AZStd::string m_string;
|
||||
AZStd::string m_prefix;
|
||||
AZStd::string m_separator;
|
||||
AZStd::deque<AZStd::size_t> m_prefixSizeStack;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user