File for reading.
More...
#include <zip.hpp>
|
| file (struct zip_file *file) noexcept |
| Create a File with a zip_file structure. More...
|
|
| file (file &&other) noexcept=default |
| Move constructor defaulted. More...
|
|
file & | operator= (file &&) noexcept=default |
| Move operator defaulted. More...
|
|
int | read (void *data, uint64_t length) noexcept |
| Read some data. More...
|
|
template<size_t Size> |
int | read (char(&data)[Size]) noexcept |
| Read some data to a fixed size array. More...
|
|
std::string | read (uint64_t length) |
| Optimized function for reading all characters with only one allocation. More...
|
|
◆ file() [1/2]
libzip::file::file |
( |
struct zip_file * |
file | ) |
|
|
inlinenoexcept |
Create a File with a zip_file structure.
- Parameters
-
file | the file ready to be used |
◆ file() [2/2]
libzip::file::file |
( |
file && |
other | ) |
|
|
defaultnoexcept |
Move constructor defaulted.
- Parameters
-
◆ operator=()
file& libzip::file::operator= |
( |
file && |
| ) |
|
|
defaultnoexcept |
Move operator defaulted.
- Returns
- *this
◆ read() [1/3]
template<size_t Size>
int libzip::file::read |
( |
char(&) |
data[Size] | ) |
|
|
inlinenoexcept |
Read some data to a fixed size array.
- Parameters
-
- Returns
- the number of bytes written or -1 on failure
◆ read() [2/3]
std::string libzip::file::read |
( |
uint64_t |
length | ) |
|
|
inline |
Optimized function for reading all characters with only one allocation.
Ideal for combining with archive::stat.
- Parameters
-
length | the length of the file |
- Returns
- the whole string
- See also
- archive::stat
◆ read() [3/3]
int libzip::file::read |
( |
void * |
data, |
|
|
uint64_t |
length |
|
) |
| |
|
inlinenoexcept |
Read some data.
- Parameters
-
data | the destination buffer |
length | the length |
- Returns
- the number of bytes written or -1 on failure
The documentation for this class was generated from the following file: