21#include <com/sun/star/lang/IllegalArgumentException.hpp>
22#include <com/sun/star/io/WrongFormatException.hpp>
25#include <osl/security.hxx>
26#include <osl/socket.hxx>
27#include <osl/file.hxx>
31#include <rtl/ustring.hxx>
32#include <rtl/strbuf.hxx>
33#include <rtl/ustrbuf.hxx>
73 std::u16string_view aOrigURL, std::u16string_view aPrefix)
76 aURL.setName(Concat2View(aPrefix +
aURL.GetLastName() +
"%23" ));
84 throw lang::IllegalArgumentException();
93 if (eStatus == osl::FileBase::E_None)
94 aURLToCheck = aResolver.
m_aStatus.getFileURL();
95 else if (eStatus == osl::FileBase::E_MULTIHOP)
98 throw io::IOException();
107 sal_Int32 nCurPos = 0;
108 while ( nCurPos <
aBuffer.getLength() )
122 if ( io_nCurPos >=
aBuffer.getLength()
125 throw io::WrongFormatException();
134 OStringBuffer aResult(128);
135 bool bHaveName =
false;
136 bool bEscape =
false;
140 if ( io_nCurPos >=
aBuffer.getLength() )
141 throw io::WrongFormatException();
146 throw io::WrongFormatException();
148 aResult.append(
static_cast<char>(
aBuffer[io_nCurPos]) );
153 else if (
aBuffer[io_nCurPos] ==
',' ||
aBuffer[io_nCurPos] ==
';' )
157 if (
aBuffer[io_nCurPos] ==
'\\' )
160 aResult.append(
static_cast<char>(
aBuffer[io_nCurPos]) );
166 return OStringToOUString( aResult, RTL_TEXTENCODING_UTF8 );
172 OUStringBuffer
aBuffer(aSource.getLength()*2);
174 for ( sal_Int32 nInd = 0; nInd < aSource.getLength() && pStr[nInd] != 0; nInd++ )
176 if ( pStr[nInd] ==
'\\' || pStr[nInd] ==
';' || pStr[nInd] ==
',' )
181 return aBuffer.makeStringAndClear();
189 if ( !
aName.isEmpty() )
202 if ( osl_getSystemTime( &aSysTime ) )
205 if ( osl_getLocalTimeFromSystemTime( &aSysTime, &aLocTime ) )
207 oslDateTime aDateTime;
208 if ( osl_getDateTimeFromTimeValue( &aLocTime, &aDateTime ) )
210 char pDateTime[
sizeof(
"65535.65535.-32768 65535:65535")];
212 o3tl::sprintf( pDateTime,
"%02" SAL_PRIuUINT32
".%02" SAL_PRIuUINT32
".%4" SAL_PRIdINT32
" %02" SAL_PRIuUINT32
":%02" SAL_PRIuUINT32, sal_uInt32(aDateTime.Day), sal_uInt32(aDateTime.Month), sal_Int32(aDateTime.Year), sal_uInt32(aDateTime.Hours), sal_uInt32(aDateTime.Minutes) );
213 aTime = OUString::createFromAscii( pDateTime );
228 ::osl::Security aSecurity;
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
OUString GetFirstName() const
OUString GetLastName() const
osl::FileBase::RC fetchFileStatus(const rtl::OUString &rURL, int nDepth=128)
osl::FileStatus m_aStatus
static OUString ParseName(const css::uno::Sequence< sal_Int8 > &aBuffer, sal_Int32 &o_nCurPos)
static OUString GetOOOUserName()
LockFileCommon(OUString aLockFileURL)
static LockFileEntry GenerateOwnEntry()
static OUString EscapeCharacters(const OUString &aSource)
void SetURL(const OUString &aURL)
const OUString & GetURL() const
static INetURLObject ResolveLinks(const INetURLObject &aDocURL)
static void ParseList(const css::uno::Sequence< sal_Int8 > &aBuffer, std::vector< LockFileEntry > &rOutput)
virtual ~LockFileCommon()
static LockFileEntry ParseEntry(const css::uno::Sequence< sal_Int8 > &aBuffer, sal_Int32 &o_nCurPos)
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.
static OUString GetCurrentLocalTime()
static PathStatus locateUserInstallation(OUString &_rURL)
int sprintf(char(&s)[N], char const *format, T &&... arguments)
std::unique_ptr< char[]> aBuffer