@@ -199,7 +199,7 @@ namespace Descriptors
199
199
}
200
200
else if (osTypeEnum == Impl::OSTypes::String)
201
201
{
202
- return construct_descriptor<UnicodeString_Wrapper>(key, ostype);
202
+ return construct_descriptor<UnicodeString_Wrapper>(document, key, ostype);
203
203
}
204
204
else
205
205
{
@@ -271,15 +271,15 @@ namespace Descriptors
271
271
{
272
272
return ;
273
273
}
274
- m_DescriptorItems.push_back (item);
274
+ m_DescriptorItems.push_back (std::move ( item) );
275
275
}
276
276
277
277
278
278
// ---------------------------------------------------------------------------------------------------------------------
279
279
// ---------------------------------------------------------------------------------------------------------------------
280
280
void KeyValueMixin::insert (std::string key, std::unique_ptr<DescriptorBase> value) noexcept
281
281
{
282
- insert (std::make_pair (key, value));
282
+ insert (std::make_pair (key, std::move ( value) ));
283
283
}
284
284
285
285
// ---------------------------------------------------------------------------------------------------------------------
@@ -328,15 +328,15 @@ namespace Descriptors
328
328
valueRef = std::move (item.second );
329
329
return ;
330
330
}
331
- m_DescriptorItems.push_back (item);
331
+ m_DescriptorItems.push_back (std::move ( item) );
332
332
}
333
333
334
334
335
335
// ---------------------------------------------------------------------------------------------------------------------
336
336
// ---------------------------------------------------------------------------------------------------------------------
337
337
void KeyValueMixin::insert_or_assign (std::string key, std::unique_ptr<DescriptorBase> value) noexcept
338
338
{
339
- insert_or_assign (std::make_pair (key, value));
339
+ insert_or_assign (std::make_pair (key, std::move ( value) ));
340
340
}
341
341
342
342
@@ -397,6 +397,18 @@ namespace Descriptors
397
397
}
398
398
399
399
400
+ // ---------------------------------------------------------------------------------------------------------------------
401
+ // ---------------------------------------------------------------------------------------------------------------------
402
+ KeyValueMixin& KeyValueMixin::operator =(KeyValueMixin&& other) noexcept
403
+ {
404
+
405
+ if (this != &other)
406
+ {
407
+ this ->m_DescriptorItems = std::move (other.m_DescriptorItems );
408
+ }
409
+ return *this ;
410
+ }
411
+
400
412
// ---------------------------------------------------------------------------------------------------------------------
401
413
// ---------------------------------------------------------------------------------------------------------------------
402
414
Property::Property (std::string key, std::vector<char > osKey, std::string name, std::string classID, std::string keyID)
@@ -1134,10 +1146,10 @@ namespace Descriptors
1134
1146
1135
1147
// ---------------------------------------------------------------------------------------------------------------------
1136
1148
// ---------------------------------------------------------------------------------------------------------------------
1137
- List::List (std::string key, std::vector<char > osKey, std::vector<DescriptorVariant > items)
1149
+ List::List (std::string key, std::vector<char > osKey, std::vector<std::unique_ptr<DescriptorBase> > items)
1138
1150
: DescriptorBase(key, osKey)
1139
1151
{
1140
- m_Items = items;
1152
+ m_Items = std::move ( items) ;
1141
1153
}
1142
1154
1143
1155
@@ -1444,7 +1456,7 @@ namespace Descriptors
1444
1456
// ---------------------------------------------------------------------------------------------------------------------
1445
1457
bool double_Wrapper::operator ==(const double_Wrapper& other) const
1446
1458
{
1447
- return this ->m_Value == other.m_Value
1459
+ return this ->m_Value == other.m_Value ;
1448
1460
}
1449
1461
1450
1462
@@ -1458,22 +1470,34 @@ namespace Descriptors
1458
1470
};
1459
1471
}
1460
1472
1473
+
1474
+ // ---------------------------------------------------------------------------------------------------------------------
1475
+ // ---------------------------------------------------------------------------------------------------------------------
1476
+ double_Wrapper::double_Wrapper (double value)
1477
+ {
1478
+ m_Value = value; DescriptorBase::m_OSKey = Impl::descriptorKeys.at (Impl::OSTypes::Double);
1479
+ }
1461
1480
1481
+
1462
1482
// ---------------------------------------------------------------------------------------------------------------------
1463
1483
// ---------------------------------------------------------------------------------------------------------------------
1464
1484
void int32_t_Wrapper::read (File& document)
1465
1485
{
1466
1486
m_Value = ReadBinaryData<int32_t >(document);
1467
1487
}
1468
1488
1489
+ // ---------------------------------------------------------------------------------------------------------------------
1490
+ // ---------------------------------------------------------------------------------------------------------------------
1469
1491
void int32_t_Wrapper::write (File& document) const
1470
1492
{
1471
1493
WriteBinaryData<int32_t >(document, m_Value);
1472
1494
}
1473
1495
1496
+ // ---------------------------------------------------------------------------------------------------------------------
1497
+ // ---------------------------------------------------------------------------------------------------------------------
1474
1498
bool int32_t_Wrapper::operator ==(const int32_t_Wrapper& other) const
1475
1499
{
1476
- return this ->m_Value == other.m_Value
1500
+ return this ->m_Value == other.m_Value ;
1477
1501
}
1478
1502
1479
1503
json_ordered int32_t_Wrapper::to_json () const
@@ -1484,6 +1508,11 @@ namespace Descriptors
1484
1508
};
1485
1509
}
1486
1510
1511
+ int32_t_Wrapper::int32_t_Wrapper (int32_t value)
1512
+ {
1513
+ m_Value = value; DescriptorBase::m_OSKey = Impl::descriptorKeys.at (Impl::OSTypes::Integer);
1514
+ }
1515
+
1487
1516
void int64_t_Wrapper::read (File& document)
1488
1517
{
1489
1518
m_Value = ReadBinaryData<int64_t >(document);
@@ -1496,17 +1525,22 @@ namespace Descriptors
1496
1525
1497
1526
bool int64_t_Wrapper::operator ==(const int64_t_Wrapper& other) const
1498
1527
{
1499
- return this ->m_Value == other.m_Value
1528
+ return this ->m_Value == other.m_Value ;
1500
1529
}
1501
1530
1502
1531
json_ordered int64_t_Wrapper::to_json () const
1503
1532
{
1504
1533
return {
1505
1534
{" implementation" , { {" _data_type" , " int64_t" } }},
1506
- { " value" , value }
1535
+ { " value" , m_Value }
1507
1536
};
1508
1537
}
1509
1538
1539
+ int64_t_Wrapper::int64_t_Wrapper (int64_t value)
1540
+ {
1541
+ m_Value = value; DescriptorBase::m_OSKey = Impl::descriptorKeys.at (Impl::OSTypes::LargeInteger);
1542
+ }
1543
+
1510
1544
void bool_Wrapper::read (File& document)
1511
1545
{
1512
1546
m_Value = ReadBinaryData<bool >(document);
@@ -1519,18 +1553,23 @@ namespace Descriptors
1519
1553
1520
1554
bool bool_Wrapper::operator ==(const bool_Wrapper& other) const
1521
1555
{
1522
- return this ->m_Value == other.m_Value
1556
+ return this ->m_Value == other.m_Value ;
1523
1557
}
1524
1558
1525
1559
json_ordered bool_Wrapper::to_json () const
1526
1560
{
1527
1561
return
1528
1562
{
1529
1563
{" implementation" , { {" _data_type" , " bool" } }},
1530
- { " value" , value }
1564
+ { " value" , m_Value }
1531
1565
};
1532
1566
}
1533
1567
1568
+ bool_Wrapper::bool_Wrapper (bool value)
1569
+ {
1570
+ m_Value = value; DescriptorBase::m_OSKey = Impl::descriptorKeys.at (Impl::OSTypes::Boolean);
1571
+ }
1572
+
1534
1573
void UnicodeString_Wrapper::read (File& document)
1535
1574
{
1536
1575
m_Value.read (document, 1u );
@@ -1543,18 +1582,23 @@ namespace Descriptors
1543
1582
1544
1583
bool UnicodeString_Wrapper::operator ==(const UnicodeString_Wrapper& other) const
1545
1584
{
1546
- return this ->m_Value == other.m_Value
1585
+ return this ->m_Value == other.m_Value ;
1547
1586
}
1548
1587
1549
1588
json_ordered UnicodeString_Wrapper::to_json () const
1550
1589
{
1551
1590
return
1552
1591
{
1553
1592
{" implementation" , { {" _data_type" , " UnicodeString" } }},
1554
- { " value" , value .getString ()}
1593
+ { " value" , m_Value .getString ()}
1555
1594
};
1556
1595
}
1557
1596
1597
+ UnicodeString_Wrapper::UnicodeString_Wrapper (UnicodeString value)
1598
+ {
1599
+ m_Value = value; DescriptorBase::m_OSKey = Impl::descriptorKeys.at (Impl::OSTypes::String);
1600
+ }
1601
+
1558
1602
}
1559
1603
1560
1604
PSAPI_NAMESPACE_END
0 commit comments