| 2183 | |
| 2184 | template < typename F > |
| 2185 | void StreamIndexedIO::Index::writeNodeChildren( DirectoryNode *n, F &f ) |
| 2186 | { |
| 2187 | uint32_t nodeCount = n->children().size(); |
| 2188 | writeLittleEndian( f, nodeCount ); |
| 2189 | |
| 2190 | for (DirectoryNode::ChildMap::const_iterator it = n->children().begin(); it != n->children().end(); ++it) |
| 2191 | { |
| 2192 | NodeBase *p = *it; |
| 2193 | switch( p->nodeType() ) |
| 2194 | { |
| 2195 | case NodeBase::Data : |
| 2196 | { |
| 2197 | DataNode *childNode = static_cast< DataNode *>(p); |
| 2198 | writeDataNode( childNode, f ); |
| 2199 | break; |
| 2200 | } |
| 2201 | case NodeBase::SmallData : |
| 2202 | { |
| 2203 | SmallDataNode *childNode = static_cast< SmallDataNode * >(p); |
| 2204 | writeDataNode( childNode, f ); |
| 2205 | break; |
| 2206 | } |
| 2207 | case NodeBase::Directory : |
| 2208 | { |
| 2209 | DirectoryNode *childNode = static_cast< DirectoryNode *>(p); |
| 2210 | writeNode( childNode, f ); |
| 2211 | break; |
| 2212 | } |
| 2213 | case NodeBase::SubIndex : |
| 2214 | { |
| 2215 | SubIndexNode *childNode = static_cast< SubIndexNode *>(p); |
| 2216 | writeNode( childNode, f ); |
| 2217 | break; |
| 2218 | } |
| 2219 | default: |
| 2220 | throw Exception( "Invalid node type!" ); |
| 2221 | } |
| 2222 | } |
| 2223 | } |
| 2224 | |
| 2225 | template < typename F > |
| 2226 | void StreamIndexedIO::Index::writeNode( DirectoryNode *node, F &f ) |
nothing calls this directly
no test coverage detected