Commit: 2e00d909381ece613abda5cdee998291b48d613b
Author: Jeroen Bakker
Date:   Mon Jan 3 10:25:16 2022 +0100
Branches: master
https://developer.blender.org/rB2e00d909381ece613abda5cdee998291b48d613b

Cleanup: Renamed to_object_value to to_dictionary_value.

===================================================================

M       source/blender/blenlib/BLI_serialize.hh
M       source/blender/blenlib/intern/serialize.cc
M       source/blender/editors/asset/intern/asset_indexer.cc

===================================================================

diff --git a/source/blender/blenlib/BLI_serialize.hh 
b/source/blender/blenlib/BLI_serialize.hh
index 11ac1c6605b..5945960c450 100644
--- a/source/blender/blenlib/BLI_serialize.hh
+++ b/source/blender/blenlib/BLI_serialize.hh
@@ -177,7 +177,7 @@ class Value {
    * Casts to an DictionaryValue.
    * Will return nullptr when it is a different type.
    */
-  const DictionaryValue *as_object_value() const;
+  const DictionaryValue *as_dictionary_value() const;
 };
 
 /**
@@ -269,13 +269,14 @@ class ContainerValue : public Value {
  * The elements are stored as an key value pair. The value is a shared pointer 
so it can be shared
  * when using `DictionaryValue::create_lookup`.
  */
-using ObjectElementType = std::pair<std::string, std::shared_ptr<Value>>;
+using DictionaryElementType = std::pair<std::string, std::shared_ptr<Value>>;
 
 /**
  * Object is a key-value container where the key must be a std::string.
  * Internally it is stored in a blender::Vector to ensure the order of keys.
  */
-class DictionaryValue : public ContainerValue<Vector<ObjectElementType>, 
eValueType::Dictionary> {
+class DictionaryValue
+    : public ContainerValue<Vector<DictionaryElementType>, 
eValueType::Dictionary> {
  public:
   using LookupValue = std::shared_ptr<Value>;
   using Lookup = Map<std::string, LookupValue>;
diff --git a/source/blender/blenlib/intern/serialize.cc 
b/source/blender/blenlib/intern/serialize.cc
index 03d08bd20c6..4e7203efe9b 100644
--- a/source/blender/blenlib/intern/serialize.cc
+++ b/source/blender/blenlib/intern/serialize.cc
@@ -44,7 +44,7 @@ const ArrayValue *Value::as_array_value() const
   return static_cast<const ArrayValue *>(this);
 }
 
-const DictionaryValue *Value::as_object_value() const
+const DictionaryValue *Value::as_dictionary_value() const
 {
   if (type_ != eValueType::Dictionary) {
     return nullptr;
@@ -99,7 +99,7 @@ static void convert_to_json(nlohmann::ordered_json &j, const 
Value &value)
     }
 
     case eValueType::Dictionary: {
-      const DictionaryValue &object = *value.as_object_value();
+      const DictionaryValue &object = *value.as_dictionary_value();
       convert_to_json(j, object);
       break;
     }
diff --git a/source/blender/editors/asset/intern/asset_indexer.cc 
b/source/blender/editors/asset/intern/asset_indexer.cc
index 87fbda068f2..55fef187080 100644
--- a/source/blender/editors/asset/intern/asset_indexer.cc
+++ b/source/blender/editors/asset/intern/asset_indexer.cc
@@ -379,7 +379,7 @@ static int 
init_indexer_entries_from_value(FileIndexerEntries &indexer_entries,
   int num_entries_read = 0;
   const ArrayValue::Items elements = 
(*entries_value)->as_array_value()->elements();
   for (ArrayValue::Item element : elements) {
-    const AssetEntryReader asset_entry(*element->as_object_value());
+    const AssetEntryReader asset_entry(*element->as_dictionary_value());
 
     FileIndexerEntry *entry = static_cast<FileIndexerEntry *>(
         MEM_callocN(sizeof(FileIndexerEntry), __func__));
@@ -564,7 +564,7 @@ struct AssetIndex {
 
   int get_version() const
   {
-    const DictionaryValue *root = contents->as_object_value();
+    const DictionaryValue *root = contents->as_dictionary_value();
     if (root == nullptr) {
       return UNKNOWN_VERSION;
     }
@@ -588,7 +588,7 @@ struct AssetIndex {
    */
   int extract_into(FileIndexerEntries &indexer_entries) const
   {
-    const DictionaryValue *root = contents->as_object_value();
+    const DictionaryValue *root = contents->as_dictionary_value();
     const int num_entries_read = 
init_indexer_entries_from_value(indexer_entries, *root);
     return num_entries_read;
   }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to