diff options
Diffstat (limited to 'src/libs/qtcreatorcdbext/containers.cpp')
-rw-r--r-- | src/libs/qtcreatorcdbext/containers.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/libs/qtcreatorcdbext/containers.cpp b/src/libs/qtcreatorcdbext/containers.cpp index 8fbd64f0a5..3b6f9362dd 100644 --- a/src/libs/qtcreatorcdbext/containers.cpp +++ b/src/libs/qtcreatorcdbext/containers.cpp @@ -203,7 +203,18 @@ int containerSize(KnownType kt, const SymbolGroupValue &v) if (const SymbolGroupValue deque = v[unsigned(0)]) return containerSize(KT_StdDeque, deque); break; + case KT_StdArray: { + std::string::size_type arraySizeStart = v.type().find(','); + if (arraySizeStart != std::string::npos) { + ++arraySizeStart; + std::string::size_type arraySizeEnd = v.type().find('>', arraySizeStart); + if (arraySizeEnd != std::string::npos) + return std::stoi(v.type().substr(arraySizeStart, arraySizeEnd - arraySizeStart)); + } + break; } + } + return -1; } @@ -253,6 +264,22 @@ static inline AbstractSymbolGroupNodePtrVector stdListChildList(SymbolGroupNode return AbstractSymbolGroupNodePtrVector(); } +static inline AbstractSymbolGroupNodePtrVector stdArrayChildList(SymbolGroupNode *n, int count, + const SymbolGroupValueContext &ctx) +{ + AbstractSymbolGroupNodePtrVector rc; + if (SymbolGroupValue elems = SymbolGroupValue(n, ctx)["_Elems"]) { + rc.reserve(count); + for (int i = 0; i < count; ++i) { + if (const SymbolGroupValue value = elems[i]) + rc.push_back(ReferenceSymbolGroupNode::createArrayNode(i, value.node())); + else + break; + } + } + return rc; +} + // QLinkedList<T>: Dummy head node and then a linked list of "n", "t". static inline AbstractSymbolGroupNodePtrVector qLinkedListChildList(SymbolGroupNode *n, int count, const SymbolGroupValueContext &ctx) @@ -1109,6 +1136,8 @@ AbstractSymbolGroupNodePtrVector containerChildren(SymbolGroupNode *node, int ty break; case KT_StdList: return stdListChildList(node, size , ctx); + case KT_StdArray: + return stdArrayChildList(node, size , ctx); case KT_StdDeque: return stdDequeChildList(SymbolGroupValue(node, ctx), size); case KT_StdStack: |