1 /* Copyright 2005 Sun Microsystems, Inc. */
3 #ifndef INCLUDED_EXTERNALVIEWLOGGER_HXX
4 #define INCLUDED_EXTERNALVIEWLOGGER_HXX
6 #ifndef INCLUDED_LOGGER_HXX
7 #include <odiapi/props/Logger.hxx>
14 #include <boost/shared_ptr.hpp>
18 struct NodeDescription
20 typedef boost::shared_ptr
<NodeDescription
> Pointer_t
;
22 NodeDescription(const std::string
& parent
, const std::string
& refersTo
, const std::string
& value
, bool inUse
);
24 std::string mParentNodeId
;
25 std::string mRefersToNodeId
;
26 std::string mNodeValue
;
32 class ExternalViewLoggerImpl
: public Logger
35 ExternalViewLoggerImpl(const std::string
& fileName
);
37 virtual void beginTree();
38 virtual void endTree();
40 virtual void beginNode(const std::string
& nodeId
, const std::string
& value
, const std::string
& refersToNodeId
, bool inUse
);
41 virtual void endNode(const std::string
& nodeId
);
44 bool isLeaf(const std::string
& nodeId
);
45 bool isUnreferencedLeaf(const std::string
& nodeId
);
46 bool isReferenced(const std::string
& nodeId
);
47 bool isReferingToOtherNode(const std::string
& nodeId
);
48 bool hasParent(const std::string
& nodeId
);
49 void dumpTree(const std::string
& nodeId
);
50 std::string
getValue(const std::string
& nodeId
);
51 std::string
getNewStyleName();
52 void dumpNodeContainer(const std::string
& fileName
);
55 typedef std::map
<std::string
, NodeDescription::Pointer_t
> NodeContainer_t
;
57 std::string mFileName
;
58 NodeContainer_t mNodeContainer
;
60 std::stack
<std::string
> mParentNodeStack
;
65 #endif // INCLUDED_LOGGER_HXX