OpendTect  7.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
OD::FileSystemAccess Class Referenceabstract

Interface to files and directories, whether local or cloud. More...

Public Member Functions

virtual bool copy (const char *from, const char *to, uiString *errmsg=nullptr) const
 
virtual bool createDirectory (const char *) const
 
virtual StreamData createIStream (const char *, bool binary=true) const =0
 
virtual StreamData createOStream (const char *, bool binary=true, bool inplaceedit=false) const =0
 
const BufferStringerrMsg () const
 
virtual bool exists (const char *) const
 
virtual std::int64_t getFileSize (const char *, bool followlink) const
 0 for non-existing, -1 for unknown More...
 
virtual BufferString iconName () const
 
virtual bool isDirectory (const char *) const
 
virtual bool isFile (const char *) const
 
virtual bool isReadable (const char *) const =0
 
virtual bool isWritable (const char *) const
 
virtual bool listDirectory (const char *, File::DirListType, BufferStringSet &, const char *mask) const
 
virtual bool operationsSupported () const
 
virtual const char * protocol () const =0
 
virtual bool queriesSupported () const
 
virtual bool readingSupported () const
 
virtual bool remove (const char *, bool recursive=true) const
 
virtual bool rename (const char *from, const char *to, uiString *errmsg=nullptr) const
 
virtual bool setWritable (const char *, bool yn, bool recursive=true) const
 
virtual BufferString timeCreated (const char *) const
 
virtual BufferString timeLastModified (const char *) const
 
virtual uiString userName () const =0
 
virtual bool writingSupported () const
 

Static Public Member Functions

static const FileSystemAccessget (const char *fnm)
 
static const FileSystemAccessgetByProtocol (const char *prot)
 
static const FileSystemAccessgetLocal ()
 
static BufferString getProtocol (const char *fnm)
 
static void getProtocolNames (BufferStringSet &, bool forread)
 
static BufferString iconForProtocol (const char *)
 
static BufferString withoutProtocol (const char *)
 
static BufferString withProtocol (const char *fnm, const char *prot)
 

Protected Member Functions

virtual ~FileSystemAccess ()
 

Static Protected Member Functions

static const FileSystemAccessgtByProt (BufferString &)
 

Protected Attributes

BufferString errmsg_
 

Detailed Description

Interface to files and directories, whether local or cloud.

OpendTect objects will always, one way or the other, use this interface to: Get information about files (and directories) Manipulate files (remove, rename, etc.) Get streams to read or write content

Utilties like od_stream's and File::exists() will use an instance of this class to get their services.

<>

Constructor & Destructor Documentation

◆ ~FileSystemAccess()

virtual OD::FileSystemAccess::~FileSystemAccess ( )
inlineprotectedvirtual

Member Function Documentation

◆ copy()

virtual bool OD::FileSystemAccess::copy ( const char *  from,
const char *  to,
uiString errmsg = nullptr 
) const
inlinevirtual

◆ createDirectory()

virtual bool OD::FileSystemAccess::createDirectory ( const char *  ) const
inlinevirtual

◆ createIStream()

virtual StreamData OD::FileSystemAccess::createIStream ( const char *  ,
bool  binary = true 
) const
pure virtual

keep binary==true also for text files unless you know what you are doing. win32 thing only.

◆ createOStream()

virtual StreamData OD::FileSystemAccess::createOStream ( const char *  ,
bool  binary = true,
bool  inplaceedit = false 
) const
pure virtual

keep binary==true also for text files unless you know what you are doing. win32 thing only.

◆ errMsg()

const BufferString& OD::FileSystemAccess::errMsg ( ) const
inline

◆ exists()

virtual bool OD::FileSystemAccess::exists ( const char *  ) const
virtual

◆ get()

static const FileSystemAccess& OD::FileSystemAccess::get ( const char *  fnm)
static

Looks at first part of filename to determine what system it belongs to. If nothing matches, local FileSystemAccess will be returned.

◆ getByProtocol()

static const FileSystemAccess& OD::FileSystemAccess::getByProtocol ( const char *  prot)
static

◆ getFileSize()

virtual std::int64_t OD::FileSystemAccess::getFileSize ( const char *  ,
bool  followlink 
) const
virtual

0 for non-existing, -1 for unknown

◆ getLocal()

static const FileSystemAccess& OD::FileSystemAccess::getLocal ( )
static

◆ getProtocol()

static BufferString OD::FileSystemAccess::getProtocol ( const char *  fnm)
static

◆ getProtocolNames()

static void OD::FileSystemAccess::getProtocolNames ( BufferStringSet ,
bool  forread 
)
static

◆ gtByProt()

static const FileSystemAccess& OD::FileSystemAccess::gtByProt ( BufferString )
staticprotected

◆ iconForProtocol()

static BufferString OD::FileSystemAccess::iconForProtocol ( const char *  )
static

◆ iconName()

virtual BufferString OD::FileSystemAccess::iconName ( ) const
inlinevirtual

◆ isDirectory()

virtual bool OD::FileSystemAccess::isDirectory ( const char *  ) const
inlinevirtual

◆ isFile()

virtual bool OD::FileSystemAccess::isFile ( const char *  ) const
virtual

◆ isReadable()

virtual bool OD::FileSystemAccess::isReadable ( const char *  ) const
pure virtual

◆ isWritable()

virtual bool OD::FileSystemAccess::isWritable ( const char *  ) const
inlinevirtual

◆ listDirectory()

virtual bool OD::FileSystemAccess::listDirectory ( const char *  ,
File::DirListType  ,
BufferStringSet ,
const char *  mask 
) const
inlinevirtual

◆ operationsSupported()

virtual bool OD::FileSystemAccess::operationsSupported ( ) const
inlinevirtual

◆ protocol()

virtual const char* OD::FileSystemAccess::protocol ( ) const
pure virtual

◆ queriesSupported()

virtual bool OD::FileSystemAccess::queriesSupported ( ) const
inlinevirtual

◆ readingSupported()

virtual bool OD::FileSystemAccess::readingSupported ( ) const
inlinevirtual

◆ remove()

virtual bool OD::FileSystemAccess::remove ( const char *  ,
bool  recursive = true 
) const
inlinevirtual

◆ rename()

virtual bool OD::FileSystemAccess::rename ( const char *  from,
const char *  to,
uiString errmsg = nullptr 
) const
inlinevirtual

◆ setWritable()

virtual bool OD::FileSystemAccess::setWritable ( const char *  ,
bool  yn,
bool  recursive = true 
) const
inlinevirtual

◆ timeCreated()

virtual BufferString OD::FileSystemAccess::timeCreated ( const char *  ) const
inlinevirtual

◆ timeLastModified()

virtual BufferString OD::FileSystemAccess::timeLastModified ( const char *  ) const
inlinevirtual

◆ userName()

virtual uiString OD::FileSystemAccess::userName ( ) const
pure virtual

◆ withoutProtocol()

static BufferString OD::FileSystemAccess::withoutProtocol ( const char *  )
static

◆ withProtocol()

static BufferString OD::FileSystemAccess::withProtocol ( const char *  fnm,
const char *  prot 
)
static

◆ writingSupported()

virtual bool OD::FileSystemAccess::writingSupported ( ) const
inlinevirtual

Member Data Documentation

◆ errmsg_

BufferString OD::FileSystemAccess::errmsg_
mutableprotected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024