Skip to content

Commit 81ec271

Browse files
committed
Merge branch 'develop' see #166
2 parents 50bb286 + c6b899e commit 81ec271

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

include/cereal/archives/json.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,13 @@ namespace cereal
560560
++itsIteratorStack.back();
561561
}
562562

563+
//! Retrieves the current node name
564+
/*! @return nullptr if no name exists */
565+
const char * getNodeName() const
566+
{
567+
return itsIteratorStack.back().name();
568+
}
569+
563570
//! Sets the name for the next node created with startNode
564571
void setNextName( const char * name )
565572
{

include/cereal/archives/xml.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,13 @@ namespace cereal
475475
itsNodes.top().name = nullptr;
476476
}
477477

478+
//! Retrieves the current node name
479+
//! will return @c nullptr if the node does not have a name
480+
const char * getNodeName() const
481+
{
482+
return itsNodes.top().node->name();
483+
}
484+
478485
//! Sets the name for the next node created with startNode
479486
void setNextName( const char * name )
480487
{

0 commit comments

Comments
 (0)