mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
IO.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <cstddef>
6
#include <cstdio>
7
#include <string>
8
#include <string_view>
9
10
#include "
mini-llvm/utils/Compiler.h
"
11
#include "
mini-llvm/utils/Expected.h
"
12
#include "
mini-llvm/utils/Path.h
"
13
#include "
mini-llvm/utils/SystemError.h
"
14
15
namespace
mini_llvm
{
16
17
MINI_LLVM_EXPORT
Expected<std::string, SystemError>
readAll
(FILE *stream);
18
MINI_LLVM_EXPORT
Expected<std::string, SystemError>
readAll
(
const
Path
&path);
19
MINI_LLVM_EXPORT
Expected<std::string, SystemError>
readAll
(
const
Path
&path, FILE *stream);
20
21
MINI_LLVM_EXPORT
Expected<void, SystemError>
writeAll
(FILE *stream,
const
char
*data,
size_t
size);
22
MINI_LLVM_EXPORT
Expected<void, SystemError>
writeAll
(
const
Path
&path,
const
char
*data,
size_t
size);
23
MINI_LLVM_EXPORT
Expected<void, SystemError>
writeAll
(
const
Path
&path, FILE *stream,
const
char
*data,
size_t
size);
24
25
inline
Expected<void, SystemError>
writeAll
(FILE *stream, std::string_view buffer) {
26
return
writeAll
(stream, buffer.data(), buffer.size());
27
}
28
29
inline
Expected<void, SystemError>
writeAll
(
const
Path
&path, std::string_view buffer) {
30
return
writeAll
(path, buffer.data(), buffer.size());
31
}
32
33
inline
Expected<void, SystemError>
writeAll
(
const
Path
&path, FILE *stream, std::string_view buffer) {
34
return
writeAll
(path, stream, buffer.data(), buffer.size());
35
}
36
37
}
// namespace mini_llvm
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
Expected.h
Path.h
SystemError.h
mini_llvm::Expected
Definition
Expected.h:65
mini_llvm::Path
Definition
Path.h:18
mini_llvm
Definition
GraphColoringAllocator.h:13
mini_llvm::writeAll
MINI_LLVM_EXPORT Expected< void, SystemError > writeAll(FILE *stream, const char *data, size_t size)
mini_llvm::readAll
MINI_LLVM_EXPORT Expected< std::string, SystemError > readAll(FILE *stream)
include
mini-llvm
utils
IO.h
Generated by
1.17.0