LibreOffice Module unotools (master) 1
Public Member Functions | Private Attributes | List of all members
utl::TempFileFast Class Reference

This is the "fast" temp file. More...

#include <tempfile.hxx>

Public Member Functions

 TempFileFast ()
 
 TempFileFast (TempFileFast &&other) noexcept
 
 ~TempFileFast ()
 
SvStreamGetStream (StreamMode eMode)
 Returns a stream to the tempfiles data; the stream is owned by the tempfile object, so you have to keep this alive as long as you want to use the stream. More...
 
void CloseStream ()
 Close and destroy the owned stream object if any. More...
 

Private Attributes

std::unique_ptr< SvFileStreammxStream
 

Detailed Description

This is the "fast" temp file.

Different OSes have different ideas how this should work, so this class presents an interface that is fast across Windows and Unix (which differ in how they want temp files to work). The key point is that such a temporary file is only a readable/writeable stream, and does not have a filename, or a location in the filesystem hierarchy. If you need a name or a URL, you should use TempFileNamed, which is slower, but creates an actual file in the filesystem.

Definition at line 46 of file tempfile.hxx.

Constructor & Destructor Documentation

◆ TempFileFast() [1/2]

utl::TempFileFast::TempFileFast ( )

Definition at line 393 of file tempfile.cxx.

◆ TempFileFast() [2/2]

utl::TempFileFast::TempFileFast ( TempFileFast &&  other)
noexcept

Definition at line 397 of file tempfile.cxx.

◆ ~TempFileFast()

utl::TempFileFast::~TempFileFast ( )

Definition at line 402 of file tempfile.cxx.

References CloseStream().

Member Function Documentation

◆ CloseStream()

void utl::TempFileFast::CloseStream ( )

Close and destroy the owned stream object if any.

Definition at line 421 of file tempfile.cxx.

References aName, and mxStream.

Referenced by ~TempFileFast().

◆ GetStream()

SvStream * utl::TempFileFast::GetStream ( StreamMode  eMode)

Returns a stream to the tempfiles data; the stream is owned by the tempfile object, so you have to keep this alive as long as you want to use the stream.

Definition at line 407 of file tempfile.cxx.

References aName, utl::CreateTempNameFast(), eMode, and mxStream.

Member Data Documentation

◆ mxStream

std::unique_ptr<SvFileStream> utl::TempFileFast::mxStream
private

Definition at line 48 of file tempfile.hxx.

Referenced by CloseStream(), and GetStream().


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