MCPcopy Create free account
hub / github.com/OriginQ/QPanda-2 / newFileStream

Method newFileStream

Extensions/PilotOSMachine/easylogging++.cpp:730–752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

728// File
729
730base::type::fstream_t* File::newFileStream(const std::string& filename) {
731 base::type::fstream_t *fs = new base::type::fstream_t(filename.c_str(),
732 base::type::fstream_t::out
733#if !defined(ELPP_FRESH_LOG_FILE)
734 | base::type::fstream_t::app
735#endif
736 );
737#if defined(ELPP_UNICODE)
738 std::locale elppUnicodeLocale("");
739# if ELPP_OS_WINDOWS
740 std::locale elppUnicodeLocaleWindows(elppUnicodeLocale, new std::codecvt_utf8_utf16<wchar_t>);
741 elppUnicodeLocale = elppUnicodeLocaleWindows;
742# endif // ELPP_OS_WINDOWS
743 fs->imbue(elppUnicodeLocale);
744#endif // defined(ELPP_UNICODE)
745 if (fs->is_open()) {
746 fs->flush();
747 } else {
748 base::utils::safeDelete(fs);
749 ELPP_INTERNAL_ERROR("Bad file [" << filename << "]", true);
750 }
751 return fs;
752}
753
754std::size_t File::getSizeOfFile(base::type::fstream_t* fs) {
755 if (fs == nullptr) {

Callers

nothing calls this directly

Calls 2

safeDeleteFunction · 0.85
flushMethod · 0.80

Tested by

no test coverage detected