From 06099e83a2887c24235a8d3475f9adb839e3b2fc Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 21 May 2024 15:34:46 -0400 Subject: [PATCH] cwObject.h : Added type_id(). --- cwObject.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cwObject.h b/cwObject.h index 494b17c..4585ee6 100644 --- a/cwObject.h +++ b/cwObject.h @@ -135,6 +135,8 @@ namespace cw // Value containers are parents of leaf nodes. (A dictionary is not a value container because it's children are pairs with are not leaf nodes.) inline bool is_value_container() const { return type != nullptr && cwIsFlag(type->flags,kValueContainerFl); } + inline unsigned type_id() const { return type==nullptr ? (unsigned)kInvalidTId : type->id; } + // Containers have children and use the object.u.children pointer. inline bool is_container() const { return type != nullptr && cwIsFlag(type->flags,kContainerFl); } inline bool is_pair() const { return type != nullptr && type->id == kPairTId; }