Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
DocumentFile Class Reference

DocumentFile Api. More...

#include <androidcontentfileengine.h>

+ Inheritance diagram for DocumentFile:
+ Collaboration diagram for DocumentFile:

Public Member Functions

DocumentFilePtr createFile (const QString &mimeType, const QString &displayName)
 
DocumentFilePtr createDirectory (const QString &displayName)
 
const QJniObjecturi () const
 
const DocumentFilePtrparent () const
 
QString name () const
 
QString id () const
 
QString mimeType () const
 
bool isDirectory () const
 
bool isFile () const
 
bool isVirtual () const
 
QDateTime lastModified () const
 
int64_t length () const
 
bool canRead () const
 
bool canWrite () const
 
bool remove ()
 
bool exists () const
 
std::vector< DocumentFilePtrlistFiles ()
 
bool rename (const QString &newName)
 

Static Public Member Functions

static DocumentFilePtr parseFromAnyUri (const QString &filename)
 
static DocumentFilePtr fromSingleUri (const QJniObject &uri)
 
static DocumentFilePtr fromTreeUri (const QJniObject &treeUri)
 

Protected Member Functions

 DocumentFile (const QJniObject &uri, const std::shared_ptr< DocumentFile > &parent)
 

Protected Attributes

QJniObject m_uri
 
DocumentFilePtr m_parent
 

Detailed Description

Constructor & Destructor Documentation

◆ DocumentFile()

DocumentFile::DocumentFile ( const QJniObject & uri,
const std::shared_ptr< DocumentFile > & parent )
protected

Definition at line 587 of file androidcontentfileengine.cpp.

Member Function Documentation

◆ canRead()

bool DocumentFile::canRead ( ) const

Definition at line 732 of file androidcontentfileengine.cpp.

References context, QString::isEmpty(), m_uri, and mimeType().

+ Here is the call graph for this function:

◆ canWrite()

bool DocumentFile::canWrite ( ) const

Definition at line 744 of file androidcontentfileengine.cpp.

References DocumentsContract::Document::COLUMN_FLAGS, context, DocumentsContract::Document::FLAG_DIR_SUPPORTS_CREATE, DocumentsContract::Document::FLAG_SUPPORTS_DELETE, DocumentsContract::Document::FLAG_SUPPORTS_WRITE, m_uri, DocumentsContract::Document::MIME_TYPE_DIR, mimeType(), and Cursor::queryColumn().

+ Here is the call graph for this function:

◆ createDirectory()

DocumentFilePtr DocumentFile::createDirectory ( const QString & displayName)

Definition at line 662 of file androidcontentfileengine.cpp.

References DocumentsContract::createDocument(), displayName(), isDirectory(), m_uri, and DocumentsContract::Document::MIME_TYPE_DIR.

+ Here is the call graph for this function:

◆ createFile()

DocumentFilePtr DocumentFile::createFile ( const QString & mimeType,
const QString & displayName )

Definition at line 652 of file androidcontentfileengine.cpp.

References DocumentsContract::createDocument(), displayName(), isDirectory(), m_uri, and mimeType().

+ Here is the call graph for this function:

◆ exists()

bool DocumentFile::exists ( ) const

Definition at line 773 of file androidcontentfileengine.cpp.

References QString::isEmpty(), and name().

+ Here is the call graph for this function:

◆ fromSingleUri()

DocumentFilePtr DocumentFile::fromSingleUri ( const QJniObject & uri)
static

Definition at line 636 of file androidcontentfileengine.cpp.

References uri().

Referenced by parseFromAnyUri().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromTreeUri()

DocumentFilePtr DocumentFile::fromTreeUri ( const QJniObject & treeUri)
static

Definition at line 641 of file androidcontentfileengine.cpp.

References DocumentsContract::buildDocumentUriUsingTree(), DocumentsContract::documentId(), DocumentsContract::isDocumentUri(), and DocumentsContract::treeDocumentId().

Referenced by parseFromAnyUri(), and rename().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ id()

QString DocumentFile::id ( ) const

Definition at line 687 of file androidcontentfileengine.cpp.

References DocumentsContract::documentId(), and uri().

+ Here is the call graph for this function:

◆ isDirectory()

bool DocumentFile::isDirectory ( ) const

Definition at line 697 of file androidcontentfileengine.cpp.

References DocumentsContract::Document::MIME_TYPE_DIR, and mimeType().

Referenced by createDirectory(), and createFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFile()

bool DocumentFile::isFile ( ) const

Definition at line 702 of file androidcontentfileengine.cpp.

References QLatin1StringView::isEmpty(), DocumentsContract::Document::MIME_TYPE_DIR, and mimeType().

+ Here is the call graph for this function:

◆ isVirtual()

bool DocumentFile::isVirtual ( ) const

Definition at line 708 of file androidcontentfileengine.cpp.

References DocumentsContract::Document::COLUMN_FLAGS, DocumentsContract::Document::FLAG_VIRTUAL_DOCUMENT, DocumentsContract::isDocumentUri(), m_uri, and Cursor::queryColumn().

+ Here is the call graph for this function:

◆ lastModified()

QDateTime DocumentFile::lastModified ( ) const

Definition at line 714 of file androidcontentfileengine.cpp.

References DocumentsContract::Document::COLUMN_LAST_MODIFIED, QDateTime::fromMSecsSinceEpoch(), m_uri, and Cursor::queryColumn().

+ Here is the call graph for this function:

◆ length()

int64_t DocumentFile::length ( ) const

Definition at line 722 of file androidcontentfileengine.cpp.

References DocumentsContract::Document::COLUMN_SIZE, m_uri, and Cursor::queryColumn().

+ Here is the call graph for this function:

◆ listFiles()

std::vector< DocumentFilePtr > DocumentFile::listFiles ( )

Definition at line 778 of file androidcontentfileengine.cpp.

References DocumentsContract::buildChildDocumentsUriUsingTree(), DocumentsContract::buildDocumentUriUsingTree(), DocumentsContract::Document::COLUMN_DOCUMENT_ID, DocumentsContract::documentId(), m_uri, Cursor::queryUri(), and uri().

+ Here is the call graph for this function:

◆ mimeType()

QString DocumentFile::mimeType ( ) const

Definition at line 692 of file androidcontentfileengine.cpp.

References DocumentsContract::Document::COLUMN_MIME_TYPE, m_uri, and Cursor::queryColumn().

Referenced by canRead(), canWrite(), createFile(), isDirectory(), and isFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ name()

QString DocumentFile::name ( ) const

Definition at line 682 of file androidcontentfileengine.cpp.

References DocumentsContract::Document::COLUMN_DISPLAY_NAME, m_uri, and Cursor::queryColumn().

Referenced by exists().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parent()

const DocumentFilePtr & DocumentFile::parent ( ) const

Definition at line 677 of file androidcontentfileengine.cpp.

References m_parent.

Referenced by rename().

+ Here is the caller graph for this function:

◆ parseFromAnyUri()

DocumentFilePtr DocumentFile::parseFromAnyUri ( const QString & filename)
static

Definition at line 605 of file androidcontentfileengine.cpp.

References fileName, fromSingleUri(), fromTreeUri(), QString::indexOf(), DocumentsContract::isDocumentUri(), DocumentsContract::isTreeUri(), QString::left(), QString::mid(), parseUri(), QUrl::toEncoded(), QUrl::toPercentEncoding(), and uri().

Referenced by AndroidContentFileEngineIterator::advance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove()

bool DocumentFile::remove ( )

Definition at line 768 of file androidcontentfileengine.cpp.

References DocumentsContract::deleteDocument(), and m_uri.

+ Here is the call graph for this function:

◆ rename()

bool DocumentFile::rename ( const QString & newName)

Definition at line 793 of file androidcontentfileengine.cpp.

References displayName(), file, fromTreeUri(), QString::left(), m_uri, DocumentsContract::moveDocument(), parent(), parseUri(), DocumentsContract::renameDocument(), QUrl::toPercentEncoding(), and uri().

+ Here is the call graph for this function:

◆ uri()

const QJniObject & DocumentFile::uri ( ) const

Definition at line 672 of file androidcontentfileengine.cpp.

References m_uri.

Referenced by fromSingleUri(), id(), listFiles(), parseFromAnyUri(), and rename().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_parent

DocumentFilePtr DocumentFile::m_parent
protected

Definition at line 107 of file androidcontentfileengine.h.

Referenced by parent().

◆ m_uri


The documentation for this class was generated from the following files: