00001
00006 #ifndef __BGDNetDirEntry_h__
00007 #define __BGDNetDirEntry_h__
00008
00009 #include "BGDNetConfig.h"
00010
00011 #include <nwdirect.h>
00012 #include <nwdentry.h>
00013 #include "BGDNetShare.h"
00014 #include "BGDNetPath.h"
00015 #include "BGDNetString.h"
00016 #include "BGDNetConnRef.h"
00017 #include "BGDNetException.h"
00018
00019 namespace BGDNet
00020 {
00021
00022 class Volume;
00023 class Context;
00024
00031 class BGDNET_API DirHandle
00032 {
00033 public:
00034
00035 DirHandle( const Volume* pVol, const Path& path, nuint8 nameSpc )
00036 throw(Exception);
00046 ~DirHandle( void );
00052 operator NWDIR_HANDLE( void ) const;
00057 private:
00058
00059 static const NWDIR_HANDLE s_invalidHandle;
00064 ConnRef m_connRef;
00069 NWDIR_HANDLE m_handle;
00073 };
00074
00075
00076
00077
00086 class BGDNET_API DirEntry : public Share
00087 {
00088 public:
00089
00090 DirEntry( const Volume* pVol, const Path& relPath );
00097 virtual ~DirEntry( void ) {}
00102 const Volume* vol( void ) const;
00108 const Path& relPath( void ) const;
00115 Path fullPath( void ) const;
00123 String dosName( void ) const;
00129 String name( void ) const;
00137 virtual nuint32 ownerId( void ) const = 0;
00143 virtual void ownerId( nuint32 id ) = 0;
00149 String ownerName( const Context& ctx ) const;
00156 void ownerName( const Context& ctx, const char* name );
00163 protected:
00164
00165 Path& relPath( void );
00172 void getEntryInfo( nuint16 attrs, NWENTRY_INFO* pInfo ) const;
00180 void setEntryInfo(
00181 nuint16 attrs,
00182 const NWENTRY_INFO& info,
00183 nuint32 changeBits );
00191 private:
00192
00193 DirEntry( const DirEntry& );
00198 DirEntry& operator =( const DirEntry& );
00203 String name( nuint8 nameSpc ) const;
00211 const Volume* m_pVol;
00216 Path m_relPath;
00220 };
00221
00222 }
00223
00224 #endif //__BGDNetDirEntry_h__