| 3090 | } |
| 3091 | |
| 3092 | IndexedIO::Entry StreamIndexedIO::entry(const IndexedIO::EntryID &name) const |
| 3093 | { |
| 3094 | assert( m_node ); |
| 3095 | readable(name); |
| 3096 | |
| 3097 | Index::MutexLock lock; |
| 3098 | m_node->m_idx->lockDirectory( lock, m_node->m_node ); |
| 3099 | |
| 3100 | DirectoryNode::ChildMap::iterator it = m_node->m_node->findChild( name ); |
| 3101 | if ( it == m_node->m_node->children().end() ) |
| 3102 | { |
| 3103 | throw IOException( "StreamIndexedIO::entry: Entry not found '" + name.value() + "'" ); |
| 3104 | } |
| 3105 | |
| 3106 | NodeBase *node = *it; |
| 3107 | |
| 3108 | switch( node->nodeType() ) |
| 3109 | { |
| 3110 | case NodeBase::Data: |
| 3111 | { |
| 3112 | DataNode *dn = static_cast< DataNode * >(node); |
| 3113 | return IndexedIO::Entry( dn->name(), IndexedIO::File, dn->dataType(), dn->arrayLength() ); |
| 3114 | } |
| 3115 | |
| 3116 | case NodeBase::SmallData: |
| 3117 | { |
| 3118 | SmallDataNode *dn = static_cast< SmallDataNode * >(node); |
| 3119 | return IndexedIO::Entry( dn->name(), IndexedIO::File, dn->dataType(), dn->arrayLength() ); |
| 3120 | } |
| 3121 | |
| 3122 | case NodeBase::Directory: |
| 3123 | case NodeBase::SubIndex: |
| 3124 | return IndexedIO::Entry( node->name(), IndexedIO::Directory, IndexedIO::Invalid, 0 ); |
| 3125 | |
| 3126 | default: |
| 3127 | throw Exception("Invalid node type!"); |
| 3128 | } |
| 3129 | } |
| 3130 | |
| 3131 | IndexedIOPtr StreamIndexedIO::parentDirectory() |
| 3132 | { |