MCPcopy Create free account
hub / github.com/boostorg/json / open

Method open

example/file.hpp:68–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66 }
67
68 void
69 open(
70 char const* path,
71 char const* mode,
72 boost::system::error_code& ec)
73 {
74 close();
75#if defined(_MSC_VER)
76# pragma warning( push )
77# pragma warning( disable : 4996 )
78#endif
79 f_ = std::fopen( path, mode );
80#if defined(_MSC_VER)
81# pragma warning( pop )
82#endif
83 if( ! f_ )
84 return fail(ec);
85 if( std::fseek( f_, 0, SEEK_END ) != 0)
86 return fail(ec);
87 size_ = std::ftell( f_ );
88 if( size_ == -1 )
89 {
90 size_ = 0;
91 return fail(ec);
92 }
93 if( std::fseek( f_, 0, SEEK_SET ) != 0)
94 return fail(ec);
95 }
96
97 void
98 open(

Callers 2

read_fileFunction · 0.80
write_childrenMethod · 0.80

Calls 1

system_errorClass · 0.85

Tested by

no test coverage detected