LibreOffice Module svl (master) 1
Public Member Functions | Protected Member Functions | List of all members
svt::GenDocumentLockFile Class Referenceabstract

Generalized class for LO and MSO lockfile handling. More...

#include <documentlockfile.hxx>

Inheritance diagram for svt::GenDocumentLockFile:
[legend]
Collaboration diagram for svt::GenDocumentLockFile:
[legend]

Public Member Functions

 GenDocumentLockFile (const OUString &aLockFileURL)
 
virtual ~GenDocumentLockFile () override
 
bool CreateOwnLockFile ()
 
bool OverwriteOwnLockFile ()
 
virtual void RemoveFile ()
 Delete the Lockfile, if current user is the owner. More...
 
void RemoveFileDirectly ()
 Only delete lockfile, disregarding ownership. More...
 
LockFileEntry GetLockData ()
 
- Public Member Functions inherited from svt::LockFileCommon
 LockFileCommon (OUString aLockFileURL)
 
virtual ~LockFileCommon ()
 
const OUString & GetURL () const
 
void SetURL (const OUString &aURL)
 

Protected Member Functions

virtual LockFileEntry GetLockDataImpl (std::unique_lock< std::mutex > &rGuard)=0
 
virtual void WriteEntryToStream (std::unique_lock< std::mutex > &rGuard, const LockFileEntry &aEntry, const css::uno::Reference< css::io::XOutputStream > &xStream)=0
 
virtual css::uno::Reference< css::io::XInputStream > OpenStream (std::unique_lock< std::mutex > &rGuard)
 

Additional Inherited Members

- Static Public Member Functions inherited from svt::LockFileCommon
static void ParseList (const css::uno::Sequence< sal_Int8 > &aBuffer, std::vector< LockFileEntry > &rOutput)
 
static LockFileEntry ParseEntry (const css::uno::Sequence< sal_Int8 > &aBuffer, sal_Int32 &o_nCurPos)
 
static OUString ParseName (const css::uno::Sequence< sal_Int8 > &aBuffer, sal_Int32 &o_nCurPos)
 
static OUString EscapeCharacters (const OUString &aSource)
 
static OUString GetOOOUserName ()
 
static OUString GetCurrentLocalTime ()
 
static LockFileEntry GenerateOwnEntry ()
 
static INetURLObject ResolveLinks (const INetURLObject &aDocURL)
 
- Static Protected Member Functions inherited from svt::LockFileCommon
static OUString GenerateOwnLockFileURL (std::u16string_view aOrigURL, std::u16string_view aPrefix)
 This method generates the URL of the lock file based on the document URL and the specified prefix. More...
 
- Protected Attributes inherited from svt::LockFileCommon
std::mutex m_aMutex
 

Detailed Description

Generalized class for LO and MSO lockfile handling.

Definition at line 33 of file documentlockfile.hxx.

Constructor & Destructor Documentation

◆ GenDocumentLockFile()

svt::GenDocumentLockFile::GenDocumentLockFile ( const OUString &  aLockFileURL)

Definition at line 48 of file documentlockfile.cxx.

◆ ~GenDocumentLockFile()

svt::GenDocumentLockFile::~GenDocumentLockFile ( )
overridevirtual

Definition at line 54 of file documentlockfile.cxx.

Member Function Documentation

◆ CreateOwnLockFile()

bool svt::GenDocumentLockFile::CreateOwnLockFile ( )

◆ GetLockData()

LockFileEntry svt::GenDocumentLockFile::GetLockData ( )

Definition at line 165 of file documentlockfile.cxx.

References GetLockDataImpl(), and svt::LockFileCommon::m_aMutex.

◆ GetLockDataImpl()

virtual LockFileEntry svt::GenDocumentLockFile::GetLockDataImpl ( std::unique_lock< std::mutex > &  rGuard)
protectedpure virtual

◆ OpenStream()

uno::Reference< io::XInputStream > svt::GenDocumentLockFile::OpenStream ( std::unique_lock< std::mutex > &  rGuard)
protectedvirtual

◆ OverwriteOwnLockFile()

bool svt::GenDocumentLockFile::OverwriteOwnLockFile ( )

◆ RemoveFile()

void svt::GenDocumentLockFile::RemoveFile ( )
virtual

Delete the Lockfile, if current user is the owner.

Reimplemented in svt::MSODocumentLockFile.

Definition at line 141 of file documentlockfile.cxx.

References svt::LockFileCommon::GenerateOwnEntry(), GetLockDataImpl(), LOCALHOST, svt::LockFileCommon::m_aMutex, RemoveFileDirectly(), SYSUSERNAME, and USERURL.

◆ RemoveFileDirectly()

void svt::GenDocumentLockFile::RemoveFileDirectly ( )

Only delete lockfile, disregarding ownership.

Definition at line 157 of file documentlockfile.cxx.

References ucbhelper::Content::executeCommand(), comphelper::getProcessComponentContext(), and svt::LockFileCommon::GetURL().

Referenced by RemoveFile(), and svt::MSODocumentLockFile::RemoveFile().

◆ WriteEntryToStream()

virtual void svt::GenDocumentLockFile::WriteEntryToStream ( std::unique_lock< std::mutex > &  rGuard,
const LockFileEntry aEntry,
const css::uno::Reference< css::io::XOutputStream > &  xStream 
)
protectedpure virtual

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