Iros
 
Loading...
Searching...
No Matches
file_implementation.h File Reference
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include "di/container/allocator/deallocate_many.h"
#include "di/sync/prelude.h"
#include "di/vocab/expected/prelude.h"
#include "dius/error.h"
#include "dius/sync_file.h"

Go to the source code of this file.

Classes

struct  ccpp::MallocAllocator
 
struct  ccpp::FileDeleter
 
struct  ccpp::File
 
struct  __file_implementation
 

Namespaces

namespace  ccpp
 

Macros

#define STDIO_TRY(...)
 
#define STDIO_TRY_OR_MARK_ERROR(file, ...)
 
#define STDIO_TRY_OR_NULL(...)
 

Typedefs

using ccpp::FileHandle = di::Box<FILE, FileDeleter>
 

Enumerations

enum class  ccpp::BufferMode { ccpp::NotBuffered = _IONBF , ccpp::LineBuffered = _IOLBF , ccpp::FullBuffered = _IOFBF }
 
enum class  ccpp::Permissions { ccpp::None = 0 , ccpp::Readable = 1 , ccpp::Writable = 2 }
 
enum class  ccpp::BufferOwnership { ccpp::Owned , ccpp::UserProvided }
 
enum class  ccpp::ReadWriteMode { ccpp::None = 0 , ccpp::Read = 1 , ccpp::Write = 2 }
 
enum class  ccpp::Status { ccpp::None = 0 , ccpp::Eof = 1 , ccpp::Error = 2 }
 

Macro Definition Documentation

◆ STDIO_TRY

#define STDIO_TRY ( ...)
Value:
__extension__({ \
auto __result = (__VA_ARGS__); \
if (!__result) { \
errno = di::to_underlying(__result.error().value()); \
return EOF; \
} \
di::util::move(__result).__try_did_succeed(); \
}).__try_move_out()
#define errno
Definition errno.h:11
constexpr auto to_underlying
Definition to_underlying.h:15
#define EOF
Definition stdio.h:23

◆ STDIO_TRY_OR_MARK_ERROR

#define STDIO_TRY_OR_MARK_ERROR ( file,
... )
Value:
__extension__({ \
auto __result = (__VA_ARGS__); \
if (!__result) { \
errno = di::to_underlying(__result.error().value()); \
(file).mark_as_error(); \
return EOF; \
} \
di::util::move(__result).__try_did_succeed(); \
}).__try_move_out()

◆ STDIO_TRY_OR_NULL

#define STDIO_TRY_OR_NULL ( ...)
Value:
__extension__({ \
auto __result = (__VA_ARGS__); \
if (!__result) { \
errno = di::to_underlying(__result.error().value()); \
return nullptr; \
} \
di::util::move(__result).__try_did_succeed(); \
}).__try_move_out()