KWin
|
Creates a file in memory. More...
#include <ramfile.h>
Public Types | |
enum class | Flag { SealWrite = 1 << 0 } |
Public Member Functions | |
RamFile ()=default | |
RamFile (const char *name, const void *inData, int size, Flags flags={}) | |
RamFile (RamFile &&other) Q_DECL_NOEXCEPT | |
RamFile & | operator= (RamFile &&other) Q_DECL_NOEXCEPT |
~RamFile () | |
bool | isValid () const |
Flags | effectiveFlags () const |
int | fd () const |
int | size () const |
Creates a file in memory.
This is useful for passing larger data to clients, for example the xkeymap.
If memfd is supported, it is used, otherwise a temporary file is created.
|
strong |
Flags to use when creating the file.
Enumerator | |
---|---|
SealWrite | Seal the file descriptor for writing. |
|
default |
KWin::RamFile::RamFile | ( | const char * | name, |
const void * | inData, | ||
int | size, | ||
Flags | flags = {} ) |
Create a file of given size with given data.
name | The file name, useful for debugging. |
data | The data to store in the file. |
size | The size of the file. |
flags | The flags to use when creating the file. |
KWin::RamFile::RamFile | ( | RamFile && | other | ) |
Definition at line 93 of file ramfile.cpp.
KWin::RamFile::~RamFile | ( | ) |
Destroys the file.
Definition at line 117 of file ramfile.cpp.
RamFile::Flags KWin::RamFile::effectiveFlags | ( | ) | const |
The flags that are effectively applied.
For instance, even though SealWrite was passed in the constructor, it might not be supported.
Definition at line 136 of file ramfile.cpp.
int KWin::RamFile::fd | ( | ) | const |
The underlying file descriptor
Definition at line 150 of file ramfile.cpp.
bool KWin::RamFile::isValid | ( | ) | const |
Whether this instance contains a valid file descriptor.
Definition at line 131 of file ramfile.cpp.
Definition at line 104 of file ramfile.cpp.
int KWin::RamFile::size | ( | ) | const |
The size of the file
Definition at line 159 of file ramfile.cpp.