-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
224 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef PAPILIO_OS_OS_HPP | ||
#define PAPILIO_OS_OS_HPP | ||
|
||
#pragma once | ||
|
||
#include <papilio/detail/prefix.hpp> | ||
#include <string_view> | ||
#include <system_error> | ||
#include <cstdio> | ||
|
||
namespace papilio::os | ||
{ | ||
bool is_terminal(std::FILE* file); | ||
|
||
void output_conv( | ||
std::FILE* file, | ||
std::string_view out | ||
); | ||
|
||
void output_nonconv( | ||
std::FILE* file, | ||
std::string_view out | ||
); | ||
} // namespace papilio::os | ||
|
||
#include <papilio/detail/suffix.hpp> | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "os_impl.hpp" | ||
#include <papilio/detail/prefix.hpp> | ||
|
||
namespace papilio::os | ||
{ | ||
void output_nonconv( | ||
std::FILE* file, | ||
std::string_view out | ||
) | ||
{ | ||
using namespace std; | ||
|
||
size_t result = fwrite( | ||
out.data(), 1, out.size(), file | ||
); | ||
if(result < out.size()) | ||
{ | ||
throw std::system_error( | ||
std::make_error_code(std::errc::io_error) | ||
); | ||
} | ||
|
||
fflush(file); | ||
} | ||
} // namespace papilio::os | ||
|
||
#include <papilio/detail/suffix.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef PAPILIO_OS_OS_IMPL_HPP | ||
#define PAPILIO_OS_OS_IMPL_HPP | ||
|
||
#pragma once | ||
|
||
#include <papilio/detail/prefix.hpp> | ||
#include <papilio/os/os.hpp> | ||
|
||
#ifdef PAPILIO_PLATFORM_WINDOWS | ||
# define PAPILIO_OS_IMPL_WINAPI 1 | ||
#else | ||
# define PAPILIO_OS_IMPL_POSIX 1 | ||
#endif | ||
|
||
#include <papilio/detail/suffix.hpp> | ||
|
||
#endif |
Oops, something went wrong.