forked from trcrsired/fast_io
-
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.
Merge pull request #3 from trcrsired/master
6
- Loading branch information
Showing
7 changed files
with
75 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <fast_io.h> | ||
#include <fast_io_device.h> | ||
#include <random> | ||
|
||
using namespace fast_io::io; | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
std::size_t n{100}; | ||
if (1 < argc) | ||
{ | ||
n = fast_io::to<std::size_t>(fast_io::mnp::os_c_str(argv[1])); | ||
} | ||
fast_io::u8obuf_file obf(u"pin6.txt"); | ||
fast_io::ibuf_white_hole_engine eng; | ||
std::uniform_int_distribution<unsigned> ud(0, 9); | ||
for (std::size_t i{}; i != n; ++i) | ||
{ | ||
for (std::size_t j{}; j != 6zu; ++j) | ||
{ | ||
char8_t ch(static_cast<char8_t>(ud(eng))); | ||
ch += u8'0'; | ||
print(obf, fast_io::mnp::chvw(ch)); | ||
} | ||
println(obf); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
#include "utime_flags.h" | ||
#include "flock.h" | ||
#include "mmap_flags.h" | ||
#include "well_known_directory.h" |
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,23 @@ | ||
#pragma once | ||
|
||
/* | ||
W3C standard | ||
File System Access | ||
Draft Community Group Report | ||
https://wicg.github.io/file-system-access/ | ||
*/ | ||
|
||
namespace fast_io | ||
{ | ||
|
||
enum class well_known_directory : ::std::uint_least32_t | ||
{ | ||
desktop, | ||
documents, | ||
downloads, | ||
music, | ||
pictures, | ||
videos | ||
}; | ||
|
||
} // namespace fast_io |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
add_executable(getfd getfd.cc) | ||
add_executable(hackstdoutptr hackstdoutptr.cc) | ||
add_test(getfd getfd) | ||
add_test(hackstdoutptr hackstdoutptr) | ||
add_subdirectory(kreckelfileno) |
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,14 @@ | ||
#include <fast_io.h> | ||
|
||
int main() | ||
{ | ||
using namespace fast_io::mnp; | ||
using namespace fast_io::io; | ||
::fast_io::c_io_observer_unlocked ciob{stdout}; | ||
for(::std::size_t i{};i!=100000u;++i) | ||
{ | ||
perrln(ciob,pointervw(obuffer_begin(ciob)), " ", pointervw(obuffer_curr(ciob)), " ", pointervw(obuffer_end(ciob))); | ||
println(40); | ||
perrln(ciob,pointervw(obuffer_begin(ciob)), " ", pointervw(obuffer_curr(ciob)), " ", pointervw(obuffer_end(ciob))); | ||
} | ||
} |