Add 8 and 16 bit numeric type API

Signed-off-by: Nicholas Van Sickle <nvsickle@amazon.com>
This commit is contained in:
Nicholas Van Sickle
2021-12-21 16:09:11 -08:00
parent 37330c43a9
commit 68c93273d6
2 changed files with 32 additions and 0 deletions
@@ -150,6 +150,26 @@ namespace AZ::Dom
return Value(&value);
}
Value::Value(int8_t value)
: m_value(aznumeric_cast<int64_t>(value))
{
}
Value::Value(uint8_t value)
: m_value(aznumeric_cast<uint64_t>(value))
{
}
Value::Value(int16_t value)
: m_value(aznumeric_cast<int64_t>(value))
{
}
Value::Value(uint16_t value)
: m_value(aznumeric_cast<uint64_t>(value))
{
}
Value::Value(int32_t value)
: m_value(aznumeric_cast<int64_t>(value))
{
@@ -193,6 +193,10 @@ namespace AZ::Dom
Value(AZStd::string_view stringView, bool copy);
Value(SharedStringType sharedString);
Value(int8_t value);
Value(uint8_t value);
Value(int16_t value);
Value(uint16_t value);
Value(int32_t value);
Value(uint32_t value);
Value(int64_t value);
@@ -321,12 +325,20 @@ namespace AZ::Dom
void SetInt64(int64_t);
int32_t GetInt32() const;
void SetInt32(int32_t);
int16_t GetInt16() const;
void SetInt16(int16_t);
int8_t GetInt8() const;
void SetInt8(int8_t);
// uint API...
uint64_t GetUint64() const;
void SetUint64(uint64_t);
uint32_t GetUint32() const;
void SetUint32(uint32_t);
uint16_t GetUint16() const;
void SetUint16(uint16_t);
uint8_t GetUint8() const;
void SetUint8(uint8_t);
// bool API...
bool GetBool() const;